This component encodes string (categorical) features into numeric features. Features created are: a) value-counts of categorical variables (count encoding), b) ranked label-count encoding, and c) target-encoding. Multiple categorical variables (string type) may be specified at one go.
As Input, it takes train and test datasets. You have to specify:
a. Target column name
b. String columns to be encoded
c. Type of categorical encoding desired
d. Perform PCA or not
To avoid (as also check) data leakage while performing 'target-encoding', encoding is performed using only train data. The encoded values are then mapped to test data. To have reliable target encoding, dataset should generally be large.
The component (optionally) performs PCA on the DataFrame consisting of either of these three or all three encodings along with on the numeric features already present. PCA model is built on train data and applied on test data. Principal components explain 95% of variance. The output of component are two dataframes, train and test. These dataframes have Principal components (or encoded columns along with already present numeric columns). The output dataframes include target column.
The component uses python script. Python libraries used are numpy, pandas, scikit-learn and pyarrow. To speed up categorical feature generation, please reach File > Preferences > KNIME > Python > Serialization library and select Apache Arrow as Serialization library. For a description of the three methods of encoding, please refer: https://wrosinski.github.io/fe_categorical_encoding/
To use this component in KNIME, download it from the below URL and open it in KNIME:
Download ComponentDeploy, schedule, execute, and monitor your KNIME workflows locally, in the cloud or on-premises – with our brand new NodePit Runner.
Try NodePit Runner!Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well? Do you think, the search results could be improved or something is missing? Then please get in touch! Alternatively, you can send us an email to mail@nodepit.com.
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.