Thrill  0.1
examples::logistic_regression Namespace Reference

Functions

template<typename T , size_t dim>
T calc_norm (const std::array< T, dim > &weights, const std::array< T, dim > &new_weights)
 
template<typename T , size_t dim>
auto gradient (const bool &y, const std::array< T, dim > &x, const std::array< T, dim > &w)
 
template<typename T , size_t dim, typename InStack , typename Element = std::array<T, dim>>
auto logit_test (const DIA< std::pair< bool, Element >, InStack > &data, const Element &weights)
 
template<typename T , size_t dim, typename InStack , typename Element = std::array<T, dim>>
auto logit_train (const DIA< std::pair< bool, Element >, InStack > &data, size_t max_iterations, double gamma=0.002, double epsilon=0.0001)
 
template<typename T >
T sigmoid (const T &x)
 

Variables

static constexpr bool debug = true
 

Function Documentation

◆ calc_norm()

T examples::logistic_regression::calc_norm ( const std::array< T, dim > &  weights,
const std::array< T, dim > &  new_weights 
)

Definition at line 43 of file logistic_regression.hpp.

References dim.

Referenced by logit_train().

◆ gradient()

auto examples::logistic_regression::gradient ( const bool &  y,
const std::array< T, dim > &  x,
const std::array< T, dim > &  w 
)

Definition at line 54 of file logistic_regression.hpp.

References dim, and sigmoid().

Referenced by LeastSquaresGradient< Vector >::Compute(), and logit_train().

◆ logit_test()

auto examples::logistic_regression::logit_test ( const DIA< std::pair< bool, Element >, InStack > &  data,
const Element weights 
)

Definition at line 106 of file logistic_regression.hpp.

References sigmoid().

◆ logit_train()

auto examples::logistic_regression::logit_train ( const DIA< std::pair< bool, Element >, InStack > &  data,
size_t  max_iterations,
double  gamma = 0.002,
double  epsilon = 0.0001 
)

Definition at line 67 of file logistic_regression.hpp.

References calc_norm(), dim, and gradient().

◆ sigmoid()

T examples::logistic_regression::sigmoid ( const T x)
inline

Definition at line 38 of file logistic_regression.hpp.

Referenced by gradient(), and logit_test().

Variable Documentation

◆ debug

constexpr bool debug = true
static

Definition at line 35 of file logistic_regression.hpp.