import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import urllib.request
import os
%matplotlib inline
print("Tensorflow版本是:",tf.__version__)
2、下载泰坦尼克号上旅客的数据集
data_url="http://biostat.mc.vanderbilt.edu/wili/pub/Main/DataSets/titanic3.xls"
data_file_path="E:/titanic3.xls"
if not os.path.isfile(data_file_path):
result=urllib.request.urlretrieve(data_url,data_file_path)
print('downloaded;',result)
else:
print(data_file_path,'data file already eists.')
一、数据准备1、导入相关的库import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltimport pandas as pdimport urllib.requestimport os%matplotlib inlineprint("Tensorflow版本是:",tf.__version__)2、下载泰坦尼克号上旅客的数据集data_url="http://biostat.mc.van