|
|
|
import pickle |
|
import joblib |
|
import numpy as np |
|
from sklearn.preprocessing import StandardScaler |
|
|
|
|
|
|
|
|
|
def diabetes_prediction(data): |
|
|
|
with open("src/Diabetes-Detection/scaler.pkl", "rb") as f: |
|
scaler = pickle.load(f) |
|
|
|
data = np.array(data).reshape(1,-1) |
|
scaled_data = scaler.transform(data) |
|
|
|
with open("src/Diabetes-Detection/model.pkl", "rb") as f: |
|
model = pickle.load(f) |
|
|
|
pred = model.predict(scaled_data) |
|
|
|
|
|
return pred |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def breast_cancer_prediction(data): |
|
|
|
with open("src/Breast-Cancer/scaler.pkl", "rb") as f: |
|
scaler = pickle.load(f) |
|
|
|
data = np.array(data).reshape(1,-1) |
|
scaled_data = scaler.transform(data) |
|
|
|
with open("src/Breast-Cancer/model.pkl", "rb") as f: |
|
model = pickle.load(f) |
|
|
|
pred = model.predict(scaled_data) |
|
|
|
|
|
return pred |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def heart_disease_prediction(data): |
|
|
|
with open("src/Heart-Disease/scaler.pkl", "rb") as f: |
|
scaler = pickle.load(f) |
|
|
|
data = np.array(data).reshape(1,-1) |
|
scaled_data = scaler.transform(data) |
|
|
|
with open("src/Heart-Disease/heart_model.pkl", "rb") as f: |
|
model = pickle.load(f) |
|
|
|
pred = model.predict(scaled_data) |
|
|
|
return pred |
|
|
|
|
|
|
|
|
|
|
|
def malaria_detection(): |
|
pass |