sklearn之load_iris数据集

from sklearn.datasets import load_iris
from sklearn.preprocessing import MinMaxScaler
from sklearn.cluster import KMeans
iris = load_iris()
iris_data = iris['data']
iris_target = iris['target']
iris_names = iris['feature_names']
scale = MinMaxScaler().fit(iris_data)#训练模型
iris_dataScale = scale.transform(iris_data)
kmeans = KMeans(n_clusters=3,random_state=123).fit(iris_dataScale)
print(kmeans)
result = kmeans.predict([[1.5,1.5,1.5,1.5]])
print(result[0])


 

你可能感兴趣的:(sklearn,python,人工智能)