Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Voting classifier in Alteryx

AddyGR
6 - Meteoroid

Hi All,

I have an ensemble model use case where Voting Classifier model needs to be used ( hard/soft voting).

Is there any predefined model or macro in Alteryx that can be used?

For now I have implemented in python code. Could someone share any steps on how to save the python model as pickle file and apply on new data instead of training the model repetitively?

I am new to Alteryx. Would appreciate if any sample workflows with python deployment is available.

Thanks in advance 

4 REPLIES 4
AmirSems_charter
7 - Meteor

Is this what you are using?

https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.VotingClassifier.html

You wouldn't pickle it. So essentially what you need is a macro and you would pick the target of your regression. Or you can do it in Jupyter.

"Voting Classifier is a machine learning model that trains on an ensemble of numerous models and predicts an output (class) based on their highest probability of chosen class as the output." Ideally the information comes into the python tool in pandas and leaves the tool in pandas. 

 

Alteryx would be a preprocessor and postprocessor of the data...It would have nothing to do with the model that is between you and the jupyter notebook. 

 

I had the same issue and Nick did a great job breaking it down:

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Creating-a-KNN-imputer-for-Alteryx-usi...

AddyGR
6 - Meteoroid

Thank you for your reply!

 

Yes. My implementation is similar to https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.VotingClassifier.html

 

I have written a python code in Alteryx Python tool to serialize into pickle file & save it in the local folder that has the Alteryx workflow (Reference link: Embedding a Model in a Workflow with a Python Tool - Alteryx Community) and I am able to call it back on new data &predict the results and write it back as a data frame.

 

I would like to know if this will work in the same way when placing in Alteryx gallery (my company's internal gallery).

 

AmirSems_charter
7 - Meteor

That is a great question and that depends 100% on the version of Python/Miniconda you have running. 


Did you wonder why you did not have to pip install anything? It was not because it was magic it is because it is already on your virtual environment. With that said you can navigate to Bin in Alteryx and check out what you have on their or reach out to Alteryx to give you that info. 

 

So case in point let me show you my version of scikit learn on my designer...

 

answer.PNG

So case in point the KNN Imputer cant run on my version. I could use simple imputer. 

 

Well i hope this answers your question. Good luck fellow Python user!

AddyGR
6 - Meteoroid

Thank you for your reply! I will check this out.

 

I still have a question though. In my workflow I read the path in which workflow is saved and I create pickle files in same folder. This works in local. Now when I save this workflow to gallery collections, how should I give a folder path

Labels