mirror of
https://github.com/Relintai/pmlpp.git
synced 2024-12-21 14:56:47 +01:00
Tweaks to MLPPUniLinReg.
This commit is contained in:
parent
28b7007bb7
commit
63d8dbf676
@ -43,7 +43,7 @@ void MLPPUniLinReg::set_b1(const real_t val) {
|
||||
_b1 = val;
|
||||
}
|
||||
|
||||
void MLPPUniLinReg::fit() {
|
||||
void MLPPUniLinReg::train() {
|
||||
ERR_FAIL_COND(!_input_set.is_valid() || !_output_set.is_valid());
|
||||
|
||||
MLPPStat estimator;
|
||||
@ -66,7 +66,7 @@ MLPPUniLinReg::MLPPUniLinReg(const Ref<MLPPVector> &p_input_set, const Ref<MLPPV
|
||||
_input_set = p_input_set;
|
||||
_output_set = p_output_set;
|
||||
|
||||
fit();
|
||||
train();
|
||||
}
|
||||
|
||||
MLPPUniLinReg::MLPPUniLinReg() {
|
||||
@ -93,7 +93,7 @@ void MLPPUniLinReg::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_b1", "val"), &MLPPUniLinReg::set_b1);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "b1"), "set_b1", "get_b1");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("fit"), &MLPPUniLinReg::fit);
|
||||
ClassDB::bind_method(D_METHOD("train"), &MLPPUniLinReg::train);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("model_set_test", "x"), &MLPPUniLinReg::model_set_test);
|
||||
ClassDB::bind_method(D_METHOD("model_test", "x"), &MLPPUniLinReg::model_test);
|
||||
|
@ -10,13 +10,13 @@
|
||||
|
||||
#include "core/math/math_defs.h"
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/resource.h"
|
||||
|
||||
#include "../lin_alg/mlpp_matrix.h"
|
||||
#include "../lin_alg/mlpp_vector.h"
|
||||
|
||||
class MLPPUniLinReg : public Reference {
|
||||
GDCLASS(MLPPUniLinReg, Reference);
|
||||
class MLPPUniLinReg : public Resource {
|
||||
GDCLASS(MLPPUniLinReg, Resource);
|
||||
|
||||
public:
|
||||
Ref<MLPPVector> get_input_set() const;
|
||||
@ -31,7 +31,7 @@ public:
|
||||
real_t get_b1() const;
|
||||
void set_b1(const real_t val);
|
||||
|
||||
void fit();
|
||||
void train();
|
||||
|
||||
Ref<MLPPVector> model_set_test(const Ref<MLPPVector> &x);
|
||||
real_t model_test(real_t x);
|
||||
|
Loading…
Reference in New Issue
Block a user