Py
PyNow

Run Scikit-Learn in Your Browser

Machine Learning in Your Browser

Run Scikit-Learn code online for free. Train machine learning models, evaluate performance, and explore datasets — no installation needed.

main.py
Ln 1, Col 1Spaces: 4
Python 3.13 (Pyodide)
Hit Run to see output here.

What You Get

Classification & regression
Clustering
Built-in datasets
Model evaluation metrics

Scikit-Learn Examples

K-Means Clustering

from sklearn.cluster import KMeans
import numpy as np

np.random.seed(42)
X = np.vstack([np.random.randn(50, 2) + [i, j] for i, j in [(0,0), (5,5), (5,0)]])

kmeans = KMeans(n_clusters=3, random_state=42, n_init=10)
labels = kmeans.fit_predict(X)
print(f"Cluster centers:\n{kmeans.cluster_centers_}")
print(f"Inertia: {kmeans.inertia_:.2f}")