Commit 0b6d5df5 authored by Davis King's avatar Davis King

merged

parents 2b0a4a6f 8b5c04d0
......@@ -28,9 +28,8 @@ if(NOT TARGET dlib-shared AND NOT dlib_BINARY_DIR)
include("${dlib_CMAKE_DIR}/dlib.cmake")
endif()
find_library(dlib_LIBRARIES dlib HINTS "@CMAKE_INSTALL_FULL_LIBDIR@")
set(dlib_LIBRARIES ${dlib_LIBRARIES} "@dlib_needed_libraries@")
set(dlib_LIBS ${dlib_LIBRARIES} "@dlib_needed_libraries@")
set(dlib_LIBRARIES dlib::dlib)
set(dlib_LIBS dlib::dlib)
set(dlib_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@" "@dlib_needed_includes@")
mark_as_advanced(dlib_LIBRARIES)
......
......@@ -2167,6 +2167,7 @@ namespace
void test_simple_linear_regression_with_mult_prev()
{
srand(1234);
print_spinner();
const int num_samples = 1000;
::std::vector<matrix<double>> x(num_samples);
......
......@@ -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,
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment