当前位置: 首页 > news >正文

泊头做网站价格手机网站分辨率做多大

泊头做网站价格,手机网站分辨率做多大,做电影网站需要那种服务器,用cn作网站行么0 前言 #x1f525; 优质竞赛项目系列#xff0c;今天要分享的是 机器学习大数据分析项目 该项目较为新颖#xff0c;适合作为竞赛课题方向#xff0c;学长非常推荐#xff01; #x1f9ff; 更多资料, 项目分享#xff1a; https://gitee.com/dancheng-senior/po…0 前言 优质竞赛项目系列今天要分享的是 机器学习大数据分析项目 该项目较为新颖适合作为竞赛课题方向学长非常推荐 更多资料, 项目分享 https://gitee.com/dancheng-senior/postgraduate 1 数据集介绍 ​ df pd.read_csv(‘/home/kesci/input/jena1246/jena_climate_2009_2016.csv’) df.head() 如上所示每10分钟记录一次观测值一个小时内有6个观测值一天有1446x24个观测值。 给定一个特定的时间假设要预测未来6小时的温度。为了做出此预测选择使用5天的观察时间。因此创建一个包含最后7205x144个观测值的窗口以训练模型。 下面的函数返回上述时间窗以供模型训练。参数 history_size 是过去信息的滑动窗口大小。target_size 是模型需要学习预测的未来时间步也作为需要被预测的标签。 下面使用数据的前300,000行当做训练数据集其余的作为验证数据集。总计约2100天的训练数据。 ​ def univariate_data(dataset, start_index, end_index, history_size, target_size): data [] labels [] start_index start_index history_sizeif end_index is None:end_index len(dataset) - target_sizefor i in range(start_index, end_index):indices range(i-history_size, i)# Reshape data from (history1_size,) to (history_size, 1)data.append(np.reshape(dataset[indices], (history_size, 1)))labels.append(dataset[itarget_size])return np.array(data), np.array(labels)2 开始分析 2.1 单变量分析 首先使用一个特征温度训练模型并在使用该模型做预测。 2.1.1 温度变量 从数据集中提取温度 ​ uni_data df[‘T (degC)’] uni_data.index df[‘Date Time’] uni_data.head() 观察数据随时间变化的情况 进行标准化 ​ #标准化 uni_train_mean uni_data[:TRAIN_SPLIT].mean() uni_train_std uni_data[:TRAIN_SPLIT].std() uni_data (uni_data-uni_train_mean)/uni_train_std #写函数来划分特征和标签 univariate_past_history 20 univariate_future_target 0 x_train_uni, y_train_uni univariate_data(uni_data, 0, TRAIN_SPLIT, # 起止区间univariate_past_history,univariate_future_target) x_val_uni, y_val_uni univariate_data(uni_data, TRAIN_SPLIT, None,univariate_past_history,univariate_future_target)可见第一个样本的特征为前20个时间点的温度其标签为第21个时间点的温度。根据同样的规律第二个样本的特征为第2个时间点的温度值到第21个时间点的温度值其标签为第22个时间点的温度…… 2.2 将特征和标签切片 ​ BATCH_SIZE 256 BUFFER_SIZE 10000 train_univariate tf.data.Dataset.from_tensor_slices((x_train_uni, y_train_uni)) train_univariate train_univariate.cache().shuffle(BUFFER_SIZE).batch(BATCH_SIZE).repeat()val_univariate tf.data.Dataset.from_tensor_slices((x_val_uni, y_val_uni)) val_univariate val_univariate.batch(BATCH_SIZE).repeat()2.3 建模 ​ simple_lstm_model tf.keras.models.Sequential([ tf.keras.layers.LSTM(8, input_shapex_train_uni.shape[-2:]), # input_shape(20,1) 不包含批处理维度 tf.keras.layers.Dense(1) ]) simple_lstm_model.compile(optimizeradam, lossmae)2.4 训练模型 ​ EVALUATION_INTERVAL 200 EPOCHS 10 simple_lstm_model.fit(train_univariate, epochsEPOCHS,steps_per_epochEVALUATION_INTERVAL,validation_dataval_univariate, validation_steps50)训练过程 训练结果 - 温度预测结果 2.5 多变量分析 在这里我们用过去的一些压强信息、温度信息以及密度信息来预测未来的一个时间点的温度。也就是说数据集中应该包括压强信息、温度信息以及密度信息。 2.5.1 压强、温度、密度随时间变化绘图 2.5.2 将数据集转换为数组类型并标准化 ​ dataset features.values data_mean dataset[:TRAIN_SPLIT].mean(axis0) data_std dataset[:TRAIN_SPLIT].std(axis0) dataset (dataset-data_mean)/data_stddef multivariate_data(dataset, target, start_index, end_index, history_size,target_size, step, single_stepFalse):data []labels []start_index start_index history_sizeif end_index is None:end_index len(dataset) - target_sizefor i in range(start_index, end_index):indices range(i-history_size, i, step) # step表示滑动步长data.append(dataset[indices])if single_step:labels.append(target[itarget_size])else:labels.append(target[i:itarget_size])return np.array(data), np.array(labels)2.5.3 多变量建模训练训练 ​ single_step_model tf.keras.models.Sequential()single_step_model.add(tf.keras.layers.LSTM(32,input_shapex_train_single.shape[-2:]))single_step_model.add(tf.keras.layers.Dense(1))single_step_model.compile(optimizertf.keras.optimizers.RMSprop(), lossmae)single_step_history single_step_model.fit(train_data_single, epochsEPOCHS,steps_per_epochEVALUATION_INTERVAL,validation_dataval_data_single,validation_steps50)def plot_train_history(history, title):loss history.history[loss]val_loss history.history[val_loss]epochs range(len(loss))plt.figure()plt.plot(epochs, loss, b, labelTraining loss)plt.plot(epochs, val_loss, r, labelValidation loss)plt.title(title)plt.legend()plt.show()plot_train_history(single_step_history,Single Step Training and validation loss) 6 最后 更多资料, 项目分享 https://gitee.com/dancheng-senior/postgraduate
http://www.w-s-a.com/news/520840/

相关文章:

  • 做网站美工要学什么网站推广的方法包括
  • 哪个网站可以做笔译兼职wordpress加表单
  • 百度站内搜索 wordpress微餐饮建站费用
  • 用什么做网站的访问量统计制作手工作品
  • 微信公众号搭建网站河南卫生基层系统网站建设
  • steam账号注册网站重庆手机版建站系统哪家好
  • 中新生态城建设局门户网站wordpress云盘视频播放
  • 大型网站开发基本流程wordpress记录用户搜索
  • 云服务器安装win系统做网站wordpress边栏扩大尺寸
  • 网站开发面试自我介绍软件下载网站如何建设
  • 可以做翻译任务的网站陕西省建设厅八大员证
  • 昆明 网站推广重庆网页优化seo公司
  • 网站排名下降怎么上去设计一套app页面多少钱
  • 专门用来查找网址的网站查公司名字是否被注册
  • 自己创建网站教程河南省建设厅官方网站李学军
  • 一个网站需要多少容量怎样免费设计网站建设
  • 建设工程交易中心网站12306的网站是哪个公司做的
  • 建设网站经营范围自己给公司做网站
  • 河北省住房建设厅政务网站网络营销推广的岗位职责有哪些
  • 上海网站建设优化价格孝义做网站的公司
  • 哪个公司网站做的最好义乌 网站 制作
  • 百度站长工具综合查询wordpress 上传pdf
  • 旅游短租公寓网站建设深圳龙岗招聘网
  • 做海淘是在哪个网站网络查控系统设计方案
  • o2o网站建设代理商微信公众号开发文档
  • 网站设计课程总结关于网站备案的公告
  • 网站建设与运营意义到哪查找网站域名
  • 网站及单位网站建设情况眉县住房和城市建设局网站
  • 网站是否能够被恶意镜像wordpress占用
  • 经典设计网站网站等保测评怎么做