Chapter 4
Working with the scikit-learn Library
IN THIS CHAPTER
Installing the scikit-learn library
Preprocessing data for models
Splitting data into training and test sets
Understanding classification, regression, and clustering models
Now that you have some experience with Python and pandas, it’s time to play around with your first AI library. In this chapter, you learn all about the scikit-learn library, a machine learning powerhouse. Plenty of libraries are available in Python to help you accomplish AI tasks, and different codebases are better suited to different problems. But if AI libraries are tools, scikit-learn is your Swiss Army Knife.
In this chapter, you install the scikit-learn library and learn how the submodules are broken down into logical groups. You implement some useful preprocessing functions, such as one-hot encoding and min-max scaling. You discover the difference between training, test, and validation sets and program these splits using the library. You also get a sense for how classification problems differ from regression problems, and clustering forms its ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access