Converts this dataset into one meant for classification problems. The given categorical feature index is removed from the data and made the target variable for the classification problem. @param index the classification variable index, should be in the range [0, #getNumCategoricalVars() ) @
(int index)
| 89 | * the target of a classification dataset |
| 90 | */ |
| 91 | public ClassificationDataSet asClassificationDataSet(int index) |
| 92 | { |
| 93 | if(index < 0) |
| 94 | throw new IllegalArgumentException("Index must be a non-negative value"); |
| 95 | else if(getNumCategoricalVars() == 0) |
| 96 | throw new IllegalArgumentException("Dataset has no categorical variables, can not create classification dataset"); |
| 97 | else if(index >= getNumCategoricalVars()) |
| 98 | throw new IllegalArgumentException("Index " + index + " is larger than number of categorical features " + getNumCategoricalVars()); |
| 99 | return new ClassificationDataSet(this, index); |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Converts this dataset into one meant for regression problems. The |