コード例 #1
0
ファイル: TrainerBase.cs プロジェクト: rca22/LightGBM.Net
        /// <summary>
        /// Evaluates the native LightGBM model on the given feature vector
        /// </summary>
        /// <param name="predictType"></param>
        /// <param name="row"></param>
        /// <returns></returns>
        public double[,] Evaluate(Booster.PredictType predictType, float[][] rows, int startIteration, int numIterations)
        {
            if (Booster == null)
            {
                throw new Exception("Model has not been trained");
            }
            var rslt = Booster.PredictForMatsMulti(predictType, rows, startIteration, numIterations);

            return(rslt);
        }
コード例 #2
0
        /// <summary>
        /// Evaluates the native LightGBM model on the given feature vector
        /// </summary>
        /// <param name="predictType"></param>
        /// <param name="row"></param>
        /// <returns></returns>
        public double [] Evaluate(Booster.PredictType predictType, float[] row, int numIteration = -1)
        {
            if (Booster == null)
            {
                throw new Exception("Model has not been trained");
            }
            var rslt = Booster.PredictForMat(predictType, row, numIteration);

            return(rslt);
        }