Skip to content

Instantly share code, notes, and snippets.

@adam2392
Created March 21, 2024 14:54
Show Gist options
  • Select an option

  • Save adam2392/97087a0a1650786dc26ed683d610c523 to your computer and use it in GitHub Desktop.

Select an option

Save adam2392/97087a0a1650786dc26ed683d610c523 to your computer and use it in GitHub Desktop.
Memory benchmark
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import make_classification
n_samples = 10_000
n_features = 200
n_estimators = 200
# Generate synthetic classification dataset
X, y = make_classification(n_samples=n_samples, n_features=n_features, n_classes=2, random_state=42)
# Initialize RandomForestClassifier
clf = RandomForestClassifier(n_estimators=n_estimators, random_state=42)
# Fit the classifier on the training data
clf.fit(X, y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment