Last active
January 22, 2021 17:53
Scikeras Tutorial-2: DataTransformers Template
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
from sklearn.base import BaseEstimator, TransformerMixin | |
from scikeras.wrappers import KerasClassifier | |
### Multi-Output Classifier | |
class MultiOutputTransformer(BaseEstimator, TransformerMixin): | |
#define your transformer | |
class MultiOutputClassifier(KerasClassifier): | |
@property | |
def target_encoder(self): | |
return MultiOutputTransformer(...) | |
### Multi-Input Classifier | |
class MultiInputTransformer(BaseEstimator, TransformerMixin): | |
#define your transformer | |
class MultiInputClassifier(KerasClassifier): | |
@property | |
def feature_encoder(self): | |
return MultiInputTransformer(...) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment