-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (22 loc) · 817 Bytes
/
main.py
File metadata and controls
31 lines (22 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
# from matplotlib import pyplot
# import numpy as np
#
# from sklearn.preprocessing import StandardScaler, LabelEncoder
# from sklearn.model_selection import train_test_split
# from sklearn.linear_model import LogisticRegression
csv_file_name = "csv_file/db.csv"
df = pd.read_csv(csv_file_name, encoding='unicode_escape')
# column_headers = list(df.columns.values)
# print("The Column Header Names :", column_headers)
# df_most_profitable_mov = df[['Original Title', 'Gross\xa0USA', 'Gross Worldwide']]
# print(df_most_profitable_mov)
best_rated = df[['Company', 'Rate', 'Metascore']]
# print(best_rated)
X = best_rated.drop(columns=['Company'])
# print(X)
y = best_rated['Company']
# print(Y)
model = DecisionTreeClassifier
model.fit(X, y)