Skip to Content
金融中的机器学习
book

金融中的机器学习

by Posts & Telecom Press, Jannes Klaas
May 2024
Intermediate to advanced
408 pages
6h 8m
Chinese
Packt Publishing
Content preview from 金融中的机器学习

第8章 调试和发布产品

在前面7章中,我们已经开发了大量的机器学习算法工具。我们可以用它们来解决金融领域的机器学习问题。为了让这些工具更加完美实用,我们来看一下如果算法不起效,你应该怎么做?

机器学习模型以最糟糕的方式失效,那就是静默。在传统软件中,一个错误通常会导致程序崩溃。尽管这让用户很恼火,但程序崩溃对程序员却很有帮助。至少代码错误是明确的,而且开发人员经常会发现附带的故障报告,报告会描述发生了什么问题。然而,当你阅读完这本书并开始开发自己的模型时,有时也会遇到机器学习代码崩溃的情况。例如,如果你输入算法中的数据有格式错误,就可能导致机器学习代码崩溃。

这些问题通常可以通过仔细跟踪数据在什么位置以及具有何种形态来进行调试。然而,更常见的情况是失败的模型只是输出了糟糕的预测结果,但不会给出故障信号,以致你可能没意识到它们出故障了。但在其他时候,模型没有训练得很好,它不会收敛或者不会取得较低的损失率。

在本章中,我们将聚焦于如何调试这些静默的错误,使它们不会影响你创建的机器学习算法,具体讨论以下主题。

  • 在数据中寻找那些能导致模型缺陷的错误。
  • 通过创造性技巧使模型从更少的数据中学到更多信息。
  • 在生产或训练中使用单元测试数据(unit testing data),以确保符合标准。
  • 注意隐私和法规(例如欧盟的相关条例)。
  • 准备训练数据并避免常见的陷阱。
  • 检查模型并探视“黑匣子”。
  • 寻找最优超参。
  • 调整学习率来减少过拟合。
  • 使用TensorBoard监控训练过程。
  • 部署机器学习产品并对其进行迭代。
  • 加速训练和推理。

在调试程序之前,你要了解的是,即使是优秀的机器学习工程师也会经常失败。机器学习项目失败的原因有很多,而大多数原因与工程师的技能无关,所以不要认为机器学习失败了就是你的错。 ...

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

Spark机器学习实战

Spark机器学习实战

Posts & Telecom Press, Siamak Amirghodsi, Meenakshi Rajendran, Broderick Hall, Shuen Mei
Python计算机视觉和自然语言处理

Python计算机视觉和自然语言处理

Posts & Telecom Press, Álvaro Morena Alberolaï, Gonzalo Molina Gallegoï, Unai Garay Maestreï
写给系统管理员的Python脚本编程指南

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

Posts & Telecom Press, Ganesh Sanjiv Naik

Publisher Resources

ISBN: 9781836203452