O'Reilly logo

Hands-On Automated Machine Learning by Umit Mert Cakmak, Sibanjan Das

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating sample datasets with sklearn

In sklearn, there are some useful ways to create sample datasets for testing algorithms:

# Importing necessary libraries for visualizationimport matplotlib.pyplot as pltimport seaborn as sns# Set context helps you to adjust things like label size, lines and various elements# Try "notebook", "talk" or "paper" instead of "poster" to see how it changessns.set_context('poster')# set_color_codes will affect how colors such as 'r', 'b', 'g' will be interpretedsns.set_color_codes()# Plot keyword arguments will allow you to set things like size or line width to be used in charts.plot_kwargs = {'s': 10, 'linewidths': 0.1}import numpy as npimport pandas as pd# Pprint will better output your variables in console ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required