本文整理汇总了Python中tools.load.LoadMatrix.load_cubes方法的典型用法代码示例。如果您正苦于以下问题:Python LoadMatrix.load_cubes方法的具体用法?Python LoadMatrix.load_cubes怎么用?Python LoadMatrix.load_cubes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tools.load.LoadMatrix
的用法示例。
在下文中一共展示了LoadMatrix.load_cubes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: distribution_histogram
# 需要导入模块: from tools.load import LoadMatrix [as 别名]
# 或者: from tools.load.LoadMatrix import load_cubes [as 别名]
# In this example the Histogram algorithm object computes a histogram over all
# 16bit unsigned integers in the features.
from tools.load import LoadMatrix
from sg import sg
lm=LoadMatrix()
traindna=lm.load_dna('../data/fm_train_dna.dat')
cubedna=lm.load_cubes('../data/fm_train_cube.dat')
parameter_list=[[traindna,cubedna,3,0,'n'],[traindna,cubedna,4,0,'n']]
def distribution_histogram(fm_train=traindna,fm_cube=cubedna,order=3,
gap=0,reverse='n'):
# sg('new_distribution', 'HISTOGRAM')
sg('add_preproc', 'SORTWORDSTRING')
sg('set_features', 'TRAIN', fm_train, 'DNA')
sg('convert', 'TRAIN', 'STRING', 'CHAR', 'STRING', 'WORD', order, order-1, gap, reverse)
sg('attach_preproc', 'TRAIN')
# sg('train_distribution')
# histo=sg('get_histogram')
# num_examples=11
# num_param=sg('get_histogram_num_model_parameters')
# for i in xrange(num_examples):
# for j in xrange(num_param):
# sg('get_log_derivative %d %d' % (j, i))
# sg('get_log_likelihood')
# return sg('get_log_likelihood_sample')
示例2: LoadMatrix
# 需要导入模块: from tools.load import LoadMatrix [as 别名]
# 或者: from tools.load.LoadMatrix import load_cubes [as 别名]
# In this example the Histogram algorithm object computes a histogram over all
# 16bit unsigned integers in the features.
from tools.load import LoadMatrix
from sg import sg
lm = LoadMatrix()
traindna = lm.load_dna("../data/fm_train_dna.dat")
cubedna = lm.load_cubes("../data/fm_train_cube.dat")
parameter_list = [[traindna, cubedna, 3, 0, "n"], [traindna, cubedna, 4, 0, "n"]]
def distribution_histogram(fm_train=traindna, fm_cube=cubedna, order=3, gap=0, reverse="n"):
# sg('new_distribution', 'HISTOGRAM')
sg("add_preproc", "SORTWORDSTRING")
sg("set_features", "TRAIN", fm_train, "DNA")
sg("convert", "TRAIN", "STRING", "CHAR", "STRING", "WORD", order, order - 1, gap, reverse)
sg("attach_preproc", "TRAIN")
# sg('train_distribution')
# histo=sg('get_histogram')
# num_examples=11
# num_param=sg('get_histogram_num_model_parameters')
# for i in xrange(num_examples):
# for j in xrange(num_param):
# sg('get_log_derivative %d %d' % (j, i))