Scikit Learn-K最近邻居(KNN)

Scikit Learn-K最近邻居(KNN) (Scikit Learn - K-Nearest Neighbors (KNN))

This chapter will help you in understanding the nearest neighbor methods in Sklearn.

本章将帮助您了解Sklearn中最接近的邻居方法。

Neighbor based learning method are of both types namely supervised and unsupervised. Supervised neighbors-based learning can be used for both classification as well as regression predictive problems but, it is mainly used for classification predictive problems in industry.

基于邻居的学习方法有两种类型,即有监督的无监督的。 有监督的基于邻居的学习既可以用于分类预测问题,也可以用于回归预测问题,但是它主要用于行业中的分类预测问题。

Neighbors based learning methods do not have a specialised training phase and uses all the data for training while classification. It also does not assume anything about the underlying data. That’s the reason they are lazy and non-parametric in nature.

基于邻居的学习方法没有专门的训练阶段,而是在分类时将所有数据用于训练。 它还不假定有关基础数据的任何信息。 这就是它们本质上是惰性和非参数化的原因。

The main principle behind nearest neighbor methods is −

最近邻方法的主要原理是-

  • To find a predefined number of training samples closet in distance to the new data point

    查找距离新数据点最近的壁橱中预定数量的训练样本

  • Predict the label from these number of training samples.

    从这些训练样本数量中预测标签。

Here, the number of samples can be a user-defined constant like in K-nearest neighbor learning or vary based on the local density of point like in radius-based neighbor learning.

在这里,样本数可以是用户定义的常数,例如在K近邻学习中,也可以根据点的局部密度而变化,例如在基于半径的邻居学习中。

sklearn.neighbors模块 (sklearn.neighbors Module)

Scikit-learn have sklearn.neighbors module that provides functionality for both unsupervised and supervised neighbors-based learning methods. As input, the classes in this module can handle either NumPy arrays or scipy.sparse matrices.

Scikit-learn具有sklearn.neighbors模块,该模块为无

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值