Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC remove FutureWarnings in plot_manifold_sphere example #24941

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

Merged
merged 14 commits into from
Nov 17, 2022

Conversation

Reddragonemperor58
Copy link
Contributor

Related to #24876

What does this implement/fix? Explain your changes.

Fix FutureWarning in manifold/plot_manifold_sphere.html

/home/runner/work/scikit-learn/scikit-learn/sklearn/manifold/_mds.py:299: FutureWarning:

The default value of normalized_stress will change to 'auto' in version 1.4. To suppress this warning, manually set the value of normalized_stress.

by explicit passing normalized_stress="auto"

Any other comments?

Reddragonemperor58 and others added 3 commits November 15, 2022 22:14
Related to scikit-learn#24876
What does this implement/fix? Explain your changes.

Fix FutureWarning in manifold/plot_manifold_sphere.html

/home/runner/work/scikit-learn/scikit-learn/sklearn/manifold/_mds.py:299: FutureWarning:

The default value of `normalized_stress` will change to `'auto'` in version 1.4. To suppress this warning, manually set the value of `normalized_stress`.

by explicit passing normalized_stress="auto"
@@ -111,7 +111,7 @@

# Perform Multi-dimensional scaling.
t0 = time()
mds = manifold.MDS(2, max_iter=100, n_init=1)
mds = manifold.MDS(2, max_iter=100, n_init=1,normalized_stress="auto",)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mds = manifold.MDS(2, max_iter=100, n_init=1,normalized_stress="auto",)
mds = manifold.MDS(2, max_iter=100, n_init=1, normalized_stress="auto")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should remove the linting error reported by the CIs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should remove the linting error reported by the CIs

I committed the change but linting test still failed

@glemaitre glemaitre changed the title FutureWarnings in the documentation #24876 DOC remove FutureWarnings in plot_manifold_sphere example Nov 15, 2022
@glemaitre
Copy link
Member

I just merged main into your branch such that it is up-to-date

@@ -1,93 +0,0 @@
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not remove this example :)
Can you revert this change.

Copy link
Contributor Author

@Reddragonemperor58 Reddragonemperor58 Nov 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made new pull request for this example #24960

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw but you should not remove this file. Currently, it is tagged as deleted from your side in your git history. You need to add the original file back.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 52 to 54
def binomial_deviance(y, raw_predictions):
return -2 * np.mean((y * raw_predictions) - np.logaddexp(0, raw_predictions))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change

@@ -76,7 +79,7 @@

for i, y_pred in enumerate(clf.staged_decision_function(X_test)):
# clf.loss_ assumes that y_test[i] in {0, 1}
test_deviance[i] = clf.loss_(y_test, y_pred)
test_deviance[i] = binomial_deviance(y_test, y_pred.ravel())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this one

@glemaitre glemaitre merged commit d47b1c8 into scikit-learn:main Nov 17, 2022
@glemaitre
Copy link
Member

LGTM. Merging. Thanks @Reddragonemperor58

@Reddragonemperor58
Copy link
Contributor Author

LGTM. Merging. Thanks @Reddragonemperor58

Thanks to you for the support and help☺

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

Successfully merging this pull request may close these issues.

2 participants