Esempio n. 1
0
        public List <List <String> > list(String path)
        {
            //Create instance
            Lasso program = new Lasso();

            string[] Lines = System.IO.File.ReadAllLines(path + "../../../Models/LassoModel/lpsa.data");
            program.outputTable = program.PredictResult(Lines, path + "../../../Models/LassoModel/lpsa.pmml");
            List <List <String> > result = new List <List <String> >();

            for (int i = 0; i < Lines.Length; i++)
            {
                List <String> tempRow   = new List <String>();
                String[]      temp      = Lines[i].Split(',');
                String        tempValue = null;
                tempValue = temp[0];
                tempRow.Add(tempValue);
                temp = temp[1].Split(' ');
                for (int j = 0; j < temp.Length; j++)
                {
                    tempValue = temp[j];
                    tempRow.Add(tempValue);
                }
                tempValue = program.outputTable[i][0].ToString();
                tempRow.Add(tempValue);
                result.Add(tempRow);
            }
            return(result);
        }
Esempio n. 2
0
        public ActionResult LassoModelDefault()
        {
            List <List <String> > Datasource = new List <List <String> >();
            Lasso  outputData = new Lasso();
            String path       = Request.PhysicalPath;

            Datasource         = outputData.list(path);
            ViewBag.datasource = Datasource;
            ViewBag.source     = System.IO.File.ReadAllText(path + "../../../Controllers/LassoModel/LassoModelController.cs");
            ViewBag.spark      = System.IO.File.ReadAllText(path + "../../../Models/LassoModel/Spark.scala");
            ViewBag.PMML       = System.IO.File.ReadAllText(path + "../../../Models/LassoModel/lpsa.pmml");
            return(View());
        }