-
Notifications
You must be signed in to change notification settings - Fork 19.6k
FEAT add scikit-learn wrappers #20599
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
Changes from 10 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
6178e35
FEAT add scikit-learn wrappers
adrinjalali 9a4b999
import cleanup
adrinjalali e14ec2b
run black
adrinjalali 77d0975
linters
adrinjalali 5b28b90
lint
adrinjalali e450bf1
add scikit-learn to requirements-common
adrinjalali f73c5e2
generate public api
adrinjalali c5aa0ea
fix tests for sklearn 1.5
adrinjalali 999c598
check fixes
adrinjalali 5d9bd01
Merge remote-tracking branch 'upstream/master' into wrapper
adrinjalali a91b475
skip numpy tests
adrinjalali ab1d0ea
xfail instead of skip
adrinjalali 4f3d7ad
apply review comments
adrinjalali 425b940
Merge remote-tracking branch 'upstream/master' into wrapper
adrinjalali 7f9dd79
change names to SKL* and add transformer example
adrinjalali 9eebe2d
fix API and imports
adrinjalali 8e784fa
fix for new sklearn
adrinjalali 4c26931
sklearn1.6 test
adrinjalali 6289a8f
review comments and remove random_state
adrinjalali a958d98
Merge remote-tracking branch 'upstream/master' into wrapper
adrinjalali 3cad37f
add another skipped test
adrinjalali 70b44e8
rename file
adrinjalali f506f97
change imports
adrinjalali a33501e
unindent
adrinjalali be8835f
Merge remote-tracking branch 'upstream/master' into wrapper
adrinjalali eb7a893
docstrings
adrinjalali File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"""DO NOT EDIT. | ||
|
||
This file was autogenerated. Do not edit it by hand, | ||
since your modifications would be overwritten. | ||
""" | ||
|
||
from keras.src.wrappers._sklearn import KerasClassifier | ||
from keras.src.wrappers._sklearn import KerasRegressor | ||
from keras.src.wrappers._sklearn import KerasTransformer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"""DO NOT EDIT. | ||
|
||
This file was autogenerated. Do not edit it by hand, | ||
since your modifications would be overwritten. | ||
""" | ||
|
||
from keras.src.wrappers._sklearn import KerasClassifier | ||
from keras.src.wrappers._sklearn import KerasRegressor | ||
from keras.src.wrappers._sklearn import KerasTransformer | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from keras.src.wrappers._sklearn import KerasClassifier | ||
from keras.src.wrappers._sklearn import KerasRegressor | ||
from keras.src.wrappers._sklearn import KerasTransformer | ||
|
||
__all__ = ["KerasClassifier", "KerasRegressor", "KerasTransformer"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reservations about "KerasTransformer" due to the very specific meaning that Transformer has in deep learning. This is going to confuse the hell out of people who search "Transformer" on keras.io. This was also not part of the original implementation of sklearn wrappers we had in Keras.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
I've included this here since, in the meantime, using pre-trained models as a step in a pipeline to get embeddings or any other kind of transformation has become much more popular than a couple of years ago.
But I do understand the name is quite confusing. What do you think of naming these estimators
SKLearn{Regressor, Classifier, Transformer}
? That should make it clear that the space/scope of these estimators are scikit-learn. We can also add a clear note in the docstring that these have nothing to do with "transformers".