forked from jkrijthe/RSSL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenerics.R
More file actions
90 lines (82 loc) · 2.53 KB
/
Copy pathGenerics.R
File metadata and controls
90 lines (82 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#' Responsibilities assigned to the unlabeled objects
#'
#' @param object Classifier; Trained Classifier
#' @param ... additional parameters
#' @return numeric; responsibilities on the unlabeled objects
#'
#' @export
#' @docType methods
#' @rdname responsibilities-methods
setGeneric("responsibilities",function(object, ...) {standardGeneric("responsibilities")})
#' Loss of a classifier or regression function
#'
#' @param object Classifier; Trained Classifier
#' @param y factor; True classes of the test data
#' @param newdata data.frame; object with test data
#' @param ... additional parameters
#' @return numeric; the total loss on the test data
#'
#' @export
#' @docType methods
#' @rdname loss-methods
setGeneric("loss",function(object, ...) {standardGeneric("loss")})
#' Loss of a classifier or regression function evaluated on partial labels
#'
#' @param object Classifier; Trained Classifier
#' @param ... additional parameters
#'
#' @export
#' @docType methods
#' @rdname losspart-methods
setGeneric("losspart",function(object, ...) {standardGeneric("losspart")})
#' LogsumLoss of a classifier or regression function
#'
#' @param object Classifier or Regression object
#' @param ... Additional parameters
#'
#' @export
#' @docType methods
#' @rdname losslogsum-methods
setGeneric("losslogsum",function(object, ...) {standardGeneric("losslogsum")})
#' Class Posteriors of a classifier
#'
#' @param object Classifier or Regression object
#' @param ... Additional parameters
#'
#' @export
#' @docType methods
#' @rdname posterior-methods
setGeneric("posterior",function(object, ...) {standardGeneric("posterior")})
#' Loss of a classifier or regression function
#'
#' @param object Classifier; Trained Classifier object
#' @param ... Not used
#' @return numeric of the total loss on the test data
#'
#' @docType methods
#' @rdname line_coefficients-methods
#' @export
setGeneric("line_coefficients",function(object, ...) {standardGeneric("line_coefficients")})
#' Decision values returned by a classifier for a set of objects
#'
#' Returns decision values of a classifier
#'
#' @param object Classifier object
#' @param newdata new data to classify
#'
#' @export
#' @docType methods
#' @rdname decisionvalues-methods
setGeneric("decisionvalues",function(object, newdata)
standardGeneric("decisionvalues")
)
#' Show RSSL classifier
#' @name rssl-formatting
#' @param object classifier
NULL
#' Predict using RSSL classifier
#' @name rssl-predict
#' @param object classifier
#' @param newdata objects to generate predictions for
#' @param ... Other arguments
NULL