通过读取sklearn自带鸢尾花数据包,编程实现计算属性的相关性,数据可视化(要求:根据数据属性特点,绘制散点图)
import sklearn.datasets as datasets
X, d = datasets.load_iris(return_X_y=True)
print(X)
print(X.shape)
print(d)
import numpy as np
X, d = datasets.load_iris(return_X_y=True)
np.savez("iris.npz", data=X, target=d)
iris_file = np.load("iris.npz")
X = iris_file["data"]
d = iris_file["target"]
print(X.shape, d.shape, X.dtype, d.dtype)
import matplotlib.pyplot as plt
plt.switch_backend("