How to evaluate a predictive neural network in Encog

We create a neural network to predict the occurrence of a typhoon using several typhoon parameters as input. So far, we have been able to generate data and train the neural network using Encog 3.2 . Now we must evaluate the learning outcomes.

We use the ForestCover project (in the examples of Encog 3.2) as a reference, however, the indicated project evaluation code is intended for a neural classification network. Thus, we cannot evaluate our neural network after the specified project code.

We also checked the PredictMarket project (in the examples of Encog 3.2), since it is an intelligent neural network. But it’s hard for us to use MLData.

MLData output = network.compute(inputData);

We want to extract the contents of the output and compare it with the contents of evaluation.csv to evaluate the neural network.

Is there a way that we can extract / convert the output variable into a normalized value, which we can then compare with the normalized .csv estimate?

or

Can I modify the ForestCover Evaluate.java file to be able to evaluate an intelligent neural network?

Thanks.

+4
source share
1 answer

# (Java ), CSV (TestResultsFile) , , Excel.

var evaluationSet = (BasicMLDataSet)EncogUtility.LoadCSV2Memory(Config.EvaluationNormalizedFile.ToString(),
    network.InputCount, network.OutputCount, true, CSVFormat.English,
        false);

var analyst = new EncogAnalyst();
analyst.Load(Config.NormalizationAnalystFile);

// Change this to whatever your output field index is
int outputFieldIndex = 29;

using (var resultsFile = new System.IO.StreamWriter(Config.TestResultsFile.ToString()))
{
    foreach (var item in evaluationSet)
    {
        var normalizedActualOuput = (BasicMLData)network.Compute(item.Input);
        var actualOutput = analyst.Script.Normalize.NormalizedFields[outputFieldIndex].DeNormalize(normalizedActualOuput.Data[0]);

        var idealOutput = analyst.Script.Normalize.NormalizedFields[outputFieldIndex].DeNormalize(item.Ideal[0]);


        var resultLine = String.Format("{0},{1}", idealOutput, actualOutput);
        resultsFile.WriteLine(resultLine);

    }
}

Abishek Kumar Pluralsight Course

, "Denormalize".

+1

Source: https://habr.com/ru/post/1624227/


All Articles