# -- Code Cell --
import pandas as pd

# -- Code Cell --
train = pd.read_csv("train.csv")
test = pd.read_csv("test.csv")

# -- Code Cell --
train.head()

# -- Code Cell --
all_styles = []
for i in range(len(train)):
    for style in train['TeamStyles'][i].split(","):
        if style not in all_styles:
            all_styles.append(style)

# -- Code Cell --
train = train.drop(columns='MatchID')

# -- Code Cell --
from catboost import CatBoostClassifier
from sklearn.metrics import f1_score
from sklearn.model_selection import train_test_split
model = CatBoostClassifier(iterations=1000, learning_rate=0.2,cat_features=['Season','HomeTeam','AwayTeam','FullTimeResult','TeamStyles'])
X = train.drop(columns='chaos_label')
y = train['chaos_label']
X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.2, random_state=42)
model.fit(X_train,y_train)
pred = model.predict(X_test)
score = f1_score(y_test,pred,average='macro')
score

# -- Code Cell --
