当前位置: 首页>>代码示例>>Python>>正文


Python RealFeatures.apply_preproc方法代码示例

本文整理汇总了Python中shogun.Features.RealFeatures.apply_preproc方法的典型用法代码示例。如果您正苦于以下问题:Python RealFeatures.apply_preproc方法的具体用法?Python RealFeatures.apply_preproc怎么用?Python RealFeatures.apply_preproc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在shogun.Features.RealFeatures的用法示例。


在下文中一共展示了RealFeatures.apply_preproc方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: norm_one

# 需要导入模块: from shogun.Features import RealFeatures [as 别名]
# 或者: from shogun.Features.RealFeatures import apply_preproc [as 别名]
def norm_one ():
	print 'NormOne'

	from shogun.Kernel import Chi2Kernel
	from shogun.Features import RealFeatures
	from shogun.PreProc import NormOne

	feats_train=RealFeatures(fm_train_real)
	feats_test=RealFeatures(fm_test_real)

	preproc=NormOne()
	preproc.init(feats_train)
	feats_train.add_preproc(preproc)
	feats_train.apply_preproc()
	feats_test.add_preproc(preproc)
	feats_test.apply_preproc()

	width=1.4
	size_cache=10
	
	kernel=Chi2Kernel(feats_train, feats_train, width, size_cache)

	km_train=kernel.get_kernel_matrix()
	kernel.init(feats_train, feats_test)
	km_test=kernel.get_kernel_matrix()
开发者ID:memimo,项目名称:shogun-liblinear,代码行数:27,代码来源:preproc_normone_modular.py

示例2: prune_var_sub_mean

# 需要导入模块: from shogun.Features import RealFeatures [as 别名]
# 或者: from shogun.Features.RealFeatures import apply_preproc [as 别名]
def prune_var_sub_mean ():
	print 'PruneVarSubMean'

	from shogun.Kernel import Chi2Kernel
	from shogun.Features import RealFeatures
	from shogun.PreProc import PruneVarSubMean

	feats_train=RealFeatures(fm_train_real)
	feats_test=RealFeatures(fm_test_real)

	preproc=PruneVarSubMean()
	preproc.init(feats_train)
	feats_train.add_preproc(preproc)
	feats_train.apply_preproc()
	feats_test.add_preproc(preproc)
	feats_test.apply_preproc()

	width=1.4
	size_cache=10
	
	kernel=Chi2Kernel(feats_train, feats_train, width, size_cache)

	km_train=kernel.get_kernel_matrix()
	kernel.init(feats_train, feats_test)
	km_test=kernel.get_kernel_matrix()
开发者ID:memimo,项目名称:shogun-liblinear,代码行数:27,代码来源:preproc_prunevarsubmean_modular.py

示例3: preproc_prunevarsubmean_modular

# 需要导入模块: from shogun.Features import RealFeatures [as 别名]
# 或者: from shogun.Features.RealFeatures import apply_preproc [as 别名]
def preproc_prunevarsubmean_modular(fm_train_real=traindat, fm_test_real=testdat, width=1.4, size_cache=10):
    from shogun.Kernel import Chi2Kernel
    from shogun.Features import RealFeatures
    from shogun.PreProc import PruneVarSubMean

    feats_train = RealFeatures(fm_train_real)
    feats_test = RealFeatures(fm_test_real)

    preproc = PruneVarSubMean()
    preproc.init(feats_train)
    feats_train.add_preproc(preproc)
    feats_train.apply_preproc()
    feats_test.add_preproc(preproc)
    feats_test.apply_preproc()

    kernel = Chi2Kernel(feats_train, feats_train, width, size_cache)

    km_train = kernel.get_kernel_matrix()
    kernel.init(feats_train, feats_test)
    km_test = kernel.get_kernel_matrix()

    return km_train, km_test, kernel
开发者ID:haipengwang,项目名称:shogun,代码行数:24,代码来源:preproc_prunevarsubmean_modular.py

示例4: preproc_normone_modular

# 需要导入模块: from shogun.Features import RealFeatures [as 别名]
# 或者: from shogun.Features.RealFeatures import apply_preproc [as 别名]
def preproc_normone_modular (fm_train_real=traindat,fm_test_real=testdat,width=1.4,size_cache=10):

	from shogun.Kernel import Chi2Kernel
	from shogun.Features import RealFeatures
	from shogun.Preprocessor import NormOne

	feats_train=RealFeatures(fm_train_real)
	feats_test=RealFeatures(fm_test_real)

	preproc=NormOne()
	preproc.init(feats_train)
	feats_train.add_preproc(preproc)
	feats_train.apply_preproc()
	feats_test.add_preproc(preproc)
	feats_test.apply_preproc()

	kernel=Chi2Kernel(feats_train, feats_train, width, size_cache)

	km_train=kernel.get_kernel_matrix()
	kernel.init(feats_train, feats_test)
	km_test=kernel.get_kernel_matrix()

	return km_train,km_test,kernel
开发者ID:alesis,项目名称:shogun,代码行数:25,代码来源:preproc_normone_modular.py


注:本文中的shogun.Features.RealFeatures.apply_preproc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。