IBM / powerai-market-sentiment

Built for developers familiar with IBM Power systems that are looking to leverage IBM's new PowerAI offering for machine learning.
https://developer.ibm.com/patterns/accelerate-training-of-machine-learning-algorithms/
Apache License 2.0
33 stars 21 forks source link
cognitive data-science ibm ibm-developer-technology-cognitive ibmcode jupyter-notebook nimbix nimbix-cloud-platform notebook powerai

Evaluating predictability of financial markets using New York Times sentiments and market data.

Read this in other languages: 한국어.

In this Code Pattern we will use a Jupyter notebook to showcase an example of machine learning with time series on IBM Power8 systems. The notebook will focus on evalulating the predictability of future financial market values in the "renewable energy" sector by examining related markets and sentiment detected in New York Times news articles.

When the reader has completed this Code Pattern, they will understand how to:

The intended audience for this Code Pattern is application developers who need to efficiently build powerful deep learning applications, but who may not have an abundance of time or data science experience.

Flow

  1. The developer loads the provided notebook, which is run on a PowerAI system.
  2. As the notebook is run, it uses data from The New York Times and market data.
  3. The notebook uses the IBM Watson Natural Language Understanding service to analyze the text.
  4. The notebook uses TensorFlow and machine learning to develop models and predictions.

Included components

Featured technologies

Watch the Video

Steps

Follow these steps to setup and run this Code Pattern. The steps are described in detail below.

  1. Get 24-hours of free access to the PowerAI platform
  2. Access and start the Jupyter notebook
  3. Run the notebook
  4. Analyze the results
  5. Save and share
  6. End your trial

1. Get 24-hours of free access to the PowerAI platform

IBM has partnered with Nimbix to provide cognitive developers a trial account that provides 24-hours of free processing time on the PowerAI platform. Follow these steps to register for access to Nimbix to try the PowerAI Cognitive Code Patterns and explore the platform.

Go to the IBM Marketplace PowerAI Portal, and click Request Trial.

On the IBM PowerAI Trial page, shown below, enter the required information to sign up for an IBM account and click Continue. If you already have an IBM ID, click Already have an account? Log in, enter your credentials and click Continue.

On the Almost there… page, shown below, enter the required information and click Continue to complete the registration and launch the IBM Marketplace Products and Services page.

Your IBM Marketplace Products and Services page displays all offerings that are available to you; the PowerAI Trial should now be one of them. From the PowerAI Trial section, click Launch, as shown below, to launch the IBM PowerAI trial page.

The Welcome to IBM PowerAI Trial page provides instructions for accessing the trial, as shown below. Alternatively, you will receive an email confirming your registration with similar instructions that you can follow to start the trial.

Summary of steps for starting the trial:

2. Access and start the Jupyter notebook

Use git clone to download the example notebook and data with a single command.

git clone https://github.com/IBM/powerai-notebook

3. Run the notebook

When a notebook is executed, what is actually happening is that each code cell in the notebook is executed, in order, from top to bottom.

Each code cell is selectable and is preceded by a tag in the left margin. The tag format is In [x]:. Depending on the state of the notebook, the x can be:

There are several ways to execute the code cells in your notebook:

Notes:

4. Analyze the results

The result of running the notebook is a report which may be shared with or without sharing the code. You can share the code for an audience that wants to see how you came your conclusions. The text, code and output/charts are combined in a single web page. For an audience that does not want to see the code, you can share a web page that only shows text and output/charts.

The graphs and charts produced in this Code Pattern attempt to prove that the closing value of the Nasdaq Clean Energy Index can be predicted by examining various input sources, such as the New York Times and other financial markets, both foreign and domestic. These markets include:

Collect Data

The notebook begins by collecting and formatting data:

Analyze Data

The notebook then utilizes EDA (exploratory data analysis) methods to find correlations in the data. These findings include:

The final analysis from the EDA are as follows:

Train and Test Data

After determining this correlation in the data, the notebook then uses TensorFlow and the IBM PowerAI machine learning framework to train and test the data.

After hundreds of thousands of iterations over the data using multiple models, the notebook is able to achieve a 70% success rate for predicting whether the Nasdaq Energy Index would close up or down on any given day.

5. Save and share

How to save your work:

Because this notebook is running temporarily on a Nimbix Cloud server, the options to saving and sharing the notebook are limited.

Under the File menu, there are options to:

6. End your trial

When you are done with your work, please cancel your subscription by issuing the following command in your ssh session or by visiting the Manage link on the My Products and Services page.

sudo poweroff --force

Troubleshooting

See DEBUGGING.md.

Links

Learn more

License

This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.

Apache Software License (ASL) FAQ