当前位置:网站首页>Machine learning interview preparation (I) KNN
Machine learning interview preparation (I) KNN
2022-06-30 10:42:00 【Start learning AI】
Catalog
One 、 Briefly KNN Principle of algorithm ?
Two 、KNN The three elements of the algorithm
3、 ... and 、 How to understand K Choice of value
Four 、kd What is a tree and its function ?
5、 ... and 、KNN Advantages and disadvantages
One 、 Briefly KNN Principle of algorithm ?
KNN(K-Nearest Neighbor) It is a basic classification and regression method , Given a training data set , For new input instances , Find the nearest... To the instance in the dataset K An example , If this K Most of the instances belong to a class , Put the input instance into this category .
KNN Learning process without display , In fact, it uses the training data set to divide the feature space , And as a model for its classification .
Two 、KNN The three elements of the algorithm
Distance metric : It is generally used LP distance .(P=1, Manhattan distance ;P=2, Euclidean distance ;P=∞, Chebyshev distance )
K It's worth choosing : Usually choose a small number , Usually, cross validation is used to select the best K value .
Classification decision rules : The majority voting rule is generally adopted
3、 ... and 、 How to understand K Choice of value
If K Smaller value selection , It is equivalent to using training examples in smaller fields to predict ,“ Study ” The approximate error of will be reduced , But the estimation error will increase , If the adjacent point is noise , The prediction will go wrong . in addition ,K A decrease in value means that the overall model becomes more complex , It's easy to get fitted .
If K It's worth choosing more , It is equivalent to using training examples in a larger field to predict , The estimation error of learning will be reduced , The approximation error will increase , This is far from the input instance ( Dissimilar ) Examples can also play a role in Forecasting , Make a prediction wrong ,K Increasing the value means that the overall model becomes simpler .
In the application , Usually choose a small number , Usually, cross validation is used to select the best K value .
Four 、kd What is a tree and its function ?
KNN The simplest way to do this is to do a linear scan , Because the distance is calculated for each instance , So when the training set is large , The training instance dimension is very high , The calculation will be very time-consuming . In order to improve the KNN Search efficiency , May adopt kd Tree to store data
5、 ... and 、KNN Advantages and disadvantages
Reference resources :
《 Statistical learning method 》
Dr. Jane's personal space _ Bili, Bili _Bilibili
边栏推荐
- 技能梳理[email protected]体感机械臂
- MySQL index, transaction and storage engine of database (3)
- 05_Node js 文件管理模块 fs
- Tooltips in the era of touch
- go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)
- 【深度学习】深度学习检测小目标常用方法
- Smith chart view of semi steel coaxial RF line and RF line matching calibration of network analyzer e5071c
- ArcGIS Pro scripting tool (5) - delete duplicates after sorting
- Apple's 5g chip was revealed to have failed in research and development, and the QQ password bug caused heated discussion. Wei Lai responded to the short selling rumors. Today, more big news is here
- 苹果高管公然“开怼”:三星抄袭 iPhone,只加了个大屏
猜你喜欢
RobotFramework学习笔记:环境安装以及robotframework-browser插件的安装
[email protected]體感機械臂"/>
技能梳理[email protected]體感機械臂
Getting started with X86 - take over bare metal control
Great Wall digital art digital collection platform releases the creation Badge
MySQL index, transaction and storage engine of database (2)
Basic MySQL operation commands of database
The performance of arm's new CPU has been improved by 22%, up to 12 cores can be combined, and the GPU is first equipped with hardware optical tracking. Netizen: the gap with apple is growing
马斯克推特粉丝过亿了,但他在线失联已一周
Use keil5 software to simulate and debug gd32f305 from 0
Voir le changement technologique à travers la Légion Huawei (5): Smart Park
随机推荐
Yixian e-commerce released its first quarterly report: adhere to R & D and brand investment to achieve sustainable and high-quality development
透過華為軍團看科技之變(五):智慧園區
Koreano essential creates a professional style
The programmer was beaten.
SGD有多种改进的形式,为什么大多数论文中仍然用SGD?
安徽《合肥市装配式建筑施工图审查设计深度要求》印发;河北衡水市调整装配式建筑预售许可标准
断路器HystrixCircuitBreaker
技能梳理[email protected]+阿里云+nbiot+dht11+bh1750+土壤湿度传感器+oled
June training (day 30) - topology sorting
如何解决跨域
吴恩达2022机器学习专项课测评来了!
微信推出图片大爆炸功能;苹果自研 5G 芯片或已失败;微软解决导致 Edge 停止响应的 bug|极客头条...
ArcGIS Pro脚本工具(5)——排序后删除重复项
历史上的今天:微软收购 PowerPoint 开发商;SGI 和 MIPS 合并
半钢同轴射频线的史密斯圆图查看和网络分析仪E5071C的射频线匹配校准
ionic4 ion-reorder-group组件拖拽改变item顺序
Harvester ch1 of CKB and HNS, connection tutorial analysis
Collectors.toMap应用
GD32 RT-Thread DAC驱动函数
2022 Season 6 perfect children's model toxon division finals came to a successful conclusion