Controlled Variables in Logistic Regression in Python

0 votes
I just learned what controlled variables mean for a project that I am doing, and I was trying to find if sci-kit learn has a controlled variable option. Specifically, does Python have controlled variable (not independent variables) for the logistic regression?

I googled stuff and found nothing for Python. However, I was thinking more basic and that controlled variables means stratifying the group you are interested (say race) and then going analysis on each group based on your x's and y. If this is correct, then I am suppose to interpret the results from those stratified groups, right?

Sorry, I asked two questions, but I am trying to gain much info on this controlled group idea and applications on Python
Apr 11, 2022 in Machine Learning by Dev
• 6,000 points
1,422 views

1 answer to this question.

0 votes

Control variables, as you may know, are factors that the researcher is not interested in examining but believes have a substantial impact on the value that your dependent variable takes. When conducting experiments, or gathering data, people usually keep the value of this variable constant.

Assume you're trying to model a person's health status, i.e., determine whether he's healthy or not, and you're using age, gender, and his/her activity routine as inputs to your model, and you want to see how each input influences your target variable. However, as you are well aware, the country in which the individual resides has an impact on his health (which encodes the climate, heath facility etc.). So, to ensure that this variable (country) has no bearing on your model, you must collect all of your data from a single country.

So, in response to your first question, no, Python does not provide controlled variables. It just assumes that the experimenter is interested in all of the input variables you're sending in.

In response to your second question, one method of dealing with control variables is to first group the data with respect to it, so that each group now has a constant value for that control variable. We then run Logistic regression or any model separately for each group, and then 'pool' the results from different models. However, if the number of levels in your control variable is really large, we must treat it as an independent variable and feed it into our model.

Ignite Your Future with Machine Learning Training

answered Apr 14, 2022 by anonymous

Related Questions In Machine Learning

0 votes
1 answer
0 votes
1 answer

Can we change the sigmoid with tanh in Logistic regression transforms??

Hi@Deepanshu, Yes, you can use tanh instead of ...READ MORE

answered May 12, 2020 in Machine Learning by MD
• 95,460 points
2,719 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,441 views
0 votes
1 answer
0 votes
1 answer

different results for Random Forest Regression in R and Python

Random Forests, as others have mentioned, have ...READ MORE

answered Apr 12, 2022 in Machine Learning by Dev
• 6,000 points
1,540 views
0 votes
1 answer

Plotting logistic regression in R with the Smarket dataset

The first, third, and fourth methods of ...READ MORE

answered Apr 12, 2022 in Machine Learning by Dev
• 6,000 points
990 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP