ageron / handson-ml2

A series of Jupyter notebooks that walk you through the fundamentals of Machine Learning and Deep Learning in Python using Scikit-Learn, Keras and TensorFlow 2.
Apache License 2.0
27.98k stars 12.79k forks source link

[IDEA] Result Readability - 02_end_to_end_machine_learning_project.ipynb #429

Open derycck opened 3 years ago

derycck commented 3 years ago

To improve the readability of which parameter is more efficient in cv_results, I suggest a small adaptation in the code:

Notebook: 02_end_to_end_machine_learning_project

In cell 105

From:

cvres = rnd_search.cv_results_
for mean_score, params in zip(cvres["mean_test_score"], cvres["params"]):
    print(np.sqrt(-mean_score), params)

To:

cvres = rnd_search.cv_results_
for rank, mean_score, params in zip(cvres['rank_test_score'], cvres['mean_test_score'], cvres['params']):
    print(rank, np.sqrt(-mean_score), params)
ageron commented 3 years ago

Hi @derycck , Thanks for the suggestion! Would you like to submit a PR? If not, I can do it, as you wish.

derycck commented 3 years ago

sure... If you can wait, next monday i could do the PR : )