示例#1
0
        public static Booster LoadFromModelString(string modelString)
        {
            BoosterHandle bh      = LoadModelFromString(modelString);
            var           booster = new Booster(bh);

            return(booster);
        }
示例#2
0
        /// <summary>
        /// Prediction task
        /// </summary>
        /// <param name="fileName">Model file name</param>
        public Booster(string fileName)
        {
            int numIterations = 0;

            _handle             = CreateFromModelfile(fileName, out numIterations);
            _numClasses         = GetNumClasses();
            _needReloadEvalInfo = true;
        }
示例#3
0
 /// <summary>
 /// Training task
 /// </summary>
 public Booster(Dataset trainSet, string parameters = "")
 {
     _handle             = Create(trainSet.Handle, parameters);
     _evalNames          = GetEvalNames();
     _trainSet           = trainSet;
     _numDatasets        = 1;
     _parameters         = parameters;
     _numClasses         = GetNumClasses();
     _needReloadEvalInfo = true;
 }
 public static extern int LGBM_BoosterGetCurrentIteration(BoosterHandle handle, out int out_iteration);
 public static extern int LGBM_BoosterUpdateOneIterCustom(BoosterHandle handle, ref float grad, ref float hess, ref int is_finished);
 public static extern int LGBM_BoosterGetNumClasses(BoosterHandle handle, out int out_len);
 public static extern int LGBM_BoosterResetTrainingData(BoosterHandle handle, DatasetHandle train_data);
 public static extern int LGBM_BoosterMerge(BoosterHandle handle, BoosterHandle other_handle);
 public static extern int LGBM_BoosterSetLeafValue(BoosterHandle handle, int tree_idx, int leaf_idx, double val);
示例#10
0
 public static extern int LGBM_BoosterGetPredict(BoosterHandle handle, int data_idx, out int out_len, out double[] out_result);
示例#11
0
 public static extern int LGBM_BoosterGetNumPredict(BoosterHandle handle, int data_idx, out int out_len);
示例#12
0
 public static extern int LGBM_BoosterCreate(DatasetHandle train_data, [In][MarshalAs(UnmanagedType.LPStr)] string parameters, out BoosterHandle @out);
示例#13
0
 public static extern int LGBM_BoosterGetEval(BoosterHandle handle, int data_idx, out int out_len, double[] out_results);
示例#14
0
 public static extern int LGBM_BoosterGetNumFeature(BoosterHandle handle, out int out_len);
示例#15
0
 public static extern int LGBM_BoosterGetFeatureNames(BoosterHandle handle, out int out_len, IntPtr out_strs);
示例#16
0
 public static extern int LGBM_BoosterLoadModelFromString([In][MarshalAs(UnmanagedType.LPStr)] string model_str, out int out_num_iterations, out BoosterHandle @out);
示例#17
0
 public static extern int LGBM_BoosterGetLeafValue(BoosterHandle handle, int tree_idx, int leaf_idx, out double out_val);
示例#18
0
 public static extern int LGBM_BoosterPredictForFile(BoosterHandle handle, [In][MarshalAs(UnmanagedType.LPStr)] string data_filename,
                                                     [MarshalAs(UnmanagedType.I4)]
                                                     bool data_has_header, LGBMPredictType predict_type,
                                                     int num_iteration,
                                                     [In][MarshalAs(UnmanagedType.LPStr)] string parameter, [In][MarshalAs(UnmanagedType.LPStr)] string result_filename);
示例#19
0
 public static extern int LGBM_BoosterFeatureImportance(BoosterHandle handle, int num_iteration, int importance_type, ref double out_results);
示例#20
0
 public static extern int LGBM_BoosterCalcNumPredict(BoosterHandle handle, int num_row, LGBMPredictType predict_type, int num_iteration, out int out_len);
示例#21
0
 public static extern int LGBM_BoosterAddValidData(BoosterHandle handle, DatasetHandle valid_data);
示例#22
0
 public static extern int LGBM_BoosterPredictForCSC(BoosterHandle handle, IntPtr col_ptr, int col_ptr_type, ref int indices, IntPtr data, int data_type, int numCols_ptr, int nelem, int num_row, int predict_type, int num_iteration, [In][MarshalAs(UnmanagedType.LPStr)] string parameter, ref int out_len, ref double out_result);
示例#23
0
 public static extern int LGBM_BoosterResetParameter(BoosterHandle handle, [In][MarshalAs(UnmanagedType.LPStr)] string parameters);
示例#24
0
 public static extern int LGBM_BoosterCreateFromModelfile([In][MarshalAs(UnmanagedType.LPStr)] string filename, out int out_num_iterations, out BoosterHandle @out);
示例#25
0
 public static extern int LGBM_BoosterUpdateOneIter(BoosterHandle handle, out int is_finished);
示例#26
0
 public static extern int LGBM_BoosterPredictForMat(BoosterHandle handle, IntPtr data, LGBMDataType data_type, int numRows, int numCols, int is_row_major, LGBMPredictType predict_type, int num_iteration, [In][MarshalAs(UnmanagedType.LPStr)] string parameter, out int out_len, IntPtr out_result);
示例#27
0
 public static extern int LGBM_BoosterRollbackOneIter(BoosterHandle handle);
示例#28
0
 public static extern int LGBM_BoosterSaveModel(BoosterHandle handle, int num_iteration, [In][MarshalAs(UnmanagedType.LPStr)] string filename);
示例#29
0
 public static extern int LGBM_BoosterGetEvalCounts(BoosterHandle handle, out int out_len);
示例#30
0
 public static extern int LGBM_BoosterDumpModel(BoosterHandle handle, int num_iteration, int buffer_len, out int out_len,
                                                [MarshalAs(UnmanagedType.LPStr)]
                                                StringBuilder out_str);