|
Cosan
1.0
Data Analytics Library
|
Typedefs | |
| template<Numeric NumericType> | |
| using | CosanMatrix = Eigen::Matrix< NumericType, Eigen::Dynamic, Eigen::Dynamic > |
| template<Numeric NumericType> | |
| using | CosanColVector = Eigen::Matrix< NumericType, Eigen::Dynamic, 1 > |
| template<Numeric NumericType> | |
| using | CosanRowVector = Eigen::Matrix< NumericType, 1, Eigen::Dynamic > |
| template<typename NumericType , typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type> | |
| using | vec = std::vector< NumericType > |
Enumerations | |
| enum | EProblemType { PdNone = 0, PdBinaryClassification = 1, PdUnivariateRegression =2 } |
| enum | EModelType { MdNone = 0, MdLinearRegression =1, MdRidgeRegression =2, MdPrincipalComponentRegression =3, MdRidgePrincipalComponentRegression =4 } |
| enum | ESolverType { SrAuto = 0, ADMM = 1 } |
Functions | |
| template<Numeric NumericType> | |
| NumericType | getVMean (const std::vector< NumericType > &v) |
| Calculate the mean of std::vector<NumericType> More... | |
| template<Numeric NumericType> | |
| NumericType | StringToNum (const std::string &arg, std::size_t *pos=0) |
| General string to number conversion function. More... | |
| template<Numeric NumericType, Derived< CosanModel > Model, Derived< CosanMetric< NumericType >> Metric, Derived< Splitter > Split> | |
| NumericType | crossValidation (CosanData< NumericType > &CRD, Model &estimator, Metric &metric, Split &split) |
| template<Numeric NumericType, Derived< CosanModel > Model, Derived< CosanMetric< NumericType >> Metric, Derived< Splitter > Split> | |
| NumericType | crossValidationParallel (CosanData< NumericType > &CRD, Model &estimator, Metric &metric, Split &split, int nthreads=-1) |
| template<typename NumericType , typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type> | |
| bool | SameSize (const CosanMatrix< NumericType > &m1, const CosanMatrix< NumericType > &m2) |
| template<typename NumericType , typename = typename std::enable_if<std::is_arithmetic<NumericType>::value,NumericType>::type> | |
| bool | LabelShape (const CosanMatrix< NumericType > &m) |
| template<typename NumericType = std::string> | |
| NumericType | StringToNum (std::string arg) |
Variables | |
| Cosan::DiffSizeException | DiffSize |
| Cosan::TooSmallSizeException | SmallRows |
| Cosan::InvalidLabelShapeException | InvalidLabelShape |
| using Cosan::CosanColVector = typedef Eigen::Matrix<NumericType, Eigen::Dynamic, 1> |
| using Cosan::CosanMatrix = typedef Eigen::Matrix<NumericType, Eigen::Dynamic, Eigen::Dynamic> |
| using Cosan::CosanRowVector = typedef Eigen::Matrix<NumericType, 1, Eigen::Dynamic> |
| using Cosan::vec = typedef std::vector<NumericType> |
Definition at line 14 of file templateTest.cpp.
| enum Cosan::EModelType |
Model Type
| Enumerator | |
|---|---|
| MdNone | |
| MdLinearRegression | |
| MdRidgeRegression | |
| MdPrincipalComponentRegression | |
| MdRidgePrincipalComponentRegression | |
Definition at line 21 of file CosanModel.h.
| enum Cosan::EProblemType |
Problem Type.
| Enumerator | |
|---|---|
| PdNone | |
| PdBinaryClassification | |
| PdUnivariateRegression | |
Definition at line 13 of file CosanModel.h.
| enum Cosan::ESolverType |
| NumericType Cosan::crossValidation | ( | CosanData< NumericType > & | CRD, |
| Model & | estimator, | ||
| Metric & | metric, | ||
| Split & | split | ||
| ) |
Definition at line 32 of file crossvalidation.h.
| NumericType Cosan::crossValidationParallel | ( | CosanData< NumericType > & | CRD, |
| Model & | estimator, | ||
| Metric & | metric, | ||
| Split & | split, | ||
| int | nthreads = -1 |
||
| ) |
Definition at line 62 of file crossvalidation.h.
| NumericType Cosan::getVMean | ( | const std::vector< NumericType > & | v | ) |
Calculate the mean of std::vector<NumericType>
| NumericType |
| v |
Definition at line 96 of file statistics.h.
| bool Cosan::LabelShape | ( | const CosanMatrix< NumericType > & | m | ) |
Definition at line 46 of file ArgCheck.h.
| bool Cosan::SameSize | ( | const CosanMatrix< NumericType > & | m1, |
| const CosanMatrix< NumericType > & | m2 | ||
| ) |
Definition at line 29 of file ArgCheck.h.
| NumericType Cosan::StringToNum | ( | const std::string & | arg, |
| std::size_t * | pos = 0 |
||
| ) |
General string to number conversion function.
As we allow for user-determined numeric type NumericType, the detailed implementation or functions needed maybe slightly different among each other. For instance, when we are trying to read data from csv file. Different data type requires different string-to-numeric function. For double, one is required std::stod while 'std::stof' is the candidate function if float is chosen. To take care of this variant before running time, we conside the static-i. The feature allows us to discard branches of an if statement at compile-time based on a constant expression condition. In the following code as an example, we define a template function with input requiring NumericType as numeric and then the implementation is decided via if constexpr statement.
Definition at line 25 of file utils.h.
| NumericType Cosan::StringToNum | ( | std::string | arg | ) |
Definition at line 22 of file templateTest.cpp.
| Cosan::DiffSizeException Cosan::DiffSize |
| Cosan::InvalidLabelShapeException Cosan::InvalidLabelShape |
| Cosan::TooSmallSizeException Cosan::SmallRows |