python中dataset是什么意思_“ClassificationDataSet”中的“target”有什么用?

我试图找出Classificationdataset的参数target可以用来做什么,但我还是不清楚。在

我所做的一切>>> from pybrain.datasets import ClassificationDataSet

>>> help(ClassificationDataSet)

Help on class ClassificationDataSet in module pybrain.datasets.classification:

class ClassificationDataSet(pybrain.datasets.supervised.SupervisedDataSet)

| Specialized data set for classification data. Classes are to be numbered from 0 to nb_classes-1.

|

| Method resolution order:

| ClassificationDataSet

| pybrain.datasets.supervised.SupervisedDataSet

| pybrain.datasets.dataset.DataSet

| pybrain.utilities.Serializable

| __builtin__.object

|

| Methods defined here:

|

| __add__(self, other)

| Adds the patterns of two datasets, if dimensions and type match.

|

| __init__(self, inp, target=1, nb_classes=0, class_labels=None)

| Initialize an empty dataset.

|

| `inp` is used to specify the dimensionality of the input. While the

| number of targets is given by implicitly by the training samples, it can

| also be set explicity by `nb_classes`. To give the classes names, supply

| an iterable of strings as `class_labels`.

|

| __reduce__(self)class SupervisedDataSet(DataSet):

"""SupervisedDataSets have two fields, one for input and one for the target.

"""

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')

它似乎与输出维度有关。但是target不应该是{}?在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值