- 博客(3)
- 收藏
- 关注
原创 【聚类】kmeans 三维或多维聚类,代码例子
此处展示的是三维的k均值聚类,可以修改为多维的聚类,直接增加x的维度就好了import numpy as npfrom sklearn.cluster import KMeansfrom sklearn.metrics import silhouette_scoreimport matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dcolo = ['b', 'g', 'r', 'c', 'm', 'y', 'k']x =
2022-05-26 18:12:37
12332
5
原创 反转链表(带头结点和不带头结点)C语言完整代码
#include <stdio.h>#include <stdlib.h>#include <time.h>#define ElemType inttypedef struct Node{ ElemType data; struct Node* next;} Node;typedef struct Node* Linklist;Linklist CreatListHead(int n); //头插法创建链表void ShowList(Linkl
2020-12-08 15:59:36
538
1
原创 Python--遍历列表时删除元素避免漏删
// An highlighted blocka = [1,2,3,4,5,6,7,8]i = 0while i < len(a): if a[i] > 5: i = i + 1 else: del a[i] print(a)
2020-08-20 10:35:09
210
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人