From 7d4a0d295de6f1ae5373201e049231c3a1c6922d Mon Sep 17 00:00:00 2001 From: DIANE <abderrahim.diane@cefe.cnrs.fr> Date: Fri, 5 Apr 2024 13:01:41 +0200 Subject: [PATCH] PCA HOTELLING --- Class_Mod/PCA_.py | 4 ++-- pages/1-samples_selection.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Class_Mod/PCA_.py b/Class_Mod/PCA_.py index 74bd3de..1c4dbc6 100644 --- a/Class_Mod/PCA_.py +++ b/Class_Mod/PCA_.py @@ -1,4 +1,4 @@ -from sklearn.decomposition import PCA +from Packages import * class LinearPCA: def __init__(self, X, Ncomp=10): @@ -82,6 +82,6 @@ class LinearPCA: def residuals(self): return self.res @property - def hotelling(self): + def hotelling_(self): #return pd.DataFrame(self.T2) return self.T2 \ No newline at end of file diff --git a/pages/1-samples_selection.py b/pages/1-samples_selection.py index 432dc37..3b88340 100644 --- a/pages/1-samples_selection.py +++ b/pages/1-samples_selection.py @@ -131,8 +131,8 @@ with container2: st.write('T²-Hotelling vs Q residuals plot') ax2 = st.selectbox("Component", options=model.scores_.columns, index=4) - t = model.scores_ - fig = px.scatter(t, x=axis1, y=t.columns[1]) + t = model.hotelling_ + fig = px.scatter(t, x=t[ax2], y=t[ax2]) st.plotly_chart(fig) with qexp: -- GitLab