scitkit polyenmialfeatures-努力了解更高程度的结果
但是,如果我的输入向量为 [a,b,c]
,我需要进行第四级转换。
如果我保持交互作用( Interactions_only = false
),我的转换向量将如何看起来像。
是否是这样的:
[a,b,c, a^2, b^2,c^2,a^3, b^3,c^3, a^4, b^4,c^4, ab, bc, ca, a^2b^2,b^2c^2,c^2a^2,a^3b^3,b^3c^3,c^3a^3]
或不同的程度也相互作用,例如 a^3b^2
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
Interactions_only = false
,它将给出所有组合的学位较小或等于您提供的学位。记住,给定组合的程度是组合中每个单个变量的度的总和(例如,A³ *b²具有5度,A *B³具有4度等)。例如,对于3度,它将给出:
[1,A,B,C,A²,B²,C²,A³,B³,C³,AB,AC,BC,BC,A²B,A²C,A²C,B²A,B²C,C²A,C²B,C²B,C²B,C²b, ABC]
使用
Interactions_only = true
,它将给出所有组合的学位较小或等于您在该组合中所提供的度数较小或等级的学位。例如,对于度量3,它将给出:
[1,A,B,C,AB,AC,BC,ABC]
来源: Scikit学习用户指南
With
interactions_only=False
, it will give all the combinations having a degree less or equal the degree you provide. Remembering that the degree of a given combination is the sum of the degrees of each individual variable in the combination (for example, a³ * b² has degree 5, a * b³ has degree 4 etc).For example, for degree 3, it will give:
[1, a, b, c, a², b², c², a³, b³, c³, ab, ac, bc, a²b, a²c, b²a, b²c, c²a, c²b, abc]
With
interactions_only=True
, it will give all the combinations having degree less or equal the degree you provide with each individual term in the combination having degree less or equal 1.For example, for degree 3, it will give:
[1, a, b, c, ab, ac, bc, abc]
Source: the scikit learn user guide