Skip to Content
Hands-On Machine Learning for Algorithmic Trading
book

Hands-On Machine Learning for Algorithmic Trading

by Stefan Jansen
December 2018
Beginner to intermediate
684 pages
21h 9m
English
Packt Publishing
Content preview from Hands-On Machine Learning for Algorithmic Trading

Gradient-boosting machine

For illustration purposes, we also train a LightGBM gradient-boosting tree ensemble with default settings and the multiclass objective:

param = {'objective':'multiclass', 'num_class': 5}booster = lgb.train(params=param,                    train_set=lgb_train,                    num_boost_round=500,                    early_stopping_rounds=20,                    valid_sets=[lgb_train, lgb_test])

The basic settings do not improve on multinomial logistic regression, but further parameter tuning remains an unused option:

y_pred_class = booster.predict(test_dtm_numeric.astype(float))accuracy_score(test.stars, y_pred_class.argmax(1) + 1)0.738665855696524
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Machine Learning for Algorithmic Trading - Second Edition

Machine Learning for Algorithmic Trading - Second Edition

Stefan Jansen

Publisher Resources

ISBN: 9781789346411Supplemental Content