Skip to Content
Python数据科学手册
book

Python数据科学手册

by Jake VanderPlas
January 2018
Intermediate to advanced
470 pages
13h 23m
Chinese
Posts & Telecom Press
Content preview from Python数据科学手册
210
|
第
4
章
图 4-28:自定义误差线
除了这些选项之外,你还可以设置水平方向的误差线(xerr)、单侧误差线(
one-sided
errorbar
),以及其他形式的误差线。关于误差线的更多选项,请参考 plt.errorbar 的程序
文档。
4.5.2
 连续误差
有时候可能需要显示连续变量的误差。虽然
Matplotlib
没有内置的简便方法可以解决这个
问题,但是通过 plt.plot 与 plt.fill_between 来解决也不是很难。
我们将用
Scikit-Learn
程序库
API
里面一个简单的
高斯过程回归方法
(
Gaussian process
regression
,
GPR
)来演示。这是用一种非常灵活的非参数方程(
nonparametric function
)对
带有不确定性的连续测量值进行拟合的方法。这里不会详细介绍高斯过程回归方法的具体
内容,而是将注意力放在数据可视化上面:
In[4]: from sklearn.gaussian_process import GaussianProcess
# 定义模型和要画的数据
model = lambda x: x * np.sin(x)
xdata = np.array([1, 3, 5, 6, 8])
ydata = model(xdata)
# 计算高斯过程拟合结果
gp = GaussianProcess(corr='cubic', theta0=1e-2, thetaL=1e-4, thetaU=1E-1, ...
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

Luciano Ramalho
Python数据分析基础

Python数据分析基础

Clinton W. Brownley
Python数据处理

Python数据处理

Jacqueline Kazil, Katharine Jarmul

Publisher Resources

ISBN: 9787115475893