Hi all,
In the past I have shared code related to machine learning prediction, but it seems as it may be quite complex to use for practice. This time, I got my hands dirty with Java and was able to build a graphical interface software that uses Neural Network to predict data.
Do know that this is a beta testing for anyone interested in playing with different settings of the software, this is to try to predict future lottery numbers based on past history data.
- In order to run the software, you must download and install Java, from Java dot com.
- Download the folder from the link provided - the file is zipped and resides in Google drive.
- After decompressing the downloaded file, the file that needs to be run is called MachineLearningTest.jar.
Before anything; I highly recommend that your normalize your data (Read around about data normalization) when trying to train a model that contains large numbers. In this case for lottery purposes, we will be using large numbers to play with. If this data does not get normalized before hand, then the software will take too long to train and possibly never even reach a global minimum for gradient descent purposes. (I will implement this formula later on this software). As an example, say that you want to normalize numbers 1,2,3,4,5. After normalized, these numbers will become 0, 0.25, 0.5, 0.75, 1. I believe Excel has a way of normalizing data. Basically you are turning large numbers to be in the range of [0,1] - Neural Networks compute decimals much faster than large numbers.
Moving On;;;
The software consist of the following options/parameters:
- X Values box - This is where you add your history to be trained. Last line can be today's draw for instance.
- X values can be of N dimension.
- Y Values box - This is where you add your expected values.
- Y values can be of N dimension, but must match X values (for now). So, if X == 5D, then Y must also equal 5D.
- For example, if yesterday draw numbers were 1,2, and today is 4,3, then, in X values box == 1,2, and Y values box == 4,3.
- Iterations - this is the amount of repetitions to train your network.
- Bias - This is the value to add a constant for gradient descent purposes. Testers tend to use 0.5 as a constant value.
- Learning Rate - This a value you must play with, although people start with 0.0003, 0.003, 0.03 as some examples widely used.
- Momentum - Very useful when training with large data sets to avoid overshooting of global minimum.
- Samples to use - this setting is setup to automatically detect your data set size, then you can reduce or increase the size of your data.
- Hidden Layers (Up to 750) - Use at your own testing. The larger the layers, the longer it will take to train a network. This can turn into a deep learning NN.
- Output values box - When your data is successfully trained, values in this box should be very similar to values in Expected Outputs box.
- If the values in Outputs box are same as Y Values box, this means your neural network was able to train the data successfully.
- For example; X == 1,0. Y == 0,1. If Output shows == 0,1, then Neural Network is trained.
- This software is setup with a constant/epsilon in back end for Regularization set to 0.00000000001 this is to avoid Overfitting.
- Train button will feed forward and back propagate your data to find its optimal weights for successful training.
After training your network, you can move on to predict data. Remember that you will know if the network has successfully been trained if the Expected values you entered, completely or almost completely match the Output values.
- Box that contains description "Enter Values to predict", Enter the values you would like to be predicted. Note that you should predict more than 5 lines of values. I am still trying to figure out why an error is thrown when trying less than 5 values.
- Predict button will calculate your inputted value with the new learned weights and show Predicted results in box that reads "Predicted value shows here".
- If when clicking predict the software doesn't do anything, the software may be throwing an error and its because your inputted values are less than 5. Also, Ignore any values that output as -1, I am still trying to figure out how to get rid of it. Therefore, I recommend adding multiple testing values to avoid confusion.
Depending on the interest shown in the software, I am willing to make the software better and add more parameters. I am a true believer of Machine learning allowing Lottery prediction easier. I've spent hundreds of hours working/learning this software in order to, with much love share with you guys.
Some of the things I will be adding on my next version will be:
Normalization - a way to turn large numbers into probabilistic values.
Gradient descent/Error value with either a line chart or just the value as output.
I can add the option to add your own value for regularization to avoid over fitting.
Any other ideas are welcome. Although, understand that making major changes, is extremely complex to add from one day to another as im not an expert in Java and still in the process of learning myself (Currently taking Computer Science major at FIU). In python, I am way more advanced and for machine learning purposes its much faster and better. So, I am willing to share codes as necessary if anyone interested.
The software looks as follows:
The link to download the software: http://bit.ly/2vZOifT