April 25, 2007

Building an AI financial market model — Lesson II

In this tutorial I want to show you how to use MultiObjective Feature Selection (MOFS) in RapidMinerIt’s a great technique to simultaneously reduce your attribute set and maximize your performance (hence: MultiObjective). This feature selection process can be run over and over again for your AI Financial Market Model, should it begin to drift.

Load in the Process from Tutorial One

Start by reading the Building an AI Financial Market Model — Lesson 1 post. At the bottom of that post you can download the RapidMiner process.

Add an Optimize Selection (Evolutionary) operator

The data that we pass through the process contains the adjusted closing prices of the S&P500, 10 Year Bond Yield, and the Philadelphia Gold. Feature Selection let’s us chose which one of these attributes contributes the most to the overall model performance, and which really don’t matter at all.

To do that, we need to add an Optimize Selection (Evolutionary) operator.

ai2-processai2-process

Why do you want to do MultiObjective Feature Selection? There are many reasons but most important of all is that a smaller data set increases your training time by reducing consumption of your computer resources.

When we execute this process, you can see that the Optimize Selection (Evolutionary) operator starts evaluating each attribute. At first, it measures the performance of ALL attributes and it looks like it’s all over the map.

ai2-generation0ai2-generation0

How it measures the performance is with a Cross Validation operator embedded inside the subprocess.

ai2-crossvalidationai2-crossvalidation

ai2-gbtai2-gbt

 

The Cross Validation operator use a Gradient Boosted Tree algorithm to analyze the permutated inputs and measures their performance in an iterative manner. Attributes are removed if they don’t provide an increase in performance.

ai2-20generationsai2-20generations

MultiObjective Feature Selection Results

From running this process, we see that the following attributes provide the best performance over 25 iterations.

ai2-selectedfeaturesai2-selectedfeatures

ai2-parametersai2-parameters

Note: We choose to have a minimum of 5 attributes returned in the parameter configuration. The selected ones have a weight of 1.

The resulting performance for this work is below.

ai2-performanceai2-performance

The overall accuracy was 66%. In the end predicting and UP trend was pretty decent, but not so good for the DOWN trend.

The possible reason for this poor performance is that I purposely made a mistake here. I used a Cross Validation operator instead of using a Sliding Window Validation operator.

The Sliding Window Validation operator is used to backtest and train a time series model in RapidMiner and we’ll explain the concepts of Windowing and Sliding Window Validation in the next Lesson.

Note: You can use the above method of MultiObjective Feature Selection for both time series and standard classification tasks.

That’s the end of Lesson  for your first AI financial market model. You can download the above sample process here. To install it, just go to File > Import Process. Lesson 3 will be updated shortly.

This is an update to my original 2007 YALE tutorials and are updated for RapidMiner v7.0. In the original set of posts I used the term AI when I really meant Machine Learning

 

Posted by Thomas Ott



tutorials RapidMiner


Previous post
Building an AI financial market model - Lesson I Before you can begin with building your own AI Financial Market Model (machine learned), you have to decide on what software to use.  Since I wrote
Next post
Building an AI financial market model - Lesson III In Lesson 2, I went over the concept of MultiObjective Feature Selection (MOFS). In this lesson we’ll build on MOFS for our model but we’ll forecast