orange3 icon indicating copy to clipboard operation
orange3 copied to clipboard

Issue using Orange generated model

Open ruthvikb14 opened this issue 5 years ago • 3 comments

I used "Tree" widget in Orange GUI to generate the decision tree model for iris dataset and saved the model using "Save Model" widget. I can use the saved model in GUI by using the "Load Model" widget. But when I use the following model in the Node-Red -> machine learning module -> predictor node , I'm getting these errors:

File "...\AppData\Local\Programs\Python\Python39\lib\site-packages\Orange\tree.py", line 205, in predict predictions = self.get_values(X) File "....\AppData\Local\Programs\Python\Python39\lib\site-packages\Orange\tree.py", line 202, in get_values return func(X, self._code, self._values, self._thresholds) File "Orange\classification_tree_scorers.pyx", line 374, in Orange.classification._tree_scorers.compute_predictions File "stringsource", line 658, in View.MemoryView.memoryview_cwrapper File "stringsource", line 349, in View.MemoryView.memoryview.cinit TypeError: a bytes-like object is required, not 'DataFrame'

ruthvikb14 avatar Aug 29 '21 17:08 ruthvikb14

Can you describe your usage problem better? Which model did you use and were there any particular settings? How did you save the model and how exactly are you trying to read it (I understood you have a Python script; share relevant code, please). Also, you removed the interesting part of the exception. Please show the whole error (the final parts are the most important)

Also, can the same model be loaded in the GUI: if you used Save Model, can you also load and use it there?

Then, how did you install Orange. Do you use the same installation for the GUI and the library or do you have two separate installs? If you have two separate installs, my hunch would be that your scripting/library install is faulty.

markotoplak avatar Aug 29 '21 19:08 markotoplak

I used "Tree" widget in Orange GUI to generate the decision tree model for iris dataset and saved the model using "Save Model" widget. I can use the saved model in GUI by using the "Load Model" widget. But when I use the following model in the Node-Red -> machine learning module -> predictor node , I'm getting these errors:

File "...\AppData\Local\Programs\Python\Python39\lib\site-packages\Orange\tree.py", line 205, in predict predictions = self.get_values(X) File "....\AppData\Local\Programs\Python\Python39\lib\site-packages\Orange\tree.py", line 202, in get_values return func(X, self._code, self._values, self._thresholds) File "Orange\classification_tree_scorers.pyx", line 374, in Orange.classification._tree_scorers.compute_predictions File "stringsource", line 658, in View.MemoryView.memoryview_cwrapper File "stringsource", line 349, in View.MemoryView.memoryview.cinit TypeError: a bytes-like object is required, not 'DataFrame'

ruthvikb14 avatar Sep 01 '21 10:09 ruthvikb14

It seems that the machine learning module from node-red and saved Orange models are incompatible. Probably no one made an effort for them to be compatible yet. Likely they use different background architectures, so this could be hard.

markotoplak avatar Sep 01 '21 13:09 markotoplak