Git Product home page Git Product logo

ml_trading_assess_learners's Introduction

Machine Learning Algorithms for Trading (Part 2)

Assess various Learners

There are two parts:

1) Implement decision tree learner, random tree learner, bag learner and insane learner

  • DTLearner.py: The random tree learner is based on J.R. Quinlan's paper. Other than addEvidence and query, this learner also has:

    • __build_tree: A private function called by addEvidence. It builds the decision tree recursively by choosing the best feature to split on and the splitting value. The best feature has the highest absolute correlation with dataY. If all features have the same absolute correlation, choose the first feature. The splitting value is the median of the data according to the best feature.
    • __tree_search(self, point, row): A private function called by query. It recursively searches the decision tree matrix and returns a predicted value for a given query.
    • get_learner_info: It print out a tree in the form of a pandas dataframe if verbose is set to True.
  • RTLearner.py: The random tree learner is based on A. Cutler's algorithm. It has a similar API to DTLearner, but has a few key differences regarding __build_tree:

    • The choice of feature to split on is be made randomly.
    • For the chosen feature, calculate the mean of feature values from two randomly-chosen rows. This mean will be the splitting value for the feature.
  • BagLearner.py: Implement Bootstrap Aggregating as a Python class named BagLearner. BagLearner can accept any learner (e.g., RTLearner, LinRegLearner, etc.) as input and use it to generate a learner ensemble.

  • InsaneLearner.py: InsaneLearner should contain 20 BagLearner instances where each instance is composed of 20 instances of LinRegLearner or another learner.

2) Evaluate learners

  • analyze_learners_util.py: contains the helper functions to proccess, train, test and plot data.

  • analyze_learners.ipynb: uses helper functions from analyze_learners_util.py to evaluate different learners.

Setup

You need Python 2.7.x or 3.x, and the following packages: pandas, numpy, and scipy.

Run

To run any script file, use:

python <script.py>

To run any IPython Notebook, use:

jupyter notebook <notebook_name.ipynb>

Source: Part 3 of Machine Learning for Trading by Georgia Tech

ml_trading_assess_learners's People

Contributors

ntrang086 avatar

Watchers

 avatar  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.