Documentation of 'org.neuroph.contrib.samples.SunSpots' Java class
SunSpots
org.neuroph.contrib.samples

Class SunSpots

  • All Implemented Interfaces:
    java.util.EventListener, LearningEventListener


    public class SunSpots
    extends java.lang.Object
    implements LearningEventListener
    This example shows how to use Neuroph to predict sunspots. It demonstrates two very important machine learning techniques. First, time-window. Sunspots are organized into input windows used to predict the next level of sunspot activity. This example uses a 30 year window. Basically, 30 years of sunspot activity is used to predict the 31st year. This 30 year window slides forward, one year at a time. Second is normalization. The sunspots are normalized into a range between 0.1 and 0.9. This is very close to the actual 0 to 1 range of the sigmoid function. We stay away from the extream edges of this range, thus using 0.1 and 0.9. This is an example from the book "Introduction to Neural Networks for Java" by Jeff Heaton. This example has been contributed to the Neuroph project by Jeff Heaton. http://www.heatonresearch.com/book/programming-neural-networks-java-2.html
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int EVALUATE_END
      End of evaluation data.
      static int EVALUATE_START
      Beginning of evaluation data.
      static double MAX_ERROR
      This really should be lowered, I am setting it to a level here that will train in under a minute.
      static int STARTING_YEAR
      Starting year for sunspot data.
      static double[] SUNSPOTS 
      static int TRAIN_END
      End of training data.
      static int TRAIN_START
      Start of training data.
      static int WINDOW_SIZE
      Size of our prediction window.
    • Constructor Summary

      Constructors 
      Constructor and Description
      SunSpots() 
    • Field Detail

      • SUNSPOTS

        public static final double[] SUNSPOTS
      • STARTING_YEAR

        public static final int STARTING_YEAR
        Starting year for sunspot data.
        See Also:
        Constant Field Values
      • WINDOW_SIZE

        public static final int WINDOW_SIZE
        Size of our prediction window.
        See Also:
        Constant Field Values
      • TRAIN_START

        public static final int TRAIN_START
        Start of training data.
        See Also:
        Constant Field Values
      • EVALUATE_START

        public static final int EVALUATE_START
        Beginning of evaluation data.
        See Also:
        Constant Field Values
      • EVALUATE_END

        public static final int EVALUATE_END
        End of evaluation data.
      • MAX_ERROR

        public static final double MAX_ERROR
        This really should be lowered, I am setting it to a level here that will train in under a minute.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SunSpots

        public SunSpots()
    • Method Detail

      • normalizeSunspots

        public void normalizeSunspots(double lo,
                                      double hi)
        Normalize the sunspots.
        Parameters:
        lo - Low range for normalization.
        hi - High range for normalization.
      • generateTrainingData

        public DataSet generateTrainingData()
        Generate the training data for the training sunspot years.
        Returns:
        The training data.
      • predict

        public void predict(NeuralNetwork network)
        Predict sunspots.
        Parameters:
        network - Neural network to use.
      • run

        public void run()
      • main

        public static void main(java.lang.String[] args)
      • handleLearningEvent

        public void handleLearningEvent(LearningEvent event)
        Description copied from interface: LearningEventListener
        This method gets executed when LearningRule fires LearningEvent which some class is listening to. For example, if you want to print current iteration, error etc.
        Specified by:
        handleLearningEvent in interface LearningEventListener
        Parameters:
        event - holds the information about event tha occured

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.