Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Armin Rauschenberger
joinet
Commits
71948291
Commit
71948291
authored
Jan 21, 2019
by
Armin Rauschenberger
Browse files
automation
parent
a79a8bca
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
.Rhistory
View file @
71948291
This diff is collapsed.
Click to expand it.
R/functions.R
View file @
71948291
...
...
@@ -405,11 +405,14 @@ predict.cornet <- function(object,newx,type="probability",...){
#' Compares models for a continuous response with a cutoff value
#'
#' @inheritParams cornet
#'
#' @param trial
#' logical
#'
#' @examples
#' NA
#'
.compare
<-
function
(
y
,
cutoff
,
X
,
alpha
=
1
,
nfolds
=
5
,
foldid
=
NULL
,
type.measure
=
"deviance"
){
.compare
<-
function
(
y
,
cutoff
,
X
,
alpha
=
1
,
nfolds
=
5
,
foldid
=
NULL
,
type.measure
=
"deviance"
,
trial
=
FALSE
){
z
<-
1
*
(
y
>
cutoff
)
if
(
is.null
(
foldid
)){
...
...
@@ -439,8 +442,15 @@ predict.cornet <- function(object,newx,type="probability",...){
type
<-
c
(
"deviance"
,
"class"
,
"mse"
,
"mae"
,
"auc"
)
loss
<-
lapply
(
X
=
type
,
FUN
=
function
(
x
)
cornet
:::
.loss
(
y
=
z
,
fit
=
pred
,
family
=
"binomial"
,
type.measure
=
x
,
foldid
=
fold
)[[
1
]])
names
(
loss
)
<-
type
if
(
trial
){
list
<-
list
(
diff
=
(
pred
-
z
)
^
2
,
loss
=
loss
)
return
(
list
)
}
else
{
return
(
loss
)
}
return
(
loss
)
}
#' @title
...
...
docs/reference/dot-compare.html
View file @
71948291
...
...
@@ -112,7 +112,7 @@
</div>
<pre
class=
"usage"
><span
class=
'fu'
>
.compare
</span>
(
<span
class=
'no'
>
y
</span>
,
<span
class=
'no'
>
cutoff
</span>
,
<span
class=
'no'
>
X
</span>
,
<span
class=
'kw'
>
alpha
</span>
<span
class=
'kw'
>
=
</span>
<span
class=
'fl'
>
1
</span>
,
<span
class=
'kw'
>
nfolds
</span>
<span
class=
'kw'
>
=
</span>
<span
class=
'fl'
>
5
</span>
,
<span
class=
'kw'
>
foldid
</span>
<span
class=
'kw'
>
=
</span>
<span
class=
'kw'
>
NULL
</span>
,
<span
class=
'kw'
>
type.measure
</span>
<span
class=
'kw'
>
=
</span>
<span
class=
'st'
>
"deviance"
</span>
)
</pre>
<span
class=
'kw'
>
type.measure
</span>
<span
class=
'kw'
>
=
</span>
<span
class=
'st'
>
"deviance"
</span>
,
<span
class=
'kw'
>
trial
</span>
<span
class=
'kw'
>
=
</span>
<span
class=
'fl'
>
FALSE
</span>
)
</pre>
<h2
class=
"hasAnchor"
id=
"arguments"
><a
class=
"anchor"
href=
"#arguments"
></a>
Arguments
</h2>
<table
class=
"ref-arguments"
>
...
...
@@ -153,6 +153,10 @@ or <code>NULL</code> (balance)</p></td>
<td><p>
loss function for binary classification
(linear regression uses the deviance)
</p></td>
</tr>
<tr>
<th>
trial
</th>
<td><p>
logical
</p></td>
</tr>
</table>
...
...
man/dot-compare.Rd
View file @
71948291
...
...
@@ -5,7 +5,7 @@
\title{Comparison}
\usage{
.compare(y, cutoff, X, alpha = 1, nfolds = 5, foldid = NULL,
type.measure = "deviance")
type.measure = "deviance"
, trial = FALSE
)
}
\arguments{
\item{y}{continuous response\strong{:}
...
...
@@ -29,6 +29,8 @@ or \code{NULL} (balance)}
\item{type.measure}{loss function for binary classification
(linear regression uses the deviance)}
\item{trial}{logical}
}
\description{
Compares models for a continuous response with a cutoff value
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment