Package weka.filters.unsupervised.attribute

Examples of weka.filters.unsupervised.attribute.SwapValues


    }

    if (m_classValueIndex != 0) { // nothing to do if == 0
      // swap selected index with index 0
      try {
  SwapValues sv = new SwapValues();
  sv.setAttributeIndex(""+(dataSet.classIndex()+1));
  sv.setFirstValueIndex("first");
  sv.setSecondValueIndex(""+(m_classValueIndex+1));
  sv.setInputFormat(dataSet);
  Instances newDataSet = Filter.useFilter(dataSet, sv);
  newDataSet.setRelationName(dataSet.relationName());
  return newDataSet;
      } catch (Exception ex) {
  if (m_logger != null) {
View Full Code Here


    }

    if (classValueIndex != 0) { // nothing to do if == 0
      // swap selected index with index 0
      try {
        SwapValues sv = new SwapValues();
        sv.setAttributeIndex(""+(dataSet.classIndex()+1));
        sv.setFirstValueIndex("first");
        sv.setSecondValueIndex(""+(classValueIndex+1));
        sv.setInputFormat(dataSet);
        Instances newDataSet = Filter.useFilter(dataSet, sv);
        newDataSet.setRelationName(dataSet.relationName());
        return newDataSet;
      } catch (Exception ex) {
        if (m_logger != null) {
View Full Code Here

    }

    if (m_classValueIndex != 0) { // nothing to do if == 0
      // swap selected index with index 0
      try {
  SwapValues sv = new SwapValues();
  sv.setAttributeIndex(""+(dataSet.classIndex()+1));
  sv.setFirstValueIndex("first");
  sv.setSecondValueIndex(""+(m_classValueIndex+1));
  sv.setInputFormat(dataSet);
  Instances newDataSet = Filter.useFilter(dataSet, sv);
  newDataSet.setRelationName(dataSet.relationName());
  return newDataSet;
      } catch (Exception ex) {
  if (m_logger != null) {
View Full Code Here

    }

    if (classValueIndex != 0) { // nothing to do if == 0
      // swap selected index with index 0
      try {
  SwapValues sv = new SwapValues();
  sv.setAttributeIndex(""+(dataSet.classIndex()+1));
  sv.setFirstValueIndex("first");
  sv.setSecondValueIndex(""+(classValueIndex+1));
  sv.setInputFormat(dataSet);
  Instances newDataSet = Filter.useFilter(dataSet, sv);
  newDataSet.setRelationName(dataSet.relationName());
  return newDataSet;
      } catch (Exception ex) {
  if (m_logger != null) {
View Full Code Here

   
    return data;
  }
 
  protected Instances swapValues(int attIndex, Instances data) throws Exception {
    SwapValues s = new SwapValues();
    s.setAttributeIndex("" + attIndex);
    s.setFirstValueIndex("first");
    s.setSecondValueIndex("last");
    s.setInputFormat(data);
    data = Filter.useFilter(data, s);
   
    return data;
  }
View Full Code Here

TOP

Related Classes of weka.filters.unsupervised.attribute.SwapValues

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.