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数据科学手册
330
|
第
5
章
关于
TF–IDF
分类问题的示例,请参见
5.5
节。
5.4.3
 图像特征
机器学习还有一种常见需求,那就是对
图像
进行编码。我们在
5.2
节处理手写数字图像时
使用的方法,是最简单的图像编码方法:用像素表示图像。但是在其他类型的任务中,这
类方法可能不太合适。
虽然完整地介绍图像特征的提取技术超出了本章的范围,但是你可以在
Scikit-Image
项目
(
http://scikit-image.org
)中找到许多标准方法的高品质实现。关于同时使用
Scikit-Learn
和
Scikit-Image
的示例,请参见
5.14
节。
5.4.4
 衍生特征
还有一种有用的特征是输入特征经过数学变换衍生出来的新特征。我们在
5.3
节从输入数
据中构造
多项式特征
时,曾经见过这类特征。我们发现将一个线性回归转换成多项式回归
时,并不是通过改变模型来实现,而是通过改变输入数据!这种处理方式有时被称为
基函
数回归
(
basis function regression
),详细请参见
5.6
节。
例如,下面的数据显然不能用一条直线描述(如图
5-35
所示):
In[10]: %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
x = np.array([1, 2, 3, 4, 5])
y = np.array([4, 2, 1, 3, 7])
plt.scatter(x, y);
图 5-35:不能用直线拟合的数据
但是我们仍然用
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