mirror of
https://github.com/Relintai/pmlpp.git
synced 2025-01-02 16:29:35 +01:00
Registrer MLPPHypothesisTesting into the ClassDB.
This commit is contained in:
parent
81cd1dda68
commit
ef7ba93eff
@ -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() {
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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>();
|
||||
|
Loading…
Reference in New Issue
Block a user