Description Usage Arguments Details Value Examples
View source: R/LogisticRegression.R
Predicted values of a certain type based on a lr
object.
1 2 |
object |
an object of class " |
newdata |
an optional data frame to predict from. If omitted, predictions will be from the original data frame used to fit the model. |
thresh |
an optional threshold parameter, see 'Details'. |
type |
type of predictions, can be one of "preds", "probs" or "vals", see 'Details'. |
... |
further arguments |
Predictions from a logistic regression model are formed by first multiplying the model matrix by the parameter vector, i.e.
f(x; β) := X β.
These values are outputted when the type
argument is "vals". Predictions for the positive class can be obtained when these values
are above a certain threshold value, the argument thresh
, i.e.
f(x; β) ≥ t,
where the threshold t is usually equal to zero. This is how the predictions are made when the type
argument is "preds".
To get probabilities, the sigmoid
function is used on the values, i.e.
p(y=1) = 1/(1 + e^{-X β}).
a vector of predictions, probabilities or values, depending on the input to type
.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.