Skip to Content
Python算法交易实战
book

Python算法交易实战

by Posts & Telecom Press, Sebastien Donadio
May 2024
Intermediate to advanced
306 pages
5h 5m
Chinese
Packt Publishing
Content preview from Python算法交易实战

第3章 通过基础机器学习预测市场

在第2章中,我们学习了如何设计交易策略、创建交易信号以及实施高级概念,例如交易工具的季节性。更仔细地理解这些概念涉及广阔的领域,包括随机过程、随机漫步、鞅和时间序列分析,你可以按照自己的节奏去探索。

那么接下来讲什么呢?让我们了解一种更先进的预测和预报方法:统计推理和预测。这就是所谓的机器学习,其基本原理是在19世纪和20世纪初发展起来的,并且一直在发展。近来,由于可以获得极具成本效益的处理能力和易于获得的大型数据集,人们对机器学习算法及其应用的兴趣再度上升。机器学习是一个庞大的领域,处于线性代数、多元微积分、概率论、频率论和贝叶斯统计学的交叉点,而深入分析机器学习也超出了本书的范围。然而,机器学习方法在Python中非常容易理解并且相当直观,所以我们将解释这些方法背后的直觉,并看看它们如何在算法交易中应用。首先,让我们介绍一些基本概念和符号。

本章将介绍以下主题。

 了解术语和符号。

 使用线性回归方法创建预测模型。

 使用线性分类方法创建预测模型。

为了快速拓宽思路并建立关于供求关系的“直觉”,我们有一个简单且完全假设的数据集,其中包括从调查中获得的几个随机样本的身高(Height)、体重(Weight)和种族(Race)。让我们来看看这个数据集,如表3-1所示(1inch=25.4mm,1lb≈0.454kg)。

表3-1

Height /inch

Weight /lb

Race

72

180

Asian

66

150

Asian

70

190

African

75

210

Caucasian

64

150

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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu
写给系统管理员的Python脚本编程指南

写给系统管理员的Python脚本编程指南

Posts & Telecom Press, Ganesh Sanjiv Naik
实时数据处理和分析指南

实时数据处理和分析指南

Posts & Telecom Press, Shilpi Saxena, Saurabh Gupta

Publisher Resources

ISBN: 9781836202554