private void Forecast_Click(object sender, RoutedEventArgs e) {//calculate the predected data and show to the user if (check_user_input(2)) { //clear Next_Data if alredy have data inside Next_Data.Clear(); //fill next data to the chart fill_next_data(); //fill predicted data to the chart Forecast_Calc_Fill(); } }
private void Current_Data_btn_Click(object sender, RoutedEventArgs e) {//show the user the current data we will use for forcasting from the hashtag file the user choose if (check_user_input(1)) { Popup.IsOpen = false; //clear the charts if it has points alrady Current_Data.Clear(); Next_Data.Clear(); Predicted_Data.Clear(); Negetive_Predicted_Data.Clear(); //create the arff data file from 90% of the current data from the hashtag that the user choose //and save in arff.next_data an array with the next data point (the last 10% of the current data) SignalToSignalArff arff = new SignalToSignalArff("D:\\Twist_DB\\hashtag_signal\\" + listBox.SelectedItem.ToString() + ".txt", data_precentage_split); //fill the next data points to the next_data prop if (arff.next_data != null) { next_data = new Tuple <double, double> [arff.next_data.Length]; next_data = arff.next_data; } //fixing chart prespective Next_Data.Add(new ObservablePoint(0, 0)); Predicted_Data.Add(new ObservablePoint(0, 0)); Negetive_Predicted_Data.Add(new ObservablePoint(0, 0)); // path to the signal data - found in the project folder ..WekaForecasting\bin\Debug String pathToData = ".\\Signal.arff"; // load the signal data Instances data = new Instances(new java.io.BufferedReader(new java.io.FileReader(pathToData))); //fill Current_Data series with the data from the hashtag file the user choose for (int i = 0; i < data.numInstances(); i++) { Current_Data.Add(new ObservablePoint(data.instance(i).value(0), data.instance(i).value(1))); } } }