Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SISIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFCB
SISIR
Commits
8075776f
Commit
8075776f
authored
2 years ago
by
Nathalie Vialaneix
Browse files
Options
Downloads
Patches
Plain Diff
improved stop messages
parent
c7c6d696
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
R/plot_functions.R
+8
-4
8 additions, 4 deletions
R/plot_functions.R
with
8 additions
and
4 deletions
R/plot_functions.R
+
8
−
4
View file @
8075776f
...
...
@@ -146,23 +146,27 @@ plot_selection <- function(x, sel.type, threshold) {
is_selected
<-
"selected"
%in%
names
(
x
)
if
(
threshold
!=
"none"
)
{
if
(
!
is.numeric
(
threshold
))
stop
(
"'threshold' must be numeric."
)
if
(
!
is.numeric
(
threshold
))
stop
(
"'threshold' must be numeric."
,
call.
=
FALSE
)
if
(
is_selected
)
stop
(
paste
(
"A selection method has already been used: 'threshold' must"
,
"be 'none'."
))
"be 'none'."
),
call.
=
FALSE
)
if
(
sel.type
!=
"selection"
)
{
warning
(
paste
(
"A 'threshold' has passed to the plot function while"
,
"'sel.type' is not 'selection'. Automatically switching it"
,
"to 'selection'."
))
"to 'selection'."
),
call.
=
FALSE
)
sel.type
<-
"selection"
}
}
if
(
sel.type
==
"selection"
&&
!
is_selected
&&
threshold
==
"none"
)
stop
(
paste
(
"Variable selection was not used on this result. Choose"
,
"sel.type = 'importance'"
))
"sel.type = 'importance'"
),
call.
=
FALSE
)
lobj
<-
length
(
x
$
importances
)
nrepeats
<-
nrow
(
x
$
mse
)
/
lobj
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment