def converter_localtangentspacealignment_modular(data, k):
    from shogun.Features import RealFeatures
    from shogun.Converter import LocalTangentSpaceAlignment

    features = RealFeatures(data)

    converter = LocalTangentSpaceAlignment()
    converter.set_target_dim(1)
    converter.set_k(k)
    converter.apply(features)

    return features
def converter_localtangentspacealignment_modular(data, k):
    try:
        from shogun.Features import RealFeatures
        from shogun.Converter import LocalTangentSpaceAlignment

        features = RealFeatures(data)

        converter = LocalTangentSpaceAlignment()
        converter.set_target_dim(1)
        converter.set_k(k)
        converter.apply(features)

        return features
    except ImportError:
        print('No Eigen3 available')
def converter_localtangentspacealignment_modular(data,k):
	from shogun.Features import RealFeatures
	from shogun.Converter import LocalTangentSpaceAlignment
	
	features = RealFeatures(data)
		
	converter = LocalTangentSpaceAlignment()
	converter.set_target_dim(1)
	converter.set_k(k)
	converter.apply(features)

	return features
def converter_localtangentspacealignment_modular (data,k):
	try:
		from shogun.Features import RealFeatures
		from shogun.Converter import LocalTangentSpaceAlignment
		
		features = RealFeatures(data)
			
		converter = LocalTangentSpaceAlignment()
		converter.set_target_dim(1)
		converter.set_k(k)
		converter.apply(features)

		return features
	except ImportError:
		print('No Eigen3 available')
Exemplo n.º 5
0
from shogun.Converter import DiffusionMaps
from shogun.Kernel import GaussianKernel
dm = DiffusionMaps()
dm.set_t(2)
dm.set_width(1000.0)
converters.append(
    (dm, "Diffusion Maps with t=%d, sigma=%f" % (dm.get_t(), dm.get_width())))

from shogun.Converter import HessianLocallyLinearEmbedding
hlle = HessianLocallyLinearEmbedding()
hlle.set_k(6)
converters.append((hlle, "Hessian LLE with k=%d" % (hlle.get_k())))

from shogun.Converter import LocalTangentSpaceAlignment
ltsa = LocalTangentSpaceAlignment()
ltsa.set_k(6)
converters.append((ltsa, "LTSA with k=%d" % (ltsa.get_k())))

from shogun.Converter import LaplacianEigenmaps
le = LaplacianEigenmaps()
le.set_k(20)
le.set_tau(100.0)
converters.append(
    (le, "Laplacian Eigenmaps with k=%d, tau=%d" % (le.get_k(), le.get_tau())))

import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

fig = plt.figure()
Exemplo n.º 6
0
from shogun.Converter import DiffusionMaps
from shogun.Kernel import GaussianKernel
dm = DiffusionMaps()
dm.set_t(20)
kernel = GaussianKernel(100,1.0)
dm.set_kernel(kernel)
converters.append((dm,"Diffusion Maps with t=%d, sigma=%f" % (dm.get_t(),kernel.get_width())))

from shogun.Converter import HessianLocallyLinearEmbedding
hlle = HessianLocallyLinearEmbedding()
hlle.set_k(6)
converters.append((hlle,"Hessian LLE with k=%d" % (hlle.get_k())))

from shogun.Converter import LocalTangentSpaceAlignment
ltsa = LocalTangentSpaceAlignment()
ltsa.set_k(6)
converters.append((ltsa,"LTSA with k=%d" % (ltsa.get_k())))

from shogun.Converter import LaplacianEigenmaps
le = LaplacianEigenmaps()
le.set_k(15)
le.set_tau(25.0)
converters.append((le,"Laplacian Eigenmaps with k=%d, tau=%d" % (le.get_k(),le.get_tau())))

import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

fig = plt.figure()