Type FastVector <E> is deprecated
I am trying to get the arrf extended output file from a multidimensional array in Java. And I imported the weka library, however I got an error; The type FastVector<E> is deprecated.
What can be used instead of FastVector and how can I rewrite the code below?
import weka.core.FastVector; //Error: The type FastVector<E> is deprecated. int [][] myArray = new int[45194][12541]; for (int i = 0; i < myArray.length; i++) { for (int j = 0; j < myArray[0].length; j++) { System.out.print(myArray[i][j]+" "); } System.out.println(""); } int numAtts = myArray[0].length; FastVector atts = new FastVector(numAtts); for (int att = 0; att < numAtts; att++) { atts.addElement(new Attribute("Attribute" + att, att)); } int numInstances = myArray.length; Instances dataset = new Instances("Dataset", atts, numInstances); for (int inst = 0; inst < numInstances; inst++) { dataset.add(new Instance(1.0, myArray[inst])); //Error: Cannot instantiate the type Instance } BufferedWriter writer = new BufferedWriter(new FileWriter("test.arff")); writer.write(dataset.toString()); writer.flush(); writer.close(); +6