Skip to content

TST Remove Boston dataset in test_mlp#17337

Merged
thomasjpfan merged 7 commits intoscikit-learn:masterfrom
lucyleeow:test_mlp
May 26, 2020
Merged

TST Remove Boston dataset in test_mlp#17337
thomasjpfan merged 7 commits intoscikit-learn:masterfrom
lucyleeow:test_mlp

Conversation

@lucyleeow
Copy link
Copy Markdown
Member

Reference Issues/PRs

Towards #16155

What does this implement/fix? Explain your changes.

Use synthetic dataset instead of Boston dataset

Any other comments?

Notes added as review comments for easier legibility

for activation in ACTIVATION_TYPES:
mlp = MLPRegressor(solver='lbfgs', hidden_layer_sizes=50,
print(f'{activation}')
mlp = MLPRegressor(solver='lbfgs', hidden_layer_sizes=50, tol=0.0,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

set tol=0.0 otherwise convergence occurs <10 iterations for 'identity'


pred2 = mlp.predict(X)
assert_almost_equal(pred1, pred2, decimal=2)
assert_almost_equal(pred1, pred2)
Copy link
Copy Markdown
Member Author

@lucyleeow lucyleeow May 25, 2020

Choose a reason for hiding this comment

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

Removed decimal=2 to use the default decimal=7 as the predictions should be/are equal to more precision.

@lucyleeow
Copy link
Copy Markdown
Member Author

(cc @glemaitre )


pred2 = mlp.predict(X)
assert_almost_equal(pred1, pred2, decimal=2)
assert_almost_equal(pred1, pred2)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we should be use assert_allclose if we are changing it.

Copy link
Copy Markdown
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Thank you @lucyleeow !

@thomasjpfan thomasjpfan merged commit 6f33c5c into scikit-learn:master May 26, 2020
@lucyleeow lucyleeow deleted the test_mlp branch June 8, 2020 10:35
viclafargue pushed a commit to viclafargue/scikit-learn that referenced this pull request Jun 26, 2020
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
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.

3 participants