Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Cabieces
otb
Commits
a6ca8195
Commit
a6ca8195
authored
9 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
ENH: expose method to check if SVM model has probability estimates
parent
18a51239
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Modules/Learning/SVMLearning/include/otbSVMModel.h
+6
-0
6 additions, 0 deletions
Modules/Learning/SVMLearning/include/otbSVMModel.h
Modules/Learning/SVMLearning/include/otbSVMModel.txx
+1
-1
1 addition, 1 deletion
Modules/Learning/SVMLearning/include/otbSVMModel.txx
with
7 additions
and
1 deletion
Modules/Learning/SVMLearning/include/otbSVMModel.h
+
6
−
0
View file @
a6ca8195
...
@@ -307,6 +307,12 @@ public:
...
@@ -307,6 +307,12 @@ public:
return
static_cast
<
bool
>
(
m_Parameters
.
probability
);
return
static_cast
<
bool
>
(
m_Parameters
.
probability
);
}
}
/** Test if the model has probabilities */
bool
HasProbabilities
(
void
)
const
{
return
static_cast
<
bool
>
(
svm_check_probability_model
(
m_Model
));
}
/** Return number of support vectors */
/** Return number of support vectors */
int
GetNumberOfSupportVectors
(
void
)
const
int
GetNumberOfSupportVectors
(
void
)
const
{
{
...
...
This diff is collapsed.
Click to expand it.
Modules/Learning/SVMLearning/include/otbSVMModel.txx
+
1
−
1
View file @
a6ca8195
...
@@ -464,7 +464,7 @@ SVMModel<TValue, TLabel>::EvaluateProbabilities(const MeasurementType& measure)
...
@@ -464,7 +464,7 @@ SVMModel<TValue, TLabel>::EvaluateProbabilities(const MeasurementType& measure)
itkExceptionMacro(<< "Model is not up-to-date, can not predict probabilities");
itkExceptionMacro(<< "Model is not up-to-date, can not predict probabilities");
}
}
if (
svm_check_probability_model(m_Model) == 0
)
if (
!this->HasProbabilities()
)
{
{
throw itk::ExceptionObject(__FILE__, __LINE__,
throw itk::ExceptionObject(__FILE__, __LINE__,
"Model does not support probability estimates", ITK_LOCATION);
"Model does not support probability estimates", ITK_LOCATION);
...
...
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