For anyone who does not understand the code provided in this library read the article linked hereÂ
Multiple Dynamic Logistic Regression Challenge
The biggest challenge I faced when building both
void  MultipleRegressionMain(double& predicted_y[],double& Y[],double& A[],double& B[]); void  MultipleRegressionMain(double& predicted_y[],double& Y[],double& A[],double& B[],double& C[],double& D[]);
but, this method is inconvenient and it feels like a premature way of coding things up and it violates the rules of clean code and DRY (don’t repeat yourself principles that OOP is trying to help us achieve)
Unlike python with flexible functions that could take a large number of functional arguments with the help of *args and **kwargs, In MQL5 this could be achieved using string only as far as I can think, I believe this is our starting point
void CMultipleLogisticRegression::MLRInit(string x_columns="3,4,5,6,7,8")
the input x_columns represents all the independent variables columns that we will use in our library, these columns will require us to have multiple independent arrays for each of the columns but, there is no way we can create arrays dynamically, so the use of arrays fall flat here
We can create multiple CSV files dynamically and use them as arrays, for sure but this will make our programs more expensive when it comes to the use of computer resources compared to the use of arrays, especially when dealing with multiple data not to mention the while loops that we will frequently use to open the files will slow the whole process down, I’m not 100% sure so correct me if I’m wrong
thought we can still use the mentioned way,
 I have discovered the way forward to use arrays we are going to store all the data from all the columns in one array then use the data separately from one that single ArrayÂ
int start = 0;   if (m_debug) //if we are on debug mode print Each Array vs its row       for (int i=0; i<x_columns_total; i++)         {             ArrayCopy(EachXDataArray,m_AllDataArray,0,start,rows_total);             start += rows_total;                         Print("Array Number =",i," From column number ",m_XColsArray[i]);             ArrayPrint(EachXDataArray);            }
Inside the for loop, we can manipulate the data in the arrays and perform all the calculations for the model the way want for all the columns, I have tried this method but I’m still on the unsuccessful attempt, the reason I explained this hypothesis is to let everyone reading this article understand this challenge and I welcome all your opinions in the comment sections on how we can code this multiple dynamic logistic regression functionÂ
This is Just a hypothesis, it is aimed to inspire you into the process of coding the multiple dynamic regression Algorithm, as discussed in Data Science and Machine Learning Article series linked aboveÂ