Learn practical skills, build real-world projects, and advance your career

Note: This is a mirror of a project from leadingindia interns to showcase jovian.

Intro to the project:

Video Introduction:

Stock Market Prediction

Video Link
Project Description (By Orignal Author):

The project looks at performing sentiment analysis on the Yelp Academic Dataset to predict Stock Market Pricings

Benefits of using Jovian:
  • Requirements:
    The orignal code repository doesn't mention the requirements to run the code. The setup for Keras and other libraries might require some iterations and guess work which might take a lot of efforts.

  • Setup issues:
    Different versions of the frameworks might cause issues with the current server setup. In this case, Keras required CUDA version 9.x and the system was setup at the latest CUDA 10.x version which caused needed a lot of debugging and a complete re-installation later. Once the code is pushed to jovian, all of the dependancies are handled by jovian and the complete installation is a one-click process.

  • Experiments:
    GitHub showcases different notebooks which can be confusing. However, the authors have run multiple experiments which aren't best documented. Jovian allows hosting multiple versions of the experiments and comparing the best results here, which also allows communicating the efforts in the project. (Presenting one simple notebook may not communicate the efforts required for a 1-month project in the best fashion for example).

  • Replication:
    Jovian also enables us to host the dataset along with the output pickle files from the experiment. This saves the time required to re-train the model, one can simply run the notebook and perform inference.

Setup and How to is mentioned below:

System setup

Jovian makes it easy to share Jupyter notebooks on the cloud by running a single command directly within Jupyter. It also captures the Python environment and libraries required to run your notebook, so anyone (including you) can reproduce your work.

Option 1: Run Online:
  • At the Top of the notebook you can find a one-click run online button for:
    • Run on MyBinder
    • Run on Collab
    • Run on Kaggle Kernels
Option 2: Run on Local Machine:

Here's what you need to do to get started:

Install Anaconda by following the instructions given here. You might also need to add Anaconda binaries to your system PATH to be able to run the conda command line tool.
Install the jovian Python library by the running the following command (without the $) on your Mac/Linux terminal or Windows command prompt:

pip install jovian --upgrade

Download the notebook for this tutorial using the jovian clone command:

$ jovian clone <notebook_id>

(You can get the notebook_id by clicking the 'Clone' button at the top of this page on https://jvn.io)

Running the clone command creates a directory 01-pytorch-basics containing a Jupyter notebook and an Anaconda environment file.

$ ls StockMarketPredictions

Now we can enter the directory and install the required Python libraries (Jupyter, PyTorch etc.) with a single command using jovian:

$ cd StockMarketPredictions
$ jovian install

Jovian reads the environment.yml file, identifies the right dependencies for your operating system, creates a virtual environment with the given name (01-pytorch-basics by default) and installs all the required libraries inside the environment, to avoid modifying your system-wide installation of Python. It uses conda internally. If you face issues with jovian install, try running conda env update instead.

We can activate the virtual environment by running

$ conda activate <env_name>

For older installations of conda, you might need to run the command: <env_name>

Once the virtual environment is active, we can start Jupyter by running

$ jupyter notebook

You can now access Jupyter's web interface by clicking the link that shows up on the terminal or by visiting http://localhost:8888 on your browser.

Getting the Dataset:

Download from DropBox