Scraping Nonograms to build a solver using machine learning
What and Why?
Nonograms are logic puzzles that create an image when solved. Originally invented in the 1980's by two different people simultaneously, and became popular in the late 80s-90s. Now they're known by almost 30 different names, the most popular ones being nonograms, hanjie puzzles, picross puzzles, and griddlers. The clues on the side and top denote which squares should be empty or filled in. The numbers denote the black squares and each group of black squares must be separated by at least one empty space. Here's a really simple puzzle being solved step-by-step.
Each move has a reason and nothing is a guess. My dad, after ordering a book of puzzles, thought they might be a good machine learning project. So this web scraping project is the first step of building a nonogram solver using machine learning.
|colClues||, , ,1,1, , , ,1,1, , , , ,3, , , , ,4, , , , ,4, , , ,2,6, , ,2,2,2, , ,4,2,2, ,3,1,2,1,1,2,2,1,1, ,1,1,2,1, , ,2,4,1, , ,2,1,2, , , ,7,4|
|rowClues||, , , , , , , ,1, , , , , , , , , , , , , , ,1,1,1, , , , , , , , , , ,1,2,2,2,1,2,1, ,2, , , ,1, , ,8,3,2,1,1,1,2,3,2,1,4, , ,2,4,10,2,2,1,1,1,1,1,1,1,1,2,2,1|
For my code and data, visit my GitHub Page: https://github.com/susarip/test/tree/master/hanjie_scraper/hanjie_scraper
- Convert output images (solutions) into data which becomes the Y value
- Split input data set into training set and test set (90:10)
- Use the training set to train a few statistical machine learning algorithms
- Use the test set to test the trained model
- If the accuracy is good enough, use the model to predict answers for new puzzles.
- Areas of research: Use neural networks to find answers instead of statistical models