Closed phamthanhlam closed 7 months ago
#include <MALE5\preprocessing.mqh>
#include <MALE5\Linear Models\Linear Regression.mqh>
CLinearRegression lr; //Load the linear regression mode
MinMaxScaler scaler; //Data scalling technique
void some_function()
{
//---
int handle = iRSI(Symbol(), PERIOD_CURRENT, 12, PRICE_OPEN);
matrix x;
vector y;
// Add your trainng data to the x and y matrix and vector respectively
// .....
x = scaler.fit_transform(x); //Normalize x variable(s) | important for all machine learning models
lr.fit_LeastSquare(x, y); //Train the linear regression model by least squre method
vector new_data;
double predicted_value = lr.predict(new_data); //obtain the signal
}
Hi MegaJoctan! Can you please give an example of how to use Regressor Nets.mqh?