40 using namespace Eigen;
60 eigen_r=2.0*eigen_lp.array().exp()-1.0;
75 eigen_r=1-(2.0*eigen_lp.array().exp()-1.0).square();
84 REQUIRE(lab,
"Labels are required (lab should not be NULL)\n")
86 "Labels must be type of CBinaryLabels\n")
88 "length of the function vector\n")
99 eigen_r=eigen_y.cwiseProduct(eigen_f);
101 for (
index_t i=0; i<eigen_r.size(); i++)
111 REQUIRE(lab,
"Labels are required (lab should not be NULL)\n")
113 "Labels must be type of CBinaryLabels\n")
115 "length of the function vector\n")
116 REQUIRE(i>=1 && i<=3,
"Index for derivative should be 1, 2 or 3\n")
126 VectorXd eigen_yf=eigen_y.cwiseProduct(eigen_f);
128 for (
index_t j=0; j<eigen_yf.size(); j++)
154 eigen_r=(-eigen_dlp.array()*((eigen_yf.array()+eigen_dlp.array()).abs().array())).matrix();
158 eigen_r=(-eigen_r.array()*((eigen_yf.array()+2.0*eigen_dlp.array()).abs().array())
159 -eigen_dlp.array()).matrix();
165 eigen_r=(eigen_r.array()*eigen_y.array()).matrix();
179 "Length of the vector of means (%d), length of the vector of "
180 "variances (%d) and number of labels (%d) should be the same\n",
183 "Labels must be type of CBinaryLabels\n")
190 "length of the vector of variances (%d) should be the same\n",
205 eigen_r=eigen_mu.array()*eigen_y.array()/((1.0+eigen_s2.array()).sqrt());
207 for (
index_t i=0; i<eigen_r.size(); i++)
217 REQUIRE(lab,
"Labels are required (lab should not be NULL)\n")
219 "Length of the vector of means (%d), length of the vector of "
220 "variances (%d) and number of labels (%d) should be the same\n",
222 REQUIRE(i>=0 && i<=mu.
vlen,
"Index (%d) out of bounds!\n", i)
224 "Labels must be type of CBinaryLabels\n")
246 REQUIRE(lab,
"Labels are required (lab should not be NULL)\n")
248 "Length of the vector of means (%d), length of the vector of "
249 "variances (%d) and number of labels (%d) should be the same\n",
251 REQUIRE(i>=0 && i<=mu.
vlen,
"Index (%d) out of bounds!\n", i)
253 "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