def converter_locallylinearembedding_modular (data_fname,k): try: from modshogun import RealFeatures, LocallyLinearEmbedding, CSVFile features = RealFeatures(CSVFile(data_fname)) converter = LocallyLinearEmbedding() converter.set_target_dim(1) converter.set_k(k) converter.apply(features) return features except ImportError: print('No Eigen3 available')
def converter_locallylinearembedding_modular(data_fname, k): try: from modshogun import RealFeatures, LocallyLinearEmbedding, CSVFile features = RealFeatures(CSVFile(data_fname)) converter = LocallyLinearEmbedding() converter.set_target_dim(1) converter.set_k(k) converter.apply(features) return features except ImportError: print('No Eigen3 available')
def preprocessor_dimensionreductionpreprocessor_modular (data, k): from modshogun import RealFeatures from modshogun import DimensionReductionPreprocessor from modshogun import LocallyLinearEmbedding features = RealFeatures(data) converter = LocallyLinearEmbedding() converter.set_k(k) preprocessor = DimensionReductionPreprocessor(converter) preprocessor.init(features) preprocessor.apply_to_feature_matrix(features) return features
def preprocessor_dimensionreductionpreprocessor_modular(data, k): from modshogun import RealFeatures from modshogun import DimensionReductionPreprocessor from modshogun import LocallyLinearEmbedding features = RealFeatures(data) converter = LocallyLinearEmbedding() converter.set_k(k) preprocessor = DimensionReductionPreprocessor(converter) preprocessor.init(features) preprocessor.apply_to_feature_matrix(features) return features
def preprocessor_dimensionreductionpreprocessor_modular(data, k): from modshogun import RealFeatures from modshogun import DimensionReductionPreprocessor try: from modshogun import LocallyLinearEmbedding except ImportError: print("LocallyLinearEmbedding not available") exit(0) features = RealFeatures(data) converter = LocallyLinearEmbedding() converter.set_k(k) preprocessor = DimensionReductionPreprocessor(converter) preprocessor.init(features) preprocessor.apply_to_feature_matrix(features) return features
def preprocessor_dimensionreductionpreprocessor_modular (data, k): from modshogun import RealFeatures from modshogun import DimensionReductionPreprocessor try: from modshogun import LocallyLinearEmbedding except ImportError: print("LocallyLinearEmbedding not available") exit(0) features = RealFeatures(data) converter = LocallyLinearEmbedding() converter.set_k(k) preprocessor = DimensionReductionPreprocessor(converter) preprocessor.init(features) preprocessor.apply_to_feature_matrix(features) return features