is there away to output selected columns names from SelectFromModel method?

前端 未结 2 1128
庸人自扰
庸人自扰 2021-01-02 13:39

i performed feature selection using ExtraTreesClassifier and SelectFromModel in data set that loaded as DataFrame, however i want to save these selected feature as DataFrame

2条回答
  •  天涯浪人
    2021-01-02 14:41

    Use the method DataFrame.to_csv() to save your dataframe as a csv file.

    Do the following :

    X_new.to_csv("your/path", sep=';')
    

    Here is a link to the documentation of the method.

提交回复
热议问题