Praneeth383 commited on
Commit
2e3fa3c
1 Parent(s): 9a38776

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
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 = '/content/drive/MyDrive/Colab Notebooks/Homework_04/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,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('/content/drive/MyDrive/Colab Notebooks/Homework_04/Logistic Regression_best_model.pkl')),
16
- ("Support Vector Machine", joblib.load('/content/drive/MyDrive/Colab Notebooks/Homework_04/Support Vector Machine_best_model.pkl')),
17
- ("Decision Trees", joblib.load('/content/drive/MyDrive/Colab Notebooks/Homework_04/Decision Trees_best_model.pkl')),
18
- ("Random Forests", joblib.load('/content/drive/MyDrive/Colab Notebooks/Homework_04/Random Forests_best_model.pkl')),
19
- ("MLPClassifier", joblib.load('/content/drive/MyDrive/Colab Notebooks/Homework_04/MLPClassifier_best_model.pkl')),
20
- ("K-Nearest Neighbors", joblib.load('/content/drive/MyDrive/Colab Notebooks/Homework_04/K-Nearest Neighbors_best_model.pkl')),
21
- ("Linear Discriminant Analysis",joblib.load('/content/drive/MyDrive/Colab Notebooks/Homework_04/Linear Discriminant Analysis_best_model.pkl'))
22
  ]
23
 
24
  # Load the saved scaler
25
- scaler = joblib.load('/content/drive/MyDrive/Colab Notebooks/Homework_04/scaler.pkl')
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",