python报错 - module 'sklearn' has no attribute 'datasets'

import sklearn as skl
    print( skl.__version__ )   # 0.17.1

    from sklearn import datasets #includes importable relationships, but no attribute relationships
    '''
    #iris = skl.datasets.load_iris() #Error, because there is no attribute relationship
    module 'sklearn' has no attribute 'datasets'
    
Attachment: the difference between from import and import
    1、from numpy import zeros
    The zeros() function can be called directly
    2、import numpy.zeros
    Only the full name numpy.zeros can be used
    '''
    iris = datasets.load_iris()

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325544193&siteId=291194637