Puzzles

Practice challenges to sharpen your scikit-learn skills.

0/14
Basic Train/Test Split
Split the iris dataset into training and test sets with 80% for training and 20% for testing. Use random_state=42 for reproducibility.
easy
KNN Fit and Predict
Train a K-Nearest Neighbors classifier on the iris dataset and make predictions on the test set.
easy
Build a Confusion Matrix
Create and display a confusion matrix for a classifier's predictions on the iris dataset.
easy
Standardize Features
Use StandardScaler to standardize features so they have zero mean and unit variance.
easy
Cross-Validation Score
Use 5-fold cross-validation to evaluate a Random Forest classifier on the digits dataset.
medium
Build a Simple Pipeline
Create a pipeline that first scales the data and then applies logistic regression.
medium
Grid Search Hyperparameters
Use GridSearchCV to find the best hyperparameters for an SVM classifier.
medium
Extract Feature Importance
Train a Random Forest and extract the feature importances for the wine dataset.
medium
PCA Dimensionality Reduction
Use PCA to reduce the digits dataset from 64 dimensions to 2 and visualize explained variance.
medium
K-Means Clustering
Apply K-Means clustering to the iris dataset and compare cluster labels with true labels.
medium
Plot ROC Curve
Train a classifier and compute the ROC curve and AUC score for binary classification.
hard
Ensemble Voting Classifier
Create a voting classifier that combines multiple different classifiers.
hard
Precision-Recall Trade-off
Calculate precision, recall, and F1-score for different classification thresholds.
hard
Mixed Data Types Pipeline
Use ColumnTransformer to handle numerical and categorical features differently in a pipeline.
hard

Command Palette

Search for a command to run...