Je model tunen

Marketinganalyse: klantverloop voorspellen in Python

Mark Peterson

Director of Data Science, Infoblox

Opfrisser

from sklearn.svm import SVC

svc = SVC()

svc.fit(telco['data'], telco['target'])
SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,
  decision_function_shape='ovr', degree=3, gamma='scale', kernel='rbf',
  max_iter=-1, probability=False, random_state=None, shrinking=True,
  tol=0.001, verbose=False)
Marketinganalyse: klantverloop voorspellen in Python

Hyperparameters van random forest

Parameter Doel
n_estimators Aantal bomen
criterion Kwaliteit van split
max_features Aantal features voor beste split
max_depth Maximale diepte van boom
min_sample_splits Min. samples om knoop te splitsen
bootstrap Of bootstrapsamples worden gebruikt
Marketinganalyse: klantverloop voorspellen in Python

Grid search

Marketinganalyse: klantverloop voorspellen in Python

Grid search in sklearn

from sklearn.model_selection import GridSearchCV

param_grid = {'n_estimators': np.arange(10, 51)}
clf_cv = GridSearchCV(RandomForestClassifier(), param_grid)
clf_cv.fit(X, y)
clf_cv.best_params_
{'n_estimators': 43}
clf_cv.best_score_
0.9237923792379238
Marketinganalyse: klantverloop voorspellen in Python

Veel succes met tunen!

Marketinganalyse: klantverloop voorspellen in Python

Preparing Video For Download...