Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
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
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
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
33a0fbd9
Commit
33a0fbd9
authored
6 years ago
by
Kim Albertsson
Committed by
Lorenzo Moneta
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[TMVA] CV modernise -- add braces for all if/for statements
parent
cd64042b
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
tmva/tmva/src/CrossValidation.cxx
+15
-8
15 additions, 8 deletions
tmva/tmva/src/CrossValidation.cxx
with
15 additions
and
8 deletions
tmva/tmva/src/CrossValidation.cxx
+
15
−
8
View file @
33a0fbd9
...
...
@@ -98,7 +98,9 @@ TMultiGraph *TMVA::CrossValidationResult::GetROCCurves(Bool_t /*fLegend*/)
Float_t
TMVA
::
CrossValidationResult
::
GetROCAverage
()
const
{
Float_t
avg
=
0
;
for
(
auto
&
roc
:
fROCs
)
avg
+=
roc
.
second
;
for
(
auto
&
roc
:
fROCs
)
{
avg
+=
roc
.
second
;
}
return
avg
/
fROCs
.
size
();
}
...
...
@@ -108,7 +110,9 @@ Float_t TMVA::CrossValidationResult::GetROCStandardDeviation() const
// NOTE: We are using here the unbiased estimation of the standard deviation.
Float_t
std
=
0
;
Float_t
avg
=
GetROCAverage
();
for
(
auto
&
roc
:
fROCs
)
std
+=
TMath
::
Power
(
roc
.
second
-
avg
,
2
);
for
(
auto
&
roc
:
fROCs
)
{
std
+=
TMath
::
Power
(
roc
.
second
-
avg
,
2
);
}
return
TMath
::
Sqrt
(
std
/
float
(
fROCs
.
size
()
-
1.0
));
}
...
...
@@ -120,8 +124,9 @@ void TMVA::CrossValidationResult::Print() const
MsgLogger
fLogger
(
"CrossValidation"
);
fLogger
<<
kHEADER
<<
" ==== Results ===="
<<
Endl
;
for
(
auto
&
item
:
fROCs
)
for
(
auto
&
item
:
fROCs
)
{
fLogger
<<
kINFO
<<
Form
(
"Fold %i ROC-Int : %.4f"
,
item
.
first
,
item
.
second
)
<<
std
::
endl
;
}
fLogger
<<
kINFO
<<
"------------------------"
<<
Endl
;
fLogger
<<
kINFO
<<
Form
(
"Average ROC-Int : %.4f"
,
GetROCAverage
())
<<
Endl
;
...
...
@@ -279,14 +284,15 @@ void TMVA::CrossValidation::ParseOptions()
// Factory options
fAnalysisTypeStr
.
ToLower
();
if
(
fAnalysisTypeStr
==
"classification"
)
if
(
fAnalysisTypeStr
==
"classification"
)
{
fAnalysisType
=
Types
::
kClassification
;
else
if
(
fAnalysisTypeStr
==
"regression"
)
}
else
if
(
fAnalysisTypeStr
==
"regression"
)
{
fAnalysisType
=
Types
::
kRegression
;
else
if
(
fAnalysisTypeStr
==
"multiclass"
)
}
else
if
(
fAnalysisTypeStr
==
"multiclass"
)
{
fAnalysisType
=
Types
::
kMulticlass
;
else
if
(
fAnalysisTypeStr
==
"auto"
)
}
else
if
(
fAnalysisTypeStr
==
"auto"
)
{
fAnalysisType
=
Types
::
kNoAnalysisType
;
}
if
(
fVerbose
)
{
fCvFactoryOptions
+=
"V:"
;
...
...
@@ -570,7 +576,8 @@ void TMVA::CrossValidation::Evaluate()
//_______________________________________________________________________
const
std
::
vector
<
TMVA
::
CrossValidationResult
>
&
TMVA
::
CrossValidation
::
GetResults
()
const
{
if
(
fResults
.
size
()
==
0
)
if
(
fResults
.
size
()
==
0
)
{
Log
()
<<
kFATAL
<<
"No cross-validation results available"
<<
Endl
;
}
return
fResults
;
}
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