Fondements de la probabilité en Python
Alexander A. Ramírez M.
CEO @ Synergy Vision


$$ y = \color{red}{pente}*x + \color{blue}{ordonnée\ à\ l'origine} $$

$$ y = slope*x + intercept + \color{red}{random\_number} $$


Quels critères permettraient de choisir le meilleur modèle ?




# Import LinearRegression
from sklearn.linear_model import LinearRegression
# sklearn linear model
model = LinearRegression()
model.fit(hours_of_study, scores)
# Get parameters
slope = model.coef_[0]
intercept = model.intercept_
# Print parameters
print(slope, intercept)
(1.496703900384545, 52.44845266434719)
# Score prediction
score = model.predict(np.array([[15]]))
print(score)
[74.89901117]
$$ $$
import matplotlib.pyplot as plt
plt.scatter(hours_of_study, scores)
plt.plot(hours_of_study_values, model.predict(hours_of_study_values))
plt.show()

Fondements de la probabilité en Python