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 面向数据科学家的实用统计学
170
|
第
6
章
borrow_knn <- knn(borrow_df, test=borrow_df, cl=loan_data[, 'outcome'],
prob=TRUE, k=10)
prob <- attr(borrow_knn, "prob")
borrow_feature <- ifelse(borrow_knn=='default', prob, 1-prob)
summary(borrow_feature)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.0000 0.4000 0.5000 0.5012 0.6000 1.0000
命令的结果是一个特征,表示了基于历史数据对借款者拖欠可能性的预测。
本节要点
• KNN
通过指定与一条记录相似的记录所属的类,实现对该记录的分类。
•
可以使用欧氏距离或其他相关度量判定相似度(距离)。
•
与一条记录进行比较的最近邻数(即
K
值),取决于使用不同
K
值时,算法在训练
数据上的性能。
•
预测变量通常需要做标准化,以避免大尺度变量主导了距离度量。
• KNN
常常作为预测建模过程的第一个阶段。
KNN
的预测值会作为一个
预测变量
添
加回数据中,进而用于第二阶段(非
KNN
)的建模。
6.2
 树模型
树模型也被称为
分类与回归树
(
CART
)
3
、
决策树
(或简称为
树
),它是一种有效的分类和
回归方法,最早由利奥
•
布莱曼等人在
1984
年提出,并得到了广泛的使用。在数据科学中
做回归和分类时,树模型及其更加强大的衍生方法 ...
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