游戏源代码是什么意思_什么是游戏

游戏源代码是什么意思

Generalized additive models (GAMs) provide a general framework for extending a standard linear model by allowing nonlinear functions of each of the variables, while maintaining additivity. Let’s see what exactly that means,

通用加性模型(GAM)通过允许每个变量的非线性函数,同时保持可加性,提供了扩展标准线性模型的通用框架。 让我们看看这到底意味着什么,

Linear models are simple to describe and implement and have advantage over other approaches in terms of interpretation and inference. But they have limitations in prediction power, that is, how accurately we can predict the output. Suppose we have data which consist of input of P features (X1, X2,….., Xp), and a output Y. Therefore, the corresponding linear model (also known as multi linear regression model) to predict the output:

线性模型易于描述和实施,在解释和推断方面比其他方法更具优势。 但是它们在预测能力方面有局限性,也就是说,我们可以多么精确地预测输出。 假设我们具有由P个要素的输入(X1,X2,…..,Xp)和输出Y组成的数据。因此,可以使用相应的线性模型(也称为多元线性回归模型)来预测输出:

Y = β0 + β1X1 + β2X2 +···+ βpXp + Ɛ

Y =β0+β1X1+β2X2+···+βpXp+Ɛ

Where β0, β1,….,βp are parameters of the equation and Ɛ is the irreducible error , in order to allow for non-linear relationships between each feature and the response(output) is to replace each linear component βjXj with a (smooth) nonlinear function fj(Xj) which corresponds to the jth feature . We would then write the model as

其中β0,β1,…。,βp是方程式的参数,and 是不可减少的误差,为了允许每个特征与响应(输出)之间存在非线性关系,将每个线性分量βjXj替换为与第j个特征对应的(平滑)非线性函数fj(Xj)。 然后我们将模型写为

Y = β0 + f1(X1) + f2(X2) + f3(X3) +…..+ fp(Xp)+Ɛ

Y =β0+ f1(X1)+ f2(X2)+ f3(X3)+….. + fp(Xp)+Ɛ

This is an example of a GAM. It is called an additive model because we calculate a separate fj for each Xj, and then add together all of their contributions. Now the question is how to find this nonlinear function? It turns out there are various methods, but we will specifically be looking at Natural Splines for below example:

这是GAM的示例。 之所以称为加性模型,是因为我们为每个Xj计算一个单独的fj,然后将它们的所有贡献相加。 现在的问题是如何找到这个非线性函数? 事实证明,有多种方法,但是我们将在下面的示例中专门研究Natural Splines

Wage = β0 + f1(year)+f2(age)+f3(education)+ Ɛ — — — — — -(1)

工资=β0+ f1(年)+ f2(年龄)+ f3(教育)+ Ɛ— — — — —-(1)

Before discussion on natural splines it is worth noting that the relationship which exist in real world data is often nonlinear, and a lot of time very complex, that is, even a standard nonlinear function will not prove to be a good approximation of the relation. Now, natural splines are piece-wise degree ‘d’ polynomials whose first ‘d-1’ derivatives are continuous with additional boundary constraints , Instead of fitting a high-degree polynomial over the entire range of feature space, piece-wise polynomial regression involves fitting separate low-degree polynomials, to be concrete, in the equation (1) we are predicting wage on the basis of years, age and education. Here we are independently fitting the functions keeping other features constant, that is, prediction of ‘wage’ on the basis of ‘age’ keeping ‘year’ and ‘education’ constant, Now we know as the ‘age’ increases ‘wages’ increases but after retirement the wages fall, that means up to a certain ‘age’ the relationship is increasing and after which it is decreasing therefore, we fit a polynomial until say age 60 which gives increasing relationship and then after 60, another polynomial to capture decreasing relationship, so it unable us to be flexibly extract relationship between feature and the response. The constraints(continuity of derivatives) unable us to smoothly join these two polynomials.

在讨论自然样条之前,值得注意的是,现实世界数据中存在的关系通常是非线性的,而且很多时间非常复杂,也就是说,即使标准非线性函数也不能证明是该关系的良好近似。 现在, 自然样条曲线是分段度的'd'多项式,其第一'd-1'导数在附加边界约束的情况下是连续的 ,而不是在整个特征空间范围内拟合高阶多项式,分段式多项式回归涉及具体来说,在等式(1)中拟合单独的低阶多项式,我们根据年龄,年龄和学历来预测工资。 这里我们独立地拟合使其他特征保持不变的功能,即在“年龄”保持“年”和“教育”不变的基础上预测“工资”,现在我们知道随着“年龄”的增加“工资”的增加但是退休后工资下降,这意味着在一定的“年龄”之前,这种关系在增加,然后在减小,因此,我们拟合多项式,直到60岁给出了增加的关系,然后在60岁以后,又用另一个多项式来捕捉下降的关系关系,因此我们无法灵活地提取特征与响应之间的关系。 约束(导数的连续性)使我们无法顺利地将这两个多项式结合起来。

Now coming back to GAMs, here ‘year’ and ‘age’ are quantitative variables, and ‘education’ is a qualitative variable with five levels: <HS, HS, <Coll, Coll ,>Coll, referring to the amount of high school or college education that an individual has completed. We fit the first two functions using natural splines. We fit the third function using a separate constant for each level, via the dummy variable approach (for each level of education we create a separate feature with binary value 0 or 1, for example, in case person has high school (HS) as education, ‘HS’ will be 1 and for every other feature of levels it will be 0. )

现在回到GAM,这里的“年”和“年龄”是定量变量,而“教育”是五个水平的定性变量:<HS,HS,<Coll,Coll和> Coll,指的是高中的数量或个人完成的大学学历。 我们使用自然样条曲线拟合前两个函数。 我们通过虚拟变量方法为每个级别使用单独的常数来拟合第三个功能(例如,对于每个教育级别,我们创建一个具有二进制值0或1的单独特征,例如,如果某人具有高中(HS)教育程度,则“ HS”将为1,其他所有级别的特征将为0。)

Figure 1 shows the results of fitting the model using least squares to predict wages on the basis of ‘years’ keeping age and education constant. Wage tends to increase slightly with year; this may be due to inflation.

图1显示了在保持年龄和教育水平不变的“年”的基础上,使用最小二乘法拟合模型以预测工资的结果。 工资往往会随年份略有增加; 这可能是由于通货膨胀。

Image for post
Source:An Introduction to Statistical Learning with Applications in R by Gareth James, Daniela Witten, Trevor Hastie and Robert Tibshirani.
资料来源:Gareth James,Daniela Witten,Trevor Hastie和Robert Tibshirani撰写的R中的统计学习及其应用入门。

Figure 2 indicates that holding education and year fixed, wage tends to be highest for intermediate values of age, and lowest for the very young and very old.

图2表明,受过教育并固定了年薪,中等年龄段的工资往往最高,而对于年轻人和非常老的年龄,工资最低。

Image for post
Source:An Introduction to Statistical Learning with Applications in R by Gareth James, Daniela Witten, Trevor Hastie and Robert Tibshirani.
资料来源:Gareth James,Daniela Witten,Trevor Hastie和Robert Tibshirani撰写的R中的统计学习及其应用入门。

Figure 3 indicates that holding year and age fixed, wage tends to increase with education: the more educated a person is, the higher their salary, on average.

图3表明,固定年纪和年龄的人,工资会随着受教育程度的增加而增加:一个人受教育程度越高,其平均工资就越高。

The main limitation of GAMs is that the model is restricted to be additive. With many variables, important interactions can be missed.

GAM的主要局限性在于该模型被限制为可加性的。 有许多变量,可能会错过重要的互动。

翻译自: https://medium.com/analytics-vidhya/what-are-gams-37f5e6a8f670

游戏源代码是什么意思

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值