If you're looking for code, I'm not familiar with C#. My answer will focus on theory.
tl;dr most machine learning-related packages have a built-in logistic regression function of some sort. That's what I'm recommending here.
More detail:
I would start with a basic model and work my way up. It sounds like this is something you can figure out using a regression model.
Based on your question: "Based on location, date (day, month), start time, end time, grade, hourly rate and hours, how can I work out the percentage chance of a shift being filled?", I understand you want:
- output: probability of shift getting filled
- input: location, date, start time, end time, grade, hourly rate, hours (these are $x$'s below)
If you're familiar with logistic regression:
$$log\left(\frac{p}{1-p}\right) = \beta_0 + \beta_1x_1 + \beta_2x_2 + ... + \beta_kx_k$$
the output of this model is the log odds of a single shift being filled (versus not filled). Note this can be rewritten as:
$$p = \frac{e^{\beta_0 + \beta_1x_1 + \beta_2x_2 + ... + \beta_kx_k}}{1-e^{\beta_0 + \beta_1x_1 + \beta_2x_2 + ... + \beta_kx_k}}$$
Where $p$ is the probability that the shift gets filled.
I would start by fitting one logistic regression model for each shift.
Be careful: multinomial regression would give you the probability of 1 shift out of k possible shifts being filled, but I don't think that's what you're looking for.
After seeing how well that worked (comparing the model predicted results to the actual percentages in the data), if necessary I would build a conditional model to take into account the probability of filling a shift, given other shifts have already been filled. Not sure how I'd do that yet, but hopefully this gives you a starting point!
EDIT based on the answer from Vikram Murthy:
I realize I forgot to mention: your response variable in this case would be 0 or 1 indicating whether a shift was filled or not. So for each shift, you would have a column indicating whether that shift was filled. That's the column being predicted. This is similar to using "dummy variables".
For example, if you have two shifts, your columns would be:
loc, day, month, starttime, endtime, grade, hourlyrate, hours, shift1_f, shift2_f
So your data might look something like this:
loc, day, month, starttime, endtime, grade, hourlyrate, hours, shift1_f, shift2_f
A, 1, 2, 12:00, 8:00, 1, 34.25, 8, 1, 0
A, 1, 2, 12:00, 8:00, 1, 34.25, 8, 0, 1
A, 1, 2, 12:00, 8:00, 1, 34.25, 8, 1, 1
A, 1, 2, 12:00, 8:00, 1, 34.25, 8, 0, 0
In this setup, this would indicate that shift 1 was filled in the first case, shift 2 was filled in the second case, both shifts in the third case, and no shifts in the last case.
Your two logistic regression models would be set up like this:
shift1_f = loc + day + month + starttime + endtime + grade + hourlyrate + hours
and
shift2_f = loc + day + month + starttime + endtime + grade + hourlyrate + hours
The proportions would be figured out automatically by the program; it's not necessary to figure them out yourself and enter them in any application of logistic regression that I've seen.