In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Multi-armed Bandit Problem in Alteryx

a150138
6 - Meteoroid
Hi Alteryx!

Is anyone familiar with the Multi-armed Bandit problem (see: https://www.analyticsvidhya.com/blog/2018/09/reinforcement-multi-armed-bandit-scratch-python/)?

Looking at the code, it seems that the use of iterative macro is necessary. Anyone has an idea how to proceed with this, like a sample workflow?

Thanks all.

- Tiff
2 REPLIES 2
JohnJPS
15 - Aurora

Hi @a150138 

 

You're right that some sort of iterative macro would probably be needed, however before doing that, since the Python code is literally right there ready to cut and paste, I would consider using the Python tool, or perhaps the R if that works better for you. I've attached a workflow that duplicates their example in Alteryx with both R and Python.

 

Notes:

  • I did rearrange things a little
  • I output only the "total reward" figures that are calculated
  • I commented out anything that wasn't contributing to that calculation
  • Python's "Alteryx.read" didn't play nice with my laptop's crazy security, so I read the physical file from within the Python, rather than grabbing input #1... you can comment out the physical file read and comment back in the Alteryx.read(#1) and it should work for you.

 

Hope that helps!

John

a150138
6 - Meteoroid

Hi John,

 

Very useful and thanks for the guidance! I will explore the R & Python code inside and see whether I can take it a step further by converting it into a macro (Still learning).

🙂

Labels
Top Solution Authors