Will Knime support saving or loading the model in pickle format?? I think the python script only support jython code as per documentation can someone tell me whether it will also support python code.

I am not sure I follow through. The Python Learner node in KNIME is mainly a code window with some suggestions on how to arrange the code.

image

You could also just write some model to the disc from the Python node without bothering with other nodes, like MOJO files in this example:

I think the structure is just there to be consistent with other KNIME model handlings.

You could BTW pickle other objects from Python too:

In the above eg. in image , what if I don’t want to write my model in python learner node ,instead I wanna make it with random forest learner and predictor nodes. After doing so, is still the model convertible to pickle format?

Pickle is not a model or data format by itself but it would ‘wrap’ a Python object and store it to be brought back later.

If you want to use models between KNIME and Python you should look for example think about using PMML - mostly I have used MOJO model files from H2O.ai which can easily be shared between KNIME and Python (or R) - if you use the correct MOJO version (which is not so obvious, unfortunately) - eg:

KNIME 4.1* <-> H2O 3.2* (MOJO version 1.3)
KNIME 4.2* <-> H2O 3.3* (MOJO version 1.4)

With other model formats you would have to check if they could be used in a corresponding Python environment/package.

Which is why I like to use
Python or R -> H2O.ai -> MOJO-file -> KNIME (if you want with Sparkling Water on a Big Data cluster)

Actually I was finding a format in which knime models can be converted so that I can save it outside of knime also (like in hdfs) for deploying it somewhere else. Please help

please help me with this

There are certain model that generic KNIME models support that you would be able to use in other environments. Namely PMML and MOJO. I am not sure if there are more. Which one would you like to use?

If you want to save files in HDFS you would have to upload them via the upload node (like at the beginning of this example).

An example of how to use MOJO in a big data environment can be found here:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.