摘要: import numpy as npfrom sklearn.datasets import load_irisfrom sklearn import tree# 对三种花分类# 导入数据部分iris = load_iris() # 加载数据print(iris.feature_names) # 打 阅读全文
posted @ 2017-08-20 10:57 Ootori 阅读(444) 评论(0) 推荐(0) 编辑
摘要: from sklearn import tree# 第一个简单的分类器features = [[140, 1], [130, 1], [150, 0], [170, 0]] #列表左边的变量代表水果的重量,右边的1代表表面光滑,0代表有疙瘩labels = [0, 0, 1, 1] #0代表苹果,1 阅读全文
posted @ 2017-08-20 10:05 Ootori 阅读(424) 评论(0) 推荐(0) 编辑
摘要: import tensorflow as tf# 熟悉tensorflow的变量定义和运行方式v1 = tf.Variable(2) #定义变量并给变量赋值v2 = tf.Variable(48)c1 = tf.constant(16) #定义常量并赋值c2 = tf.constant(3)addv 阅读全文
posted @ 2017-08-20 10:02 Ootori 阅读(1105) 评论(0) 推荐(0) 编辑