Last active
July 18, 2024 18:55
-
-
Save FernandoCutire/9471612717eff6b6634481d2d6841c5a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import weka.core.converters.ConverterUtils.DataSource; | |
... | |
DataSource source = new DataSource("/some/where/data.arff"); | |
Instances data = source.getDataSet(); | |
// setting class attribute if the data format does not provide this information | |
// For example, the XRFF format saves the class attribute information as well | |
if (data.classIndex() == -1) | |
data.setClassIndex(data.numAttributes() - 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment