File: similarity_measures_regression.Rd

package info (click to toggle)
r-cran-stablelearner 0.1-5%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 380 kB
  • sloc: makefile: 2
file content (138 lines) | stat: -rw-r--r-- 3,225 bytes parent folder | download | duplicates (3)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
\name{similarity_measures_regression}

\alias{similarity_measures_regression}
\alias{edist}
\alias{msdist}
\alias{rmsdist}
\alias{madist}
\alias{qadist}
\alias{cprob}
\alias{ccc}
\alias{pcc}
\alias{cosine}
\alias{rbfkernel}
\alias{tanimoto}

\title{Similarity Measure Infrastructure for Stability Assessment with Numerical Responses}

\description{
  Functions that provide objects with functionality used by 
  \code{\link{stability}} to measure the similarity between numeric 
  predictions of two results in regression problems.
}

\usage{
  edist()
  msdist()
  rmsdist()
  madist()
  qadist(p = 0.95)
  
  cprob(kappa = 0.1)
  rbfkernel()
  tanimoto()
  cosine()
  
  ccc()
  pcc()
}

\arguments{
  \item{p}{A numeric value between 0 and 1 specifying the probability to which 
  the sample quantile of the absolute distance between the predictions is 
  computed.}
  \item{kappa}{A positive numeric value specifying the upper limit of the 
  absolute distance between the predictions to which the coverage probability 
  is computed.}
}

\details{

  The similarity measure functions provide objects that include functionality 
  used by \code{\link{stability}} to measure the similarity between numeric 
  predictions of two results in regression problems.

  The \code{edist} (euclidean distance), \code{msdist} (mean squared distance), 
  \code{rmsdist} (root mean squared distance), \code{madist} (mean absolute 
  distance) and \code{qadist} (quantile of absolute distance) functions 
  implement scale-variant distance measures that are unbounded.

  The \code{cprob} (coverage probability), \code{rbfkernel} (gaussian radial 
  basis function kernel), \code{tanimoto} (tanimoto coefficient) and 
  \code{cosine} (cosine similarity) functions implement scale-variant distance 
  measures that are bounded.

  The \code{ccc} (concordance correlation coefficient) and \code{pcc} (pearson
  correlation coefficient) functions implement scale-invariant distance 
  measures that are bounded between 0 and 1.

}

\seealso{\code{\link{stability}}}

\examples{

\donttest{

set.seed(0)

library("partykit")

airq <- subset(airquality, !is.na(Ozone))
m1 <- ctree(Ozone ~ ., data = airq[sample(1:nrow(airq), replace = TRUE),])
m2 <- ctree(Ozone ~ ., data = airq[sample(1:nrow(airq), replace = TRUE),])

p1 <- predict(m1)
p2 <- predict(m2)

## euclidean distance
m <- edist()
m$measure(p1, p2)

## mean squared distance
m <- msdist()
m$measure(p1, p2)

## root mean squared distance
m <- rmsdist()
m$measure(p1, p2)

## mean absolute istance
m <- madist()
m$measure(p1, p2)

## quantile of absolute distance
m <- qadist()
m$measure(p1, p2)

## coverage probability
m <- cprob()
m$measure(p1, p2)

## gaussian radial basis function kernel
m <- rbfkernel()
m$measure(p1, p2)

## tanimoto coefficient
m <- tanimoto()
m$measure(p1, p2)

## cosine similarity
m <- cosine()
m$measure(p1, p2)

## concordance correlation coefficient
m <- ccc()
m$measure(p1, p2)

## pearson correlation coefficient
m <- pcc()
m$measure(p1, p2)

}

}

\keyword{stability}
\keyword{similariy}
\keyword{measures}