<jupyter_start><jupyter_text>Arbol de decisión<jupyter_code>#No hay standar entre los parametros, pero si tiene hyperparametros, es decir, profundidad: max_depth
from sklearn.pipeline import Pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.tree import DecisionTreeClassifier
# creacion de pipeline
pipeline_arbol= Pipeline([("arbol",DecisionTreeClassifier())])
hyper_arbol={"arbol__max_depth":[2,3,4,5,6,7,8]}

gs_arbol= GridSearchCV (pipeline_arbol,param_grid = hyper_arbol,cv=5,scoring ="roc_auc",verbose=3)
gs_arbol
gs_arbol.fit(df_white_train[nombres],df_white_train["quality"])
print("Puntuacion:"+ str (gs_arbol.best_score_))
print("Mejor Parametro:"+ str (gs_arbol.best_params_))
y_pred = gs_arbol.predict(df_white_test[nombres])
y_pred
from sklearn.metrics import accuracy_score, recall_score,precision_score
accuracy_score(df_white_test["quality"], y_pred)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11123227917121047, 'fraction_numerical': 0.009814612868047983, 'mean_word_length': 12.114285714285714, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '246098', 'license': 'MIT', 'n_tokens_mistral': 338, 'n_tokens_neox': 334, 'n_words': 58, 'path': 'prediciones/Pred_wine_white.ipynb', 'repo_name': 'rusgar/Me_gusta_el_vino_y_los-toros', 'size': '917'}