Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            ThreadPool.QueueUserWorkItem((object obj) =>
            {
                try
                {
                    DeleteAll();

                    AddItemToListBox(this.lstResult, "数据下载中");
                    string gpCode = txtGPCode.Text.Trim();
                    DownLoadData(gpCode);
                    AddItemToListBox(this.lstResult, "数据下载完成");
                    AddItemToListBox(this.lstResult, "===========================================");

                    AddItemToListBox(this.lstResult, "训练数据中");
                    CreateAndTrain();
                    AddItemToListBox(this.lstResult, "训练数据完成");
                    AddItemToListBox(this.lstResult, "===========================================");

                    ModelInput sampleData = MyAutoML.CreateSingleDataSample(predictFilePath);
                    var result            = Predict(sampleData);
                    var day = GetNextDataStr(sampleData.Riqi, 1);
                    AddItemToListBox(this.lstResult, $"股票{this.txtGPCode.Text} {day}预测股价:{result.Score};昨收盘:{sampleData.Spj}");
                }
                catch (Exception ex)
                {
                    AddItemToListBox(this.lstResult, $"出现异常,异常信息:{ex.Message}");
                    AddItemToListBox(this.lstResult, "===========================================");
                }
            });
        }
Esempio n. 2
0
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         string gpdm = txtGPCode.Text;
         string file = FileHelper.Search(gpdm);
         if (!string.IsNullOrEmpty(file) && file.Contains(gpdm))
         {
             this.filePath = file;
             ModelInput sampleData = MyAutoML.CreateSingleDataSample(filePath);
             var        result     = Predict(sampleData);
             AddItemToListBox(this.lstResult, $"股票{this.txtGPCode.Text}预测股价:{result.Score}");
         }
         else
         {
             button2_Click(sender, e);
         }
     }
     catch (Exception ex)
     {
         AddItemToListBox(this.lstResult, $"出现异常,异常信息:{ex.Message}");
         AddItemToListBox(this.lstResult, "===========================================");
     }
 }