Skip to Content
面向数据科学家的实用统计学
book

面向数据科学家的实用统计学

by Peter Bruce, Andrew Bruce
October 2018
Beginner to intermediate
238 pages
6h 32m
Chinese
Posts & Telecom Press
Content preview from 面向数据科学家的实用统计学
168
|
第
6
章
loan_df[attr(knn_pred,"nn.index"),]
payment_inc_ratio dti revol_bal revol_util
2081 2.61091 1.03 1218 9.7
36054 2.22024 0.79 1687 8.4
23655 2.34286 1.12 523 10.7
41327 2.15987 0.69 2115 8.1
39555 2.76891 0.75 2129 9.5
可以看到,这时所显示的
5
个近邻数据中,所有的变量都与新记录的对应值非常接近,这
样的结果更直观。需要注意的是,虽然结果以是数据的原始比例显示的,但是
KNN
是应
用于经过缩放的数据以及要预测的新贷款上的。
z
分数只是一种重新调整变量尺度的方式。均值可以替换成更稳健的位置估
计量,例如中位数。同样,标准偏差也可以使用其他的缩放估计量替换,例
如四分位距。在一些情况下,变量已被“压缩”到
[0, 1]
区间内。我们也应
认识到,为了得到单位变异性而对每个变量进行缩放,其中可能存在一定的
随意性。这意味着,我们认为每个变量在预测能力上具有同等的重要性。如
果我们只根据自己的主观认识,判定一些变量比其他变量更重要,那么我们
可以放大这些变量。例如,对于贷款数据,我们完全有理由认为支出与收入
的比率非常重要。
标准化(归一化)并不会改变数据的分布形状。如果数据并不符合正态分
布,那么标准化后也不会符合正态分布(参见
2.6
节 )。
6.1.5
 
K
值的选取
K
值的选取对
KNN
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的智能文本分析

Benjamin Bengfort, Rebecca Bilbro, Tony Ojeda
Python数据处理

Python数据处理

Jacqueline Kazil, Katharine Jarmul
精通機器學習

精通機器學習

Aurélien Géron
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9787115493668