Spaces:
Runtime error
Runtime error
Praneeth383
commited on
Commit
•
2e3fa3c
1
Parent(s):
9a38776
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import pandas as pd
|
|
4 |
import numpy as np
|
5 |
|
6 |
# Load your dataset here
|
7 |
-
file_path_gr = '
|
8 |
df = pd.read_csv(file_path_gr, header=None, sep='\s+')
|
9 |
|
10 |
# Define the X variable with the feature columns
|
@@ -12,17 +12,17 @@ X = df.drop(df.columns[-1], axis=1)
|
|
12 |
|
13 |
# Load the saved models
|
14 |
best_models = [
|
15 |
-
("Logistic Regression", joblib.load('
|
16 |
-
("Support Vector Machine", joblib.load('
|
17 |
-
("Decision Trees", joblib.load('
|
18 |
-
("Random Forests", joblib.load('
|
19 |
-
("MLPClassifier", joblib.load('
|
20 |
-
("K-Nearest Neighbors", joblib.load('
|
21 |
-
("Linear Discriminant Analysis",joblib.load('
|
22 |
]
|
23 |
|
24 |
# Load the saved scaler
|
25 |
-
scaler = joblib.load('
|
26 |
|
27 |
attribute_names = [
|
28 |
"age", "sex", "chest pain type", "resting blood pressure",
|
|
|
4 |
import numpy as np
|
5 |
|
6 |
# Load your dataset here
|
7 |
+
file_path_gr = 'heart.dat'
|
8 |
df = pd.read_csv(file_path_gr, header=None, sep='\s+')
|
9 |
|
10 |
# Define the X variable with the feature columns
|
|
|
12 |
|
13 |
# Load the saved models
|
14 |
best_models = [
|
15 |
+
("Logistic Regression", joblib.load('Logistic Regression_best_model.pkl')),
|
16 |
+
("Support Vector Machine", joblib.load('Support Vector Machine_best_model.pkl')),
|
17 |
+
("Decision Trees", joblib.load('Decision Trees_best_model.pkl')),
|
18 |
+
("Random Forests", joblib.load('Random Forests_best_model.pkl')),
|
19 |
+
("MLPClassifier", joblib.load('MLPClassifier_best_model.pkl')),
|
20 |
+
("K-Nearest Neighbors", joblib.load('K-Nearest Neighbors_best_model.pkl')),
|
21 |
+
("Linear Discriminant Analysis",joblib.load('Linear Discriminant Analysis_best_model.pkl'))
|
22 |
]
|
23 |
|
24 |
# Load the saved scaler
|
25 |
+
scaler = joblib.load('scaler.pkl')
|
26 |
|
27 |
attribute_names = [
|
28 |
"age", "sex", "chest pain type", "resting blood pressure",
|