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 ...

Get Hands-On Automated Machine Learning now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.