def main(argv): del argv # Unused. df = io_utils.read_dataframe_from_hdf5(FLAGS.original_df) ## Generate the percentile-normalized embeddings emb_df_normalized = normalize_ljosa(df) ## Generate the post-factor analysis embeddings np.random.seed(0) emb_df_fa = transform.factor_analysis(emb_df_normalized, 0.15, 50) io_utils.write_dataframe_to_hdf5(emb_df_fa, FLAGS.post_fa_path) io_utils.write_dataframe_to_hdf5(emb_df_normalized, FLAGS.post_normliazation_path)
def apply_post_processing(df, percent_norm, factor_analys): """Apply percentile normalization and/or factor analysis. If using WDN, this must be done after the transformation. Thus, this function is applied in wasserstein_transform. Args: df (pandas dataframe): input dataframe percent_norm (bool): whether to apply percentile normalization factor_analys (bool): whether to apply factor analysis Returns: df (pandas dataframe): post-processed dataframe. """ if percent_norm: df = ljosa_preprocessing.normalize_ljosa(df) if factor_analys: np.random.seed(0) df = transform.factor_analysis(df, 0.15, 50) return df
def testFactorAnalysisRun(self): transform.factor_analysis(self.data, 0.1, -1)