scikit-learn 1 · Data and splitting

Generate a synthetic dataset

Create a random classification problem, good for testing code quickly.

from sklearn.datasets import make_classification

X, y = make_classification(n_samples=500, n_features=8, n_informative=4, random_state=42)

Official scikit-learn 1 documentation

More data and splitting commands

All data and splitting commands · scikit-learn 1 cheatsheet

Was this page helpful?