1. 首页
  2. 人工智能
  3. 机器学习
  4. python下的k邻近小例子

python下的k邻近小例子

上传者: 2021-04-19 18:01:16上传 PY文件 1.13KB 热度 10次
import numpy as np import matplotlib.pyplot as plt from sklearn.neighbors import NearestNeighbors # Input data X = np.array([[1, 1], [1, 3], [2, 2], [2.5, 5], [3, 1], [4, 2], [2, 3.5], [3, 3], [3.5, 4]]) # Number of neighbors we want to find num_neighbors = 3 # Input point in
下载地址
用户评论