11장 모델 선택
모델을 선택하기 위한 방법을 익힙니다.
from sklearn.ensemble import RandomForestClassifier
from yellowbrick.model_selection import (
ValidationCurve
)
fig, ax = plt.subplots(figsize=(6, 4))
vc_viz = ValidationCurve(
RandomForestClassifier(n_estimators=100),
param_name="max_depth",
param_range=np.arange(1, 11),
cv=10,
n_jobs=-1,
)
vc_viz.fit(X, y)
vc_viz.poof()
from yellowbrick.model_selection import (
LearningCurve,
)
fig, ax = plt.subplots(figsize=(6, 4))
lc3_viz = LearningCurve(
RandomForestClassifier(n_estimators=100),
cv=10,
)
lc3_viz.fit(X, y)
lc3_viz.poof()