Exemplo n.º 1
0
        private static ActiveDataBase getGPParams()
        {
            var adb = new ActiveDataBase();

            //
            //first 4 algebraical operations +,-,*,/
            adb.FunctionSet = Globals.functionSet.Where(x => x.Value.Selected).Select(x => x.Value).ToArray();

            //prepare params
            adb.Parameters = prepareGP();

            //termination criteria
            adb.TC = new TerminationCriteria()
            {
                IsIteration = true, Value = 50
            };

            adb.reportRun = reportProgress;

            return(adb);
        }
Exemplo n.º 2
0
        static async Task CreateNewRegressionProject()
        {
            dataSetName = "Iris flower identification";
            Project proj = new Project("testProject");

            proj.InitiNewProject("IrisPrjTest");
            var      metaData = getMetaData("iris");
            var      strData  = getIrisString(',', 1);
            DataSet1 ds       = new DataSet1();

            ds.MetaData = metaData;
            ds.Data     = strData;
            var dataSet = ds.GetDataSet(true);

            //
            proj.DataSet = ds;
            //rft format of the simple text
            proj.ProjectInfo = "{\\rtf1\\ansi\\deff0\\nouicompat{\\fonttbl{\\f0\\fnil\\fcharset0 Microsoft Sans Serif;}}\r\n{\\*\\generator Riched20 10.0.16299}\\viewkind4\\uc1 \r\n\\pard\\f0\\fs17\\lang1033 Famous classification dataset\\par\r\n}\r\n";
            proj.CreateModel("iris-data-set", "Iris", true);
            var model = proj.Models[0];
            //

            ActiveDataBase actvData = getGPParams();

            //change Default PArams
            actvData.Parameters.ParallelProcessing = true;
            actvData.Parameters.FitnessName        = "RMSE";


            //if the solution is reseted constants from MODel must be update to activeData
            await model.RunGPAsync(actvData, new CancellationToken(), true);

            //saved into bin folder
            var strPath = $@"Data\\iris_{DateTime.Now.Ticks}.gpa";

            proj.Save(strPath);
        }