Package weka.core.converters

Examples of weka.core.converters.ArffSaver


        this.learnPostSelectionFileName = learnFileName.substring(0,learnFileName.indexOf(".")).concat("PostBayesAttSel.arff");
        this.holdPostSelectionFileName = holdFileName.substring(0,holdFileName.indexOf(".")).concat("PostBayesAttSel.arff");
    }

    public void saveFile() throws Exception{
            ArffSaver saverLearn = new ArffSaver();
            saverLearn.setInstances(learnFinal);
            saverLearn.setFile(new File(learnPostSelectionFileName));
            saverLearn.writeBatch();

            ArffSaver saverHold = new ArffSaver();
            saverHold.setInstances(holdFinal);
            saverHold.setFile(new File(holdPostSelectionFileName));
            saverHold.writeBatch();
    }
View Full Code Here


            ///////// Creates the two new files
            String small_fileName = fileName.substring(0,1+ fileName.lastIndexOf("\\")).concat("hold_out_").concat(fileName.substring(1+fileName.lastIndexOf("\\"), fileName.length()));
            String big_fileName = fileName.substring(0, 1+fileName.lastIndexOf("\\")).concat("learn_").concat(fileName.substring(1+fileName.lastIndexOf("\\"), fileName.length()));

            ArffSaver saverSmall = new ArffSaver();
            saverSmall.setInstances(smallSet);
            saverSmall.setFile(new File(small_fileName));
            saverSmall.writeBatch();
           
            ArffSaver saverBig = new ArffSaver();
            saverBig.setInstances(bigSet);
            saverBig.setFile(new File(big_fileName));
            saverBig.writeBatch();

            return big_fileName.concat(";").concat(small_fileName);

        } catch (Exception e) {
            System.out.println(e.toString());
View Full Code Here

    CSVLoader loader = new CSVLoader();
    loader.setSource(new File(input));
    Instances data = loader.getDataSet();

    // save ARFF
    ArffSaver saver = new ArffSaver();
    saver.setInstances(data);
    saver.setFile(new File(output));
    //saver.setDestination(new File(output));
    saver.writeBatch();
    return true;
  }
View Full Code Here

//        this.holdPostSelectionFileName = holdFileName.substring(0,holdFileName.indexOf(".")).concat("PostTTestAttSel.arff");
        this.p_val_threshold = p_val_threshold;
    }

    public void saveFile() throws Exception {
        ArffSaver saverLearn = new ArffSaver();
        saverLearn.setInstances(learnFinal);
        saverLearn.setFile(new File(learnPostSelectionFileName));
        saverLearn.writeBatch();

        ArffSaver saverHold = new ArffSaver();
        saverHold.setInstances(holdFinal);
        saverHold.setFile(new File(holdPostSelectionFileName));
        saverHold.writeBatch();
    }
View Full Code Here

TOP

Related Classes of weka.core.converters.ArffSaver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.