public ClassificationDataSet asClassificationDataSet ( int index ) { if ( index < 0 ) throw new IllegalArgumentException ( "Index must be a non-negative value" ) ; else if ( getNumCategoricalVars ( ) == 0 ) throw new IllegalArgumentException ( "Dataset has no categorical variables, can not create classification dataset" ) ; else if ( index >= getNumCategoricalVars ( ) ) throw new IllegalArgumentException ( "Index " + index + " is larger than number of categorical features " + getNumCategoricalVars ( ) ) ; return new ClassificationDataSet ( this , index ) ; }
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 .