Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
old_macaon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Franck Dary
old_macaon
Commits
2e407928
Commit
2e407928
authored
6 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Added more info to errors evaluation
parent
6a9e3b32
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
error_correction/include/Error.hpp
+4
-0
4 additions, 0 deletions
error_correction/include/Error.hpp
error_correction/src/Error.cpp
+25
-0
25 additions, 0 deletions
error_correction/src/Error.cpp
with
29 additions
and
0 deletions
error_correction/include/Error.hpp
+
4
−
0
View file @
2e407928
...
@@ -18,12 +18,16 @@ class Error
...
@@ -18,12 +18,16 @@ class Error
std
::
string
gold
;
std
::
string
gold
;
Classifier
::
WeightedActions
weightedActions
;
Classifier
::
WeightedActions
weightedActions
;
std
::
string
type
;
std
::
string
type
;
int
indexOfPrediction
;
int
indexOfGold
;
int
distanceWithGold
;
public
:
public
:
Error
(
std
::
string
&
,
std
::
string
&
,
Classifier
::
WeightedActions
&
);
Error
(
std
::
string
&
,
std
::
string
&
,
Classifier
::
WeightedActions
&
);
bool
isError
()
const
;
bool
isError
()
const
;
const
std
::
string
&
getType
()
const
;
const
std
::
string
&
getType
()
const
;
const
bool
goldWasAtDistance
();
};
};
class
ErrorSequence
class
ErrorSequence
...
...
This diff is collapsed.
Click to expand it.
error_correction/src/Error.cpp
+
25
−
0
View file @
2e407928
...
@@ -4,6 +4,31 @@ Error::Error(std::string & prediction, std::string & gold, Classifier::WeightedA
...
@@ -4,6 +4,31 @@ Error::Error(std::string & prediction, std::string & gold, Classifier::WeightedA
prediction
(
prediction
),
gold
(
gold
),
weightedActions
(
weightedActions
)
prediction
(
prediction
),
gold
(
gold
),
weightedActions
(
weightedActions
)
{
{
type
=
prediction
+
"->"
+
gold
;
type
=
prediction
+
"->"
+
gold
;
indexOfPrediction
=
-
1
;
indexOfGold
=
-
1
;
distanceWithGold
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
weightedActions
.
size
();
i
++
)
{
if
(
weightedActions
[
i
].
second
.
second
==
prediction
)
indexOfPrediction
=
i
;
if
(
weightedActions
[
i
].
second
.
second
==
gold
)
indexOfGold
=
i
;
if
(
weightedActions
[
i
].
first
&&
indexOfPrediction
!=
-
1
&&
indexOfGold
==
-
1
)
distanceWithGold
++
;
}
if
(
indexOfPrediction
==
-
1
||
indexOfGold
==
-
1
)
{
fprintf
(
stderr
,
"ERROR (%s) : weightedActions do not contain prediction or gold. Aborting.
\n
"
,
ERRINFO
);
exit
(
1
);
}
if
(
distanceWithGold
!=
0
&&
!
isError
())
{
fprintf
(
stderr
,
"ERROR (%s) : incoherent Error initialization. Aborting.
\n
"
,
ERRINFO
);
exit
(
1
);
}
}
}
const
std
::
string
&
Error
::
getType
()
const
const
std
::
string
&
Error
::
getType
()
const
...
...
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