Giter VIP home page Giter VIP logo

bayesian_foundations's Introduction

Course 1: Bayesian Foundations Notebooks

This repo is for UpSkill ML's 💻 Course 1 of Bayesian Foundations 💻.

You have two options to run this code either:

  1. Working through a Binder online or
  2. Downloading the code and working with it locally.

Working the code through "My Binder"

My Binder is a free service that will set up a light-weight virtual dockerized python container. It will contain the set of notebooks for this course for you to work with so you don't need to download the code locally.

To access it click the link below and it will create a jupyter notebook environment for you that is already pre-configured with the appropriate libraries.

Binder

It is free to work with and requires no sign-up on your end. It will take a couple of minutes to spin up the container so be patient.

Note that sessions do expire if you are not actively work with the notebooks so you may need to "reload" a session if you step away from it for more than 30 minutes.

Working with Code Locally

Pulling code

In this section we will go through pulling down the code for use in the UpSkill ML Bayesian Foundations course.

Using a terminal:

  1. Open a terminal
  2. Navigate to a folder where you would like to clone the the code
  3. Run the following command
git clone https://github.com/jtouyz/Bayesian_foundations
  1. A new folder will be created with the code

Downloading the ZIP

Navigate to https://github.com/jtouyz/Bayesian_foundations and press the green code button. Select Download Zip. Unzip it on a place on your desktop.

Setting up your virtual environment

It is recommended that you set up a virtual environment or run the code in a container. There are several approaches to creating a virtual environment and is generally considered best practice.

Below we demonstrate how to set up a virtual environment with venv:

  1. Open a terminal and navigate to where you want to create your virtual environment
  2. Once you have use the following piece of code:
python3 -m venv Bayesian_foundations
  1. Using the same terminal or open a terminal activate your virtual envrionment using:

Mac command:

source Bayesian_foundations/bin/activate

Windows command:

Bayesian_foundations\Scripts\activate.bat
  1. Once you've set up your virtual environment there are 4 main libraries we will work with throughout this code. They are pandas, numpy, scipy, plotnine, tensorflow and tensorflow-probability. Run the following set of code to install those libraries:
pip3 install numpy scipy pandas plotnine tensorflow tensorflow-probability
  1. Next you will install several jupyter notebooks (or labs if you're feeling fancy) so that you can run through the code. To do that run the following set of commands:
pip3 install jupyterlab
  1. Now you are ready to run the code! Navigate to the same directory you downloaded the repo's notebooks and run the following
jupyter-lab

or for the classic notebook:

jupyter-notebook

When running the code, make sure to select the python3 kernel which is associated virtual environment in which you installed the required libraries. This can be done by clicking on the kernel tab in the navigation menu (once you've started a notebook) or selecting the python environment located at the top right of the running notebook.

Workaround for Big Sur (Mac)

There are some known problems with using SciPy on Big Sur. Until they are resolved the following steps propose an alternate route to get started:

  1. Download Anaconda : Individual Edition https://www.anaconda.com/products/individual
  2. Install Anaconda via downloaded package
  3. Open Anaconda Navigator
  4. Click the JupyterLab “Launch” button a. go to the directory where the course repository was downloaded b. open 1_p1_Bayes_theorem_ad_example_beta_binomial.ipynb
  5. Open Terminal app or launch a new tab if already open; the new Z shell should look like (already in Anaconda’s base environment): (base) user@node a. cd into course project directory b. run the following to install plotnine conda install -c conda-forge plotnine
  6. All done, Enjoy the course.

bayesian_foundations's People

Contributors

jtouyz avatar

Stargazers

 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.