towardsinnovationlab commited on
Commit
cbf9887
·
verified ·
1 Parent(s): 019f8ee

Update pages/CGMM_Trial_1.py

Browse files
Files changed (1) hide show
  1. pages/CGMM_Trial_1.py +10 -10
pages/CGMM_Trial_1.py CHANGED
@@ -220,11 +220,11 @@ def plot_glm_shap_importance(
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_80_encod.csv')
226
  df1_synthetic = df1_synthetic.drop(columns=["Unnamed: 0"])
227
- df2_synthetic=pd.read_csv('../CGMM/d2_cgmm_80_encod.csv')
228
  df2_synthetic = df2_synthetic.drop(columns=["Unnamed: 0"])
229
 
230
 
@@ -361,8 +361,8 @@ st.dataframe(styled_df)
361
  st.subheader('PCA comparison')
362
  st.write('Assesses similarity in global variance structure and major latent components.')
363
  # Load the saved models
364
- scaler = load('../CGMM/scaler_pca_model_d1_cgmm_80.pkl')
365
- pca = load('../CGMM/pca_model_d1_cgmm_80.pkl')
366
 
367
  def pca_visual_comparison_3d_with_saved_model(real_df, synthetic_df, scaler, pca, title_suffix=""):
368
  assert set(real_df.columns) == set(synthetic_df.columns), "Datasets must have the same columns."
@@ -404,7 +404,7 @@ pca_visual_comparison_3d_with_saved_model(X_train, df1_synthetic, scaler, pca)
404
 
405
  st.subheader('UMAP comparison')
406
  st.write('Examines nonlinear manifold structure and clustering behavior.')
407
- img = mpimg.imread('../CGMM/umap_d1_80.png')
408
  fig=plt.figure(figsize=(10, 8))
409
  plt.imshow(img)
410
  plt.axis('off')
@@ -653,8 +653,8 @@ st.dataframe(styled_df)
653
  st.subheader('PCA comparison')
654
  st.write('Assesses similarity in global variance structure and major latent components.')
655
  # Load the saved models
656
- scaler = load('../CGMM/scaler_pca_model_d2_cgmm_80.pkl')
657
- pca = load('../CGMM/pca_model_d2_cgmm_80.pkl')
658
 
659
  def pca_visual_comparison_3d_with_saved_model(real_df, synthetic_df, scaler, pca, title_suffix=""):
660
  assert set(real_df.columns) == set(synthetic_df.columns), "Datasets must have the same columns."
@@ -689,7 +689,7 @@ pca_visual_comparison_3d_with_saved_model(X_train, df2_synthetic, scaler, pca)
689
  # ### UMAP Analysis
690
  st.subheader('UMAP comparison')
691
  st.write('Examines nonlinear manifold structure and clustering behavior.')
692
- img = mpimg.imread('../CGMM/umap_d2_80.png')
693
  fig=plt.figure(figsize=(10, 8))
694
  plt.imshow(img)
695
  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_80_encod.csv')
226
  df1_synthetic = df1_synthetic.drop(columns=["Unnamed: 0"])
227
+ df2_synthetic=pd.read_csv('./CGMM/d2_cgmm_80_encod.csv')
228
  df2_synthetic = df2_synthetic.drop(columns=["Unnamed: 0"])
229
 
230
 
 
361
  st.subheader('PCA comparison')
362
  st.write('Assesses similarity in global variance structure and major latent components.')
363
  # Load the saved models
364
+ scaler = load('./CGMM/scaler_pca_model_d1_cgmm_80.pkl')
365
+ pca = load('./CGMM/pca_model_d1_cgmm_80.pkl')
366
 
367
  def pca_visual_comparison_3d_with_saved_model(real_df, synthetic_df, scaler, pca, title_suffix=""):
368
  assert set(real_df.columns) == set(synthetic_df.columns), "Datasets must have the same columns."
 
404
 
405
  st.subheader('UMAP comparison')
406
  st.write('Examines nonlinear manifold structure and clustering behavior.')
407
+ img = mpimg.imread('./CGMM/umap_d1_80.png')
408
  fig=plt.figure(figsize=(10, 8))
409
  plt.imshow(img)
410
  plt.axis('off')
 
653
  st.subheader('PCA comparison')
654
  st.write('Assesses similarity in global variance structure and major latent components.')
655
  # Load the saved models
656
+ scaler = load('./CGMM/scaler_pca_model_d2_cgmm_80.pkl')
657
+ pca = load('./CGMM/pca_model_d2_cgmm_80.pkl')
658
 
659
  def pca_visual_comparison_3d_with_saved_model(real_df, synthetic_df, scaler, pca, title_suffix=""):
660
  assert set(real_df.columns) == set(synthetic_df.columns), "Datasets must have the same columns."
 
689
  # ### UMAP Analysis
690
  st.subheader('UMAP comparison')
691
  st.write('Examines nonlinear manifold structure and clustering behavior.')
692
+ img = mpimg.imread('./CGMM/umap_d2_80.png')
693
  fig=plt.figure(figsize=(10, 8))
694
  plt.imshow(img)
695
  plt.axis('off')