https://github.com/mickaelbergem/shannonuniversalpredictor
Shannon Universal Predictor
https://github.com/mickaelbergem/shannonuniversalpredictor
cpp prediction-algorithm python3 shannon-predictor
Last synced: 9 months ago
JSON representation
Shannon Universal Predictor
- Host: GitHub
- URL: https://github.com/mickaelbergem/shannonuniversalpredictor
- Owner: MickaelBergem
- Created: 2015-10-30T12:40:16.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-06-11T12:58:43.000Z (over 7 years ago)
- Last Synced: 2025-01-19T12:49:18.809Z (10 months ago)
- Topics: cpp, prediction-algorithm, python3, shannon-predictor
- Language: C++
- Homepage:
- Size: 707 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shannon Universal Predictor
Predicts the bit you are about to type, because hey, you are a poor entropy source ;)
Your goal is to get the lowest predictability score possible.
## Python implementation
```bash
cd src-py
python3 algorithm.py -h
# Manual game: the higher the predictor's score, the lowest is your entropy
python3 algorithm.py
# Try with random input (using Python's random module)
# this should tend to 50%
python3 algorithm.py -p random
# Or load from a file
python3 algorithm.py -p file -i example.txt
```
Demo with manual input:

## C++ implementation
```bash
cd src-cpp
g++ main.cpp -o predictor
./predictor
```