Cosan
1.0
Data Analytics Library
ordinalEncoder.h
Go to the documentation of this file.
1
#ifndef COSAN_ORDINALENCODER_H
2
#define COSAN_ORDINALENCODER_H
3
4
#include <
cosan/preprocessing/encoder.h
>
5
6
namespace
Cosan
{
7
template
<Numeric NumericType>
8
class
OrdinalEncoder
:
public
Encoder
<NumericType> {
9
public
:
10
std::vector<int>
getEncoding
(
int
colIdx,
const
std::string &category) {
11
int
ordinal = this->
getCategories
()[colIdx][category];
12
std::vector<int> encoding{};
13
encoding.push_back(ordinal);
14
return
encoding;
15
}
16
17
};
18
19
}
20
21
22
#endif //COSAN_ORDINALENCODER_H
encoder.h
Cosan
Definition:
CosanBO.h:29
Cosan::Encoder
Definition:
encoder.h:9
Cosan::Encoder::getCategories
std::vector< std::unordered_map< std::string, gsl::index > > getCategories() const
Definition:
encoder.h:71
Cosan::OrdinalEncoder
Definition:
ordinalEncoder.h:8
Cosan::OrdinalEncoder::getEncoding
std::vector< int > getEncoding(int colIdx, const std::string &category)
Definition:
ordinalEncoder.h:10
cosan
preprocessing
ordinalEncoder.h
Generated by
1.8.20