Icon

Python - PySpark and MLlib RandomForest Classifier (with vtreat)

Spark MLlib in a KNIME Python node - also using vtreat to prepare the data

Demonstrates how to start a spark session within a Python node (the performance will very much depend on your machine)

URL: Medium: Data preparation for Machine Learning with KNIME and the Python “vtreat” package https://medium.com/p/efcaf58fa783
URL: Medium: KNIME and Python — Setting up and managing Conda environments https://medium.com/p/2ac217792539
URL: HUB: Python - PySpark and MLlib RandomForest Classifier (with vtreat) https://hub.knime.com/-/spaces/-/~prZ9x1tPyiYVM0aj/current-state/

Spark MLlib in a KNIME Python node - also using vtreat to prepare the data

Demonstrates how to start a spark session within a Python node (the performance will very much depend on your machine)


https://hub.knime.com/-/spaces/-/~prZ9x1tPyiYVM0aj/current-state/

locate and create /data/ folder with absolute paths
Collect Local Metadata
var_model_files_path
Create File/Folder Variables
Merge Variables
var_model_files_zip
Create File/Folder Variables
py3_knime_spark_ml
Conda Environment Propagation
RandomForest Classifiervia Spark session
Python Script
train.parquet
Parquet Reader
var_excluded_featuresWhich features to exclud
String Widget
original by: https://hub.knime.com/ajc
vtreat Learner Python
Merge Variables
original by: https://hub.knime.com/ajc
vtreat Fitter Python
var_labelWhich variable is the Label/Target?
String Widget
vtreat_model.zip
Model Writer
test.parquet
Parquet Reader
Store dictionaryof model
Model Writer
train_vtreated.parquet
Parquet Writer
var_name_modelThe Name of the Model
String Widget
vtreat_model.zip
Model Reader
Create File/Folder Variables
test_vtreated.parquet
Parquet Writer
Apply the RF modelvia Spark to new data
Python Script
var_dictionary_name
Java Edit Variable (simple)
Binary Classification Inspector
Model Reader
./my_model.zip=> pack Model into .ZIP files
Compress Files/Folder
var_number_treesNumber of Random Trees
Integer Widget

Nodes

Extensions

Links