回归函数中如何枚举哑变量列名

使用oneHot后,行业哑变量列名变成 industry_801780.SI样式的几十个

这时做ols回归该如何枚举这几十个列名?

columnNames(table)也报错

hot=oneHot(table,`industry)

h=columnNames(hot)

offset0123456789

0  date stock  gtjaAlpha1  mv  industry_801780.SI  industry_801180.SI  industry_801150.SI  industry_801160.SI  industry_801200.SI  industry_801890.SI


select date,stock, ols(gtjaAlpha1,h[3:],true, 2)[`Residual] as rs from table  context  by date 
报错=> Usage: ols(Y, X, [intercept=true], [mode=0]). X(independent factors) must be numeric data.'
请先 登录 后评论

最佳答案 2023-05-26 12:53

使用元编程

h=columnNames(hot)

makeCall(ols, sqlCol(yColName), makeUnifiedCall(matrix, sqlCol(h)), 1, 2)

请先 登录 后评论

其它 0 个回答

  • 1 关注
  • 0 收藏,571 浏览
  • Gaxia320 提出于 2023-05-23 19:54

相似问题