Machine LearningBeginner
Run Scikit-learn Online
Run scikit-learn models online with no install and no signup. Free in-browser Python sklearn compiler with NumPy and Pandas pre-loaded.
Try it yourself
Run this code directly in your browser. Click "Open in full editor" to experiment further.
Loading...
Click Run to see output
Or press Ctrl + Enter
How it works
Run Scikit-learn Online
This example demonstrates a typical machine learning workflow: loading a dataset, splitting it, training a classifier, and evaluating its performance.
What's happening
load_iris() — loads the classic Iris flower dataset with 150 samples and 4 featurestrain_test_split() — splits data into 70% training and 30% test setsRandomForestClassifier() — creates an ensemble of 100 decision treesclassification_report() — shows precision, recall, and F1-score per classKey scikit-learn concepts
| Operation | Code |
|---|---|
| Load dataset | load_iris() |
| Split data | train_test_split(X, y) |
| Train model | clf.fit(X_train, y_train) |
| Predict | clf.predict(X_test) |
| Evaluate | accuracy_score(y_test, y_pred) |
Scikit-learn, NumPy, and Pandas are pre-loaded in PythonHere — no installation required.
Related examples
Scientific Computing
NumPy Online Compiler
Run NumPy arrays and matrix operations online with no install and no signup. Free in-browser NumPy compiler with pandas and Matplotlib pre-loaded.
Data Science
Run Pandas Online
Run pandas DataFrames online with no install and no signup. Free in-browser Python pandas compiler with NumPy and Matplotlib pre-loaded.