Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Supervised MultiModal Integration Tool
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
Container registry
Model registry
Analyze
Contributor 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
Baptiste Bauvin
Supervised MultiModal Integration Tool
Commits
3dc80bce
Commit
3dc80bce
authored
7 years ago
by
Baptiste Bauvin
Browse files
Options
Downloads
Patches
Plain Diff
Added logging commentary
parent
fd1103b3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/MonoMultiViewClassifiers/ResultAnalysis.py
+13
-0
13 additions, 0 deletions
Code/MonoMultiViewClassifiers/ResultAnalysis.py
with
13 additions
and
0 deletions
Code/MonoMultiViewClassifiers/ResultAnalysis.py
+
13
−
0
View file @
3dc80bce
...
@@ -45,6 +45,7 @@ def genNamesFromRes(mono, multi):
...
@@ -45,6 +45,7 @@ def genNamesFromRes(mono, multi):
def
resultAnalysis
(
benchmark
,
results
,
name
,
times
,
metrics
,
directory
,
minSize
=
10
):
def
resultAnalysis
(
benchmark
,
results
,
name
,
times
,
metrics
,
directory
,
minSize
=
10
):
mono
,
multi
=
results
mono
,
multi
=
results
for
metric
in
metrics
:
for
metric
in
metrics
:
logging
.
debug
(
"
Start:
\t
Score graph generation for
"
+
metric
[
0
])
names
=
genNamesFromRes
(
mono
,
multi
)
names
=
genNamesFromRes
(
mono
,
multi
)
nbResults
=
len
(
mono
)
+
len
(
multi
)
nbResults
=
len
(
mono
)
+
len
(
multi
)
validationScores
=
[
float
(
res
[
1
][
2
][
metric
[
0
]][
1
])
for
res
in
mono
]
validationScores
=
[
float
(
res
[
1
][
2
][
metric
[
0
]][
1
])
for
res
in
mono
]
...
@@ -78,9 +79,11 @@ def resultAnalysis(benchmark, results, name, times, metrics, directory, minSize=
...
@@ -78,9 +79,11 @@ def resultAnalysis(benchmark, results, name, times, metrics, directory, minSize=
plt
.
tight_layout
()
plt
.
tight_layout
()
f
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-
"
+
name
+
"
-
"
+
metric
[
0
]
+
"
.png
"
)
f
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-
"
+
name
+
"
-
"
+
metric
[
0
]
+
"
.png
"
)
plt
.
close
()
plt
.
close
()
logging
.
debug
(
"
Done:
\t
Score graph generation for
"
+
metric
[
0
])
def
analyzeIterLabels
(
labelsAnalysisList
,
directory
,
classifiersNames
,
minSize
=
10
):
def
analyzeIterLabels
(
labelsAnalysisList
,
directory
,
classifiersNames
,
minSize
=
10
):
logging
.
debug
(
"
Start:
\t
Global label analysis figure generation
"
)
nbExamples
=
labelsAnalysisList
[
0
].
shape
[
0
]
nbExamples
=
labelsAnalysisList
[
0
].
shape
[
0
]
nbClassifiers
=
len
(
classifiersNames
)
nbClassifiers
=
len
(
classifiersNames
)
nbIter
=
2
nbIter
=
2
...
@@ -99,6 +102,8 @@ def analyzeIterLabels(labelsAnalysisList, directory, classifiersNames, minSize=1
...
@@ -99,6 +102,8 @@ def analyzeIterLabels(labelsAnalysisList, directory, classifiersNames, minSize=1
fig
.
tight_layout
()
fig
.
tight_layout
()
fig
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-error_analysis.png
"
)
fig
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-error_analysis.png
"
)
plt
.
close
()
plt
.
close
()
logging
.
debug
(
"
Done:
\t
Global label analysis figure generation
"
)
logging
.
debug
(
"
Start:
\t
Global error by example figure generation
"
)
errorOnExamples
=
-
1
*
np
.
sum
(
data
,
axis
=
1
)
/
nbIter
+
(
nbClassifiers
*
len
(
labelsAnalysisList
))
errorOnExamples
=
-
1
*
np
.
sum
(
data
,
axis
=
1
)
/
nbIter
+
(
nbClassifiers
*
len
(
labelsAnalysisList
))
np
.
savetxt
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-clf_errors.csv
"
,
data
,
delimiter
=
"
,
"
)
np
.
savetxt
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-clf_errors.csv
"
,
data
,
delimiter
=
"
,
"
)
np
.
savetxt
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-example_errors.csv
"
,
errorOnExamples
,
delimiter
=
"
,
"
)
np
.
savetxt
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-example_errors.csv
"
,
errorOnExamples
,
delimiter
=
"
,
"
)
...
@@ -109,9 +114,11 @@ def analyzeIterLabels(labelsAnalysisList, directory, classifiersNames, minSize=1
...
@@ -109,9 +114,11 @@ def analyzeIterLabels(labelsAnalysisList, directory, classifiersNames, minSize=1
plt
.
title
(
"
Number of classifiers that failed to classify each example
"
)
plt
.
title
(
"
Number of classifiers that failed to classify each example
"
)
fig
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-example_errors.png
"
)
fig
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-example_errors.png
"
)
plt
.
close
()
plt
.
close
()
logging
.
debug
(
"
Done:
\t
Global error by example figure generation
"
)
def
analyzeLabels
(
labelsArrays
,
realLabels
,
results
,
directory
,
minSize
=
10
):
def
analyzeLabels
(
labelsArrays
,
realLabels
,
results
,
directory
,
minSize
=
10
):
logging
.
debug
(
"
Start:
\t
Label analysis figure generation
"
)
mono
,
multi
=
results
mono
,
multi
=
results
classifiersNames
=
genNamesFromRes
(
mono
,
multi
)
classifiersNames
=
genNamesFromRes
(
mono
,
multi
)
nbClassifiers
=
len
(
classifiersNames
)
nbClassifiers
=
len
(
classifiersNames
)
...
@@ -140,6 +147,9 @@ def analyzeLabels(labelsArrays, realLabels, results, directory, minSize = 10):
...
@@ -140,6 +147,9 @@ def analyzeLabels(labelsArrays, realLabels, results, directory, minSize = 10):
fig
.
tight_layout
()
fig
.
tight_layout
()
fig
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-error_analysis.png
"
)
fig
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-error_analysis.png
"
)
plt
.
close
()
plt
.
close
()
logging
.
debug
(
"
Done:
\t
Label analysis figure generation
"
)
logging
.
debug
(
"
Start:
\t
Error by example figure generation
"
)
errorOnExamples
=
-
1
*
np
.
sum
(
data
,
axis
=
1
)
/
nbIter
+
nbClassifiers
errorOnExamples
=
-
1
*
np
.
sum
(
data
,
axis
=
1
)
/
nbIter
+
nbClassifiers
np
.
savetxt
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-clf_errors.csv
"
,
data
,
delimiter
=
"
,
"
)
np
.
savetxt
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-clf_errors.csv
"
,
data
,
delimiter
=
"
,
"
)
np
.
savetxt
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-example_errors.csv
"
,
errorOnExamples
,
delimiter
=
"
,
"
)
np
.
savetxt
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-example_errors.csv
"
,
errorOnExamples
,
delimiter
=
"
,
"
)
...
@@ -150,6 +160,7 @@ def analyzeLabels(labelsArrays, realLabels, results, directory, minSize = 10):
...
@@ -150,6 +160,7 @@ def analyzeLabels(labelsArrays, realLabels, results, directory, minSize = 10):
plt
.
title
(
"
Number of classifiers that failed to classify each example
"
)
plt
.
title
(
"
Number of classifiers that failed to classify each example
"
)
fig
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-example_errors.png
"
)
fig
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-example_errors.png
"
)
plt
.
close
()
plt
.
close
()
logging
.
debug
(
"
Done:
\t
Error by example figure generation
"
)
return
data
return
data
...
@@ -201,6 +212,8 @@ def analyzeIterResults(iterResults, name, metrics, directory):
...
@@ -201,6 +212,8 @@ def analyzeIterResults(iterResults, name, metrics, directory):
nbIter
=
len
(
iterResults
)
nbIter
=
len
(
iterResults
)
names
=
genNamesFromRes
(
iterResults
[
0
][
0
],
iterResults
[
0
][
1
])
names
=
genNamesFromRes
(
iterResults
[
0
][
0
],
iterResults
[
0
][
1
])
for
metric
in
metrics
:
for
metric
in
metrics
:
logging
.
debug
(
"
Start:
\t
Global score graph generation for
"
+
metric
[
0
])
figure
=
genScoresNames
(
iterResults
,
metric
,
nbResults
,
names
,
nbMono
)
figure
=
genScoresNames
(
iterResults
,
metric
,
nbResults
,
names
,
nbMono
)
figure
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-
"
+
name
+
"
-Mean_on_
"
figure
.
savefig
(
directory
+
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
+
"
-
"
+
name
+
"
-Mean_on_
"
+
str
(
nbIter
)
+
"
_iter-
"
+
metric
[
0
]
+
"
.png
"
)
+
str
(
nbIter
)
+
"
_iter-
"
+
metric
[
0
]
+
"
.png
"
)
logging
.
debug
(
"
Done:
\t
Global score graph generation for
"
+
metric
[
0
])
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