Contents
Which is the best logistic regression model for fitted probabilities?
I would suggest giving glmnet a try- it introduces a regularization that can help a bit and should be performant. On the issue of 0/1 probabilities: it means your problem has separation or quasi-separation (a subset of the data that is predicted perfectly and may be running a subset of the coefficients out to infinity).
Which is the quantity on the left in a logistic regression?
The quantity on the left is the logarithm of the odds. So, the model is a linear regression of the log-odds, sometimes called logit, and hence the name logistic. Since I have more than one regressor ( Sales, cust_program_level, CUST_REGION_DESCR ), I assume I will have beta_0, beta_1, beta_2 or something like that.
How to find threshold in logistic regression model?
That means for one (/more) predictor (s) you can determine threshold which can predict the outcome exactly. With an handful of predictors you can always use table (for categorical predictors) or boxplot (plot continuous predictors against outcome) to find the offending predictors.
Is the perfect prediction problem a RStudio problem?
This is not a Rstudio problem but a modelling issue. As @JohnMount indicated you have so called PERFECT PREDICTION problem. That means for one (/more) predictor (s) you can determine threshold which can predict the outcome exactly.
How to create your own model in train?
Our function will be very simple: The function predict.ksvm will automatically create a factor vector as output. The function could also produce character values. Either way, the innards of train will make them factors and ensure that the same levels as the original data are used.
How to predict in the train.kknn function?
2) in train.kknn: I split the data and use 80% of the whole data and intend to use the rest 20% for prediction. Is it an correct common practice? 2) Or should I just use the original data (the whole data set) for train.kknn, and create a loop: data [-i,] for training, data [i,] for validation in kknn? So they will be the counterparts?