AttributeError using pyBrain _splitWithPortion - object type changed?

前端 未结 6 892
遥遥无期
遥遥无期 2021-02-07 06:36

I\'m testing out pybrain following the basic classification tutorial here and a different take on it with some more realistic data here. However I receive this error when applyi

6条回答
  •  悲&欢浪女
    2021-02-07 07:25

    So, I did the following without getting an error:

    from pybrain.datasets import ClassificationDataSet
    ds = ClassificationDataSet(4096, 1 , nb_classes=40)
    for k in range(400):
        ds.addSample(k,k%4)
    print(type(ds))
    # 
    tstdata, trndata = ds.splitWithProportion(0.25)
    print(type(trndata))
    # 
    print(type(tstdata))
    # 
    trndata._convertToOneOfMany()
    tstdata._convertToOneOfMany()
    

    The only difference I see between my code and yours is your use of X. Perhaps you can confirm that my code works on your machine, and if so then we could look into what about X if confusing things?

提交回复
热议问题