11.1 검증 곡선

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()

11.2 학습 곡선

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()