![](/img/trans.png)
[英]How do I create a train data set with both numeric and 1-hot categorical features with Scikit-learn?
[英]VowpalWabbit - how to set third order interactions only for categorical features for tabular data with both continues and categorical features
对于 VowpalWabbit - 如何仅为具有连续和分类特征的表格数据的分类特征设置三阶交互,例如如何更改: vw_squared = VWRegressor(loss_function='squared' , interacts = 'abc')
假设 VWRegressor 的输入数据是 Pandas 数据框,其中分类特征是作为类别类型的市场,例如
'''
df['jobcat']=df['job'].astype('category').cat.codes
df['educationcat']=df['education'].astype('category').cat.codes
df['defaultcat']=df['default'].astype('category').cat.codes
'''
您可以将分类数据放在与非分类数据不同的命名空间下,然后仅为这些命名空间分配交互。 现在没有自动的方法来做到这一点,因此必须通过将要交互的功能分离到单独的命名空间中来手动完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.