From a4f07dc9a5b6fbd5957aaba0567b3e5bb38e7f8b Mon Sep 17 00:00:00 2001 From: Samuel MEYNARD Date: Sun, 7 Jun 2020 14:05:50 +0200 Subject: [PATCH] =?UTF-8?q?Affichage=20r=C3=A9sultat=20stacko=20>=20MTU=20?= =?UTF-8?q?cas=20regression=20lin=C3=A9aire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module3/exo3/exercice_python_fr.org | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/module3/exo3/exercice_python_fr.org b/module3/exo3/exercice_python_fr.org index 3379b50..2d4fe8d 100644 --- a/module3/exo3/exercice_python_fr.org +++ b/module3/exo3/exercice_python_fr.org @@ -574,7 +574,7 @@ fig.savefig('stacko_g1500_reglineaireT-f(S).png') #+RESULTS: : None -#+BEGIN_SRC python :session :results output :exports both +#+BEGIN_SRC python :session :results replace :exports both from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error S_tt = [[value] for value in S_g1500] @@ -584,14 +584,8 @@ my_t = np.array(T_g1500) lmodel = LinearRegression() lmodel.fit(my_s, my_t) f"Les coeff sont L = {lmodel.intercept_} et C = { 1 / lmodel.coef_}" - #+END_SRC #+RESULTS: -: Traceback (most recent call last): -: File "", line 1, in -: File "/var/folders/gg/nbr_dzs57lq4z877d6xndp5w0000gn/T/babel-ppt7An/python-CQJzRz", line 9 -: return (f"Les coeff sont L = {lmodel.intercept_} et C = { 1 / lmodel.coef_}") -: ^ -: SyntaxError: 'return' outside function +: Les coeff sont L = 120.04921279789215 et C = [-555.38712112] Etonnant pour C négatif alors que l'analyse graphique montre une pente positivew -- 2.18.1