scikit-learn 中 iris 数据集的信息描述
1、从 sklearn 中加载数据
from sklearn.datasets import load_iris iris = load_iris()
2、打印相关信息(一)
print('1、Type of iris dataset:\n{}'.format(type(iris))) print('\n2、keys of iris:\n{}'.format(iris.keys())) print('\n3、Describe of iris dataset:\n{}'.format(iris['DESCR'][:193] + '\n...')) print('\n4、Target names of iris dataset:\n{}'.format(iris.target_names)) print('\n5、Feature names of iris dataset:\n{}'.format(iris.feature_names))
输出

3、打印相关信息(二)
print('\n6、The type of data in the iris dataset:\n{}'.format(type(iris['data']))) print('\n7、The shape of data in the iris dataset:\n{}'.format(iris['data'].shape)) print('\n8、The first seven rows of data in the iris dataset:\n{}'.format(iris['data'][:7])) print('\n9、The type of target in the iris dataset:\n{}'.format(type(iris['target']))) print('\n10、The shape of target in the iris dataset:\n{}'.format(iris.target.shape)) print('\n11、The target in the iris dataset:\n{}'.format(iris.target))
输出

非学无以广才,非志无以成学。

浙公网安备 33010602011771号