Package org.neuroph.core.data

Examples of org.neuroph.core.data.DataSet


*/
public class IrisNeurophClassifierEvaluation {

    public static void main(String[] args) {          
        NeuralNetwork neuralNet = NeuralNetwork.load(IrisNeurophClassifierEvaluation.class.getResource("IrisClassifier.nnet").getFile());
        DataSet dataSet = DataSet.createFromFile(IrisNeurophClassifierEvaluation.class.getResource("iris_data_normalised.txt").getPath(), 4, 3, ",");
             
        NeurophClassifierEvaluation evaluation =
                new NeurophClassifierEvaluation(neuralNet, dataSet);
       
        String[] classNames = {"Setosa", "Versicolor", "Virginica"}; // these shoul dbe set either from output neurons or data set...       
View Full Code Here


       
        // create GOAI classifier with loaded Neuroph neural network
        Classifier<double[], String> goaiClassifier = new NeurophClassifier(neuralNet);
                 
        // load dataset and create map here
        DataSet evaluationDataSet =  DataSet.createFromFile(IrisNeurophClassifierSample.class.getResource("iris_data_normalised.txt").getPath(), 4, 3, ",");
       
        ClassificationProblem<double[], String> classificationProblem = createClassificationProblem(evaluationDataSet);
       
        ClassifierEvaluator<double[], String> evaluator = new ClassifierEvaluator<>();
        ClassifierEvaluationResult evaluationResults =  evaluator.evaluate(goaiClassifier, classificationProblem);       
View Full Code Here

     * Trains neural network with data from itemClassMap
     * @param itemClassMap Map<double[], String>
     */
    @Override
    public void buildClassifier(Map<double[], String> itemClassMap) {
        DataSet dataSet = convertItemClassMapToDataset(itemClassMap);
        neuralNet.learn(dataSet);
    }
View Full Code Here

            //map double value for class value
            classVals.put(values, new Double(ind));
            ind++;
        }
       
        DataSet neurophDataSet = new DataSet(entryRow.length, 1);
       
        for(Map.Entry<double[],String> entry : itemClassMap.entrySet()){
            double[] out = new double[1];
            out[0] = classVals.get(entry.getValue());
            DataSetRow dataSetRow = new DataSetRow(entry.getKey(), out);
            neurophDataSet.addRow(dataSetRow);
        }
       
        return neurophDataSet;
    }
View Full Code Here

TOP

Related Classes of org.neuroph.core.data.DataSet

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.