Unable to select a target variable in linear regression
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am trying to run a linear regression. I dropped the data in the canvas and I can see the data loaded successfully but when I try to run a regression the dropdown menu for target variable is blank. what am I doing wrong?
- Labels:
- Prescriptive Analytics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @PaoloP
Would you please check the data type of your target variable?
You can drop a select tool between your input and the linear regression to change the type to numeric if need be.
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes it is numeric. I dropped the select tool and it says the "Type" of each variable is "V_String"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @PaoloP
If your target is continuous, I would change it to double. Please try this out and see if it will solve the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
See attached. Thanks for the help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @PaoloP
Alteryx imports all variables coming from a csv file as strings by default, but the Linear Regression tool only accepts numerical values as a target variable.
As mentioned by @christine_assaad ,you can use a Select tool before the Regression tool and manually change each variable type or you could try an Auto Field tool (example workflow attached), which does the job automatically, then you´ll be able to choose the target:
Hope it helps
Regards
