Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary complexity (I think) #32

Open
cgosorio opened this issue Jul 25, 2022 · 0 comments
Open

Unnecessary complexity (I think) #32

cgosorio opened this issue Jul 25, 2022 · 0 comments

Comments

@cgosorio
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant