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


Python DataSet.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from dataset import DataSet [as 别名]
# 或者: from dataset.DataSet import __init__ [as 别名]
	def __init__(self, data, interval_type=ClassIntervalType.ROOT):
		
		f = []
		for d in data:
			f.append(float(d))      
		data = f
		
		DataSet.__init__(self, data)
		self.interval_type = interval_type
		
		if self.interval_type != ClassIntervalType.THREESIGMA:    
			self.class_interval = self.calc_class_interval(interval_type, self.min, self.max, self.n);
			self.construct_bins(self.min, self.max, self.class_interval, False);
		else:
			sigma_span = 6
			min = self.mean - self.stdev * (sigma_span / 2)
			max = self.mean + self.stdev * (sigma_span / 2)
			self.class_interval = self.calc_class_interval(ClassIntervalType.THREESIGMA, min, max, sigma_span)
			self.construct_bins(min, max, self.class_interval, True)
			
		self.fill_bins()
		self.sort_bins()

		total = 0
		for bin in self.bins:
			total = total + bin.count()
		self.bin_contents_count = total
开发者ID:davidbarkhuizen,项目名称:dart,代码行数:29,代码来源:histogram.py

示例2: __init__

# 需要导入模块: from dataset import DataSet [as 别名]
# 或者: from dataset.DataSet import __init__ [as 别名]
    def __init__(self, inp, target):
        """Initialize an empty supervised dataset.

        Pass `inp` and `target` to specify the dimensions of the input and
        target vectors."""
        DataSet.__init__(self)
        if isscalar(inp):
            # add input and target fields and link them
            self.addField('input', inp)
            self.addField('target', target)
        else:
            self.setField('input', inp)
            self.setField('target', target)

        self.linkFields(['input', 'target'])

        # reset the index marker
        self.index = 0

        # the input and target dimensions
        self.indim = self.getDimension('input')
        self.outdim = self.getDimension('target')
开发者ID:firestrand,项目名称:pybrain-gpu,代码行数:24,代码来源:supervised.py

示例3: __init__

# 需要导入模块: from dataset import DataSet [as 别名]
# 或者: from dataset.DataSet import __init__ [as 别名]
 def __init__(self, statedim, actiondim):
     """ initialize the reinforcement dataset, add the 3 fields state, action and 
         reward, and create an index marker. This class is basically a wrapper function
         that renames the fields of SupervisedDataSet into the more common reinforcement
         learning names. Instead of 'episodes' though, we deal with 'sequences' here. """
     DataSet.__init__(self)
     # add 3 fields: input, target, importance
     self.addField('state', statedim)
     self.addField('action', actiondim)
     self.addField('reward', 1)
     # link these 3 fields
     self.linkFields(['state', 'action', 'reward'])
     # reset the index marker
     self.index = 0
     # add field that stores the beginning of a new episode
     self.addField('sequence_index', 1)
     self.append('sequence_index', 0)
     self.currentSeq = 0
     self.statedim = statedim
     self.actiondim = actiondim
 
     # the input and target dimensions (for compatibility)
     self.indim = self.statedim
     self.outdim = self.actiondim
开发者ID:ZachPhillipsGary,项目名称:CS200-NLP-ANNsProject,代码行数:26,代码来源:reinforcement.py


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