Exemplo n.º 1
0
        public static Booster LoadFromModelString(string modelString)
        {
            BoosterHandle bh      = LoadModelFromString(modelString);
            var           booster = new Booster(bh);

            return(booster);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
 }
Exemplo n.º 4
0
 public static extern int LGBM_BoosterGetCurrentIteration(BoosterHandle handle, out int out_iteration);
Exemplo n.º 5
0
 public static extern int LGBM_BoosterUpdateOneIterCustom(BoosterHandle handle, ref float grad, ref float hess, ref int is_finished);
Exemplo n.º 6
0
 public static extern int LGBM_BoosterGetNumClasses(BoosterHandle handle, out int out_len);
Exemplo n.º 7
0
 public static extern int LGBM_BoosterResetTrainingData(BoosterHandle handle, DatasetHandle train_data);
Exemplo n.º 8
0
 public static extern int LGBM_BoosterMerge(BoosterHandle handle, BoosterHandle other_handle);
Exemplo n.º 9
0
 public static extern int LGBM_BoosterSetLeafValue(BoosterHandle handle, int tree_idx, int leaf_idx, double val);
Exemplo n.º 10
0
 public static extern int LGBM_BoosterGetPredict(BoosterHandle handle, int data_idx, out int out_len, out double[] out_result);
Exemplo n.º 11
0
 public static extern int LGBM_BoosterGetNumPredict(BoosterHandle handle, int data_idx, out int out_len);
Exemplo n.º 12
0
 public static extern int LGBM_BoosterCreate(DatasetHandle train_data, [In][MarshalAs(UnmanagedType.LPStr)] string parameters, out BoosterHandle @out);
Exemplo n.º 13
0
 public static extern int LGBM_BoosterGetEval(BoosterHandle handle, int data_idx, out int out_len, double[] out_results);
Exemplo n.º 14
0
 public static extern int LGBM_BoosterGetNumFeature(BoosterHandle handle, out int out_len);
Exemplo n.º 15
0
 public static extern int LGBM_BoosterGetFeatureNames(BoosterHandle handle, out int out_len, IntPtr out_strs);
Exemplo n.º 16
0
 public static extern int LGBM_BoosterLoadModelFromString([In][MarshalAs(UnmanagedType.LPStr)] string model_str, out int out_num_iterations, out BoosterHandle @out);
Exemplo n.º 17
0
 public static extern int LGBM_BoosterGetLeafValue(BoosterHandle handle, int tree_idx, int leaf_idx, out double out_val);
Exemplo n.º 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);
Exemplo n.º 19
0
 public static extern int LGBM_BoosterFeatureImportance(BoosterHandle handle, int num_iteration, int importance_type, ref double out_results);
Exemplo n.º 20
0
 public static extern int LGBM_BoosterCalcNumPredict(BoosterHandle handle, int num_row, LGBMPredictType predict_type, int num_iteration, out int out_len);
Exemplo n.º 21
0
 public static extern int LGBM_BoosterAddValidData(BoosterHandle handle, DatasetHandle valid_data);
Exemplo n.º 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);
Exemplo n.º 23
0
 public static extern int LGBM_BoosterResetParameter(BoosterHandle handle, [In][MarshalAs(UnmanagedType.LPStr)] string parameters);
Exemplo n.º 24
0
 public static extern int LGBM_BoosterCreateFromModelfile([In][MarshalAs(UnmanagedType.LPStr)] string filename, out int out_num_iterations, out BoosterHandle @out);
Exemplo n.º 25
0
 public static extern int LGBM_BoosterUpdateOneIter(BoosterHandle handle, out int is_finished);
Exemplo n.º 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);
Exemplo n.º 27
0
 public static extern int LGBM_BoosterRollbackOneIter(BoosterHandle handle);
Exemplo n.º 28
0
 public static extern int LGBM_BoosterSaveModel(BoosterHandle handle, int num_iteration, [In][MarshalAs(UnmanagedType.LPStr)] string filename);
Exemplo n.º 29
0
 public static extern int LGBM_BoosterGetEvalCounts(BoosterHandle handle, out int out_len);
Exemplo n.º 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);