예제 #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;
 }
예제 #4
0
 public static extern int LGBM_BoosterGetCurrentIteration(BoosterHandle handle, out int out_iteration);
예제 #5
0
 public static extern int LGBM_BoosterUpdateOneIterCustom(BoosterHandle handle, ref float grad, ref float hess, ref int is_finished);
예제 #6
0
 public static extern int LGBM_BoosterGetNumClasses(BoosterHandle handle, out int out_len);
예제 #7
0
 public static extern int LGBM_BoosterResetTrainingData(BoosterHandle handle, DatasetHandle train_data);
예제 #8
0
 public static extern int LGBM_BoosterMerge(BoosterHandle handle, BoosterHandle other_handle);
예제 #9
0
 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);