Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
utils.cpp File Reference
#include "utils.h"
#include "rnd.h"
#include <unordered_set>
Include dependency graph for utils.cpp:

Go to the source code of this file.

Namespaces

namespace  Brush
 < nsga2 selection operator for getting the front
 
namespace  Brush::Util
 namespace containing various utility functions
 

Functions

void Brush::Util::clean (ArrayXf &x)
 limits node output to be between MIN_FLT and MAX_FLT
 
std::string Brush::Util::ltrim (std::string str, const std::string &chars)
 
std::string Brush::Util::rtrim (std::string str, const std::string &chars)
 
std::string Brush::Util::trim (std::string str, const std::string &chars)
 
vector< type_index > Brush::Util::get_dtypes (MatrixXf &X)
 calculates data types for each column of X
 
float Brush::Util::condition_number (const MatrixXf &X)
 returns true for elements of x that are infinite
 
MatrixXf Brush::Util::corrcoef (const MatrixXf &X)
 returns the pearson correlation coefficients of matrix.
 
float Brush::Util::mean_square_corrcoef (const MatrixXf &X)
 
int Brush::Util::argmiddle (vector< float > &v)
 returns the (first) index of the element with the middlest value in v
 
float Brush::Util::variance (const ArrayXf &v)
 calculate variance
 
float Brush::Util::skew (const ArrayXf &v)
 calculate skew
 
float Brush::Util::kurtosis (const ArrayXf &v)
 calculate kurtosis
 
float Brush::Util::covariance (const ArrayXf &x, const ArrayXf &y)
 covariance of x and y
 
float Brush::Util::slope (const ArrayXf &x, const ArrayXf &y)
 slope of x/y
 
float Brush::Util::pearson_correlation (const ArrayXf &x, const ArrayXf &y)
 the normalized covariance of x and y
 
float Brush::Util::mad (const ArrayXf &x)
 median absolute deviation
 
std::string Brush::Util::ReplaceString (std::string subject, const std::string &search, const std::string &replace)
 find and replace string
 
void Brush::Util::ReplaceStringInPlace (std::string &subject, const std::string &search, const std::string &replace)
 string find and replace in place
 
vector< size_tBrush::Util::mask_to_index (const ArrayXb &mask)
 convert a boolean mask to an index array
 
tuple< vector< size_t >, vector< size_t > > Brush::Util::mask_to_indices (const ArrayXb &mask)
 returns 2 indices: first where mask is true, and second where mask is false.
 

Variables

string Brush::Util::PBSTR = "===================="
 
int Brush::Util::PBWIDTH = 20
 
TypeMap< std::string > Brush::Util::type_names