# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Load Data

# + tags=[]
import matplotlib.pyplot as plt
import pandas as pd

data = pd.read_csv("interviewTrain.csv")
test = pd.read_csv("interviewTestEven.csv")
# -

print(data.head())

X = data[["height", "weight", "handson", "rich", "experience"]]
Y = data["y"]

# # Load Model

# +
from sklearn.linear_model import LogisticRegression as LR

model_LR = LR()
model_LR.fit(X, Y)
data["y_preLR"] = model_LR.predict(X)
# -

data

# # Metrics report

# +
from sklearn.metrics import classification_report

target_names = ["reject", "accept"]
print(classification_report(data["y"], data["y_preLR"], target_names=target_names))
# -

# # Manual Report

h_threshold = 40
w_threshold = 30
h_threshold = 60
r_threshold = 60
e_threshold = 50
num_of_pass = 2

data["h"] = data["height"] > h_threshold
data["w"] = data["weight"] > w_threshold
data["h"] = data["handson"] > h_threshold
data["r"] = data["rich"] > r_threshold
data["e"] = data["experience"] > e_threshold
data["count"] = data[["h", "w", "h", "r", "e"]].sum(axis=1)
data["y_manual"] = (data["count"] > num_of_pass).astype(int)

data

target_names = ["reject", "accept"]
print(classification_report(data["y_manual"], data["y_preLR"], target_names=target_names))

StarcoderdataJupyterScriptsDedupFiltered