Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zeller Group
SIAMCAT
Commits
18363633
Commit
18363633
authored
Feb 16, 2022
by
Jakob Wirbel
Browse files
Fix bug with model interpretation plot for randomForest models. (github issue
#29
)
parent
3c8559c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
R/model_interpretation_plot.R
View file @
18363633
...
...
@@ -334,7 +334,7 @@ model.interpretation.plot <-
# Heatmap
if
(
verbose
>
2
)
message
(
"+++ plotting heatmap"
)
if
(
model.type
!=
"
R
andomForest"
)
{
if
(
model.type
!=
"
r
andomForest"
)
{
model.interpretation.heatmap.plot
(
image.data
=
img.data
,
limits
=
limits
,
...
...
@@ -359,7 +359,7 @@ model.interpretation.plot <-
image.data
=
img.data
,
limits
=
limits
,
color.scheme
=
color.scheme
,
effect.size
=
NULL
,
effect.size
=
bin.auroc.effect
,
verbose
=
verbose
)
}
...
...
@@ -414,7 +414,7 @@ model.interpretation.feature.weights.plot <-
verbose
=
0
)
{
if
(
verbose
>
2
)
message
(
"+ model.interpretation.feature.weights.plot"
)
if
(
mod.type
!=
"
R
andomForest"
)
{
if
(
mod.type
!=
"
r
andomForest"
)
{
relative.weights
<-
rel.weights
[
sel.idx
,
]
}
else
{
relative.weights
<-
-
rel.weights
[
sel.idx
,
]
...
...
@@ -423,7 +423,7 @@ model.interpretation.feature.weights.plot <-
low.qt
<-
rowQuantiles
(
relative.weights
,
probs
=
0.25
)
upp.qt
<-
rowQuantiles
(
relative.weights
,
probs
=
0.75
)
if
(
mod.type
!=
"
R
andomForest"
)
{
if
(
mod.type
!=
"
r
andomForest"
)
{
par
(
mar
=
c
(
0.1
,
1.1
,
0
,
1.1
))
mi
=
min
(
-
med
-
(
abs
(
low.qt
-
upp.qt
)))
mx
=
max
(
-
med
+
(
abs
(
low.qt
-
upp.qt
)))
...
...
Write
Preview
Supports
Markdown
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