Example usage for weka.filters.unsupervised.attribute RemoveByName RemoveByName

List of usage examples for weka.filters.unsupervised.attribute RemoveByName RemoveByName

Introduction

In this page you can find the example usage for weka.filters.unsupervised.attribute RemoveByName RemoveByName.

Prototype

RemoveByName

Source Link

Usage

From source file:etc.aloe.cscw2013.FeatureGenerationImpl.java

License:Open Source License

/**
 * Get a filter that removes the id attribute from the data set, necessary
 * before training./*  w  w  w.j  a  v a  2  s.  c  o  m*/
 *
 * @param examples
 * @return
 * @throws Exception
 */
protected Filter getRemoveIDFilter(ExampleSet examples) throws Exception {
    RemoveByName filter = new RemoveByName();
    filter.setExpression(Pattern.quote(ExampleSet.ID_ATTR_NAME));

    filter.setInputFormat(examples.getInstances());
    Instances filtered = Filter.useFilter(examples.getInstances(), filter);
    examples.setInstances(filtered);

    return filter;
}

From source file:etc.aloe.cscw2013.FeatureGenerationImpl.java

License:Open Source License

/**
 * Get a filter that removes the id attribute from the data set, necessary
 * before training.//www  .ja  v a2s .  c o m
 *
 * @param examples
 * @return
 * @throws Exception
 */
protected Filter getRemoveParticipantFilter(ExampleSet examples) throws Exception {
    RemoveByName filter = new RemoveByName();
    filter.setExpression(Pattern.quote(ExampleSet.PARTICIPANT_ATTR_NAME));

    filter.setInputFormat(examples.getInstances());
    Instances filtered = Filter.useFilter(examples.getInstances(), filter);
    examples.setInstances(filtered);

    return filter;
}

From source file:etc.aloe.oilspill2010.BigramFeatureGenerationImpl.java

/**
 * Get a filter that removes the id attribute from the data set, necessary
 * before training.//  ww  w.ja va2s .  c o m
 *
 * @param examples
 * @return
 * @throws Exception
 */
protected Filter getRemoveMessageFilter(ExampleSet examples) throws Exception {
    RemoveByName filter = new RemoveByName();
    filter.setExpression(Pattern.quote(ExampleSet.MESSAGE_ATTR_NAME));

    filter.setInputFormat(examples.getInstances());
    Instances filtered = Filter.useFilter(examples.getInstances(), filter);
    examples.setInstances(filtered);

    return filter;
}