资源简介
TensorFlow DNNRegressor的简单使用,包括代码和所生成的用于 TensorBoard 可视化的文件
代码片段和文件信息
# coding: utf-8
# 详细可以参考 http://blog.csdn.net/u010099080/article/details/72824899
import numpy as np
import pandas as pd
import tensorflow as tf
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
import seaborn as sns
boston = load_boston()
boston_df = pd.Dataframe(np.c_[boston.data boston.target] columns=np.append(boston.feature_names ‘MEDV‘))
LABEL_COLUMN = [‘MEDV‘]
FEATURE_COLUMNS = [f for f in boston_df if not f in LABEL_COLUMN]
X_train X_test y_train y_test = train_test_split(boston_df[FEATURE_COLUMNS] boston_df[LABEL_COLUMN] test_size=0.3)
print(‘训练集:{}\n测试集:{}‘.format(X_train.shape X_test.shape))
# ## 定义 FeatureColumns
feature_cols = [tf.contrib.layers.real_valued_column(k) for k in FEATURE_COLUMNS]
# ## 定义 regressor
config = tf.contrib.learn.RunConfig(gpu_memory_fraction=0.3 log_device_placement=False)
regressor = tf.contrib.learn.DNNRegressor(feature_columns=feature_cols
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1775 2017-06-02 22:04 TensorFlow-DNNRegressor\boston-tensorflow-dnnregressor.py
文件 130 2017-06-02 21:17 TensorFlow-DNNRegressor\dnnregressor\checkpoint
文件 146040 2017-06-02 21:17 TensorFlow-DNNRegressor\dnnregressor\eval\events.out.tfevents.1496409475.ALAN-MIBOOKAIR
文件 194312 2017-06-02 18:20 TensorFlow-DNNRegressor\dnnregressor\events.out.tfevents.1496398833.ALAN-MIBOOKAIR
文件 661725 2017-06-02 21:17 TensorFlow-DNNRegressor\dnnregressor\events.out.tfevents.1496409457.ALAN-MIBOOKAIR
文件 336765 2017-06-02 21:17 TensorFlow-DNNRegressor\dnnregressor\graph.pbtxt
文件 337198 2017-06-02 18:20 TensorFlow-DNNRegressor\dnnregressor\graph.pbtxt.tmp54df31fd23424c2db67693d4ae89b347
文件 74772 2017-06-02 21:17 TensorFlow-DNNRegressor\dnnregressor\model.ckpt-1.data-00000-of-00001
文件 596 2017-06-02 21:17 TensorFlow-DNNRegressor\dnnregressor\model.ckpt-1.index
文件 133112 2017-06-02 21:17 TensorFlow-DNNRegressor\dnnregressor\model.ckpt-1.me
文件 74772 2017-06-02 21:17 TensorFlow-DNNRegressor\dnnregressor\model.ckpt-5000.data-00000-of-00001
文件 596 2017-06-02 21:17 TensorFlow-DNNRegressor\dnnregressor\model.ckpt-5000.index
文件 133112 2017-06-02 21:17 TensorFlow-DNNRegressor\dnnregressor\model.ckpt-5000.me
..AD... 0 2017-06-02 21:52 TensorFlow-DNNRegressor\dnnregressor\eval
..AD... 0 2017-06-02 21:52 TensorFlow-DNNRegressor\dnnregressor
..AD... 0 2017-06-02 21:52 TensorFlow-DNNRegressor
----------- --------- ---------- ----- ----
2094905 16
相关资源
- zw_学习OpenCV(中文版).zip
- 1-300.pdf
- pyqt5windows生成二维工具源码
- KNN疾病预测算法Demo
- ABAQUS单元失效浅析(单元删除
- Jtopo+json格式数据代码
- 解多目标规划的单纯形代码
- TerraVolVoxelTerrainEngine2.1c.7z
- VA_X_Setup2118.rar
- CHS_Ha_PasswarekitEnterprise10.0.exe
- 无线通信AndreaGoldsmith杨鸿文等译.rar
- 迅捷PDF转换器破解版.rar
- 迅捷PDF编辑器破解版.rar
- 金字塔原理1清晰扫描版.pdf
- TeamViewer_11已激活+破解版+随意换ID.z
- FieldtheoryofGuidedwavesCollin__2nd.pdf
- 先进电气驱动的分析建模与控制[比
- IPC-J-STD033潮湿、回流焊敏感表面贴装
- 网络是怎样连接的_户根勤.pdf
- tesseract最新最全资料.rar
- 大话数据结构.epub
- iBATIS实战.pdf
- zw_new_smile-7110337-ImageAnimationTest.zip
- zw_jhn199388-9911706-基于51单片机都_自动
- zw_fan7983377-9600053-RecyclerViewDemo.zip
- zw_CHINA__.zip
- 我的第一本算法书+算法图解.zip
- 数学物理方法_德顾樵编著_2012.01_545页
- zw_WKTConvert.zip
- tdxw.exe
评论
共有 条评论