# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
from sklearn import tree
from sklearn.model_selection import cross_val_score
import matplotlib.pyplot as plt
import seaborn as sb
import numpy as np
import pandas as pd

# %matplotlib inline
# -

from IPython.display import SVG
from graphviz import Source
from IPython.display import display

df_train = pd.read_csv('../data/dogs_n_cats.csv')

df_train = df_train.sample(frac=1).reset_index(drop=True)
df_train.head()

y_train = df_train['Вид']
X_train = df_train.drop(['Вид'], axis=1)

X_train.head()

# +
clf = tree.DecisionTreeClassifier(max_depth=5, criterion='entropy')
clf.fit(X_train, y_train)
score = cross_val_score(clf, X=X_train, y=y_train, cv=5)
    
score
# -

df_test = pd.read_json('../data/dataset_209691_15.txt')
df_test.head()

predicts = clf.predict(df_test)

l = list(predicts)
l.count('собачка')



StarcoderdataJupyterScriptsDedupFiltered