Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update sequential.py - #207

Open
gissemari wants to merge 1 commit into
pybrain:masterfrom
gissemari:patch-1
Open

Update sequential.py#207
gissemari wants to merge 1 commit into
pybrain:masterfrom
gissemari:patch-1

Conversation

@gissemari

Copy link
Copy Markdown

This modfiication in splitWithProportion would allow us to call it before or after a _convertToOneOfMany, obtain the correct type if it is ClassificationDataSet and maintain the speed benefit of not adding sample by sample:

  1. Case after converting: it would raise the error "IndexError: Classes and 1-of-k representation out of sync!" due to passing the data arrays in the datasetClass() instead of just the dimensions (that sets outdimension in more than one) but having incosistant the 'class' tag of the new arrays (leftDs and rightDs).
  2. Case before converting: it is not guarantee that testDataSet and trainDataSet contain the same number of classes that the original dataset had. So, when trying to convert to many classes each dataset, there would be an out-of-index error newtarg's target would have the dimension according on how many different classes the testDataSet or traingDataSet had.

This modfiication in splitWithProportion would allow to call it  before or after a _convertToOneOfMany for datasets of type ClassificationDataSet:
Case after converting: it would raise the error "IndexError: Classes and 1-of-k representation out of sync!" due to passing the data arrays in the datasetClass() instead of just the dimensions (that sets outdimension in more than one) but having incosistant the 'class' tag of the new arrays (leftDs and rightDs).
Case before converting: it is not guarantee that testDataSet and trainDataSet contain the same number of classes that the original dataset had. So, when trying to convert to many classes each dataset, there would be an out-of-index error newtarg's target would have the dimension according on how many different classes the testDataSet or traingDataSet had.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant