Exemplo n.º 1
0
        public static double CalcMSE(XGBRegressor regr)
        {
            var target = GetKlaThickness(LoadedDatas);
            var pred   = regr.Predict(GetReflectivity(LoadedDatas));

            return(MSE(pred, target));
        }
Exemplo n.º 2
0
 //  나중에는 세팅 , 데이터 , 로드 여부 순으로 모델 만들기
 public static XGBRegressor CreateModel(List <IpsDataSet> datas)
 {
     LoadedDatas = datas;
     Regr        = new XGBRegressor();
     Regr.Fit(GetReflectivity(datas), GetKlaThickness(datas));
     return(Regr);
 }
Exemplo n.º 3
0
        [TestMethod] public void Predict()
        {
            var dataTrain   = TestUtils.GetRegressorDataTrain();
            var labelsTrain = TestUtils.GetRegressorLabelsTrain();
            var dataTest    = TestUtils.GetRegressorDataTest();

            var xgbr = new XGBRegressor();

            xgbr.Fit(dataTrain, labelsTrain);
            var preds = xgbr.Predict(dataTest);

            Assert.IsTrue(TestUtils.RegressorPredsCorrect(preds));
        }
Exemplo n.º 4
0
        public void TestRegressorSaveAndLoadWithParameters()
        {
            var dataTrain   = TestUtils.GetRegressorDataTrain();
            var labelsTrain = TestUtils.GetRegressorLabelsTrain();
            var dataTest    = TestUtils.GetRegressorDataTest();

            var xgbr = new XGBRegressor();

            xgbr.Fit(dataTrain, labelsTrain);
            var preds1 = xgbr.Predict(dataTest);

            xgbr.SaveModelToFile(TEST_FILE);

            var xgbr2  = BaseXgbModel.LoadRegressorFromFile(TEST_FILE);
            var preds2 = xgbr2.Predict(dataTest);

            Assert.IsTrue(TestUtils.AreEqual(preds1, preds2));
        }
Exemplo n.º 5
0
 public static XGBRegressor LoadModel(string path)           // Excuted when ScanAutorun is fired
 {
     Regr = LoadRegressorFromFile(path);
     return(Regr);
 }
Exemplo n.º 6
0
 public static void Reset()
 {
     Regr        = new XGBRegressor();
     LoadedDatas = new List <IpsDataSet>();
 }