Personal Projects

HMS

Development in-progress

img

note

The hospital management system (HMS) is an integrated and secure web application useful for hospital staff and patients. Features included but not limited to book doctor appointments, keep track of medical history and prescriptions, manage billings and hospital workflows.

Spring Boot FusionAuth Spring Security Spring Config MongoDB


Florida Lottery Powerball Winning Number Generator and Predictor

An effort to make sense out of random winning numbers in last 10 years

img

note

Medium Post

Odds of winning the Powerball lottery jackpot is 1:222M. Despite of known understanding that the drawn numbers are completely random, this project is an effort to identify pattern in jackpot winning draws based on the history of Powerball draws.

This project uses neural network algorithm to classify the draw to be winning or losing. Random number generator tool generates n random draws which are then passed through the Multilayer Perceptor Classifier to find out the winning numbers. Classifier accuracy has been measured upto 97.4% (which also means there is 2.6% of tolerance). It should be noted that the numbers generated by this project may not be the next jackpot, but it certainly increases the chances of winning the jackpot. Generated numbers may not be the next jackpot, but it will eventually be in future draws.

Disclaimer: This project is mere an experiment. Owner of this project is not responsible of any monetory or emotional loss. Also, owner is not willing to grab any piece of monetory gain done by the generated numbers. User should understand that the generated numbers are mere suggestions, and not the jackpot number as yet.

Spring Boot Machine Learning scikit-learn Python

Project Details

Dataset source

http://www.flalottery.com/exptkt/pb.pdf

Machine Learning

Library : scikit-learn https://scikit-learn.org/stable/
Scripting : Python
File operations : Pandas
Classifiers :
- MLPClassifier https://scikit-learn.org/stable/modules/generated/sklearn.neural_network.MLPClassifier.html
- SGDClassifier https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html

Random Number Generator

  • Application name : winners-analysis
  • Type : Spring Boot with RestController to trigger number generation and writing to csv

Technical Details

The dataset

  • Powerball winning number data from Florida Lottery website
  • Mega Millions winning number data from Florida Lottery website
  • Pdf data transformed into csv
  • Training data set prepared by mixing winning and random losing numbers

Number Generator : The Spring project : winners-analysis

It generates n draws containing numbers which are randomly generated. The ranges of numbers are :

1 : 1-69
2 : 1-69
3 : 1-69
4 : 1-69
5 : 1-69
PB : 1-26

These generated numbers are written to csv file which can be used as test data for the machine learning model.

Below APIs can be used to generate the draws

GET /draw/generate/{n} : Generate n draws and write to csv file which can be supplied to machine learning model for prediction

GET /draw/repeatedRandom/{n} : Generate m draws (โˆ€m <= n) and write to csv file that can be supplied to machine learning model for prediction. The generated draws are the repeated combination of the draws when random numbers generated n times. Theory says these numbers may have higher chances to be the jackpot number. Also, it returns ~1300 out of 1 million random generated draws, which are then passed through the model results in ~20 lucky numbers.

Machine learning model

Multi-layer Perceptron model with 100 hidden layers has been used to reach accuracy ~ 97%.

Below steps are used to perform machine learning:

  • Collect training data (csv) generated by winners-analysis Spring project.
  • Read csv using pandas library and split train and test data with 20% test data.
  • Initialize MLPClassifier from sklearn.neural-network
from sklearn.neural_network import MLPClassifier
clf = MLPClassifier(alpha=1, max_iter=5000)
  • Fit training data into the classifier
  • Predict output for the test data and calculate the accuracy
from sklearn.metrics import accuracy_score
score = accuracy_score(y_test, y_pred)

Activity

Pick the latest draw winning and pass through the model for prediction. There is 97% chances the result is going to be winning.

TODO

  • Automate end to end flow
  • Deploy and make it available for public
  • Real-time retraining the model after each Powerball draw to improve the accuracy over the period

Quoter Space

note

http://www.quoter.space

Quoter is a web application which displays random quotes with beautiful vector graphics on the background. The special thing about this application is that its completed handcrafted, even the font.

Angular Spring Boot Docker