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


Python DataSet.log_normalize方法代码示例

本文整理汇总了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
开发者ID:amorale4,项目名称:humanizr,代码行数:33,代码来源:xvalidator.py

示例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)
开发者ID:amorale4,项目名称:humanizr,代码行数:33,代码来源:classifier.py


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