To try the examples in the browser:
Shift + Enter
to executeRun
button in the toolbarmicropip.list()
to view installed packages.# Example code to try:
from sklearn.datasets import (
load_breast_cancer as data_2_classes,
load_iris as data_3_classes,
load_digits as data_10_classes,
make_classification,
)
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
# Load the data
X, y = data_3_classes(return_X_y=True, as_frame=True)
X_train, X_val, y_train, y_val = \
train_test_split(X, y, test_size=0.5)
# Create and train the model
model = RandomForestClassifier()\
.fit(X_train, y_train)
#import matplotlib.pyplot as plt
import scikitplot as sp
# Plot feature importances
ax, features = sp.estimators.plot_feature_importances(
model,
display_bar_label=False,
figsize=(12,5)
);
# Check installed packages:
import micropip; micropip.list()