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

com.blazebit.ai.decisiontree.impl.SimpleDiscreteAttribute 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.*;

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 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