Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
8b5c04d0
Commit
8b5c04d0
authored
Nov 10, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated code to work with new regression test output.
parent
df0f62d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
decision_functions.cpp
tools/python/src/decision_functions.cpp
+5
-0
testing_results.h
tools/python/src/testing_results.h
+11
-6
No files found.
tools/python/src/decision_functions.cpp
View file @
8b5c04d0
...
...
@@ -116,6 +116,7 @@ std::string regression_test__str__(const regression_test& item)
{
std
::
ostringstream
sout
;
sout
<<
"mean_squared_error: "
<<
item
.
mean_squared_error
<<
" R_squared: "
<<
item
.
R_squared
;
sout
<<
" mean_average_error: "
<<
item
.
mean_average_error
<<
" mean_error_stddev: "
<<
item
.
mean_error_stddev
;
return
sout
.
str
();
}
std
::
string
regression_test__repr__
(
const
regression_test
&
item
)
{
return
"< "
+
regression_test__str__
(
item
)
+
" >"
;}
...
...
@@ -247,6 +248,10 @@ void bind_decision_functions()
class_
<
regression_test
>
(
"_regression_test"
)
.
def
(
"__str__"
,
regression_test__str__
)
.
def
(
"__repr__"
,
regression_test__repr__
)
.
add_property
(
"mean_average_error"
,
&
regression_test
::
mean_average_error
,
"The mean average error of a regression function on a dataset."
)
.
add_property
(
"mean_error_stddev"
,
&
regression_test
::
mean_error_stddev
,
"The standard deviation of the absolute value of the error of a regression function on a dataset."
)
.
add_property
(
"mean_squared_error"
,
&
regression_test
::
mean_squared_error
,
"The mean squared error of a regression function on a dataset."
)
.
add_property
(
"R_squared"
,
&
regression_test
::
R_squared
,
...
...
tools/python/src/testing_results.h
View file @
8b5c04d0
...
...
@@ -19,14 +19,19 @@ struct binary_test
struct
regression_test
{
regression_test
()
:
mean_squared_error
(
0
),
R_squared
(
0
)
{}
regression_test
()
=
default
;
regression_test
(
const
dlib
::
matrix
<
double
,
1
,
2
>&
m
const
dlib
::
matrix
<
double
,
1
,
4
>&
m
)
:
mean_squared_error
(
m
(
0
)),
R_squared
(
m
(
1
))
{}
double
mean_squared_error
;
double
R_squared
;
R_squared
(
m
(
1
)),
mean_average_error
(
m
(
2
)),
mean_error_stddev
(
m
(
3
))
{}
double
mean_squared_error
=
0
;
double
R_squared
=
0
;
double
mean_average_error
=
0
;
double
mean_error_stddev
=
0
;
};
struct
ranking_test
...
...
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