Txeo v0.1
A Developer-Friendly TensorFlow C++ Wrapper
Loading...
Searching...
No Matches
DataTableNorm.h
Go to the documentation of this file.
1#ifndef DATATABLENORM_H
2#define DATATABLENORM_H
3#include <functional>
4#pragma once
5
6#include "txeo/DataTable.h"
7#include "txeo/types.h"
8
9namespace txeo {
10
25template <typename T>
27 public:
28 DataTableNorm() = default;
29
30 DataTableNorm(const DataTableNorm &) = delete;
34 ~DataTableNorm() = default;
35
56
68 const txeo::DataTable<T> &data_table() const { return *_data_table; }
69
84
96 [[nodiscard]] txeo::NormalizationType type() const { return _type; }
97
114
128 return this->normalize(x.clone());
129 };
130
144
156
168
169 private:
171
172 const txeo::DataTable<T> *_data_table{nullptr};
173
174 std::vector<std::function<T(const T &)>> _funcs;
175};
176
177class DataTableNormError : public std::runtime_error {
178 public:
179 using std::runtime_error::runtime_error;
180};
181
182} // namespace txeo
183
184#endif
A container for managing training, evaluation, and test data splits.
Definition DataTable.h:24
DataTable< T > clone() const
A normalizer for DataTable objects that handles feature scaling.
DataTableNorm(const DataTableNorm &)=delete
txeo::Matrix< T > x_eval_normalized()
Get normalized evaluation data.
txeo::Matrix< T > x_test_normalized()
Get normalized test data.
DataTableNorm(const txeo::DataTable< T > &data, txeo::NormalizationType type=txeo::NormalizationType::MIN_MAX)
Construct a new DataTableNorm object with associated DataTable.
DataTableNorm & operator=(DataTableNorm &&)=default
txeo::Matrix< T > normalize(const txeo::Matrix< T > &x) const
Normalize a copy of the input matrix.
const txeo::DataTable< T > & data_table() const
Get the associated DataTable.
DataTableNorm(DataTableNorm &&)=default
DataTableNorm & operator=(const DataTableNorm &)=delete
txeo::Matrix< T > x_train_normalized()
Get normalized training data.
DataTableNorm()=default
~DataTableNorm()=default
txeo::Matrix< T > normalize(txeo::Matrix< T > &&x) const
Normalize a matrix using rvalue semantics (move data)
txeo::NormalizationType type() const
Get the current normalization type.
void set_data_table(const txeo::DataTable< T > &data)
Set a new DataTable for normalization.
NormalizationType
Normalization types to be used in normalization functions.
Definition types.h:38