# Ceteris Lab downloadable Python script
# Course: Fundamentals of Python for Financial Econometrics

def rule_based_income(income):
    return "high" if income >= 70_000 else "not high"

for value in [55_000, 72_000]:
    print(value, rule_based_income(value))

import numpy as np
from sklearn.linear_model import LogisticRegression

X = np.array([[20], [30], [45], [60], [75], [90]])
y = np.array([0, 0, 0, 1, 1, 1])
model = LogisticRegression().fit(X, y)
print(np.round(model.predict_proba([[50], [80]]), 3))
