39 using namespace Eigen;
59 eigen_r=2.0*eigen_lp.array().exp()-1.0;
74 eigen_r=1-(2.0*eigen_lp.array().exp()-1.0).square();
83 REQUIRE(lab,
"Labels are required (lab should not be NULL)\n")
85 "Labels must be type of CBinaryLabels\n")
87 "length of the function vector\n")
98 eigen_r=eigen_y.cwiseProduct(eigen_f);
100 for (
index_t i=0; i<eigen_r.size(); i++)
110 REQUIRE(lab,
"Labels are required (lab should not be NULL)\n")
112 "Labels must be type of CBinaryLabels\n")
114 "length of the function vector\n")
115 REQUIRE(i>=1 && i<=3,
"Index for derivative should be 1, 2 or 3\n")
125 VectorXd eigen_yf=eigen_y.cwiseProduct(eigen_f);
127 for (
index_t j=0; j<eigen_yf.size(); j++)
153 eigen_r=(-eigen_dlp.array()*((eigen_yf.array()+eigen_dlp.array()).abs().array())).matrix();
157 eigen_r=(-eigen_r.array()*((eigen_yf.array()+2.0*eigen_dlp.array()).abs().array())
158 -eigen_dlp.array()).matrix();
164 eigen_r=(eigen_r.array()*eigen_y.array()).matrix();
178 "Length of the vector of means (%d), length of the vector of "
179 "variances (%d) and number of labels (%d) should be the same\n",
182 "Labels must be type of CBinaryLabels\n")
189 "length of the vector of variances (%d) should be the same\n",
204 eigen_r=eigen_mu.array()*eigen_y.array()/((1.0+eigen_s2.array()).sqrt());
206 for (
index_t i=0; i<eigen_r.size(); i++)
216 REQUIRE(lab,
"Labels are required (lab should not be NULL)\n")
218 "Length of the vector of means (%d), length of the vector of "
219 "variances (%d) and number of labels (%d) should be the same\n",
221 REQUIRE(i>=0 && i<=mu.
vlen,
"Index (%d) out of bounds!\n", i)
223 "Labels must be type of CBinaryLabels\n")
245 REQUIRE(lab,
"Labels are required (lab should not be NULL)\n")
247 "Length of the vector of means (%d), length of the vector of "
248 "variances (%d) and number of labels (%d) should be the same\n",
250 REQUIRE(i>=0 && i<=mu.
vlen,
"Index (%d) out of bounds!\n", i)
252 "Labels must be type of CBinaryLabels\n")
virtual ELabelType get_label_type() const =0
The class Labels models labels, i.e. class assignments of objects.
virtual int32_t get_num_labels() const =0
static const float64_t ERFC_CASE2
virtual SGVector< float64_t > get_predictive_variances(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab=NULL) const
static float64_t lnormal_cdf(float64_t x)
virtual SGVector< float64_t > get_log_probability_f(const CLabels *lab, SGVector< float64_t > func) const
virtual SGVector< float64_t > get_log_zeroth_moments(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab) const
virtual SGVector< float64_t > get_predictive_means(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab=NULL) const
virtual ~CProbitLikelihood()
all of classes and functions are contained in the shogun namespace
static float64_t erfc8_weighted_sum(float64_t x)
static float64_t exp(float64_t x)
virtual float64_t get_first_moment(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab, index_t i) const
static float64_t normal_cdf(float64_t x, float64_t std_dev=1)
Binary Labels for binary classification.
static float32_t sqrt(float32_t x)
virtual SGVector< float64_t > get_log_probability_derivative_f(const CLabels *lab, SGVector< float64_t > func, index_t i) const
virtual float64_t get_second_moment(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab, index_t i) const
void set_const(T const_elem)
static const float64_t PI