Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
0a8da5ed
Commit
0a8da5ed
authored
Apr 30, 2012
by
Davis King
Browse files
Made these functions work even if one the labels never shows up
in the data.
parent
7e5cc9b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
dlib/svm/cross_validate_graph_labeling_trainer.h
dlib/svm/cross_validate_graph_labeling_trainer.h
+16
-4
No files found.
dlib/svm/cross_validate_graph_labeling_trainer.h
View file @
0a8da5ed
...
@@ -59,8 +59,14 @@ namespace dlib
...
@@ -59,8 +59,14 @@ namespace dlib
}
}
matrix
<
double
,
1
,
2
>
res
;
matrix
<
double
,
1
,
2
>
res
;
res
(
0
)
=
(
double
)
num_pos_correct
/
(
double
)(
num_pos
);
if
(
num_pos
!=
0
)
res
(
1
)
=
(
double
)
num_neg_correct
/
(
double
)(
num_neg
);
res
(
0
)
=
(
double
)
num_pos_correct
/
(
double
)(
num_pos
);
else
res
(
0
)
=
1
;
if
(
num_neg
!=
0
)
res
(
1
)
=
(
double
)
num_neg_correct
/
(
double
)(
num_neg
);
else
res
(
1
)
=
1
;
return
res
;
return
res
;
}
}
...
@@ -161,8 +167,14 @@ namespace dlib
...
@@ -161,8 +167,14 @@ namespace dlib
matrix
<
double
,
1
,
2
>
res
;
matrix
<
double
,
1
,
2
>
res
;
res
(
0
)
=
(
double
)
num_pos_correct
/
(
double
)(
num_pos
);
if
(
num_pos
!=
0
)
res
(
1
)
=
(
double
)
num_neg_correct
/
(
double
)(
num_neg
);
res
(
0
)
=
(
double
)
num_pos_correct
/
(
double
)(
num_pos
);
else
res
(
0
)
=
1
;
if
(
num_neg
!=
0
)
res
(
1
)
=
(
double
)
num_neg_correct
/
(
double
)(
num_neg
);
else
res
(
1
)
=
1
;
return
res
;
return
res
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment