def get_partition_filename(config, gz=True): fields = [ 'data_file', 'data_index', 'segment_size', 'segment_stride', 'window_size', 'window_stride' ] return get_filename(config, fields, "Partition", gz)
def get_distances_filename(config, gz=True): fields = ['data_file', 'data_index', 'segment_size', 'segment_stride', 'window_size', 'window_stride', 'max_simplices', 'persistence_epsilon'] if config.post_process != None : fields.extend(['post_process', 'post_process_arg']) return get_filename(config, fields, "Distances", gz)
def get_learning_filename(config, gz=True): fields = ['data_file', 'data_index', 'segment_size', 'segment_stride', 'window_size', 'window_stride', 'max_simplices', 'persistence_epsilon', 'kernel_scale', 'kernel_gamma', 'learning_C'] if config.post_process != None : fields.extend(['post_process', 'post_process_arg']) return get_filename(config, fields, "Learning", gz)
def get_learning_filename(config, gz=True) : fields = ['data_file', 'data_index', 'segment_size', 'segment_stride', 'window_size', 'window_stride', 'learning_C'] if config.post_process != None : fields.extend(['post_process', 'post_process_arg']) if config.status == 'RBFKernel' : fields.append('kernel_gamma') elif config.status == 'PersistenceKernel' : fields.append('max_simplices') fields.append('kernel_scale') return get_filename(config, fields, (config.status + 'Learning') if config.status != None else 'KernelLearning', gz)
def get_learning_filename(config, gz=True): fields = [ 'data_file', 'data_index', 'segment_size', 'segment_stride', 'window_size', 'window_stride', 'learning_C' ] if config.post_process != None: fields.extend(['post_process', 'post_process_arg']) if config.status == 'RBFKernel': fields.append('kernel_gamma') elif config.status == 'PersistenceKernel': fields.append('max_simplices') fields.append('kernel_scale') return get_filename( config, fields, (config.status + 'Learning') if config.status != None else 'KernelLearning', gz)
if status != None : in_obj.config.status = status if "Segments" in file_class or \ "Post" in file_class : out_file = module_class.get_segment_filename(in_obj.config, gz=False) elif "Features" in file_class : out_file = module_class.get_features_filename(in_obj.config, gz=False) elif "PersistenceDiagrams" in file_class : out_file = module_class.get_persistence_diagrams_filename(in_obj.config, gz=False) elif "Partition" in file_class : out_file = module_class.get_partition_filename(in_obj.config, gz=False) elif "Learning" in file_class : out_file = module_class.get_learning_filename(in_obj.config, gz=False) elif "Distances" in file_class or \ "ScaleSpaceSimilarity" in file_class : out_file = module_class.get_distances_filename(in_obj.config, gz=False) elif "AverageKernel" in file_class : out_file = get_filename(in_obj.config, ['max_simplices', 'persistence_epsilon', 'segment_filename', 'segment_stride', 'segment_size', 'window_size', 'window_stride', 'kernel_scale', 'kernel_gamma', 'invariant_epsilon', 'data_file', 'data_index', 'label_index', 'persistence_degree', 'data_type', 'post_process', 'post_process_arg'], "AverageKernel") elif "Kernel" in file_class : out_file = module_class.get_kernel_filename(in_obj.config, gz=False) elif "CrossValidation" in file_class : out_file = module_class.get_cross_validation_filename(in_obj.config, gz=False) print "Writing %s" % (out_file,) save_data(out_file, in_obj.toJSONDict())
if "Segments" in file_class or \ "Post" in file_class : out_file = module_class.get_segment_filename(in_obj.config, gz=False) elif "Features" in file_class: out_file = module_class.get_features_filename(in_obj.config, gz=False) elif "PersistenceDiagrams" in file_class: out_file = module_class.get_persistence_diagrams_filename( in_obj.config, gz=False) elif "Partition" in file_class: out_file = module_class.get_partition_filename(in_obj.config, gz=False) elif "Learning" in file_class: out_file = module_class.get_learning_filename(in_obj.config, gz=False) elif "Distances" in file_class or \ "ScaleSpaceSimilarity" in file_class : out_file = module_class.get_distances_filename(in_obj.config, gz=False) elif "AverageKernel" in file_class: out_file = get_filename(in_obj.config, [ 'max_simplices', 'persistence_epsilon', 'segment_filename', 'segment_stride', 'segment_size', 'window_size', 'window_stride', 'kernel_scale', 'kernel_gamma', 'invariant_epsilon', 'data_file', 'data_index', 'label_index', 'persistence_degree', 'data_type', 'post_process', 'post_process_arg' ], "AverageKernel") elif "Kernel" in file_class: out_file = module_class.get_kernel_filename(in_obj.config, gz=False) elif "CrossValidation" in file_class: out_file = module_class.get_cross_validation_filename(in_obj.config, gz=False) print "Writing %s" % (out_file, ) save_data(out_file, in_obj.toJSONDict())
def get_cross_validation_filename(config, gz=False): fields = Configuration.fields return get_filename(config, fields, 'CrossValidation', gz)
def get_partition_filename(config, gz=True): fields = ['data_file', 'data_index', 'segment_size', 'segment_stride', 'window_size', 'window_stride'] return get_filename(config, fields, "Partition", gz)