Package etc.aloe.data

Examples of etc.aloe.data.Model


            //Get the fruits of our labors
            System.out.println("== Saving Output ==");

            FeatureSpecification spec = trainingController.getFeatureSpecification();
            Model model = trainingController.getModel();
            List<String> topFeatures = trainingController.getTopFeatures();
            List<Map.Entry<String, Double>> featureWeights = trainingController.getFeatureWeights();

            saveFeatureSpecification(spec, options.outputFeatureSpecFile);
            saveModel(model, options.outputModelFile);
View Full Code Here


            LabelingController labelingController = new LabelingController();
            factory.configureLabeling(labelingController);

            FeatureSpecification spec = this.loadFeatureSpecification(options.inputFeatureSpecFile);
            Model model = this.loadModel(options.inputModelFile);

            labelingController.setModel(model);
            labelingController.setFeatureSpecification(spec);
            labelingController.setSegmentSet(segmentSet);
            labelingController.run();
View Full Code Here

            factory.configureLabeling(labelingController);

            //Process the input messages
            MessageSet messages = this.loadMessages(options.inputCSVFile);
            FeatureSpecification spec = this.loadFeatureSpecification(options.inputFeatureSpecFile);
            Model model = this.loadModel(options.inputModelFile);

            SegmentSet segments = segmentation.segment(messages);

            //Run the labeling process
            labelingController.setModel(model);
View Full Code Here

        return messages;
    }

    protected Model loadModel(File inputModelFile) {
        Model model = factory.constructModel();
        try {
            System.out.println("Reading model from " + inputModelFile);
            InputStream inputModel = new FileInputStream(inputModelFile);
            model.load(inputModel);
            inputModel.close();
        } catch (FileNotFoundException e) {
            System.err.println("Model file " + inputModelFile + " not found.");
            System.exit(1);
        } catch (InvalidObjectException e) {
View Full Code Here

                System.out.println("- Extracting features from training set");
                ExampleSet trainingSet = extraction.extractFeatures(basicTrainingExamples, spec);
                basicTrainingExamples = null;

                Training training = getTrainingImpl();
                Model model = training.train(trainingSet);
                trainingSet = null;
               
                System.out.println("- Splitting out test set");
                SegmentSet testingSegments = new SegmentSet();
                testingSegments.setSegments(split.getTestingForFold(segmentSet.getSegments(), foldIndex, this.folds));
                if (getBalancingImpl() != null && balanceTestSet) {
                    testingSegments = getBalancingImpl().balance(testingSegments);
                }

                System.out.println("- Extracting basic features from test set");
                ExampleSet basicTestingExamples = testingSegments.getBasicExamples();

                System.out.println("- Extracting features from test set");
                ExampleSet testingSet = extraction.extractFeatures(basicTestingExamples, spec);
                basicTestingExamples = null;

                Predictions predictions = model.getPredictions(testingSet);
                EvaluationReport report = new EvaluationReport("Fold " + (foldIndex + 1), falsePositiveCost, falseNegativeCost);
                report.addPredictions(predictions);
               
                LabelMapping mapping = getMappingImpl();
                mapping.map(predictions, testingSegments);
View Full Code Here

            //Provide implementations for the controller
            interactiveController.setFeatureExtractionImpl(factory.constructFeatureExtraction());
            interactiveController.setMappingImpl(factory.constructLabelMapping());

            FeatureSpecification spec = this.loadFeatureSpecification(options.inputFeatureSpecFile);
            Model model = this.loadModel(options.inputModelFile);

            interactiveController.setModel(model);
            interactiveController.setFeatureSpecification(spec);
            interactiveController.run();
View Full Code Here

TOP

Related Classes of etc.aloe.data.Model

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.