com.blazebit.ai.decisiontree.impl.SimpleDiscreteAttribute Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of blaze-ai-utils Show documentation
Show all versions of blaze-ai-utils Show documentation
Artificial Intelligence Utilities.
package com.blazebit.ai.decisiontree.impl;
import com.blazebit.ai.decisiontree.*;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
/**
* @author Christian Beikov
*/
public class SimpleDiscreteAttribute extends AbstractAttribute implements DiscreteAttribute {
private final Set values;
public SimpleDiscreteAttribute(final String name, final Set extends AttributeValue> values) {
super(name);
this.values = Collections.unmodifiableSet(new HashSet(values));
}
@Override
public Set getValues() {
return values;
}
@Override
public DecisionNode createNode(final DecisionNodeFactory decisionNodeFactory, final Set> examples) {
return new DiscreteDecisionNode(decisionNodeFactory, this, examples);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy