Giter VIP home page Giter VIP logo

livebook_examples's Introduction

Elixir Livebook examples

A collection of Livebook .livemd examples with training datasets.

Salary prediction

Elixir Livebook

Training time: 0.637s

Compiling EXLA

First time you run the Livebook notebook it will probably need to compile exla, which requires bazel to be installed.

EXLA on macOS Big Sur

On macOS Big Sur this worked:

% export BAZEL_VERSION=3.1.0
% curl -fLO "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/$ bazel-${BAZEL_VERSION}-installer-darwin-x86_64.sh"
% chmod +x "bazel-${BAZEL_VERSION}-installer-darwin-x86_64.sh"
% ./bazel-${BAZEL_VERSION}-installer-darwin-x86_64.sh --user
EXLA on RaspberryPi 4
$ wget https://github.com/bazelbuild/bazel/releases/download/3.4.0/bazel-3.4.0-linux-arm64
$ chmod u+x bazel-3.4.0-linux-arm64
$ ./bazel-3.4.0-linux-arm64
$ cd ~/bin
$ ln -s /home/pi/dev/bazel/bazel-3.4.0-linux-arm64 bazel

Erlang prerequisites on Linux

$ apt-get -y install build-essential autoconf libncurses5-dev libwxbase3.0-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils openjdk-11-jdk

Install Erlang and Elixir:

Next step is to run Livebook, which requires Erlang and Elixir to be installed.

% git clone https://github.com/asdf-vm/asdf.git ~/.asdf
% . $HOME/.asdf/asdf.sh
% asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
% export KERL_CONFIGURE_OPTIONS="--without-javac --enable-lock-counter --with-microstate-accounting=extra"
% asdf install erlang 24.0-rc3
% asdf global erlang 24.0-rc3
% asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
% asdf install elixir 1.12.0-rc.1-otp-24
% asdf global elixir 1.12.0-rc.1-otp-24

% cat ~/.zshrc
export PATH="$PATH:$HOME/bin"

. $HOME/.asdf/asdf.sh

Compile Livebook and start it:

% git clone https://github.com/elixir-nx/livebook.git
% cd livebook
% mix deps.get --only prod
% MIX_ENV=prod mix phx.server

Python3 version

Training time: 2.860s

% cd salary_prediction
% python3 salary_prediction.py

Jupyter Notebook

Training time: 12.639s

% cd salary_prediction
% jupyter notebook

Google Colab

Training time: 23.478s

% cd salary_prediction
% jupyter notebook  --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0

Upload salaries.csv to your Google Drive and add this at the top of the notebook:

from google.colab import drive
drive.mount('/content/gdrive')
!cat ./gdrive/MyDrive/MachineLearning/salaries.csv

Then update the cell to read_csv from your actual path.

livebook_examples's People

Contributors

michalslaski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.