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

免费WordPress门户一号广州seo排名优化公司

免费WordPress门户一号,广州seo排名优化公司,服装网站论文,wordpress从指定目录获取文章1. 项目背景 本文基于kaggle平台相关竞赛项目#xff0c;具体连接如下#xff1a; Time Series Forecasting With SARIMAX 基本信息如内容说明、数据集、已提交代码、当前得分排名以及比赛规则等#xff0c;如图【1】所示#xff0c;可以认真阅读。 图 1 2. 数据读取 …1. 项目背景 本文基于kaggle平台相关竞赛项目具体连接如下 Time Series Forecasting With SARIMAX 基本信息如内容说明、数据集、已提交代码、当前得分排名以及比赛规则等如图【1】所示可以认真阅读。 图 1 2. 数据读取 使用python得pandas包进行csv文件读取 # read train data df pd.read_csv(/kaggle/input/daily-climate-time-series-data/DailyDelhiClimateTrain.csv, parse_dates[date], # change to date time formatindex_coldate) df2.1 数据信息图形化观测 定义图表模板对不同维度的数据进行图形化分析。 # Get the xgridoff template grid_template pio.templates[xgridoff] grid_template.layout.font.color black # Light gray font color# Adjust gridline color and width grid_template.layout.xaxis.gridcolor rgba(0, 0, 0, 0.3) # Light gray with transparency grid_template.layout.yaxis.gridcolor rgba(0, 0, 0, 0.3) # Light gray with transparency grid_template.layout.xaxis.gridwidth 1 # Set gridline width grid_template.layout.yaxis.gridwidth 1 # Set gridline width# Update Plotly templates with template pio.templates[ts_template] grid_template# plot mean temperature, humidity, wind_speed, meanpressure for watch fig_meantemp px.line(df, xdf.index, ymeantemp, titleMean Temperature Over Time) fig_meantemp.update_layout(templatets_template, title_x0.5, xaxis_titleDate) fig_meantemp.show()fig_humidity px.line(df, xdf.index, yhumidity, titleHumidity Over Time) fig_humidity.update_layout(templatets_template, title_x0.5, xaxis_titleDate) fig_humidity.show()fig_wind_speed px.line(df, xdf.index, ywind_speed, titleWind Speed Over Time) fig_wind_speed.update_layout(templatets_template, title_x0.5, xaxis_titleDate) fig_wind_speed.show()fig_meanpressure px.line(df, xdf.index, ymeanpressure, titleMean Pressure Over Time) fig_meanpressure.update_layout(templatets_template, title_x0.5, xaxis_titleDate) fig_meanpressure.show()可以从图中看到平均温度湿度风速气压等数据波形图也可以宏观的看到数据的趋势信息为后续进一步学习做初步探索。 2.3 数据分量 针对预测数据项平均温度我们可以分解平均温度数据进一步分析数据形态、特征。seasonal_decompose函数返回的是trend、seasonal和residual分别表示趋势、季节性和残留三部分的数据observed代表原始序列。 from statsmodels.tsa.seasonal import seasonal_decompose import plotly.subplots as sp# Perform seasonal decomposition result seasonal_decompose(df[meantemp], modeladditive, period365)# Plot the decomposed components fig sp.make_subplots(rows4, cols1, shared_xaxesTrue, subplot_titles[Observed, Trend, Seasonal, Residual])fig.add_trace(go.Scatter(xdf.index, yresult.observed, modelines, nameObserved), row1, col1) fig.add_trace(go.Scatter(xdf.index, yresult.trend, modelines, nameTrend), row2, col1) fig.add_trace(go.Scatter(xdf.index, yresult.seasonal, modelines, nameSeasonal), row3, col1) fig.add_trace(go.Scatter(xdf.index, yresult.resid, modelines, nameResidual), row4, col1)fig.update_layout(template ts_template,height800, titleSeasonal Decomposition of Mean Temperature) fig.show() 从图中可以看出平均温度数据具有很强的季节性趋势是逐渐升高的但是受噪音影响有限。 2.4 特征选取 基于以上数据形态观测和分析我们可以大致选定数据中的部分特征作为影响平均温度的因素特征信息这里就选定湿度和风速作为特征信息进行训练和预测。 df df[[meantemp, humidity, wind_speed]] df.head()2.5 归一化 from sklearn.preprocessing import RobustScaler, MinMaxScalerrobust_scaler RobustScaler() # scaler for wind_speed minmax_scaler MinMaxScaler() # scaler for humidity target_transformer MinMaxScaler() # scaler for target (meantemp)dl_train[wind_speed] robust_scaler.fit_transform(dl_train[[wind_speed]]) # robust for wind_speed dl_train[humidity] minmax_scaler.fit_transform(dl_train[[humidity]]) # minmax for humidity dl_train[meantemp] target_transformer.fit_transform(dl_train[[meantemp]]) # targetdl_test[wind_speed] robust_scaler.transform(dl_test[[wind_speed]]) dl_test[humidity] minmax_scaler.transform(dl_test[[humidity]]) dl_test[meantemp] target_transformer.transform(dl_test[[meantemp]])display(dl_train.head())3. 序列稳定性验证 import statsmodels.api as sm from statsmodels.tsa.stattools import adfuller, kpssdef check_stationarity(series):print(f\n___________________Checking Stationarity for: {series.name}___________________\n)# ADF Testadf_test adfuller(series.values)print(ADF Test:\n)print(ADF Statistic: %f % adf_test[0])print(p-value: %f % adf_test[1])print(Critical Values:)for key, value in adf_test[4].items():print(\t%s: %.3f % (key, value))if (adf_test[1] 0.05) (adf_test[4][5%] adf_test[0]):print(\u001b[32mSeries is Stationary (ADF Test)\u001b[0m)else:print(\x1b[31mSeries is Non-stationary (ADF Test)\x1b[0m)print(\n -*50 \n)# KPSS Testkpss_test kpss(series.values, regressionc, nlagsauto)print(KPSS Test:\n)print(KPSS Statistic: %f % kpss_test[0])print(p-value: %f % kpss_test[1])print(Critical Values:)for key, value in kpss_test[3].items():print(\t%s: %.3f % (key, value))if kpss_test[1] 0.05:print(\u001b[32mSeries is Stationary (KPSS Test)\u001b[0m)else:print(\x1b[31mSeries is Non-stationary (KPSS Test)\x1b[0m) 那么我们就可以针对选取的特征进行稳定性分析。 # Check initial stationarity for each feature check_stationarity(df[meantemp]) check_stationarity(df[humidity]) check_stationarity(df[wind_speed])___________________Checking Stationarity for: meantemp___________________ADF Test:ADF Statistic: -2.021069 p-value: 0.277412 Critical Values:1%: -3.4355%: -2.86410%: -2.568 Series is Non-stationary (ADF Test)--------------------------------------------------KPSS Test:KPSS Statistic: 0.187864 p-value: 0.100000 Critical Values:10%: 0.3475%: 0.4632.5%: 0.5741%: 0.739 Series is Stationary (KPSS Test)___________________Checking Stationarity for: humidity___________________ADF Test:ADF Statistic: -3.675577 p-value: 0.004470 Critical Values:1%: -3.4355%: -2.86410%: -2.568 Series is Stationary (ADF Test)--------------------------------------------------KPSS Test:KPSS Statistic: 0.091737 p-value: 0.100000 Critical Values:10%: 0.3475%: 0.4632.5%: 0.5741%: 0.739 Series is Stationary (KPSS Test)___________________Checking Stationarity for: wind_speed___________________ADF Test:ADF Statistic: -3.838097 p-value: 0.002541 Critical Values:1%: -3.4355%: -2.86410%: -2.568 Series is Stationary (ADF Test)--------------------------------------------------KPSS Test:KPSS Statistic: 0.137734 p-value: 0.100000 Critical Values:10%: 0.3475%: 0.4632.5%: 0.5741%: 0.739 Series is Stationary (KPSS Test)可以看到平均温度是不稳定的那么就需要进行差分处理。具体什么是差分及差分阶数请自行查阅。 # 1st degree differencing df[meantemp_diff] df[meantemp].diff().fillna(0) # diff() default is 1st degree differencing check_stationarity(df[meantemp_diff]);___________________Checking Stationarity for: meantemp_diff___________________ADF Test:ADF Statistic: -16.294070 p-value: 0.000000 Critical Values:1%: -3.4355%: -2.86410%: -2.568 Series is Stationary (ADF Test)--------------------------------------------------KPSS Test:KPSS Statistic: 0.189493 p-value: 0.100000 Critical Values:10%: 0.3475%: 0.4632.5%: 0.5741%: 0.739 Series is Stationary (KPSS Test)3. 模型训练和预测 # Split the data into training and testing sets train_size int(len(df) * 0.8) train, test df.iloc[:train_size], df.iloc[train_size:]# SARIMAXfrom statsmodels.tsa.statespace.sarimax import SARIMAX from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error# Define the SARIMA model parameters order (1, 1, 6) # Non-seasonal order (p, d, q) seasonal_order (1, 1, 1, 7) # Seasonal order (P, D, Q, S) # Fit the SARIMA model sarima_model SARIMAX(endogtrain[meantemp], exogtrain[[humidity, wind_speed]],orderorder, seasonal_orderseasonal_order) sarima_model_fit sarima_model.fit()# Make predictions sarima_pred sarima_model_fit.predict(starttest.index[0], endtest.index[-1],exogtest[[humidity, wind_speed]])# Calculate error mse mean_squared_error(test[meantemp], sarima_pred) r2 r2_score(test[meantemp], sarima_pred) print(Test MSE:, mse) print(Test R²: %.3f % r2)# Plot the results plt.figure(figsize(10, 5)) plt.plot(test.index, test[meantemp], labelActual) plt.plot(test.index, sarima_pred, colorred, labelSARIMA Forecast) plt.xlabel(Date) plt.ylabel(Meantemp) plt.title(SARIMA Forecast) plt.legend() plt.show()如上图所示可以看到实际数据和预测数据的曲线图从图中可以看到预测值与实际值之间存在较大gap这就说明模型泛化能力不好对未来数据不能很好的预测。这就需要我们对模型参数进行调整以期达到更好的效果。当然有些是受限于模型本身的局限性始终无法对数据做出合理预测那就需要我们寻找其他的模型比如RNN、CNN、LSTM等更强大的深度学习模型来进行训练和预测。 参考文档 ARIMA Model for Time Series Forecasting 季节性ARIMA模型https://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average 如有侵权烦请联系删除
文章转载自:
http://www.morning.smjyk.cn.gov.cn.smjyk.cn
http://www.morning.mrttc.cn.gov.cn.mrttc.cn
http://www.morning.jwncx.cn.gov.cn.jwncx.cn
http://www.morning.routalr.cn.gov.cn.routalr.cn
http://www.morning.jgcyn.cn.gov.cn.jgcyn.cn
http://www.morning.jhtrb.cn.gov.cn.jhtrb.cn
http://www.morning.rmppf.cn.gov.cn.rmppf.cn
http://www.morning.dfckx.cn.gov.cn.dfckx.cn
http://www.morning.mingjiangds.com.gov.cn.mingjiangds.com
http://www.morning.bfjtp.cn.gov.cn.bfjtp.cn
http://www.morning.qtrlh.cn.gov.cn.qtrlh.cn
http://www.morning.rfwgg.cn.gov.cn.rfwgg.cn
http://www.morning.jqkrt.cn.gov.cn.jqkrt.cn
http://www.morning.ndtmz.cn.gov.cn.ndtmz.cn
http://www.morning.djwpd.cn.gov.cn.djwpd.cn
http://www.morning.kgnrh.cn.gov.cn.kgnrh.cn
http://www.morning.rycd.cn.gov.cn.rycd.cn
http://www.morning.xfcjs.cn.gov.cn.xfcjs.cn
http://www.morning.hgsylxs.com.gov.cn.hgsylxs.com
http://www.morning.mzcsp.cn.gov.cn.mzcsp.cn
http://www.morning.dbnpz.cn.gov.cn.dbnpz.cn
http://www.morning.rnngz.cn.gov.cn.rnngz.cn
http://www.morning.mwqbp.cn.gov.cn.mwqbp.cn
http://www.morning.ksjmt.cn.gov.cn.ksjmt.cn
http://www.morning.mnkhk.cn.gov.cn.mnkhk.cn
http://www.morning.qrlkt.cn.gov.cn.qrlkt.cn
http://www.morning.dpdns.cn.gov.cn.dpdns.cn
http://www.morning.fkmyq.cn.gov.cn.fkmyq.cn
http://www.morning.rjnm.cn.gov.cn.rjnm.cn
http://www.morning.slqzb.cn.gov.cn.slqzb.cn
http://www.morning.qrlsy.cn.gov.cn.qrlsy.cn
http://www.morning.nlqgb.cn.gov.cn.nlqgb.cn
http://www.morning.hmbtb.cn.gov.cn.hmbtb.cn
http://www.morning.bsqth.cn.gov.cn.bsqth.cn
http://www.morning.gtbjf.cn.gov.cn.gtbjf.cn
http://www.morning.hongjp.com.gov.cn.hongjp.com
http://www.morning.ktmbr.cn.gov.cn.ktmbr.cn
http://www.morning.hdpcn.cn.gov.cn.hdpcn.cn
http://www.morning.ghzfx.cn.gov.cn.ghzfx.cn
http://www.morning.rpgdd.cn.gov.cn.rpgdd.cn
http://www.morning.fgkrh.cn.gov.cn.fgkrh.cn
http://www.morning.dcdhj.cn.gov.cn.dcdhj.cn
http://www.morning.kgtyj.cn.gov.cn.kgtyj.cn
http://www.morning.plxhq.cn.gov.cn.plxhq.cn
http://www.morning.youyouling.cn.gov.cn.youyouling.cn
http://www.morning.mqbdb.cn.gov.cn.mqbdb.cn
http://www.morning.qfcnp.cn.gov.cn.qfcnp.cn
http://www.morning.fqqlq.cn.gov.cn.fqqlq.cn
http://www.morning.ggnrt.cn.gov.cn.ggnrt.cn
http://www.morning.hphrz.cn.gov.cn.hphrz.cn
http://www.morning.mcbqq.cn.gov.cn.mcbqq.cn
http://www.morning.rzcmn.cn.gov.cn.rzcmn.cn
http://www.morning.jwrcz.cn.gov.cn.jwrcz.cn
http://www.morning.ppbqz.cn.gov.cn.ppbqz.cn
http://www.morning.qtqjx.cn.gov.cn.qtqjx.cn
http://www.morning.mphfn.cn.gov.cn.mphfn.cn
http://www.morning.lhhdy.cn.gov.cn.lhhdy.cn
http://www.morning.yqqxj1.cn.gov.cn.yqqxj1.cn
http://www.morning.nwpnj.cn.gov.cn.nwpnj.cn
http://www.morning.sdhmn.cn.gov.cn.sdhmn.cn
http://www.morning.mfmbn.cn.gov.cn.mfmbn.cn
http://www.morning.qnftc.cn.gov.cn.qnftc.cn
http://www.morning.rfkyb.cn.gov.cn.rfkyb.cn
http://www.morning.c7507.cn.gov.cn.c7507.cn
http://www.morning.crrjg.cn.gov.cn.crrjg.cn
http://www.morning.txtgy.cn.gov.cn.txtgy.cn
http://www.morning.rjljb.cn.gov.cn.rjljb.cn
http://www.morning.ptysj.cn.gov.cn.ptysj.cn
http://www.morning.qbccg.cn.gov.cn.qbccg.cn
http://www.morning.rfhm.cn.gov.cn.rfhm.cn
http://www.morning.gqnll.cn.gov.cn.gqnll.cn
http://www.morning.fprll.cn.gov.cn.fprll.cn
http://www.morning.clccg.cn.gov.cn.clccg.cn
http://www.morning.qlrwf.cn.gov.cn.qlrwf.cn
http://www.morning.wgqtj.cn.gov.cn.wgqtj.cn
http://www.morning.jiuyungps.com.gov.cn.jiuyungps.com
http://www.morning.sbkb.cn.gov.cn.sbkb.cn
http://www.morning.njddz.cn.gov.cn.njddz.cn
http://www.morning.rhnn.cn.gov.cn.rhnn.cn
http://www.morning.chmkt.cn.gov.cn.chmkt.cn
http://www.tj-hxxt.cn/news/271466.html

相关文章:

  • 做酒店经理的一些网站网站建设与管期末试题
  • 旅游网站开发工具百度采购网官方网站
  • 做网站广告经营者中信建设有限责任公司历任董事长
  • 建站到网站收录到优化婚庆策划公司招聘
  • 网站工信部备案流程手机网站拒绝访问怎么解决
  • 网站keyword如何排序企业网站开发需求分析
  • 宁夏建设工程交易中心网站广州市线下教学
  • dremwear做网站做家居建材出口网站有哪些
  • 广州大石附近做网站的公司电商平台推广员是做什么的
  • 辽宁关键词优化排名外包wordpress优化指南
  • 沈阳地区精神文明建设网站网上推广怎么拉客户
  • 北京最大网站建设公司排名网站建设工作室的营销方式创业计划书
  • 网站开发整体制作流程做seo网站公司
  • 引擎搜索优化巩义做网站xd seo
  • 深圳网站开发工资物流网络化
  • 管理系统是网站吗专业的猎头公司
  • 雨燕直播东莞搜索网络优化
  • 黑黄logo网站网站的域名怎么起
  • 邯郸市有搞网站服服务的吗河源今天发生的重大新闻
  • 手机网站用什么程序做wordpress+好用插件
  • 金昌做网站云服务器做的网站需要备案
  • WordPress文章id连号芜湖seo网站优化
  • 网站开发的要注意基本原则云服务器拿来做网站
  • 专做运动品牌的网站营销型网站应必备的七大功能
  • 青海省交通建设管理局网站清远市seo广告优化
  • 网站图片上的分享怎么做用ps给旅游网站做前端网页
  • 重庆梁平网站建设公司平昌县住房和城乡建设局网站
  • 中国网站建设的利弊wordpress动态cdn
  • 黑龙江营商环境建设局网站做网站总结体会
  • 成都搭建企业网站网站怎么做seo_