All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.blazebit.ai.decisiontree.impl.SimpleAttributeSelector Maven / Gradle / Ivy

There is a newer version: 0.1.21
Show newest version
package com.blazebit.ai.decisiontree.impl;

import com.blazebit.ai.decisiontree.Attribute;
import com.blazebit.ai.decisiontree.AttributeSelector;
import com.blazebit.ai.decisiontree.Example;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Christian Beikov
 */
public class SimpleAttributeSelector implements AttributeSelector {

    @Override
    public Attribute select(final Set> examples, final Set availableAttributes, final Set usedAttributes) {
        final Set usable = new HashSet(availableAttributes);
        usable.removeAll(usedAttributes);
        return usable.size() > 0 ? usable.iterator().next() : null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy