Transformed target regressor support?
See original GitHub issueWhen I build a pipeline where I use a scikeras KerasRegressor, but put it inside of a scikitlearn transformedtargetregressor, I can no longer access the training history.
I can still access the KerasRegressor object, and when I do I get the following:
In [38]: pipeline['NN_model'].regressor
Out[38]:
KerasRegressor(
model=<function build_regressor_model at 0x000001DE15A4D5E0>
build_fn=None
warm_start=False
random_state=None
optimizer=<tensorflow.python.keras.optimizer_v2.adam.Adam object at 0x000001DE760DAF40>
loss=mse
metrics=None
batch_size=None
validation_batch_size=None
verbose=1
callbacks=None
validation_split=0.2
shuffle=True
run_eagerly=False
epochs=100
parameters={'num_nodes': (250, 150, 100), 'num_dense_layers': 3, 'dropout': 0.01, 'dropout_type': 'none', 'activation': 'elu', 'output_activation': 'linear', 'learning_rate': 0.0001, 'input_dim': 258, 'output_dim': 140, 'loss': 'mse', 'epochs': 100}
)
but when I try to get the history object, I get the following
In [39]: pipeline['NN_model'].regressor.history
Traceback (most recent call last):
File "<ipython-input-40-eb7647671dbe>", line 1, in <module>
pipeline['NN_model'].regressor.history
AttributeError: 'KerasRegressor' object has no attribute 'history'
Am I doing something wrong, or is some of the functionality of scikeras not supported when using a Transformed target regressor?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
sklearn.compose.TransformedTargetRegressor
Meta-estimator to regress on a transformed target. Useful for applying a non-linear transformation to the target y in regression problems. This transformation ......
Read more >How to Transform Target Variables for Regression in Python
In this tutorial, you will discover how to use the TransformedTargetRegressor to scale and transform target variables for regression using ...
Read more >Effect of transforming the targets in regression model
TransformedTargetRegressor . Two examples illustrate the benefit of transforming the targets before learning a linear regression model.
Read more >Target Transformed Regression for Accurate Tracking - arXiv
This target contextualized representation is able to enhance the target relevant information to help precisely locate the box boundaries, and ...
Read more >SHAP library does not support TransformedTargetRegressor ...
We are working with a regression problem, where we want to apply log transform to target variable. After model training, we want to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Try
history_, nothistory.https://github.com/adriangb/scikeras/blob/7c072fbed1985e9ad58e2291b3fee2324e4c39ea/scikeras/wrappers.py#L94-L95
Glad we could help!