towardsinnovationlab commited on
Commit
02bfe2a
·
verified ·
1 Parent(s): aa66829

Update pages/CGMM_Trial_3.py

Browse files
Files changed (1) hide show
  1. pages/CGMM_Trial_3.py +7 -7
pages/CGMM_Trial_3.py CHANGED
@@ -220,11 +220,11 @@ def plot_glm_shap_importance(
220
  #-------------------
221
  # DATASETS
222
  #-------------------
223
- df1=pd.read_csv('../dataset/ausprivauto0405.csv')
224
- df2=pd.read_csv('../dataset/swmotorcycle.csv')
225
- df1_synthetic=pd.read_csv('../dataset/synthetic_data_CGMM/gender/d1_cgmm_gender_encod.csv')
226
  df1_synthetic = df1_synthetic.drop(columns=["Unnamed: 0"])
227
- df2_synthetic=pd.read_csv('../dataset/synthetic_data_CGMM/gender/d2_cgmm_gender_encod.csv')
228
  df2_synthetic = df2_synthetic.drop(columns=["Unnamed: 0"])
229
 
230
 
@@ -655,8 +655,8 @@ st.dataframe(styled_df)
655
  st.subheader('PCA comparison')
656
  st.write('Assesses similarity in global variance structure and major latent components.')
657
  # Load the saved models
658
- scaler = load('../dataset/synthetic_data_CGMM/gender/scaler_pca_model_d2_cgmm_gender.pkl')
659
- pca = load('../dataset/synthetic_data_CGMM/gender/pca_model_d2_cgmm_gender.pkl')
660
 
661
  def pca_visual_comparison_3d_with_saved_model(real_df, synthetic_df, scaler, pca, title_suffix=""):
662
  assert set(real_df.columns) == set(synthetic_df.columns), "Datasets must have the same columns."
@@ -691,7 +691,7 @@ pca_visual_comparison_3d_with_saved_model(X_train, df2_synthetic, scaler, pca)
691
  # ### UMAP Analysis
692
  st.subheader('UMAP comparison')
693
  st.write('Examines nonlinear manifold structure and clustering behavior.')
694
- img = mpimg.imread('../dataset/synthetic_data_CGMM/gender/umap_d2_gender.png')
695
  fig=plt.figure(figsize=(10, 8))
696
  plt.imshow(img)
697
  plt.axis('off')
 
220
  #-------------------
221
  # DATASETS
222
  #-------------------
223
+ df1=pd.read_csv('../data/ausprivauto0405.csv')
224
+ df2=pd.read_csv('../data/swmotorcycle.csv')
225
+ df1_synthetic=pd.read_csv('../CGMM/d1_cgmm_gender_encod.csv')
226
  df1_synthetic = df1_synthetic.drop(columns=["Unnamed: 0"])
227
+ df2_synthetic=pd.read_csv('../CGMM/d2_cgmm_gender_encod.csv')
228
  df2_synthetic = df2_synthetic.drop(columns=["Unnamed: 0"])
229
 
230
 
 
655
  st.subheader('PCA comparison')
656
  st.write('Assesses similarity in global variance structure and major latent components.')
657
  # Load the saved models
658
+ scaler = load('../CGMM/scaler_pca_model_d2_cgmm_gender.pkl')
659
+ pca = load('../CGMM/pca_model_d2_cgmm_gender.pkl')
660
 
661
  def pca_visual_comparison_3d_with_saved_model(real_df, synthetic_df, scaler, pca, title_suffix=""):
662
  assert set(real_df.columns) == set(synthetic_df.columns), "Datasets must have the same columns."
 
691
  # ### UMAP Analysis
692
  st.subheader('UMAP comparison')
693
  st.write('Examines nonlinear manifold structure and clustering behavior.')
694
+ img = mpimg.imread('../CGMM/umap_d2_gender.png')
695
  fig=plt.figure(figsize=(10, 8))
696
  plt.imshow(img)
697
  plt.axis('off')