I do not know if this is an issue of the code, or just the consequence of my limited understanding of what is going on in a piece of code. In the notebook 02_end_to_end_machine_learning_project.ipynb, why the for loop is like this in the section about logistic regression:
for train_index, cv_index in k_fold.split(np.zeros(len(X_train)), y_train.ravel()):
Instead of just
for train_index, cv_index in k_fold.split(X_train, y_train):
What is behind that np.zeros and the call to the method ravel()?
If there is no reason for doing it the way it is done, I think the simpler version would be better, given that this is code to teach people how to use scikitlearn library.
I do not know if this is an issue of the code, or just the consequence of my limited understanding of what is going on in a piece of code. In the notebook 02_end_to_end_machine_learning_project.ipynb, why the for loop is like this in the section about logistic regression:
Instead of just
What is behind that np.zeros and the call to the method ravel()?
If there is no reason for doing it the way it is done, I think the simpler version would be better, given that this is code to teach people how to use scikitlearn library.