weka.filters.unsupervised.attribute.NominalToBinary Java Examples

The following examples show how to use weka.filters.unsupervised.attribute.NominalToBinary. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LibLINEAR.java    From tsml with GNU General Public License v3.0 6 votes vote down vote up
/**
 * turns on nominal to binary filtering
 * if there are not only numeric attributes
 */
private Instances nominalToBinary( Instances insts ) throws Exception {
  boolean onlyNumeric = true;
  for (int i = 0; i < insts.numAttributes(); i++) {
    if (i != insts.classIndex()) {
      if (!insts.attribute(i).isNumeric()) {
        onlyNumeric = false;
        break;
      }
    }
  }

  if (!onlyNumeric) {
    m_NominalToBinary = new NominalToBinary();
    m_NominalToBinary.setInputFormat(insts);
    insts = Filter.useFilter(insts, m_NominalToBinary);
  }
  return insts;
}
 
Example #2
Source File: MultilayerPerceptron.java    From tsml with GNU General Public License v3.0 4 votes vote down vote up
/**
 * The constructor.
 */
public MultilayerPerceptron() {
  m_instances = null;
  m_currentInstance = null;
  m_controlPanel = null;
  m_nodePanel = null;
  m_epoch = 0;
  m_error = 0;
  
  
  m_outputs = new NeuralEnd[0];
  m_inputs = new NeuralEnd[0];
  m_numAttributes = 0;
  m_numClasses = 0;
  m_neuralNodes = new NeuralConnection[0];
  m_selected = new FastVector(4);
  m_graphers = new FastVector(2);
  m_nextId = 0;
  m_stopIt = true;
  m_stopped = true;
  m_accepted = false;
  m_numeric = false;
  m_random = null;
  m_nominalToBinaryFilter = new NominalToBinary();
  m_sigmoidUnit = new SigmoidUnit();
  m_linearUnit = new LinearUnit();
  //setting all the options to their defaults. To completely change these
  //defaults they will also need to be changed down the bottom in the 
  //setoptions function (the text info in the accompanying functions should 
  //also be changed to reflect the new defaults
  m_normalizeClass = true;
  m_normalizeAttributes = true;
  m_autoBuild = true;
  m_gui = false;
  m_useNomToBin = true;
  m_driftThreshold = 20;
  m_numEpochs = 500;
  m_valSize = 0;
  m_randomSeed = 0;
  m_hiddenLayers = "a";
  m_learningRate = .3;
  m_momentum = .2;
  m_reset = true;
  m_decay = false;
}