Registrer MLPPHypothesisTesting into the ClassDB.

This commit is contained in:
Relintai 2023-02-12 16:19:06 +01:00
parent 81cd1dda68
commit ef7ba93eff
3 changed files with 14 additions and 7 deletions

View File

@ -6,13 +6,15 @@
#include "hypothesis_testing.h"
std::tuple<bool, real_t> MLPPHypothesisTesting::chiSquareTest(std::vector<real_t> observed, std::vector<real_t> 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<bool, real_t>();
}
void MLPPHypothesisTesting::_bind_methods() {
}

View File

@ -10,16 +10,19 @@
#include "core/math/math_defs.h"
#include "core/object/reference.h"
#include <tuple>
#include <vector>
class MLPPHypothesisTesting : public Reference {
GDCLASS(MLPPHypothesisTesting, Reference);
class MLPPHypothesisTesting {
public:
std::tuple<bool, real_t> chiSquareTest(std::vector<real_t> observed, std::vector<real_t> expected);
private:
protected:
static void _bind_methods();
};
#endif /* HypothesisTesting_hpp */

View File

@ -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<MLPPTransforms>();
ClassDB::register_class<MLPPStat>();
ClassDB::register_class<MLPPNumericalAnalysis>();
ClassDB::register_class<MLPPHypothesisTesting>();
ClassDB::register_class<MLPPHiddenLayer>();
ClassDB::register_class<MLPPOutputLayer>();