Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

SMOTE in Designer - Is it possible? - Machine Learning Question

alkan
7 - Meteor

Hello Everyone, 

 

I am working with a heavily imbalanced dataset where I am trying to create synthetic data for the minority target variables to balance out the target so the algorithms can learn better. I have no Python or R coding skills and was wondering if there is any tool or Macro available out there in Designer that would allow me to create synthetic data to balance out my target field. It is a multiclassification dataset and out of 6 total target variables, 3 of them are heavily imbalanced. I looked at the Oversample tool but that seems to do the opposite of what I am trying to achieve. I think some of the more recent versions of Designer and/or BI Suite has this capability but unfortunately i only have access to Designer 20202.

Thank you 

15 REPLIES 15
alkan
7 - Meteor

Hi @AkimasaKajitani ,

 

I am sorry for the trouble and thank you again for helping me out. I am still getting the below error using the latest macro you sent me. I am on version 2020.2.3.

 

 

 

alkan_0-1647789386269.png

 

alkan_1-1647789669952.png

 

 

 

AkimasaKajitani
17 - Castor
17 - Castor

Hi @alkan 

 

It is difficult to understand the current situation for this short error message.

 

Please open the macro, could you please run the python code step by step and send the full error message?

 

AkimasaKajitani_0-1647830499742.png

 

 

alkan
7 - Meteor

Hi @AkimasaKajitani ,

 

Below is the error message that i receive when i step into the Python code.

Thank you

 

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-cd9b84157175> in <module>
      1 from ayx import Alteryx
----> 2 from imblearn.over_sampling import SMOTE
      3 from imblearn.over_sampling import SMOTEN
      4 from imblearn.over_sampling import SMOTENC
      5 from imblearn.over_sampling import ADASYN

ModuleNotFoundError: No module named 'imblearn  .
 

 

 

AkimasaKajitani
17 - Castor
17 - Castor

Hi @alkan ,

 

Thank you for your try and sharing the error message.

Regarding the ModuleNotFoundError, I found the this post below.

 

Workaround for PythonTool's ModuleNotFoundError: No module named "xxxxx" issue

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Workaround-for-PythonTool-s-ModuleNotF...

 

According to the post, it is the problem about admin rights.

Please check that post and try to the workaround.

 

alkan
7 - Meteor

Hi @AkimasaKajitani ,

 

Thank you again for your very helpful insight. I read thru the workaround for the ModuleNotFoundError. Option 1 and 2 require to be an admin if i understand correctly which I am not so i cant implement any of those.

 

I am not sure if I can implement option 3 mentioned in the article as a non admin as i dont even know how to import any libraries using the instructions. I think your macro would definitely be a solution to my problem if i had a little bit more understanding of Python and its libraries. I will mark this as resolved regardless, you have been very helpful.

 

If there is anyway maybe you can simplify the instructions under Option 3 for me, maybe I can try to implement, otherwise as always, much appreciated.

 

Thank you 

AkimasaKajitani
17 - Castor
17 - Castor

Hi @alkan ,

 

Yes, your understand is correct. The administrator rights is needed to do workaround.

I hope that you can get the admin rights temporally. If you can get it temporally when you install the packages, after that you can continuously use the macro.

 

Labels