예제 #1
0
from collections import OrderedDict
from pypospack.pyposmat.data.pipeline import PyposmatPipeline

pipeline_configuration = OrderedDict()


# define first segment (plotting)
pipeline_configuration[0] = OrderedDict()
pipeline_configuration[0]['segment_type'] = 'plot'
pipeline_configuration[0]['function_calls'] = OrderedDict()
pipeline_configuration[0]['function_calls'][0]= OrderedDict()
pipeline_configuration[0]['function_calls'][0]['function'] = 'plot_by_cluster'
pipeline_configuration[0]['function_calls'][0]['args'] = OrderedDict()
pipeline_configuration[0]['function_calls'][0]['args']['x_axis'] = 'pca_1'
pipeline_configuration[0]['function_calls'][0]['args']['y_axis'] = 'pca_2'
pipeline_configuration[0]['function_calls'][0]['args']['filename'] = 'param_clusters_in_qoi_pca_space.png'

if __name__ == "__main__":
    pipeline = PyposmatPipeline()
    fn = __file__.replace('.py', '.in')
    pipeline.write_configuration(filename=fn,
                                 d=pipeline_configuration)
예제 #2
0
pypospack_root_dir = pypospack.utils.get_pypospack_root_directory()
configuration_dir = 'examples/Ni__eam__born_exp_fs_postprocessing/Reduced_Isomap_qoi_in_param/configuration/'

config_fn_0 = os.path.join(pypospack_root_dir, configuration_dir,
                           'configure_qoi_clustering.in')
config_fn_1 = os.path.join(pypospack_root_dir, configuration_dir,
                           'configure_param_isomap.in')
config_fn_2 = os.path.join(pypospack_root_dir, configuration_dir,
                           'configure_final_plot.in')

pyposmat_data_fn = os.path.join(
    pypospack_root_dir, 'data/Ni__eam__born_exp_fs__3.5NN/pyposmat.kde.20.out')

if __name__ == "__main__":
    # normalize, pca transform, and cluster qoi space
    pipeline_0 = PyposmatPipeline(configuration_fn=config_fn_0,
                                  data_fn=pyposmat_data_fn)
    pipeline_0.read_configuration(config_fn_0)
    pipeline_0.read_data(pyposmat_data_fn)
    pipeline_0.run()

    # normalize and pca transform param space
    pipeline_1 = PyposmatPipeline(configuration_fn=config_fn_1,
                                  data_fn=pyposmat_data_fn)
    pipeline_1.read_configuration(config_fn_1)
    pipeline_1.read_data(pyposmat_data_fn)
    pipeline_1.run()

    pipeline_1.df['cluster_id'] = pipeline_0.df[
        'cluster_id']  # transfer cluster labels

    # plot qoi clusters in parameter space