Predict Lottery Numbers using Artificial Intelligent Neural Network in Kera, Python.
Вставка
- Опубліковано 31 гру 2021
- Predict lottery game by using AI power to map many to many. Uses previous winning lottery numbers to predict next weeks lottery numbers. Has won tax free prizes to fund future research.
This is one amazing little program. Had to fine tune a few things but it works great
What did you fine tune!!!! I did it. How can i get more then one combination
Thank you very much for your idea! I had a lot of problems with it this public ai model, but eventually, I bought a model, and it's giving excellent results. I haven't won the jackpot yet, but each time I've won a few hundred dollars.
where did you buy a model ?
@@Xplosive24 Google: LottoMasterAi (got 5 out of 7 correct last Saturday, won 1k euro, i am happy now😁
where did you buy a model ?
Most useful jobs . Thank man
It may be random but I believe this would increase your odds of winning
Hi Arnold, I don’t know what happened, but today when I added the latest winning number and ran the script again, without changing any of the other parameters, it produced a “0” in the predicted number. Any idea why and how can I do some kinda test to ensure that the results it’s producing are correct or that the script is doing what it’s actually supposed to do? Because the day before it produced duplicates and today a zero and the numbers are from 1-35, and 1-12. Doesn’t include zeros. Please help me. Thank you so much
does your code actually predict future numbers?
@@doulbeyob it will not, unless lottery is following a certain pattern. But it can increase the odds of winning
Hi, I know the video is old, but I was wondering for a 90 number lottery, where does the value 240 in the LSTM in Bidirectional come from? Then the history is ordered from oldest to most recent? For the value 59 in Dense I believe it should be set to 90, since in the lottery in question the playable numbers range from 1 to 90.
Thanks in advance.
The 240 was an experiment to produce a wider neural network, you have to experiment and record the results as every lottery is different.
Hello, I see your python code today, very good! thanks for this!
I have a question: you have 100 random lotto draws (6 numbers) from 0 to 99 lines, the draw which precedes the prediction of the next draw is 0 or 99 because the reading direction (from top to bottom or vice versa) of the code certainly changes the prediction? You don't say the % of exact numbers compared to real draw? Thanks. Good day (sorry for my english, i'm french)
You have to back test using your local lottery and look for the article I posted in comments of my lottery videos. Search google for How to Guess Accurately 3 Lottery Numbers Out of 6 using
Hello Arnold, I'm curios to know if the model follows any directionality - say for example does the model or your draw lines follow any chronological order - as I would imagine a model should make prediction, ideally , for a potential feature draw based on patterns that, by following direction, are turning into trend.
Good question, you can try both ways. See this article medium.com/@polanitzer/how-to-guess-accurately-3-lottery-numbers-out-of-6-using-lstm-model-e148d1c632d6
There is a way to get np.array of last games from API?
A big merci 😊
Hello Arnold,
shouldn't the training data actually be learned in chronological order. In your case, the most recent draws are first, so it's the other way around. According to your algorithm, you also learn the data set that you actually want to predict. However, I think that this data set does not belong in the training data. The data set for an upcoming draw is supposed to be predicted and is not yet known at the time of training. Please explain your procedure to me I would like to understand this.
Reinhard
yes, the "test data" included inside the "training data". this is incorrect!
Hi Arnold,
It is not a question of differentiating between training and test data.
I have noticed that the training data is trained in reverse order and not in chronological order as I would expect. But what is actually not possible is that the draw to be predicted is also trained. But this draw has not yet been drawn and is therefore not known.
Rather curious that the "train" data shown is identical to the "to_predict" data used later in the video. For true, non-fabricated results, wouldn't you normally want to keep these data groups separate and not "reuse" the same numbers? Yes I believe so. This example achieves nothing except how if you use the same train & test data, you can "predict" the outcome which has already been incorporated.
Thanks for the video. I tried this with one number (e.g. A column only) accuracy goes down to zero but you get an answer out is there a reason why it wouldn't give an accuracy figure? Other than there is no accuracy with one culumn of numbers? As an update, it works. We didn't win the big prize but we were only a max of 1 out on several numbers. We matched 4 on EM....
What was the max price you won? Did you win any in the range of $1000?
how did you make it work? my one shows last numbers of my training data instead of actually predicting something
Dear Arnold Dalby:
I watched your video "Predict Lottery Numbers using Artificial Intelligent Neural Network in Kera, Python" and I would like to know if it is possible to make predictions for more games in the future, that is, instead of predicting only game N+1, you extend the prediction for N+2, N+3,.....up to N+10 in the future, or at least up to N+5. is it possible to do? Can you provide the suitability in the code to do this?
That can be done using fantasy numbers not the winning numbers from last game. The AI is looking for connections between winning numbers to predict next games numbers. But you can take the predicted output and use it as input if you want and see what happens.
@@arnolddalby5552 This is a hard way and very dificult to have a good result. I mean if you dont have a way to put a lag in the sequence to preview next games.
Hello Arnold, is there a way to use a csv file or excel file to be read instead of putting gin the numbers manual as i have 7 columns and 54 rows for each so it can predict from the data it has?
See may latest video for that
@@arnolddalby5552 sorry i did mate, thank you for the new video on that, i should have checked the video library first. ive also used it for tonight set for life, ill update on how close the numbers generated come to it and as add the new numbers to the csv file and see what happens next
Can’t barely make out some of the code. Have you uploaded it?
Do the most recent numbers go first or last in the np array?
last but you can try first if you like. Wishing you success.
Before i go any further have you won the lotto?
Did you win the lottery, using this system. The cool thing would be to see it live in action.
Hi Arnold, how would you go about this if you wanted to include two bonus numbers which are called from a different drum than the main 5 numbers? main drum is 1 - 35 and the two bonus numbers are between 1 -12. Thank you
Hi Samuel, I have done a lot of back testing so I would create 3 models. one for 7 no's, one for 5 no's and one for the 2 no's and see how they perform. I recently had a model that won a prize looking at only the last 2 games. I use models that win any prize which I put back into more plays. I will give you that model soon once I find it in comment below.
model = Sequential()
model.add(Bidirectional(LSTM(64,
input_shape=(window_length, number_of_features),
return_sequences=True)))
model.add(Dropout(0.2))
model.add(Bidirectional(LSTM(32,
return_sequences=False)))
model.add(Dropout(0.2))
model.add(Dense(20))
model.add(Dense(number_of_features))
model.compile(loss='mse', optimizer='rmsprop', metrics=['accuracy'])
model.fit(train, label,
batch_size=64, epochs=300)
@@arnolddalby5552 Hi Arnold thank you so much for the reply. When I got to the interesting part, to run the LSTM it said ModuleNotFoundError: No module named 'keras'. any idea why? Thank you
@@MrSunshanmu make sure you have this imports :
from keras.models import Sequential
from keras.models import load_model
from keras.layers import LSTM, Dense,Dropout
Hey Arnold trust that you're well, is there a way to make more than one prediction?
See github.com/LukeTonin/keras-seq-2-seq-signal-prediction
Hi, Arnold, Do you have finished software to predict lotto? If so, where I can order and download it? Thanks.
It's research project and free as it's an impossible and complex subject but use this code for free. medium.com/@polanitzer/how-to-guess-accurately-3-lottery-numbers-out-of-6-using-lstm-model-e148d1c632d6
@@arnolddalby5552 Thanks for your sincere reply. But my computer science is poor and can not make any code. Sorry about that. Please let me know once you finish the code to get the working software. Best regards, Andy
Hello Arnold, well done for this code!! Thank you! I'd like to change it simply: my base is 20 numbers drawn by the lottery instead of 6.
As a prediction I would like the code to show me only 8 probable numbers (instead of 20) which are in the 2 Array database: 50 arrays of 20 numbers at the beginning of the code and 5 arrays of 20 before the prediction, as you did it), where do I have to change the code to have only 8 numbers predicted? thank you and have a nice day Jean
Window length should be 8 if your predicting 8 numbers. See this article medium.com/@polanitzer/how-to-guess-accurately-3-lottery-numbers-out-of-6-using-lstm-model-e148d1c632d6
Hi, Thank you for this great video. I'm getting an error when I run train = np.empty, I'm getting a ValueError: negative dimensions are not allowed. Any reason why. Please help. Thank you.🙏🧠
github.com/luwei250002695/keras-lstm-to-predict-lottery-game-many_to_many
Hi Dalby, when increasing epochs, the accuracy was almost the same (almost 1.0) and the loss was still dropping, and the predicted numbers were different each time. Was it normal? Thanks.
Yeah, that is normal but sounds like you need to lower the LSTM no to 64 or 32 or 16 and change number of games to train on to 2 or 5 or 7. See my latest video just out.
Thanks a lot!
How can you improve the accuracy ? what is the dependency here ?
has anyone got over 65% accuracy ?
Experiment try using only last 2 games. More epochs.
Hi Arnold,
Thanks for this simple program, I find an average of 3 out of 6 numbers.
I have a few questions to improve it maybe ? How do I add the Bidirectional command (values to write?) to this program (Only this one because it's short and easy for me to understand it)
Which optimizer is better? rmsprop or adam in THIS program ?
Why is the train shape 95 5 6 (5 is the number of lines for the prediction, 6 is the number of numbers in the array, but 95?? )
My last question is the value of LSTM (32 is it related to the 100 random lines because I have only 25 arrows to train and 5 for the prediction?)
Thank you if you have some time to answer me ! Great job! Thanks
You can try different variations of all variables to suit your local lottery, add Bidirectional see machinelearningmastery.com/develop-bidirectional-lstm-sequence-classification-python-keras/
@@arnolddalby5552 Thanks Arnold for your response, yesterday I still had 3 numbers out of 6 and the 3 others numbers were close to the good ones !
But the program that has this good score is your first Python code without ' activation relu' and with the rmsprop optimizer, the others ones give me 0 numbers !!!
Thanks !
@@jeanphilippecagnati1033 how did you get this result? did you improve something? mine are close but none is actually correct
How does this do when it’s back-tested against historical draws?
Different models need testing but can pick 2 or 3 balls with a near miss or two, so performs better with syndicates. You have to spend a few hours back testing on recent data and adjust model to find optimum model and parameters.
Hi. Great program, My best in testing is getting 2 numbers 4 out of 7 so far.
Which order do the numbers go in the pd.dataframe. Most recent lottery numbers first or last?
Which order do the numbers go in the np.array. Most recent lottery numbers first or last?
In the np.array can you use the most recent numbers from the pd.dataframe array?
What is the code to run the epochs in a window so that it is not scrolling forever?
Sometimes when changing epochs and values in the np.array I get a value error. Why?
Is it better to stick with 100 numbers or use the complete lottery history?
Thanks in advance...
In my lottery I only have 1-39. Whete do I change this in the code?
When I change epochs. Sometimes I get a value error. Why?
ValueError: Failed to find data adapter that can handle input: ,
change epoch to 300. use any number of history to train your neural network. Use your intuition and test.
@@arnolddalby5552 Thanks Arnold. I got some of the problems sorted. The value error was because when I changed the df.tail value to 2 I did not change the two other lines of previous code to 2 also. I have 2022 results which I am testing. Love the program. Thanks.
@@MJJVCdid you get any result?
thanks for your help I just have a last question what does batch size relate to ? and what does LSTM number relate to ?
A batch size of 32 means that 32 samples from the training dataset will be used to estimate the error gradient before the model weights are updated. One training epoch means that the learning algorithm has made one pass through the training dataset, where examples were separated into randomly selected “batch size” groups.
model.add(LSTM(100 means number of output connections to next level of neural net. See machinelearningmastery.com/lstm-autoencoders/
Thank u sir
After setting everything right I should tune the LSTM and the epochs right because I have 85 smaples so I should put the batch size as 85 and since tue draw has 54 balls I should put the dense as 54 and then try to tune the epochs and LSTM and see if I get a close number as the last winning numbers right ?
Does anyone experienced this error "Input of layer sequential is incompatible with the layer: shapes error in LSTM" expected shape and found shape are different but you don't get how to fix it in this?
Hi try the code in this article which may help medium.com/@polanitzer/how-to-guess-accurately-3-lottery-numbers-out-of-6-using-lstm-model-e148d1c632d6
@@arnolddalby5552 wow that's something else but thank you for sharing!
So I tried it. Not many errors but one so thank you for that.
In the "y_pred = model.predict.. print("The predicted numbers in the last lottery game are:", scaler.inverse...) = [-8 -9 2 12 24].
Output is very odd regarding the previous results, not in order which previous results are in order, and negative numbers like; -8 -9....
I really don't get why it isn't in order the results from today aren't even close, order is messed up
so how can I get close to the upcoming results, get the numbers of lottery tickets in order and no -8 -9 numbers at all?
Hi! Great video, question when I run train = np.empty I recive this error; only integer scalar arrays can be converted to a scalar index. Any idea about the reason why?
Sounds like you have a full stop instead of a comma separating your data. Your lottery numbers are just integers between 1 to 59 as example.
@@arnolddalby5552 thanks for your reply! Actually I'm ussing a coma in the array to separate the data. Im using another range of numbers, dtypes is showing me that all numbers are integers, can't figure out what is the problem
@@arnolddalby5552 Hi, I'm also getting an error when I run train = np.empty, I'm getting a ValueError: negative dimensions are not allowed. Any reason why. The instructor also seems to have come across an issue in that part of the video, not sure. Please help.
Hi Arnold, İ used the program and im now a millionaire!
more or less, right?
Nice Bro, very interessant . A good base to start. Where and how did you learn Artificiel Intelligence ? Why you chose LSTM is it a unsupervised model ? :)
Thanks a lot for the video! I just have a question, sometimes I got repetitive numbers in the prediction, what should I do so that the prediction will not give repetitive numbers? Thanks
Lower the 240 to 120 to 80 to 32 and test. Lower 7 last games to 2.
thanks a lot!
ok i want to use the full history for my lottery. how can i do that and only get predictions that sum up to from 68-112? is this possible
Which lottery are you playing?
@@arnolddalby5552 I did it. How can Imake it make more then 1 prediction and also how can I input more them 5 combos?
Hi, How can you get the historic lottery numbers from a csv file?
Go to National Lottery website Draw History. www.national-lottery.co.uk/results/lotto/draw-history
Nice video Arnold! In my country there's a lottery that you need to pick 1 number between 0 and 99. How to modify the code to make predictions with such constrain?
You need a different type of AI that predicts the next number from previous winning numbers. See
machinelearningmastery.com/sequence-prediction/
@@arnolddalby5552 Interesting I will check it out. Thanks!
May I ask. I'm new to the site. What website is this? Love your video!!
Hi Rochelle, wishing you all success. Read this new article and code which may help on your journey to many lottery prizes. medium.com/@polanitzer/how-to-guess-accurately-3-lottery-numbers-out-of-6-using-lstm-model-e148d1c632d6
@@arnolddalby5552 Thanks so much!!! :)
Your missing a very important step. Converting a pd. Dataram to a np.array
hai bro, nice video , how to get 2 or more out put results bro, it would be more use full bro
I don't think 7 draws is enough to find a pattern, some numbers are overdue for 44 draws. It's best to use a 50 draw preset.
I finally found the template setup and I get what I have to change and add. But can I use this in Visual Studio Code? Is Jupyter free to use? Or do you suggest another free application or website to use this?
Download Anaconda which is free and has Jupyter built into it. It cannot be used with Visual Studio. Wishing you every success and many lottery wins.
@@arnolddalby5552 Will do! Thanks for being so honest.
- Is there also a way to tell it not to use the number; 0 for example? And use numbers that are most used in the results of the winning lottos?
- Why "Bidirectional(LSTM(240,...))" and why use that 3 times?
- I used most of your codes but at the end of code "scaled_predict_output_1.... print(scaler.inverse_transform)" I get an error which says "valueerror" or "outputs are collapsed". How do you suggest to fix this problem?
I am working on the daily million for Ireland which is 1-39. Where should I put this?
Daily million is 6 balls plus bonus so you can put 6 or 7 balls into the pd.dataframe and delete my numbers. you will have to add G to column list as well. Run as usual and test or play.
@@arnolddalby5552 Thanks Arnold
Gambler's fallacy.
I'm not sure how it's making predictions based on past draws, number 19 was out for at least 15 games before it hit tonight. One thing these programs have trouble doing is predicting oldest numbers.
As there isn't a consistent pattern.
Not even AI can predict a totally random event. Waste of effort.
thanks for the video, any link for the code used? how to change the range of numbers and detection of output to be 5 numbers instead of 6?
Hi Ahmed, I will do a 5 number video for you and leave code in description if I can. I do have a 5 number version which is very similar. This weekend.
@@arnolddalby5552 great, thanks Arnold
@@arnolddalby5552 I would like to try it too. A 5 number version with number between 1 and 90.
Aparentemente o resultado previsto pelo código já está incluido na base dados para treinamento do código. Por favor me corrija se eu estiver errado, mas ele está prevendo um resultado já conhecido. Se for isso ele não está prevendo nada..
I wrote a python script using a history csv file I will see how the generated combinations perform.
great video! Question: ModuleNotFoundError: No module named 'keras'
Sounds like you need to install keras using pip install keras from cmd line. I used Andaconda python 3.6 installation.
where is the validation???
Hi I don’t know how to get on to the website your showing so can som one help me please
Similar code in basic form is here. click github.com/luwei250002695/keras-lstm-to-predict-lottery-game-many_to_many
This shows how dump people are applying a predictive model on a totally random things lol
Jesse Lara UA-cam channel talks about how lottery numbers get created.
Everyone should visit your UA-cam channel as your a great thinker Jesse Lara.
Let’s code a ai to predict sportsbet and then lol
Kann man diesen Code irgendwie kaufen oder zugeschickt bekommen?
medium.com/@polanitzer/how-to-guess-accurately-3-lottery-numbers-out-of-6-using-lstm-model-e148d1c632d6
It is better to use icdst Ai predict lstm model.
Try it as you my need to optimise different models for your local lottery by backtesting. Wishing you all success, you can do it.
how I can get the scrip version of your code?
Google: LottoMasterAi (gumroad) this code on YT is public, not working good, predictions are also useless, may problems etc.
medium.com/@polanitzer/how-to-guess-accurately-3-lottery-numbers-out-of-6-using-lstm-model-e148d1c632d6
yes you can but numbers are still random everytime. and still you doing youtube videos so its not work xD
Can you share the AI
The AI is changing all the time and UA-cam won't let me post it as it's full of non characters. Sorry.
@@arnolddalby5552 can you help me recreate it?
@@arnolddalby5552 can you email me the app?
Not going to work.... because the assumptions are even wrong
Great so why do I keep getting winning tickets and tax free cash. Hahaha.
@@arnolddalby5552 the processed data is not a real life time series, but in your case, I would say.... luck
Ok
I can conclude that you are not yet a millionaire !
Honestly u can’t figure it they use more then one computer and all of them are AI then they coin flip to pick which computer to use for that draw 🤷🏾♂️ it’s over pack it up u can’t predict it
Your correct it is impossible but the AI neural network LSTM model doesn't know that. Hahaha. I won many tax free prizes which funds more research for free. hahaha. He who dares wins. hahaha.
They never use computer, they use alghorythm class.
im rich now
Code???
Code already in other answers.
WTF so interesting hahahah
Hello can share code?
Hi Luk, try this code as it's similar but better model. Wishing you many prizes. medium.com/@polanitzer/how-to-guess-accurately-3-lottery-numbers-out-of-6-using-lstm-model-e148d1c632d6
Lo
Are you lost man? any idea what are you doing....?
Well, every time I go to my local newsagents with a winning ticket and get the tax free cash I thank the AI Keras Gods for small mercies. Hahaha.
@@arnolddalby5552 How many percent of accuracy does this project have? I have tried, but why can't AI predict true even just one number in today's lottery result?
What a way to waste time. They are independent trials. Unless you think they aren't of course in which case you probably need to go see a doctor.
Thanks, I will let my doctor know. Hahaha.
@@arnolddalby5552 At least you have a sense of humour
Posta o código pra download?
medium.com/@polanitzer/how-to-guess-accurately-3-lottery-numbers-out-of-6-using-lstm-model-e148d1c632d6
8:44 yes predict there is it never correct. you can do past games to see it LOL
and example not even work thats so suprice. why need allways update working libraries so same not work new versions lol
Your correct about the updates and new versions. That's why I won't be updating the libraries. Hahaha. The program isn't supposed to get all numbers every week otherwise the lottery would be obsolete. The program does win prizes more often than a lucky dip or picking numbers yourself. It also wins more prizes if used as a syndicate.
Is this software for sales?
No it's free because you can make it better by tinkering with it. Look, professional AI developers usually create over 100 different models and test them.
@@arnolddalby5552 I'm not developer.. I was looking for one program for me.. who can I reach?
Hi can you please email me the code?