Skip to content

Machine learning code examples in Scikit-learn, Keras, Weka and R

License

Notifications You must be signed in to change notification settings

jhagelback/ml-sk

Repository files navigation

Machine Learning examples

This is a collection of machine learning code examples in different languages and libraries.

Jupyter kernels

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:

  • IJava for Java (available here)
  • IRKernel for R (available here)

A list of Jupyter kernels can be found here. You can check which kernels you have installed with the command jupyter kernelspec list

Folders

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.

Run using Docker

  1. Clone the GitHub repository to your computer
  2. 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
  3. Copy the URL you see in the terminal (http://127.0.0.1:8888/?token=...) and paste it in a web browser
  4. Now you are ready to start hacking!

Other Docker files

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

About

Machine learning code examples in Scikit-learn, Keras, Weka and R

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published