public ActionResult DataPreprocess()
        {
            DataPreprocessViewModel view = new DataPreprocessViewModel();

            view.ProjectId = Convert.ToString(Session["ID"]);
            view.mode      = Convert.ToString(Session["Mode"]);

            //讀檔案路徑
            Users  user = userservice.FindUser(User.Identity.Name);
            string MapPath = filePath + user.Site + "/" + view.ProjectId + "/";
            string path = MapPath + view.ProjectId;
            string file, savePath, corrPath;

            if (view.mode == "2") //predict
            {
                file     = path + "_predict.csv";
                savePath = path + "_predict_pre.csv";
                corrPath = "null";
            }
            else
            {
                file     = path + ".csv";
                savePath = path + "_pre.csv";
                corrPath = path + "_corr.csv";
            }
            //執行預處理
            string arg2 = $"{pyPath}preprocessing.py {file} {0} {0} {"interp1d"} {savePath} {corrPath} {"null"} {"null"}";

            callpython.CMD();
            string output = callpython.Execute(arg2);

            //存回傳結果
            string[]       data = output.Split('/');
            DataPreprocess _pre = new DataPreprocess();

            _pre.isnull    = data[0];
            _pre.DeleteCol = data[1].Substring(1).Substring(0, data[1].Length - 2).Split(',');
            _pre.SameCol   = data[2].Substring(1).Substring(0, data[2].Length - 2).Split(',');
            _pre.abnormal  = data[3];
            _pre.outlier   = data[4];
            view.pre       = _pre;

            //dropdownlist
            string[] lines = System.IO.File.ReadAllLines(file, Encoding.UTF8);
            view.ColList = lines[0].Trim().Split(',').Skip(1).ToArray(); //移除date,存入下拉式選單

            return(View(view));
        }
        public ActionResult DataPreprocess(DataPreprocessViewModel view)
        {
            //讀檔案路徑
            Users  user = userservice.FindUser(User.Identity.Name);
            string MapPath = filePath + user.Site + "/" + view.ProjectId + "/";
            string path = MapPath + view.ProjectId;
            string file, savePath, corrPath, select;

            if (view.mode == "2") //predict
            {
                file     = path + "_predict.csv";
                savePath = path + "_predict_pre.csv";
                corrPath = "null";
            }
            else
            {
                file     = path + ".csv";
                savePath = path + "_pre.csv";
                corrPath = path + "_corr.csv";
            }

            select = (view.Selected != null) ? String.Join(",", view.Selected.ToArray()) : "null";                                                                //判斷selected是否有值
            //執行預處理
            string arg = $"{pyPath}preprocessing.py {file} {view.abnormal} {view.outlier} {view.fill} {savePath} {corrPath} {"null"} {select.Replace(' ', '_')}"; //字串不可含空白

            callpython.CMD();
            string output = callpython.Execute(arg);

            //無法補值
            string[]       data = output.Split('/');
            DataPreprocess pre  = new DataPreprocess();

            pre.cantfill = data[5];

            //更新執行步驟&時間
            if (view.mode == "1")
            {
                modelservice.DataSplit(view.ProjectId, view.TrainVal, view.ValidVal, view.TestVal); //存train/valid/test
                modelservice.UpdateProcess(view.ProjectId, 2);
            }

            return(RedirectToAction("ChooseModel", "Model", pre));
        }