|
Cosan
1.0
Data Analytics Library
|
Go to the documentation of this file.
5 #ifndef COSAN_OVERUNDERFLOW_H
6 #define COSAN_OVERUNDERFLOW_H
13 template<Numeric NumericType>
23 fmt::print(
"*********************************\n");
24 fmt::print(
"Begin cleaning up data of overflow/underflow!\n");
26 std::set<gsl::index> InfIdx;
28 InfIdx.insert(each[0]);
31 InfIdx.insert(each[0]);
34 InfIdx.insert(each[0]);
37 InfIdx.insert(each[0]);
39 std::vector<gsl::index> SelectedIdx;
40 for (
auto i = 0; i<RD.
GetrowsX();i++){
41 if (InfIdx.find(i)==InfIdx.end()){
42 SelectedIdx.push_back(i);
45 fmt::print(
"There are {:d} rows that have overflow/underflow data! Delete the whole rows. \n",InfIdx.size());
54 fmt::print(
"End of cleaning up data of overflow/underflow!\n");
55 fmt::print(
"*********************************\n");
59 std::vector<std::string> svaluesX;
60 std::vector<std::string> svaluesY;
61 for (gsl::index i=0; i< RD.
GetsvaluesX().size();i++){
62 if (InfIdx.find(i/NumOfCat)==InfIdx.end()){
73 #endif //COSAN_OVERUNDERFLOW_H
CosanMatrix< NumericType > GetInput()
Get a copy of CosanMatrix<NumericType> X.
CosanMatrix< NumericType > GetTarget()
Get a copy of CosanMatrix<NumericType> Y.
void UpdateData(const CosanMatrix< NumericType > &inputX)
Update X using CosanMatrix<NumericType> input X.
std::vector< std::string > GetsvaluesX() const
Get the vector of categorical data from X. order: row first.
std::set< gsl::index > GetcolCatX() const
Get the column index (in the origin X of csv file) where the column is of categorical type.
void UpdateCat(const std::vector< std::string > &inputX)
Update categorical vector svaluesX using std::vector<std::string> & inputX.
void fit(CosanRawData< NumericType > &RD)
std::vector< std::vector< gsl::index > > GetIdxminfY() const
Get the position of negative infinity in the origin data Y.
OverUnderFlow(CosanRawData< NumericType > &RD)
std::vector< std::vector< gsl::index > > GetIdxminfX() const
Get the position of negative infinity in the origin data X.
gsl::index GetrowsX()
Get the number of rows for X.
std::vector< std::vector< gsl::index > > GetIdxpinfX() const
Get the position of positive infinity in the origin data X.
std::vector< std::vector< gsl::index > > GetIdxpinfY() const
Get the position of positive infinity in the origin data Y.