/** Constructor - initialises the filter */ public Discretize() { m_DefaultCols = "first-last"; setAttributeIndices("first-last"); }
/** * Another constructor, sets the attribute indices immediately * * @param cols the attribute indices */ public Discretize(String cols) { m_DefaultCols = cols; setAttributeIndices(cols); }
/** * Another constructor, sets the attribute indices immediately * * @param cols the attribute indices */ public Discretize(String cols) { m_DefaultCols = cols; setAttributeIndices(cols); }
/** Constructor - initialises the filter */ public Discretize() { m_DefaultCols = "first-last"; setAttributeIndices("first-last"); }
/** * Sets which attributes are to be Discretized (only numeric attributes among * the selection will be Discretized). * * @param attributes an array containing indexes of attributes to Discretize. * Since the array will typically come from a program, attributes are * indexed from 0. * @throws IllegalArgumentException if an invalid set of ranges is supplied */ public void setAttributeIndicesArray(int[] attributes) { setAttributeIndices(Range.indicesToRangeList(attributes)); }
/** * Sets which attributes are to be Discretized (only numeric attributes among * the selection will be Discretized). * * @param attributes an array containing indexes of attributes to Discretize. * Since the array will typically come from a program, attributes are * indexed from 0. * @throws IllegalArgumentException if an invalid set of ranges is supplied */ public void setAttributeIndicesArray(int[] attributes) { setAttributeIndices(Range.indicesToRangeList(attributes)); }
/** Creates a specialized Discretize */ public Filter getFilter(String rangelist) { try { Discretize f = new Discretize(); f.setAttributeIndices(rangelist); return f; } catch (Exception ex) { ex.printStackTrace(); fail("Exception setting attribute range: " + rangelist + "\n" + ex.getMessage()); } return null; }
/** Creates a specialized Discretize */ public Filter getFilter(String rangelist) { try { Discretize f = new Discretize(); f.setAttributeIndices(rangelist); return f; } catch (Exception ex) { ex.printStackTrace(); fail("Exception setting attribute range: " + rangelist + "\n" + ex.getMessage()); } return null; }
setAttributeIndices(convertList); } else { setAttributeIndices(m_DefaultCols);
setAttributeIndices(convertList); } else { setAttributeIndices(m_DefaultCols);
m_Discretizer.setAttributeIndices("" + (instances.classIndex() + 1)); m_Discretizer.setBins(getNumBins()); m_Discretizer.setUseEqualFrequency(getUseEqualFrequency());
m_Discretizer.setAttributeIndices("" + (instances.classIndex() + 1)); m_Discretizer.setBins(getNumBins()); m_Discretizer.setUseEqualFrequency(getUseEqualFrequency());
.setAttributeIndices(rangeList); } else { m_disTransform = new weka.filters.supervised.attribute.Discretize();
.setAttributeIndices(rangeList); } else { m_disTransform = new weka.filters.supervised.attribute.Discretize();