MachineLearningWithPYTHON

在这里插入图片描述

%matplotlib inline
%matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import mglearn
import sys
print(“Python version:{}”.format(sys.version))
Python version:3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
import pandas as pd
print(“pandas version:{}”.format(pd.version))
pandas version:0.22.0
import matplotlib
print(“matplotlib version:{}”.format(matplotlib.version))
matplotlib version:2.1.2
import numpy as np
print(“Numpy version:{}”.format(np.version))
Numpy version:1.14.0
import scipy as sp
print(“SciPy version:{}”.format(sp.version))
SciPy version:1.0.0
import IPython
print(“IPython version:{}”.format(IPython.version))
IPython version:6.2.1
import sklearn
print(“scikit-learn version:{}”.format(sklearn.version))
scikit-learn version:0.19.1

A first application:Classifying Iris Species
Goal:build a machine learning model that can learn from the measurements of these irises whose species is known, and we can predicted the species the new iris.
Because we have measurement for which we know the correct species ,so this machine learning is a Supervised Learning.and this a classification Problem,the output called :”classes”.
The desired output for a single data is the species this flower, the species it belongs to is call “label”
For example:
#this a c;assical dataset in the machine learning and statistics so we can call the "load_iris "function in the scikit-learn
from sklearn.datasets import load_iris
iris_dataset=load_iris()
#the iris object is return by load_iris(which seems like a dictory which has keys and values )
print(“Keys of iris_dataset:\n{}”.format(iris_dataset.keys()))

Keys of iris_dataset:
dict_keys([‘data’, ‘target’, ‘target_names’, ‘DESCR’, ‘feature_names’])

print(iris_dataset[‘DESCR’][:]+"\n")

Iris Plants Database

Notes

Data Set Characteristics:
:Number of Instances: 150 (50 in each of three classes)
:Number of Attributes: 4 numeric, predictive attributes and the class
:Attribute Information:
- sepal length in cm
- sepal width in cm
- petal length in cm
- petal width in cm
- class:
- Iris-Setosa
- Iris-Versicolour
- Iris-Virginica
:Summary Statistics:

============== ====
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值