R/predict.R

Defines functions predict

Documented in predict

#' @title Predict
#' @description Predict for Logistic Regression.
#' @author Alberto AlmuiƱa
#' @param x_train Matrix with the predictor variables of the training dataset
#' @param x_test Matrix with the predictor variables of the test dataset
#' @param theta Matrix with the theta's values for sigmoid function
#' @return
#' Returns the predicted values for logistic regression

predict<-function(x_train,x_test, theta){

  pred_train<-sigmoid(x_train %*% theta)

  pred_test<-sigmoid(x_test %*% theta)

  return(list(pred_train = pred_train,
              pred_test = pred_test))
}
AlbertoAlmuinha/LogisticRegression documentation built on Jan. 5, 2020, 9:18 a.m.