Package org.apache.stanbol.enhancer.topic

Examples of org.apache.stanbol.enhancer.topic.ClassificationReport


        assertEquals(0, classifier.updateModel(true));
    }

    @Test
    public void testUpdatePerformanceEstimates() throws Exception {
        ClassificationReport performanceEstimates;
        // no registered topic
        try {
            classifier.getPerformanceEstimates("urn:t/001");
            fail("Should have raised ClassifierException");
        } catch (ClassifierException e) {
View Full Code Here


    @Test
    public void testCrossValidation() throws Exception {
        // seed a pseudo random number generator for reproducible tests
        Random rng = new Random(0);
        ClassificationReport performanceEstimates;

        // build an artificial data set used for training models and evaluation
        int numberOfTopics = 10;
        int numberOfDocuments = 100;
        int vocabSizeMin = 20;
View Full Code Here

                metadata.add(new TripleImpl(enhancement,
                        org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_CONFIDENCE, lf
                                .createTypedLiteral(Double.valueOf(topic.score))));

                // add performance estimates of the classifier if available
                ClassificationReport perf = getPerformanceEstimates(topic.conceptUri);
                if (perf.uptodate) {
                    metadata.add(new TripleImpl(enhancement, precision, lf.createTypedLiteral(Double
                            .valueOf(perf.precision))));
                    metadata.add(new TripleImpl(enhancement, recall, lf.createTypedLiteral(Double
                            .valueOf(perf.recall))));
View Full Code Here

            Float recall = computeMeanValue(metadata, recallField);
            int positiveSupport = computeSumValue(metadata, positiveSupportField);
            int negativeSupport = computeSumValue(metadata, negativeSupportField);
            Date evaluationDate = (Date) metadata.getFirstValue(modelEvaluationDateField);
            boolean uptodate = evaluationDate != null;
            ClassificationReport report = new ClassificationReport(precision, recall, positiveSupport,
                    negativeSupport, uptodate, evaluationDate);
            if (metadata.getFieldValues(falsePositivesField) == null) {
                metadata.setField(falsePositivesField, new ArrayList<Object>());
            }
            for (Object falsePositiveId : metadata.getFieldValues(falsePositivesField)) {
View Full Code Here

        assertEquals(0, classifier.updateModel(true));
    }

    @Test
    public void testUpdatePerformanceEstimates() throws Exception {
        ClassificationReport performanceEstimates;
        // no registered topic
        try {
            classifier.getPerformanceEstimates("urn:t/001");
            fail("Should have raised ClassifierException");
        } catch (ClassifierException e) {
View Full Code Here

    @Test
    public void testCrossValidation() throws Exception {
        // seed a pseudo random number generator for reproducible tests
        Random rng = new Random(0);
        ClassificationReport performanceEstimates;

        // build an artificial data set used for training models and evaluation
        int numberOfTopics = 10;
        int numberOfDocuments = 100;
        int vocabSizeMin = 20;
View Full Code Here

            Float recall = computeMeanValue(metadata, recallField);
            int positiveSupport = computeSumValue(metadata, positiveSupportField);
            int negativeSupport = computeSumValue(metadata, negativeSupportField);
            Date evaluationDate = (Date) metadata.getFirstValue(modelEvaluationDateField);
            boolean uptodate = evaluationDate != null;
            ClassificationReport report = new ClassificationReport(precision, recall, positiveSupport,
                    negativeSupport, uptodate, evaluationDate);
            if (metadata.getFieldValues(falsePositivesField) == null) {
                metadata.setField(falsePositivesField, new ArrayList<Object>());
            }
            for (Object falsePositiveId : metadata.getFieldValues(falsePositivesField)) {
View Full Code Here

TOP

Related Classes of org.apache.stanbol.enhancer.topic.ClassificationReport

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.