{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "rOafwFRXG7fb" }, "source": [ "# 교차 검증과 그리드 서치" ] }, { "cell_type": "markdown", "metadata": { "id": "6YuimmymG7fi" }, "source": [ "
\n", " 구글 코랩에서 실행하기\n", " | \n", "
GridSearchCV(estimator=DecisionTreeClassifier(random_state=42), n_jobs=-1,\n", " param_grid={'min_impurity_decrease': [0.0001, 0.0002, 0.0003,\n", " 0.0004, 0.0005]})In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
GridSearchCV(estimator=DecisionTreeClassifier(random_state=42), n_jobs=-1,\n", " param_grid={'min_impurity_decrease': [0.0001, 0.0002, 0.0003,\n", " 0.0004, 0.0005]})
DecisionTreeClassifier(random_state=42)
DecisionTreeClassifier(random_state=42)
GridSearchCV(estimator=DecisionTreeClassifier(random_state=42), n_jobs=-1,\n", " param_grid={'max_depth': range(5, 20),\n", " 'min_impurity_decrease': array([0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008,\n", " 0.0009]),\n", " 'min_samples_split': range(2, 100, 10)})In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
GridSearchCV(estimator=DecisionTreeClassifier(random_state=42), n_jobs=-1,\n", " param_grid={'max_depth': range(5, 20),\n", " 'min_impurity_decrease': array([0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008,\n", " 0.0009]),\n", " 'min_samples_split': range(2, 100, 10)})
DecisionTreeClassifier(random_state=42)
DecisionTreeClassifier(random_state=42)
RandomizedSearchCV(estimator=DecisionTreeClassifier(random_state=42),\n", " n_iter=100, n_jobs=-1,\n", " param_distributions={'max_depth': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce351cc0>,\n", " 'min_impurity_decrease': <scipy.stats._distn_infrastructure.rv_continuous_frozen object at 0x7cccce2f4610>,\n", " 'min_samples_leaf': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce352da0>,\n", " 'min_samples_split': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce353bb0>},\n", " random_state=42)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
RandomizedSearchCV(estimator=DecisionTreeClassifier(random_state=42),\n", " n_iter=100, n_jobs=-1,\n", " param_distributions={'max_depth': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce351cc0>,\n", " 'min_impurity_decrease': <scipy.stats._distn_infrastructure.rv_continuous_frozen object at 0x7cccce2f4610>,\n", " 'min_samples_leaf': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce352da0>,\n", " 'min_samples_split': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce353bb0>},\n", " random_state=42)
DecisionTreeClassifier(random_state=42)
DecisionTreeClassifier(random_state=42)
RandomizedSearchCV(estimator=DecisionTreeClassifier(random_state=42,\n", " splitter='random'),\n", " n_iter=100, n_jobs=-1,\n", " param_distributions={'max_depth': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce351cc0>,\n", " 'min_impurity_decrease': <scipy.stats._distn_infrastructure.rv_continuous_frozen object at 0x7cccce2f4610>,\n", " 'min_samples_leaf': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce352da0>,\n", " 'min_samples_split': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce353bb0>},\n", " random_state=42)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
RandomizedSearchCV(estimator=DecisionTreeClassifier(random_state=42,\n", " splitter='random'),\n", " n_iter=100, n_jobs=-1,\n", " param_distributions={'max_depth': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce351cc0>,\n", " 'min_impurity_decrease': <scipy.stats._distn_infrastructure.rv_continuous_frozen object at 0x7cccce2f4610>,\n", " 'min_samples_leaf': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce352da0>,\n", " 'min_samples_split': <scipy.stats._distn_infrastructure.rv_discrete_frozen object at 0x7cccce353bb0>},\n", " random_state=42)
DecisionTreeClassifier(random_state=42, splitter='random')
DecisionTreeClassifier(random_state=42, splitter='random')