2
$\begingroup$

I have a data set that contains cyclists traffic, the independent variables are: day of week, high temp, humidity

the dependent variable is: total number of cyclists for that day.

Is it possible to predict what day of the week it is based on a given number of cyclists for that day? If so, what method should be used?

essentially, can you predict/estimate a independent variable from a dependent variable

Info about data set: ~40 entries for each day of week

based on total cyclists how can I predict what day of week it is?

my current idea is to use multinomial Naive Bayes and swap the variables so that days of week are dependent categorical and total cyclists are the independent variable.

I am trying to solve this with python so any starter material around using the suggested method would be helpful but not required.

$\endgroup$
2
  • $\begingroup$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. $\endgroup$
    – Community Bot
    Jul 26, 2023 at 15:20
  • $\begingroup$ How is the "dependence" and "independence" of these variables currently determined? This sounds like an observational dataset. What would distinguish count of cyclists from any of the other variables from this perspective? $\endgroup$
    – whuber
    Jul 26, 2023 at 18:50

2 Answers 2

2
$\begingroup$

"Dependent" and "independent" are not intrinsic properties of variables themselves, they are merely labels that describe how you use them. If you use X to predict Y, X is independent and Y is dependent, while if you use Y to predict X, Y is independent and X is dependent. Oftentimes you'll try to set the dependent and independent variables in a way that reflects causality, but it's not a requirement.

You seem to have defined your variables as "independent" or "dependent" based on domain knowledge of what is likely related or unrelated, but that sense of independence actually has nothing to do with the sense of dependent vs. independent variables in the context of statistical modelling. We can surmise that colloquially in the sense of causation, the day of the week cannot possibly "depend" on how many cyclists are out, but we can still build a model that treats it as such.

$\endgroup$
1
$\begingroup$

“Independent” and “dependent” variables describe how variables are used in a regression model. Without such a model, you just have variables.

The way you handle such a situation is to run a regression with the predictive variable(s) as independent as the outcome as dependent.

If you want to predict the day of the week from the number of cyclists, feel free to do so as you would predict anything else.

my current idea is to use multinomial Naive Bayes and swap the variables so that days of week are dependent categorical and total cyclists are the independent variable.

It is not clear that naïve Bayes is the right model over a multinomial logistic regression, random forest, or neural network (just to name a few), but $1)$ it might be, and $2)$ you’re getting the important idea that you can use whatever to predict whatever else if you would get use out of such a model.

$\endgroup$
1
  • $\begingroup$ One possible issue is that the days of the week are cyclical. You might get better performance by treating it as a circular variable. The downside is that this is harder analysis to understand and explain to stakeholders. $\endgroup$
    – Dave
    Jul 26, 2023 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.