AI Code Explorer

AI Code Explorer

Code examples at five levels (beginner, intermediate, advanced, research, applied); each example has a goal, commented code, requirements and how to run it. 61 of the 69 examples were actually run and their output recorded.

Reset

69 matching examples

ResearchSciPyRun and tested

A statistical significance test between two models

Finding out whether the difference between two models' accuracies across cross-validation folds is statistically significant.

Numerical computing and arrays · Model evaluation

MediumPolarsRun and tested

A lazy query in Polars

Building a query plan that Polars optimises before execution.

Big data and parallel table processing · Data analysis

BeginnerSeabornRun and tested

A distribution plot by category

Comparing a variable's distribution between two groups in one line.

Charts and data visualisation · Data analysis

MediumXGBoostRun and tested

XGBoost with early stopping

Stopping the addition of trees when the validation set stops improving.

Gradient boosting trees · Tabular classification

MediumOptunaRun and tested

Hyperparameter tuning with Optuna

Searching for the best hyperparameters with the TPE algorithm instead of grid search.

Hyperparameter tuning · Model tuning

BeginnerFLAMLRun and tested

AutoML with a time budget in FLAML

Letting the library choose the model and its hyperparameters within a set number of seconds.

Automated machine learning · Automated machine learning

ResearchPyTorchRun and tested

A capsule layer with dynamic routing

Implementing the squash function and the routing-by-agreement algorithm between capsules as in the paper by Sabour et al. (2017).

Convolutional networks · Scientific research

No code runs on the site's server; copy the example and run it on your machine or in a Jupyter notebook. Examples marked “not run” need a GPU or large model downloads, so check them against the official documentation.