diff --git a/src/DataSet/DataSet.cpp b/src/DataSet/DataSet.cpp index 214c987395dde5b15406b95a4637af2287c0beb0..71b288468a3e3da0024f2a7b78b912a3fdafbe90 100644 --- a/src/DataSet/DataSet.cpp +++ b/src/DataSet/DataSet.cpp @@ -351,6 +351,25 @@ namespace lib4neuro { } } + void DataSet::de_normalize() { + std::vector<double> tmp_inp(this->data.at(0).first.size()); + std::vector<double> tmp_out(this->data.at(0).second.size()); + + for(auto& pair: this->data) { + for(size_t i=0; i < pair.first.size(); i++) { + tmp_inp.at(i) = this->normalization_strategy->de_normalize(pair.first.at(i)); + } + pair.first = tmp_inp; + } + + for(auto& pair: this->data) { + for(size_t i=0; i < pair.second.size(); i++) { + tmp_out.at(i) = this->normalization_strategy->de_normalize(pair.second.at(i)); + } + pair.second = tmp_out; + } + } + void DataSet::de_normalize_single(std::vector<double> &d1, std::vector<double> &d2){ assert(d1.size() == d2.size()); for (size_t j = 0; j < d1.size(); ++j) { diff --git a/src/DataSet/DataSet.h b/src/DataSet/DataSet.h index 52ed4e74ea0664ec78bcaeb5aa8dacbed3baf63d..7793b7481d0d2761cb572c0e367b383cfa1b5b00 100644 --- a/src/DataSet/DataSet.h +++ b/src/DataSet/DataSet.h @@ -233,6 +233,11 @@ namespace lib4neuro { */ LIB4NEURO_API void normalize(); + /** + * Denormalizes the data set + */ + LIB4NEURO_API void de_normalize(); + /** * stores the de-normalized vector @d1 into @d2 * @param d1