用TensorFlow创建FNN神经网络模型,梯度下降采用Adagrad,使用dropout防止过拟合,尝试保存模型再调用的操作。
import tensorflow as tf
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import metrics
#定义读取数据的函数
def load_data(train_path=""):
train=pd.read_csv(train_path,names=["feature1", "feature2" ,"feature3" ,"feature4" ,"feature5",
"feature6" ,"feature7" ,"feature8", "feature9" ,"feature10",
"feature11" ,"feature12", "feature13" ,"feature14", "feature15" ,
"feature16" ,"feature17" ,"feature18", "feature19", "feature20",
"feature21" ,"feature22", "feature23" ,"feature24" ,"feature25",
"feature26", "feature27", "feature28" ,"feature29", "feature30",
"feature31" ,"feature32", "feature33", "feature34" ,"feature35",