GetModelString() public method

public GetModelString ( ) : string
return string
Exemplo n.º 1
0
        public static void Save <T>(IVectorisedPredictorWithFeatureWeights <T> pred, BinaryWriter writer)
        {
            Booster booster     = null;
            int     maxNumTrees = pred.MaxNumTrees;

            if (pred is BinaryNativePredictor b)
            {
                writer.Write(0);
                booster = b.Booster;
            }
            else if (pred is RegressionNativePredictor r)
            {
                writer.Write(1);
                booster = r.Booster;
            }
            else if (pred is MulticlassNativePredictor m)
            {
                writer.Write(2);
                booster = m.Booster;
            }
            else if (pred is RankingNativePredictor k)
            {
                writer.Write(3);
                booster = k.Booster;
            }
            else
            {
                throw new Exception("Unknown IPredictorWithFeatureWeights type");
            }
            writer.Write(booster.GetModelString());
            writer.Write(maxNumTrees);
        }
Exemplo n.º 2
0
 public string GetModelString() => Booster.GetModelString();