from sklearn.datasets import load_iris

iris = load_iris()

"""
Explanation: Sklearn comes with multiple preloaded datasets for data manipulation, regression, or classification. They are loaded with the following commands
Classification datasets:
 - iris (4 features - set of measurements of flowers - 3 possible flower species)
 - breast_cancer (features describing malignant and benign cell nuclei)
 - digits (hand-written digits stored as 64 numerical array representing 8x8 black/white images)  
 - wine (13 numeric features - 3 possibile wine classes)
Regression datsets:
- boston (13 numeric/categorical features - predict housing prices from boston)
- diabetes (10 numeric features - used to predict disease progression)  
Multivariate regression:
 - linnerud (3 numeric features - phsyical exercises - 3 numeric observations on weight, waist, pulse)
Loading dataset:
from sklearn.datasets import load_name
name = load_name()
End of explanation
"""


import pandas as pd

iris_features_df = pd.DataFrame(data=iris.data,
                               columns=iris.feature_names)

iris_features_df.head(2)

iris_target_df = pd.DataFrame(data=iris.target,
                               columns=["Species"])

iris_target_df.head(2)

list(iris.target_names) #0 - setosa, 1 - versicolor, 2- virginica

"""
Explanation: Accessing dataset:
To see this options, type iris. then tab after importing.
Select any of the following:<br>
iris.data<br>
iris.DESCR<br>
iris.feature_names<br>
iris.target<br>
iris.target_names<br>
Examining dataset
End of explanation
"""


print(iris.DESCR)

"""
Explanation: Printing description of dataset
End of explanation
"""


from sklearn.datasets import load_breast_cancer,load_boston,load_diabetes,load_linnerud,load_digits

datasets = {'Iris':load_iris() ,'Breast Cancer':load_breast_cancer(),'Boston':load_boston(),
            'Diabetes':load_diabetes(),'Linnerud':load_linnerud()}

for dataset in datasets:
    print("\n** {} **".format(dataset))
    print('{}'.format(datasets[dataset].feature_names))

"""
Explanation: Feature Names
Note: digits has no feature_names
End of explanation
"""


datasets = {'Iris':load_iris() ,'Breast Cancer':load_breast_cancer(),'Digits':load_digits(),'Linnerud':load_linnerud()}

for dataset in datasets:
    print("\n** {} **".format(dataset))
    print('{}'.format(datasets[dataset].target_names))

"""
Explanation: Target Names
End of explanation
"""


datasets = {'Iris':load_iris() ,'Breast Cancer':load_breast_cancer(),'Boston':load_boston(),'Digits':load_digits(),
            'Diabetes':load_diabetes(),'Linnerud':load_linnerud()}

for dataset in datasets:
    print("\n** {} **".format(dataset))
    print('{}'.format(datasets[dataset].data.shape))

"""
Explanation: Shapes
End of explanation
"""


