Package quickml.supervised.featureEngineering

Examples of quickml.supervised.featureEngineering.AttributesEnricher


        attributes = AttributesMap.newHashMap() ;
        attributes.put("k1",1);
        attributes.put("k2",2);
        trainingData.add(new InstanceImpl(attributes, "false"));
        ProbabilityEnrichStrategy probabilityEnrichStrategy = new ProbabilityEnrichStrategy(Sets.newHashSet("k1", "k2"), "true");
        final AttributesEnricher attributesEnricher = probabilityEnrichStrategy.build(trainingData);
        {
            AttributesMap inputAttributes = AttributesMap.newHashMap() ;
            inputAttributes.put("k1", 1);
            inputAttributes.put("k2", 1);
            final AttributesMap outputAttributes = attributesEnricher.apply(inputAttributes);
            Assert.assertEquals(outputAttributes.get("k1-PROB"), 0.5);
            Assert.assertEquals(outputAttributes.get("k2-PROB"), 1.0);
        }
        {
            AttributesMap inputAttributes = AttributesMap.newHashMap() ;
            inputAttributes.put("k1", 2);
            inputAttributes.put("k2", 2);
            final AttributesMap outputAttributes = attributesEnricher.apply(inputAttributes);
            Assert.assertEquals(outputAttributes.get("k1-PROB"), 0.5);
            Assert.assertEquals(outputAttributes.get("k2-PROB"), 1.0/3.0);
        }
    }
View Full Code Here

TOP

Related Classes of quickml.supervised.featureEngineering.AttributesEnricher

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.