
Data_Analysis
Data_analysis uses different methods to model learning and inference of data. The use method has the fully connection layer, the random forest, provides the example has the stock price forecast, the sin waveform prediction.

Introduction
The contents of this solution folder are shown in Figure 1 below. The contents of Flow are described in the following table.
The source code path is shown in Fig. 2 below.
The path to the data and trained model files is shown in Fig. 3 below.
Fig. 1. Folder diagram.
Method 
Application 
Flow Files and instructions 
Dense 
Sin Function Waveform Prediction 
sin_read.flow Read Sin waveform data. 
sin_dense_keras_1_training.flow Sin waveform training, generating models. 

sin_dense_keras_2_inference.flow Use a trained model for inference data. 

Stock price Analysis Forecast 
stock_dense_keras_1_training.flow Train stock price data to produce models. 

stock_dense_keras_2_inference.flow Use a trained model for inference data. 

Regression forest 
Sin Function Waveform Prediction 
sin_regression_forest_1_training.flow Sin waveform training, generating models. 
sin_regression_forest_2_inference.flow Use a trained model for inference data. 

Stock price Analysis Forecast 
stock_regression_forest_1_preparation.flow Read stock price data. 

stock_regression_forest_2_training.flow Train stock price data to produce models. 

stock_regression_forest_3_inference.flow Use a trained model for inference data. 

Model training and prediction based on dense method applied to sin or stock
※ This solution needs to use Python. Please install the Python kit yourself.
 Preparing data :
Please to OpenR8 ＞ solution ＞ Data_Analysis ＞ Sin.csv and Stock.csv are found in the Data folder. See Fig. 4 below.
(1) sin.csv : The sin.csv content is turned on as shown in Fig. 5 (left), with two fields (degree, sin). This data automatically outputs its corresponding Sin angle value for what you want the model to learn when the input angle is.
From this, we can find out the sin waveform diagram, and further infer the values of different angles.
(2) Stock.csv: The opening content is shown in Fig. 5 (right) below, with six fields, the first five to enter information about the daily stock, and the last is the closing price after five days of output.
Sin's waveform is an input, an output, the stock example is five inputs, an output, you can according to the requirements of the data you want to make inferences into CSV, and then follow the process to run the next steps, you can complete the training model and inference.
Fig. 4. The file path of Sin.csv and Stock.csv.
Fig. 5. Schematic diagram of sin.csv left stock.csv right.
 Run flow files :
【Training Models】
(1) How to use it : Run R8.exe ＞ Open and load process files ＞ Perform training. First, introduce the example of sin, each step is shown in Fig. 6, Fig. 7, Fig. 8, Fig. 9.
Stock : Please select Stock_dense_keras_1_training.flow, follow in the way of sin and so on.
Fig. 6. Run R8.exe.
Fig. 7. Open and load process files (sin).
Fig. 8. Training Models (sin).
Fig. 9. Training complete, output model file (. h5).
(2) Parameter description :There are two main parameters, one of which sets the content to be learned and the other is the model file name that is completed for training. See Fig. 10, Fig. 11 below.
Fig. 10. Set the data you want the model to learn.
Fig. 11. File name of the output model.
【Model Inference】Test the model files that have been trained to complete. The inference steps for the Sin example are shown in Fig. 12, Fig. 13, Fig. 14, Fig. 15, Fig. 16. Stock is used in a way that selects Stock_dense_keras_2_inference.flow. For subsequent use, please refer to the use of sin.
Fig. 12. Open Inference flow file.
Fig. 13. Select the model to use for inference.
Fig. 14. Select what you want to infer.
Fig. 15. Set the result file name of the output inference.
Fig. 16. Inference Results.

Model training and prediction based on regression forest method applied to sin or stock
 Run R8.exe > Load stock_regression_forest_1_preparation.flow > Click Run.
Running completes results in the stock25to51validation.csv of Data augmentation, whose path is in the OpenR8/solution/Data_Analysis/data folder.
 Load stock_regression_forest_2_training.flow file > Click Run.
 Load stock_regression_forest_3_inference.flow file > Click Run.
 Produce inference results placed in : OpenR8/solution/Data_Analysis/data/stock25to51.csv.The last field of the CSV table content close after 5 days is the result of the inference.
If there is a need to replace the user's own data or modify parameters, please refer to the parameter setting instructions below. Parameter setting Description :
The parameters of "Stock_regression_forest_1_preparation.flow" are shown in Fig. 17, Fig. 18, Fig. 19, Fig. 20, Fig. 21.
Fig. 17. Data files that need to be preprocessed.
Fig. 18. Multiples of preprocessed data increments.
Fig. 19. Set the output of the preprocessing.
Fig. 20. Set test samples as a percentage of the dataset.
Fig. 21. stock25to51validation.
【stock_regression_forest_2_training.flow】The parameter settings are shown in Fig. 22, Fig. 23 below.
Fig. 22. stock_regression_forest_2_training (1).
Fig. 23. stock_regression_forest_2_training (2).
The parameters of 【Stock_regression_forest_3_inference.flow】 are shown in Fig. 24, Fig. 25 below.
Fig. 24. stock_regression_forest_3_inference (1).
Fig. 25Fig. 25. stock_regression_forest_3_inference (2).