import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
iris=pd.read_csv("D:Testiris1.csv")
iris.describe()
from sklearn.preprocessing import LabelEncoder
iris["style"]=LabelEncoder().fit_transform(iris["style"].values.reshape(-1,1))
from sklearn.preprocessing import StandardScaler
column_list=["sl","sw","pl","pw"]
for i in range(len(column_list)):
iris[column_list[i]]=StandardScaler().fit_transform(iris[column_list[i]].values.reshape(-1,1))
x=iris[["sl","sw","pl","pw"]]
y=iris["style"]
#KMeans聚类
from sklearn.cluster import KMeans
kmeans=KMeans(n_clusters=4)
kmeans.fit(x)
pre_label=kmeans.labels_
#print(pre_label)
x0=x[pre_label==0]
x1=x[pre_label&#
相关知识
鸢尾花三种聚类算法(K
利用GMM对鸢尾花聚类
卷积神经网络实现鸢尾花数据分类python代码实现
有了K均值聚类,为什么还需要DBSCAN聚类算法?
使用K
Python实现Iris数据集(鸢尾花卉数据集)meanshift聚类
对鸢尾花数据集和月亮数据集,分别采用线性LDA、k
数据分析之鸢尾花简单分析
鸢尾花的分类(四种方法)
北京地区引种宿根花卉抗旱性评价
网址: 数据分析之鸢尾花KMEANS,层次,DBSCAN 聚类简单实现,评价指标:兰德系数,轮廓系数 https://m.huajiangbk.com/newsview546425.html
上一篇: 数据挖掘之鸢尾花数据集分析 |
下一篇: 利用 ChiMerge 分析鸢尾 |