forked from Roodaki/Diabetes-Predictor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (22 loc) · 891 Bytes
/
main.py
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
32
from model import LogisticRegression
from IO import *
# Read the training and testing data
X_train, X_test, y_train, y_test = read_csv_dataset('samples.csv', 'Outcome')
logistic_regression = LogisticRegression()
# Train the logistic regression model
logistic_regression.train(X_train, y_train)
# Make predictions on the testing data
accuracy, predictions = logistic_regression.predict(X_test, y_test)
# Print accuracy and predictions
print("Accuracy:", accuracy)
print("Predictions:", predictions)
app = QApplication(sys.argv)
window = DiabetesPredictionWindow()
window_width = window.frameGeometry().width()
window_height = window.frameGeometry().height()
screen = app.primaryScreen().availableGeometry()
x = (screen.width() - window_width) // 2
y = (screen.height() - window_height) // 2
window.setGeometry(x, y, window_width, window_height)
window.show()
sys.exit(app.exec_())