마케팅 애널리틱스: Python으로 고객 이탈 예측하기
Mark Peterson
Director of Data Science, Infoblox
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)
| 매개변수 | 목적 |
|---|---|
| n_estimators | 트리 개수 |
| criterion | 분할 품질 기준 |
| max_features | 최적 분할에 사용할 특징 수 |
| max_depth | 트리 최대 깊이 |
| min_sample_splits | 노드 분할 최소 샘플 수 |
| bootstrap | 부트스트랩 샘플 사용 여부 |
from sklearn.model_selection import GridSearchCVparam_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
마케팅 애널리틱스: Python으로 고객 이탈 예측하기