Examples of ExampleSet


Examples of etc.aloe.data.ExampleSet

            //First extract features
            FeatureExtraction extraction = getFeatureExtractionImpl();
            extraction.setVerbosity(Loggable.Verbosity.Quiet);

            ExampleSet examples = extraction.extractFeatures(segmentSet.getBasicExamples(), featureSpecification);

            //Predict the labels
            Predictions prediction = this.model.getPredictions(examples);

            //Map back onto messages
View Full Code Here

Examples of etc.aloe.data.ExampleSet

    }
   
    @Override
    public FeatureSpecification generateFeatures(ExampleSet basicExamples) {

        ExampleSet examples = basicExamples.copy();
        FeatureSpecification spec = new FeatureSpecification();

        System.out.print("Configuring features over " + examples.size() + " examples... ");

        try {
            spec.addFilter(getPronounsFilter(examples));
            spec.addFilter(getPunctuationFilter(examples));
            spec.addFilter(getSpecialWordsFilter(examples));
View Full Code Here

Examples of etc.aloe.data.ExampleSet

    @Test
    public void testTrain() {
        System.out.println("train");

        TrainingImpl instance = new TrainingImpl();
        WekaModel model = instance.train(new ExampleSet(instances));

        //The test here is whether the model works
        Boolean[] expResult = new Boolean[]{true, true, false, false};
        Double[] expConfidence = new Double[]{1.0, 1.0, 0.0, 0.0};

        ExampleSet examples = new ExampleSet(testInstances);
        Predictions predictions = model.getPredictions(examples);

        assertEquals(expResult.length, predictions.size());

        for (int i = 0; i < expResult.length; i++) {
View Full Code Here

Examples of etc.aloe.data.ExampleSet

    private Verbosity verbosity = Verbosity.Normal;

    @Override
    public ExampleSet extractFeatures(ExampleSet basicExamples, FeatureSpecification spec) {
        ExampleSet examples = basicExamples;

        if (this.verbosity.ordinal() > Verbosity.Quiet.ordinal()) {
            System.out.print("Extracting features for " + examples.size() + " examples... ");
        }

        for (Filter filter : spec.getFilters()) {
            try {
                Instances instances = Filter.useFilter(examples.getInstances(), filter);
                examples = new ExampleSet(instances);
            } catch (Exception e) {
                System.err.println("Unable to apply filter: " + filter.toString());
                System.err.println("\t" + e.getMessage());
                return null;
            }
View Full Code Here

Examples of etc.aloe.data.ExampleSet

    }
   
    @Override
    public FeatureSpecification generateFeatures(ExampleSet basicExamples) {

        ExampleSet examples = basicExamples.copy();
        FeatureSpecification spec = new FeatureSpecification();

        System.out.print("Configuring features over " + examples.size() + " examples... ");

        try {
            spec.addFilter(getPronounsFilter(examples));
            spec.addFilter(getPunctuationFilter(examples));
            spec.addFilter(getSpecialWordsFilter(examples));
View Full Code Here

Examples of etc.aloe.data.ExampleSet

    }
   
    @Override
    public FeatureSpecification generateFeatures(ExampleSet basicExamples) {

        ExampleSet examples = basicExamples.copy();
        FeatureSpecification spec = new FeatureSpecification();

        System.out.print("Configuring features over " + examples.size() + " examples... ");

        try {
            spec.addFilter(getPronounsFilter(examples));
            spec.addFilter(getPunctuationFilter(examples));
            spec.addFilter(getSpecialWordsFilter(examples));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.