def converter_isomap_modular(data_fname): from modshogun import RealFeatures, CSVFile from modshogun import Isomap features = RealFeatures(CSVFile(data)) converter = Isomap() converter.set_k(20) converter.set_target_dim(1) converter.apply(features) return features
def converter_isomap_modular(data_fname): try: from modshogun import RealFeatures, Isomap, CSVFile features = RealFeatures(CSVFile(data)) converter = Isomap() converter.set_k(20) converter.set_target_dim(1) converter.apply(features) return features except ImportError: print('No Eigen3 available')
def converter_isomap_modular (data_fname): from modshogun import RealFeatures, CSVFile from modshogun import Isomap features = RealFeatures(CSVFile(data)) converter = Isomap() converter.set_k(20) converter.set_target_dim(1) converter.apply(features) return features
def converter_isomap_modular (data_fname): try: from modshogun import RealFeatures, Isomap, CSVFile features = RealFeatures(CSVFile(data)) converter = Isomap() converter.set_k(20) converter.set_target_dim(1) converter.apply(features) return features except ImportError: print('No Eigen3 available')
# Compute a second SPE embedding with local strategy converter.set_strategy(SPE_LOCAL) converter.set_k(12) embedding = converter.embed(features) X = embedding.get_feature_matrix() fig.add_subplot(2, 2, 3) pylab.plot(X[0, y1], X[1, y1], 'ro') pylab.plot(X[0, y2], X[1, y2], 'go') pylab.title('SPE with local strategy') # Compute Isomap embedding (for comparison) converter = Isomap() converter.set_target_dim(2) converter.set_k(6) embedding = converter.embed(features) X = embedding.get_feature_matrix() fig.add_subplot(2, 2, 4) pylab.plot(X[0, y1], X[1, y1], 'ro') pylab.plot(X[0, y2], X[1, y2], 'go') pylab.title('Isomap') pylab.connect('key_press_event', util.quit)