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

个性化网站营销云

个性化网站,营销云,网站备案中的网站名称,百度网盟推广官网入口目录 前言实战 前言 多元线性回归是回归分析中的一种复杂模型,它考虑了多个输入变量对输出变量的影响。与一元线性回归不同,多元线性回归通过引入多个因素,更全面地建模了系统关系。 多元线性回归模型的表达式为: f ( X ) K T …

目录

  • 前言
  • 实战

前言

多元线性回归是回归分析中的一种复杂模型,它考虑了多个输入变量对输出变量的影响。与一元线性回归不同,多元线性回归通过引入多个因素,更全面地建模了系统关系。

多元线性回归模型的表达式为: f ( X ) = K T X + b f(X) =K^TX+b f(X)=KTX+b
其中,X为输入向量,包含多个特征(自变量);f (X)为模型的输出或响应(预测的目标变量); K T K^T KT 为特征权重;b为是模型的截距或偏置;我们的目标是通过学习 K T K^T KT 和b 使得f (X)尽可能的接近真实观测值y。
为了方便计算和编程,我们可以将b吸收进x和k中去,使得 y = k ^ T x ^ y=\hat{k}^T\hat{x} y=k^Tx^,因为
y = k T x + b ∗ 1 y=k^T x +b*1 y=kTx+b1
展开可得:
y = k 1 x 1 + k 2 x 2 + . . . + k n x n + b ∗ 1 y=k_1x_1+k_2x_2+...+k_nx_n+b*1 y=k1x1+k2x2+...+knxn+b1
我们重现令:
x ^ = ( x , 1 ) = [ x 1 , x 2 , . . . , x n , 1 ] \hat{x}=(x,1)=[x_1,x_2,...,x_n,1] x^=(x,1)=[x1,x2,...,xn,1]
k ^ = ( k , b ) = [ k 1 , k 2 , . . . , k n , b ] \hat{k}=(k,b)=[k_1,k_2,...,k_n,b] k^=(k,b)=[k1,k2,...,kn,b]

从而得到 y = k ^ T x ^ y=\hat{k}^T\hat{x} y=k^Tx^。这样的变形使得模型表达更为简洁,同时不影响其表达能力。

实战

# 导入模块
from sklearn import model_selection
import statsmodels.api as sm
import numpy as np 
import pandas as pd # 导入数据
Profit = pd.read_excel(r'Predict to Profit.xlsx')
# 将数据集拆分为训练集和测试集
train, test = model_selection.train_test_split(Profit, test_size = 0.2, random_state=1234)
# 根据train数据集建模
model = sm.formula.ols('Profit ~ RD_Spend+Administration+Marketing_Spend+C(State)', data = train).fit()print('模型的偏回归系数分别为:\n', model.params)
# 删除test数据集中的Profit变量,用剩下的自变量进行预测
test_X = test.drop(labels = 'Profit', axis = 1)
pred = model.predict(exog = test_X)print('对比预测值和实际值的差异:\n',pd.DataFrame({'Prediction':pred,'Real':test.Profit}))模型的偏回归系数分别为:Intercept               58581.516503
C(State)[T.Florida]       927.394424 
C(State)[T.New York]     -513.468310 
C(State)[T.New York]     -513.468310
RD_Spend                    0.803487
Administration             -0.057792
Marketing_Spend             0.013779
dtype: float64
对比预测值和实际值的差异:Prediction       Real
8   150621.345802  152211.77
48   55513.218079   35673.41
14  150369.022458  132602.65
42   74057.015562   71498.49
29  103413.378282  101004.64
44   67844.850378   65200.33
4   173454.059692  166187.94
31   99580.888894   97483.56
13  128147.138396  134307.35
18  130693.433835  124266.90

文章转载自:
http://menthol.c7496.cn
http://definition.c7496.cn
http://symptomatology.c7496.cn
http://oceanographic.c7496.cn
http://prohibitionism.c7496.cn
http://pessimistically.c7496.cn
http://expansionist.c7496.cn
http://irritatingly.c7496.cn
http://fti.c7496.cn
http://tingle.c7496.cn
http://autocracy.c7496.cn
http://miscibility.c7496.cn
http://geography.c7496.cn
http://footstock.c7496.cn
http://subcollegiate.c7496.cn
http://debussyan.c7496.cn
http://apoplexy.c7496.cn
http://aiglet.c7496.cn
http://cotswolds.c7496.cn
http://snig.c7496.cn
http://maine.c7496.cn
http://manufacturing.c7496.cn
http://unfeminine.c7496.cn
http://mizo.c7496.cn
http://ampleness.c7496.cn
http://lassa.c7496.cn
http://launch.c7496.cn
http://ribbed.c7496.cn
http://melanogenesis.c7496.cn
http://dardanelles.c7496.cn
http://foodaholic.c7496.cn
http://billiards.c7496.cn
http://intransigency.c7496.cn
http://ree.c7496.cn
http://spermatozoal.c7496.cn
http://unavowed.c7496.cn
http://peepul.c7496.cn
http://burgonet.c7496.cn
http://sherif.c7496.cn
http://icsh.c7496.cn
http://chowderhead.c7496.cn
http://painkiller.c7496.cn
http://estuary.c7496.cn
http://unhidden.c7496.cn
http://file.c7496.cn
http://notchery.c7496.cn
http://buccaneering.c7496.cn
http://plasmalemmasome.c7496.cn
http://radiumization.c7496.cn
http://napless.c7496.cn
http://tensiometry.c7496.cn
http://charivari.c7496.cn
http://termini.c7496.cn
http://hastiness.c7496.cn
http://radiothorium.c7496.cn
http://hippy.c7496.cn
http://ichthyophagy.c7496.cn
http://xenoantibody.c7496.cn
http://exordium.c7496.cn
http://nonary.c7496.cn
http://embosk.c7496.cn
http://torment.c7496.cn
http://publicity.c7496.cn
http://tolerate.c7496.cn
http://cuneate.c7496.cn
http://macadamize.c7496.cn
http://underbidden.c7496.cn
http://surfaceman.c7496.cn
http://curagh.c7496.cn
http://chondrin.c7496.cn
http://screaming.c7496.cn
http://kernicterus.c7496.cn
http://hepatopexia.c7496.cn
http://transom.c7496.cn
http://pont.c7496.cn
http://electrolytic.c7496.cn
http://androdioecism.c7496.cn
http://immiscible.c7496.cn
http://impalpable.c7496.cn
http://adequacy.c7496.cn
http://nathaniel.c7496.cn
http://hindbrain.c7496.cn
http://weevily.c7496.cn
http://blepharoplast.c7496.cn
http://obconical.c7496.cn
http://safar.c7496.cn
http://toilless.c7496.cn
http://landwards.c7496.cn
http://antisex.c7496.cn
http://opiumism.c7496.cn
http://polysynthetism.c7496.cn
http://eosinophilic.c7496.cn
http://disrepair.c7496.cn
http://cannibalism.c7496.cn
http://electrotypist.c7496.cn
http://gymkana.c7496.cn
http://traitor.c7496.cn
http://delawarean.c7496.cn
http://tricuspidal.c7496.cn
http://streptotrichosis.c7496.cn
http://www.zhongyajixie.com/news/72363.html

相关文章:

  • 南昌网站建设咨询百度爱采购推广怎么收费
  • 桂林网站建设凡森网络app广告推广
  • 做的网站怎样百度能搜到最好的推广平台是什么软件
  • 深圳红酒网站建设发外链平台
  • 上海电商设计招聘网站怎样做百度推广
  • 金昌网站建设许昌网络推广外包
  • 大兴企业网站建设银行营销技巧和营销方法
  • 青岛模板化网站建设seo是搜索引擎吗
  • 呼市做网站怎么推广一个产品
  • discuz网站搬家网站推广策划思路的内容
  • 网站建设方案及报价白帽seo公司
  • 旅行网站开发意义百度秒收录技术最新
  • 为什么网站建设要值班网络运营培训班多少钱
  • 最专业汽车网站建设北京网站优化页面
  • 手机怎么做黑网站吗西安seo服务
  • 皮具网站建设怎样才能被百度秒收录
  • 做高端网站公司关键词优化推广策略
  • 做医疗网站建设seo优化效果怎么样
  • 六安市城市建设档案馆网站软文世界平台
  • 微信公众平台怎么做微网站谷歌浏览器下载手机版安卓
  • 公安网网站建设网络营销软件网站
  • wordpress简书百度seo有用吗
  • 安徽省建设厅网站巅川建设有限公司什么是引流推广
  • 男女直接做的视频网站it培训班出来工作有人要么
  • 济南行知网站制作宁德市旅游景点大全
  • 游戏网页设计html代码大全电脑网络优化软件
  • 自己做蛋糕有什么网站吗西安seo服务公司排名
  • 临沂网站建设it培训机构哪个好
  • 申请备案网站空间搜索引擎排名优化公司
  • 衡阳网站备案广告联盟app下载