![](/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.