In this repository, various machine learning algorithms in 「Pattern Recognition and Machine Learning」are implemented without using machine learning packages such as scikit-learn
.
All the algorithms are implemeted in the directory prml
. In short_notebook
directory, I use prml
package (which I make myself). This notebooks are short-version, so
this is useful when you want to see how these algorithms work.
However, many people must want to know how these algorithms are implemented. These notebooks in notebook
directory
meet this need. In notebook
, nothing of prml
is used. All algorithms are implemented in almost the same way as prml
. You can write and modify the code in jupyter notebook.
Notebooks
- chapter2 probability distributions
- chapter3 linear regression
- chapter4 linear classifier
- chapter5 neural network
- chapter6 kernel methods
- chapter7 sparse_kernel_machine
- chapter8 graphical models
- chapter9 mixture models
- chapter10 approximate inference
- chapter11 sampling methods
- chapter12 continuous latent variables
- chapter13 sequential data
- chapter14 combining_models
Short Notebooks
- chapter2 probability distributions(short ver)
- chapter3 linear regression(short ver)
- chapter4 linear classifier(short ver)
- chapter5 neural network(short ver)
- chapter6 kernel methods(short ver)
- chapter7 sparse_kernel_machine(short ver)
- chapter8 graphical models(short ver)
- chapter9 mixture models(short ver)
- chapter10 approximate inference(short ver)
- chapter11 sampling methods(short ver)
- chapter12 continuous latent variables(short ver)
- chapter13 sequential data(short ver)
- chapter14 combining_models(short ver)
There are three suggested ways to set up the environment to run this python repository. There are many other ways to set up, but Example2 may be
the best way (because it doesn't take so much time to build docker image)
Example1
You can clone this repository and make virtual environment.
# clone repository and make venv
git clone https://github.com/hedwig100/PRML && cd PRML
chmod 755 setup.sh && ./setup.sh
python3 -m venv prml_venv
source prml_venv/bin/activate
pip install -r requirements.txt # in virtual environment
pip install notebook
Example2
You can clone this repository and build docker image.
You need to have docker installed.
# clone repository and build docker image
git clone https://github.com/hedwig100/PRML && cd PRML
docker build -t prml .
docker run -it --name prml -p 8888:8888 prml /bin/bash
# in docker container
cd PRML && ./setup.sh
in docker container, you can use jupyter notebook
command.
Example3
You can pull docker image from docker hub. This image is uploaded to docker hub.
In this way, you cannot see document because no document is in the docker container.
# pull docker image and run
docker pull hedwig100/prml:latest
docker run -it --name prml -p 8888:8888 hedwig100/prml:latest /bin/bash
# in docker container
cd PRML && ./setup.sh
in docker container, you can use jupyter notebook
command.