上传者: 38721252
|
上传时间: 2022-05-14 19:57:27
|
文件大小: 123KB
|
文件类型: PDF
代码实现及说明
# python 3.6
# TensorFlow实现简单的鸢尾花分类器
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from sklearn import datasets
sess = tf.Session()
#导入数据
iris = datasets.load_iris()
# 是否是山鸢尾 0/1
binary_target = np.array([1. if x == 0 else 0. for
x in