JustPaste
HomeCategoriesAboutDonateContactTerms of UsePrivacy Policy
JustPaste

Free online notepad — write and share instantly

Navigate

  • Home
  • Timeline
  • Categories

Info

  • About
  • Donate
  • Contact

Legal

  • Terms of Use
  • Privacy Policy

© 2026 JustPaste.app. All rights reserved.

Made with ♥ by JustPaste

d | JustPaste.app
26 days ago9 views
👨‍💻Programming

d

import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, confusion_matrix


data = pd.read_csv("tiu_data.csv")  



X = data[['study_hours']]  
y = data['passed']         



X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)


model = LogisticRegression()
model.fit(X_train, y_train)


y_pred = model.predict(X_test)


accuracy = accuracy_score(y_test, y_pred)

new_study_hour=[[4.5]]

predicition=model.predict(new_study_hour)


print(f"Accuracy: {accuracy * 100:.2f}%")
print("Predicton for 4.5 study hours:",predicition)
← Back to timeline