Package com.blazebit.ai.decisiontree

Examples of com.blazebit.ai.decisiontree.AttributeValue


        final TrieMap<Set<Example<T>>> exampleTrieMap = new TrieMap<Set<Example<T>>>();

        /* Fill values */
        for (final Example<T> example : examples) {
            final AttributeValue exampleAttributeValue = example.getValues().get(attribute);
            final String key = exampleAttributeValue == null ? "" : (String) exampleAttributeValue.getValue();
            Set<Example<T>> set = exampleTrieMap.get(key);
           
            if (set == null) {
                set = new HashSet<Example<T>>();
                exampleTrieMap.put(key, set);
View Full Code Here


        return attribute;
    }

    @Override
    public Set<T> apply(final Item item) {
        final AttributeValue value = item.getValues().get(attribute);
       
        if (value == null) {
            /* If no value exists for the current attribute, use the results of all the children */
            final Set<T> results = new HashSet<T>();
           
            for (final DecisionNode<T> node : children.values()) {
                results.addAll(node.apply(item));
            }

            return results;
        } else {
            final DecisionNode<T> node = children.get((String) value.getValue());

            if (node == null) {
                return Collections.emptySet();
            } else {
                return node.apply(item);
View Full Code Here

        }
    }

    @Override
    public T applySingle(final Item item) {
        final AttributeValue value = item.getValues().get(attribute);

        if (value == null) {
            /* If no value exists for the current attribute, use the results of all the children */
            T result = null;

View Full Code Here

            final Map<AttributeValue, Pair> valueUsage = new HashMap<AttributeValue, Pair>();
            attributeUsage.put(attr, valueUsage);

            for (int i = 0; i < examplesSize; i++) {
                final AttributeValue value = exampleArray[i].getValues().get(attr);
                Pair valueUsageExamples = valueUsage.get(value);

                if (valueUsageExamples == null) {
                    valueUsageExamples = new Pair();
                    valueUsage.put(value, valueUsageExamples);
View Full Code Here

        final Set<AttributeValue> attributeValues = attribute.getValues();
        final Map<AttributeValue, Set<Example<T>>> exampleMap = new HashMap<AttributeValue, Set<Example<T>>>(attributeValues.size() + 1);

        /* Fill values */
        for (final Example<T> example : examples) {
            final AttributeValue attributeValue = example.getValues().get(attribute);
            Set<Example<T>> set = exampleMap.get(attributeValue);

            if(set == null){
                set = new HashSet<Example<T>>();
                exampleMap.put(attributeValue, set);
View Full Code Here

        return attribute;
    }

    @Override
    public Set<T> apply(final Item item) {
        final AttributeValue value = item.getValues().get(attribute);

        if (value == null) {
            /* If no value exists for the current attribute, use the results of all the children */
            final Set<T> results = new HashSet<T>();

View Full Code Here

        }
    }

    @Override
    public T applySingle(final Item item) {
        final AttributeValue value = item.getValues().get(attribute);

        if (value == null) {
            /* If no value exists for the current attribute, use the results of all the children */
            T result = null;

View Full Code Here

TOP

Related Classes of com.blazebit.ai.decisiontree.AttributeValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.