aws / amazon-sagemaker-examples

Example 📓 Jupyter notebooks that demonstrate how to build, train, and deploy machine learning models using 🧠 Amazon SageMaker.
https://sagemaker-examples.readthedocs.io
Apache License 2.0
10k stars 6.74k forks source link

scikit_learn_iris.py script embedded in notebook does not import tree #663

Open willettk opened 5 years ago

willettk commented 5 years ago

The Jupyter notebook (c80657daa9d42b7c9b12729d6fa4b825fd980730) for the scikit-learn estimator example contains an embedded example of the Python script scikit_learn_iris.py. The script provided in the repo is correct, but the version in the notebook is not - specifically, the commands in the notebook is missing

import sklearn.tree

Instead, it imports sklearn.svm, which is not used in the script.

willettk commented 5 years ago

Not directly, but I don't have nearly enough details from your use case to say why. scikit-learn k-fold is implemented in the version supported in the Docker image, so it should be able to work.

I didn't see an issue posted to Github for this - I suggest adding your issue along with specific examples of code/error messages and see if someone can help.

On Tue, Apr 2, 2019 at 2:09 PM Yu Liu notifications@github.com wrote:

thank you willettk, this helps. I'm trying to add k-fold cross-validation into the script, but not been successful. Do you by chance know how?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/awslabs/amazon-sagemaker-examples/issues/663#issuecomment-479203550, or mute the thread https://github.com/notifications/unsubscribe-auth/ACLhazuyOfVx8rC69b8Fm3U8M3Eh2J_Bks5vc8b4gaJpZM4bj908 .

YuLiu83 commented 5 years ago

Not directly, but I don't have nearly enough details from your use case to say why. scikit-learn k-fold is implemented in the version supported in the Docker image, so it should be able to work. I didn't see an issue posted to Github for this - I suggest adding your issue along with specific examples of code/error messages and see if someone can help. … On Tue, Apr 2, 2019 at 2:09 PM Yu Liu @.***> wrote: thank you willettk, this helps. I'm trying to add k-fold cross-validation into the script, but not been successful. Do you by chance know how? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#663 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ACLhazuyOfVx8rC69b8Fm3U8M3Eh2J_Bks5vc8b4gaJpZM4bj908 .

The current version in sk-learn is the 0.20.0, but GridSearchCV() only came out in 0.20.3. That maybe the issue?!

willettk commented 5 years ago

If that's what you're specifically trying to do, then that seems plausible. I'd suggest opening a separate issue and asking if the scikit-learn version can be upgraded.