Пример #1
0
        public List <List <String> > list(String path)
        {
            //Create instance
            LassoModel program = new LassoModel();

            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>();
                tempRow.Add(program.outputTable[i][0].ToString());
                String[] tempValue = new String[2];
                tempValue = Lines[i].Split(',');
                tempRow.Add(tempValue[0]);
                tempRow.InsertRange(2, tempValue[1].Split(' ').ToList());
                result.Add(tempRow);
            }
            return(result);
        }
Пример #2
0
        private void BindDataSource()
        {
            List <List <String> > Datasource = new List <List <String> >();

            LassoModel outputData = new LassoModel();
            String     path       = Request.PhysicalPath;

            Datasource = outputData.list(path);
            this.FlatGrid.DataSource = Datasource;
            this.FlatGrid.DataBind();
            Model  data       = new Model();
            String pmmlPath   = string.Format("{0}{1}.pmml", path + "../../../Models/LassoModel/", "lpsa");
            String sourcePath = string.Format("{0}{1}.aspx.cs", path + "../../../LassoModel/", "Default");
            String sparkPath  = string.Format("{0}{1}.scala", path + "../../../Models/LassoModel/", "Spark");

            data.setPath(pmmlPath, sourcePath, sparkPath);
            string PMMLconv = data.PMML.Replace("<", "&lt");

            Literal3.Text = PMMLconv;
            JavaScriptSerializer js = new JavaScriptSerializer();

            Session["source"] = js.Serialize(data.Source).Replace("\"", "^");
            Session["spark"]  = js.Serialize(data.Spark).Replace("\"", "^");
        }