Instances data; RemoveWithValues filter = new RemoveWithValues(); String[] options = new String[4]; options[0] = "-C"; // attribute index options[1] = "5"; // 5 options[2] = "-S"; // match if value is smaller than options[3] = "10"; // 10 filter.setOptions(options); filter.setInputFormat(data); Instances newData = Filter.useFilter(data, filter);
/** * Main method for running this filter. * * @param args arguments for the filter: use -h for help */ public static void main(String[] args) { runFilter(new RemoveDuplicates(), args); } }
public void testSampleSizePercentNoReplacement() { ((Resample) m_Filter).setSampleSizePercent(20); ((Resample) m_Filter).setNoReplacement(true); Instances result = useFilter(); assertEquals(m_Instances.numAttributes(), result.numAttributes()); assertEquals("Expecting output to be 20% of input", (int) (m_Instances.numInstances() * 20.0 / 100), result.numInstances()); }
/** Creates a default Resample */ public Filter getFilter() { Resample f = new Resample(); f.setSampleSizePercent(50); return f; }
/** * Main method for testing this class. * * @param argv should contain arguments to the filter: use -h for help */ public static void main(String[] argv) { runFilter(new ReservoirSample(), argv); } }
/** * Main method for testing this class. * * @param argv should contain arguments to the filter: use -h for help */ public static void main(String [] argv) { runFilter(new SparseToNonSparse(), argv); } }
/** * Main method for testing this class. * * @param argv should contain arguments to the filter: use -h for help */ public static void main(String[] argv) { runFilter(new NonSparseToSparse(), argv); } }
/** * Creates a SubsetByExpression filter with the given expression. * * @param expr the expression to use * @return the filter */ public Filter getFilter(String expr) { SubsetByExpression result = new SubsetByExpression(); result.setExpression(expr); return result; }
/** Creates a default RemovePercentage */ public Filter getFilter() { RemovePercentage f = new RemovePercentage(); return f; }
/** * Main method for testing this class. * * @param argv should contain arguments to the filter: use -h for help */ public static void main(String[] argv) { runFilter(new RemoveFolds(), argv); } }
/** * Main method for testing this class. * * @param argv should contain arguments to the filter: use -h for help */ public static void main(String[] argv) { runFilter(new RemoveMisclassified(), argv); } }
/** * Main method for running this filter. * * @param args arguments for the filter: use -h for help */ public static void main(String[] args) { runFilter(new SubsetByExpression(), args); } }
/** Creates a default RemoveRange */ public Filter getFilter() { RemoveRange f = new RemoveRange(); return f; }
/** Creates an example SparseToNonSparse */ public Filter getFilter() { SparseToNonSparse f = new SparseToNonSparse(); return f; }
/** Creates a default ReservoirSample */ public Filter getFilter() { ReservoirSample r = new ReservoirSample(); return r; }
/** Creates a default RemoveFolds */ public Filter getFilter() { RemoveFolds f = new RemoveFolds(); return f; }
/** * Creates a default SubsetByExpression filter. * * @return the filter */ @Override public Filter getFilter() { return new SubsetByExpression(); }
/** Creates a default Normalize */ public Filter getFilter() { Normalize f = new Normalize(); return f; }