'how to view the transformed data in pycaret?
I have been following the "diamond" data example here https://pycaret.gitbook.io/docs/learn-pycaret/official-blog/easy-mlops-with-pycaret-and-mlflow
s = setup(data,
target = 'Price',
transform_target = True, # tell PyCaret to transform the target column in the raw data
log_experiment = True, # tell PyCaret to log to MLFlow
experiment_name = 'example - pycaret - diamond' # experiment name in MLFlow
)
I can see in the output of setup that a boxcox transformation will be applied to the target column (Price). I wanted to see the histogram of the transformed target data, so I tried obtaining the data and plotting
y = get_config('y')
figY = px.histogram(y, template = 'plotly_dark', title = 'Histogram of Price - Transformed')
figY.show()
Although y is described as "Transformed dataset (y)" it is still skewed and the boxcox transformation is not applied.
According to this Issue in gitlab the target transformation occurs "under the hood" prior to the model being called. That's fine, but how do I see it prior to training models?
Solution 1:[1]
You can't see the transformed target in the current version of Pycaret. For the transformed features, you can access them with:
prep_pipe = get_config('prep_pipe')
prep_pipe.transform(data)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | SciPy |