Training a Neural Network to predict the output of a power plant

Neural networks are really powerful regressors, capable of fitting almost any arbitrary data. In this example, however, we will use a simple model to fit the data as we already know our data exerts a linear relationship.

Getting ready

To execute this recipe, you will need pandas and PyBrain. No other prerequisites are required.

How to do it…

We specify the fitANN(...) method in a very similar way as we did in Chapter 3, Classification Techniques (the regression_ann.py file). For brevity, some of the import statements have been removed:

import pybrain.structure as st import pybrain.supervised.trainers as tr import pybrain.tools.shortcuts as pb @hlp.timeit def fitANN(data): ''' Build a ...

Get Practical Data Analysis Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.