Examples of classIndex()


Examples of weka.core.Instances.classIndex()

   *
   * @return the dataset
   */
  public static Instances readInstances(String location) throws Exception {
    Instances data = new weka.core.converters.ConverterUtils.DataSource(location).getDataSet();
    if (data.classIndex() == -1)
      data.setClassIndex(data.numAttributes() - 1);
    return data;
  }
}
View Full Code Here

Examples of weka.core.Instances.classIndex()

    Map<ClusterClass, List<StoredDomainCluster>> retval =
        new HashMap<ClusterClass, List<StoredDomainCluster>>();
    try{
      DataSource source = new DataSource(new ByteArrayInputStream(prepfeatures.getBytes()));
      Instances data = source.getDataSet();
      if (data.classIndex() == -1){
        data.setClassIndex(data.numAttributes() - 1);
      }
      String[] options = weka.core.Utils.splitOptions("-p 0");
      J48 cls = (J48)weka.core.SerializationHelper.read(modelfile);
      cls.setOptions(options);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.