Beispiel #1
0
        public void Regression_linear_gd_check_rmse_jason_input()
        {
            initData_Jason();

            BuildLinearSGD lm = new BuildLinearSGD();

            Dasmic.MLLib.Algorithms.Regression.ModelBase mb =
                (Dasmic.MLLib.Algorithms.Regression.ModelBase)
                lm.BuildModel(_trainingData,
                              _attributeHeaders, _indexTargetAttribute);

            double value = mb.GetModelRMSE(_trainingData);

            Assert.IsTrue(value > .68 && value < .70);
        }
Beispiel #2
0
        public void Regression_Linear_gd_check_model_jason_input()
        {
            initData_Jason();
            BuildLinearSGD lm = new BuildLinearSGD();

            Dasmic.MLLib.Algorithms.Regression.ModelBase mb = (Dasmic.MLLib.Algorithms.Regression.ModelBase)
                                                              lm.BuildModel(_trainingData,
                                                                            _attributeHeaders, _indexTargetAttribute);

            double[] validateData = { 1 };
            double   value        = mb.RunModelForSingleData(
                validateData);

            Assert.IsTrue(value > 1.1 && value < 1.3);
        }
Beispiel #3
0
        public void Regression_linear_gd_check_rmse_power_input()
        {
            initData_Power();

            BuildLinearSGD lm = new BuildLinearSGD();

            Dasmic.MLLib.Algorithms.Regression.ModelBase mb = (Dasmic.MLLib.Algorithms.Regression.ModelBase)
                                                              lm.BuildModel(_trainingData,
                                                                            _attributeHeaders,
                                                                            _indexTargetAttribute);

            double value = mb.GetModelRMSE(_trainingData);

            //Some issues were seen earlier maybe with parrelization
            Assert.IsTrue(SupportFunctions.DoubleCompare(value, 3.18));
        }
Beispiel #4
0
        public void Regression_linear_gd_check_model_power_input_param()
        {
            initData_Power();

            BuildLinearSGD lm = new BuildLinearSGD();

            lm.SetParameters(.005, 30);
            Dasmic.MLLib.Algorithms.Regression.ModelBase mb = (Dasmic.MLLib.Algorithms.Regression.ModelBase)
                                                              lm.BuildModel(_trainingData,
                                                                            _attributeHeaders, _indexTargetAttribute);

            double[] validateData = { 4 };
            double   value        = mb.RunModelForSingleData(
                validateData);

            Assert.IsTrue(value > 16.64 && value < 16.66);
        }
Beispiel #5
0
        public void Regression_linear_gd_check_rmse_power_param()
        {
            initData_Power();

            BuildLinearSGD lm = new BuildLinearSGD();

            lm.SetParameters(.02, 20);

            Dasmic.MLLib.Algorithms.Regression.ModelBase mb = (Dasmic.MLLib.Algorithms.Regression.ModelBase)
                                                              lm.BuildModel(_trainingData,
                                                                            _attributeHeaders,
                                                                            _indexTargetAttribute);

            double value = mb.GetModelRMSE(_trainingData);

            Assert.IsTrue(SupportFunctions.DoubleCompare(value, 3.16));
        }