# ---
# 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
# ---

import pandas as pd
df = pd.read_csv("dataset.csv")
df.head()

df.RCL.unique()

from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import train_test_split
import numpy as np
from sklearn.metrics import confusion_matrix
from sklearn.metrics import f1_score
from sklearn.metrics import accuracy_score
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
from sklearn.feature_selection import VarianceThreshold
import matplotlib.pyplot as plt
import seaborn as sns
# %matplotlib inline

del df['Time']
df.head()

print(pd.Series(df['Subject']))

X = df.iloc[:, 0:5]
y = df.iloc[:, -1]
y.head()

# +
from sklearn import preprocessing

x = X.values #returns a numpy array
min_max_scaler = preprocessing.MinMaxScaler()
x_scaled = min_max_scaler.fit_transform(x)
X = pd.DataFrame(x_scaled)
# -

from sklearn.metrics import classification_report
from sklearn.metrics import accuracy_score 

X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0, test_size=0.20)

classifier = DecisionTreeClassifier()
classifier.fit(X_train, y_train)

import pickle

pickle.dump(classifier, open('model1.pkl','wb'))



StarcoderdataJupyterScriptsDedupFiltered