How to Transform Target Variables for Regression in Python
Last Updated on August 18, 2020
Data preparation is a big part of applied machine learning.
Correctly preparing your training data can mean the difference between mediocre and extraordinary results, even with very simple linear algorithms.
Performing data preparation operations, such as scaling, is relatively straightforward for input variables and has been made routine in Python via the Pipeline scikit-learn class.
On regression predictive modeling problems where a numerical value must be predicted, it can also be critical to scale and perform other data transformations on the target variable. This can be achieved in Python using the TransformedTargetRegressor class.
In this tutorial, you will discover how to use the TransformedTargetRegressor to scale and transform target variables for regression using the scikit-learn Python machine learning library.
After completing this tutorial, you will know:
- The importance of scaling input and target data for machine learning.
- The two approaches to applying data transforms to target variables.
- How to use the TransformedTargetRegressor on a real regression dataset.
Kick-start your project with my new book Data Preparation for Machine Learning, including step-by-step tutorials and the Python source code files for all examples.
Let’s get started.