How to visualize validation loss during each epoch with make_pipeline
and metadata routing in scikit-learn?
#30656
Closed
acmoudleysa
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The Problem
I’m working with a custom
MLPestimator
in scikit-learn and want to visualize the validation loss during each epoch while training. Here's a snippet of theMLPestimator
:This allows me to visualize the validation loss at each epoch and train my model.
The challenge
I want to integrate this process with
sklearn
'smake_pipeline
, so I don’t have to manually apply preprocessing steps like scaling. Here's the current implementation:It seems like it works but the issue is that the validation data is only passed to
MLPestimator
during thefit
method, meaning it bypasses the preprocessing steps (like scaling). This causes a mismatch in how the training and validation data are processed, leading to incorrect resultsThe question
Is there a built-in way to visualize the validation loss during training while using
make_pipeline
? Also, how can I ensure the validation data passes through the preprocessing steps (like scaling) before being passed to the model for validation loss evaluation?I understand metadata routing wasn't originally designed for this, but it seems like it could help here. Before building a custom solution, I wanted to check if there is already a better way to handle this within scikit-learn or if metadata routing can be leveraged effectively in this case.
Beta Was this translation helpful? Give feedback.
All reactions