diff --git a/mlpp/hypothesis_testing/hypothesis_testing.cpp b/mlpp/hypothesis_testing/hypothesis_testing.cpp index 0dde525..8c1b4d0 100644 --- a/mlpp/hypothesis_testing/hypothesis_testing.cpp +++ b/mlpp/hypothesis_testing/hypothesis_testing.cpp @@ -6,13 +6,15 @@ #include "hypothesis_testing.h" - - std::tuple MLPPHypothesisTesting::chiSquareTest(std::vector observed, std::vector expected) { - real_t df = observed.size() - 1; // These are our degrees of freedom + //real_t df = observed.size() - 1; // These are our degrees of freedom real_t sum = 0; - for (int i = 0; i < observed.size(); i++) { + for (uint32_t i = 0; i < observed.size(); i++) { sum += (observed[i] - expected[i]) * (observed[i] - expected[i]) / expected[i]; } + + return std::tuple(); } +void MLPPHypothesisTesting::_bind_methods() { +} diff --git a/mlpp/hypothesis_testing/hypothesis_testing.h b/mlpp/hypothesis_testing/hypothesis_testing.h index d38a0e8..970d454 100644 --- a/mlpp/hypothesis_testing/hypothesis_testing.h +++ b/mlpp/hypothesis_testing/hypothesis_testing.h @@ -10,16 +10,19 @@ #include "core/math/math_defs.h" +#include "core/object/reference.h" + #include #include +class MLPPHypothesisTesting : public Reference { + GDCLASS(MLPPHypothesisTesting, Reference); -class MLPPHypothesisTesting { public: std::tuple chiSquareTest(std::vector observed, std::vector expected); -private: +protected: + static void _bind_methods(); }; - #endif /* HypothesisTesting_hpp */ diff --git a/register_types.cpp b/register_types.cpp index 1a4c23f..a4320c0 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -56,6 +56,7 @@ SOFTWARE. #include "mlpp/mann/mann.h" #include "mlpp/log_reg/log_reg.h" #include "mlpp/lin_reg/lin_reg.h" +#include "mlpp/hypothesis_testing/hypothesis_testing.h" #include "test/mlpp_tests.h" @@ -71,6 +72,7 @@ void register_pmlpp_types(ModuleRegistrationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); + ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class();