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 features
  • train_test_split() — splits data into 70% training and 30% test sets
  • RandomForestClassifier() — creates an ensemble of 100 decision trees
  • classification_report() — shows precision, recall, and F1-score per class
  • Key scikit-learn concepts

    OperationCode
    Load datasetload_iris()
    Split datatrain_test_split(X, y)
    Train modelclf.fit(X_train, y_train)
    Predictclf.predict(X_test)
    Evaluateaccuracy_score(y_test, y_pred)
    Scikit-learn, NumPy, and Pandas are pre-loaded in PythonHere — no installation required.

    Related examples