This is a collection of machine learning code examples in different languages and libraries.
For machine learning I prefer to code in Jupyter Notebooks (my current version is 5.7.4). There are additional Jupyter kernels available for other languages than Python, which is great if you wanna try out some stuff in Weka or R. I use the following kernels:
A list of Jupyter kernels can be found here. You can check which kernels you have installed with the command jupyter kernelspec list
Keras contains examples using Keras (checked for version 2.2.5) with TensorFlow backend (checked for version 1.14.0).
R contains a few examples using R (checked for version 3.4.2). I am not a huge R fan, but have written some examples for students that prefer R.
Weka contains some examples using the Weka API (checked for version 3.8.3). The main benefit of Weka is its GUI, but learning how to use the API can sometimes be useful.
sklearn contains examples using Scikit-learn (checked for version 0.20.3). I usually prefer Scikit-learn for most tasks, along with Keras for deep learning.
data contains the datasets used in the code examples.
images contains example images used for the pre-trained image recognition example in the Keras folder.
- Clone the GitHub repository to your computer
- Run the Jupyter TensorFlow notebook and attach the notebooks directory by running the following command in a terminal:
docker run --rm -p 8888:8888 -v [put your local path here]/ml-sk:/home/jovyan jupyter/tensorflow-notebook
- Copy the URL you see in the terminal (http://127.0.0.1:8888/?token=...) and paste it in a web browser
- Now you are ready to start hacking!
R:
docker run --rm -p 8888:8888 -v [put your local path here]/ml-sk:/home/jovyan jupyter/R-notebook
Jupyter Notebook with R support.
Java:
docker run --rm -p 8888:8888 -v [put your local path here]/ml-sk:/home/jovyan jbindinga/java-notebook
Jupyter Notebook with Java support.
Jupyter extended:
docker run --rm -p 8888:8888 -v [put your local path here]/ml-sk:/home/jovyan jhagelback/jupyter-ext
Extended Jupyter Tensorflow notebook (available at Docker Hub) with some additional packages:
- XGBoost, OpenCV, mtcnn, gensim, pyod, import-ipynb