本文整理汇总了Python中dataset.DataSet.log_normalize方法的典型用法代码示例。如果您正苦于以下问题:Python DataSet.log_normalize方法的具体用法?Python DataSet.log_normalize怎么用?Python DataSet.log_normalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dataset.DataSet
的用法示例。
在下文中一共展示了DataSet.log_normalize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: int
# 需要导入模块: from dataset import DataSet [as 别名]
# 或者: from dataset.DataSet import log_normalize [as 别名]
num_folds = int(args.num_folds)
print(ds_file)
if(args.debug):
logging.basicConfig(level=logging.DEBUG,filename='xvalidator_log_'+os.path.basename(ds_file)+'_'+str(os.getpid())+'.log')
else:
logging.basicConfig(level=logging.INFO)
# load the data set
data_set = DataSet(ds_file)
#data_set.filter_features([0])
#data_set.normalize_linear(0,1)
#data_set.smart_normalize()
# Normalization, log normalize
data_set.log_normalize()
#data_set.normalize_linear(-1,1)
#data_set.normalize_to_unit_vector()
# create the trainer
tfact = TrainerFactory()
trainer = tfact.make_trainer(settings_file)
# run the cross validation
xv = XValidator(trainer,data_set,num_folds)
xv.run_xvalid()
# print out some statistics
num_preds = float(len(xv.predictions()))
avg_sense = sum([pred.sensitivity() for pred in xv.predictions()]) / num_preds
avg_spec = sum([pred.sensitivity() for pred in xv.predictions()]) / num_preds
avg_accuracy=sum([pred.accuracy() for pred in xv.predictions()]) / num_preds
示例2: DataSet
# 需要导入模块: from dataset import DataSet [as 别名]
# 或者: from dataset.DataSet import log_normalize [as 别名]
# Therefore, the model file needs to exist.
# if not, raise an exception.
if(model_file==None):
raise InvalidModelFileToReadException
# check if the model_file actually exists
if(os.path.exists(model_file)==False):
raise InvalidModelFileToReadException
# load the data set
if(training_file_provided):
training_data_set = DataSet(training_ds_file)
#training_data_set.normalize_to_unit_vector()
observed_min_values=training_data_set.log_normalize()
else:
# No training file provided.
# But the model file contains info about normalization min_values
observed_min_values=read_model_file_normalization_min_values(model_file)
test_data_set=DataSet(test_ds_file)
#test_data_set.normalize_to_unit_vector()
test_data_set.log_normalize_using_training_set_values(observed_min_values)
'''
test_data_set=DataSet(test_ds_file)