def preprocessor_hessianlocallylinearembedding_modular(data, k): from shogun.Features import RealFeatures from shogun.Preprocessor import HessianLocallyLinearEmbedding features = RealFeatures(data) preprocessor = HessianLocallyLinearEmbedding() preprocessor.set_target_dim(1) preprocessor.set_k(k) preprocessor.apply_to_feature_matrix(features) return features
def preprocessor_hessianlocallylinearembedding_modular(data,k): from shogun.Features import RealFeatures from shogun.Preprocessor import HessianLocallyLinearEmbedding features = RealFeatures(data) preprocessor = HessianLocallyLinearEmbedding() preprocessor.set_target_dim(1) preprocessor.set_k(k) preprocessor.apply_to_feature_matrix(features) return features
lmds.set_landmark_number(20) preprocs.append((lmds,"LMDS with %d landmarks" % lmds.get_landmark_number())) from shogun.Preprocessor import ClassicIsomap cisomap = ClassicIsomap() cisomap.set_k(9) preprocs.append((cisomap,"K-Isomap with k=%d" % cisomap.get_k())) from shogun.Preprocessor import LandmarkIsomap lisomap = LandmarkIsomap() lisomap.set_landmark_number(500) lisomap.set_k(9) preprocs.append((lisomap,"K-LIsomap with k=%d, %d landmarks" % (lisomap.get_k(),lisomap.get_landmark_number()))) from shogun.Preprocessor import HessianLocallyLinearEmbedding hlle = HessianLocallyLinearEmbedding() hlle.set_k(6) preprocs.append((hlle,"Hessian LLE with k=%d" % (hlle.get_k()))) from shogun.Preprocessor import LocalTangentSpaceAlignment ltsa = LocalTangentSpaceAlignment() ltsa.set_k(6) preprocs.append((ltsa,"LTSA with k=%d" % (ltsa.get_k()))) from shogun.Preprocessor import LaplacianEigenmaps le = LaplacianEigenmaps() le.set_k(15) le.set_tau(25.0) preprocs.append((le,"Laplacian Eigenmaps with k=%d, tau=%d" % (le.get_k(),le.get_tau()))) import matplotlib.pyplot as plt
preprocs.append((lmds, "LMDS with %d landmarks" % lmds.get_landmark_number())) from shogun.Preprocessor import ClassicIsomap cisomap = ClassicIsomap() cisomap.set_k(9) preprocs.append((cisomap, "K-Isomap with k=%d" % cisomap.get_k())) from shogun.Preprocessor import LandmarkIsomap lisomap = LandmarkIsomap() lisomap.set_landmark_number(500) lisomap.set_k(9) preprocs.append((lisomap, "K-LIsomap with k=%d, %d landmarks" % (lisomap.get_k(), lisomap.get_landmark_number()))) from shogun.Preprocessor import HessianLocallyLinearEmbedding hlle = HessianLocallyLinearEmbedding() hlle.set_k(6) preprocs.append((hlle, "Hessian LLE with k=%d" % (hlle.get_k()))) from shogun.Preprocessor import LocalTangentSpaceAlignment ltsa = LocalTangentSpaceAlignment() ltsa.set_k(6) preprocs.append((ltsa, "LTSA with k=%d" % (ltsa.get_k()))) from shogun.Preprocessor import LaplacianEigenmaps le = LaplacianEigenmaps() le.set_k(15) le.set_tau(25.0) preprocs.append( (le, "Laplacian Eigenmaps with k=%d, tau=%d" % (le.get_k(), le.get_tau())))