19 using namespace shogun;
51 SG_ERROR(
"Number of training vectors does not match number of labels\n");
59 int32_t m = kernel_matrix.num_rows;
60 ASSERT(kernel_matrix.matrix && m>0 && n>0);
62 for(int32_t i=0; i < n; i++)
63 kernel_matrix.matrix[i+i*n]+=tau;
73 if (alpha_orig.
vlen!=n)
75 SG_ERROR(
"Number of labels does not match number of kernel"
76 " columns (num_labels=%d cols=%d\n", alpha_orig.
vlen, n);
79 clapack_dposv(CblasRowMajor,CblasUpper, n, 1, kernel_matrix.matrix, n, alpha, n);
117 cblas_dgemv(CblasColMajor, CblasTrans, m_int, n_int, 1.0, (
double*) kernel_matrix.
matrix,
118 m_int, (
double*) alpha, 1, 0.0, (
double*) Yh.
vector, 1);
virtual bool init(CFeatures *lhs, CFeatures *rhs)
SGVector< float64_t > get_labels()
The class Labels models labels, i.e. class assignments of objects.
virtual CLabels * apply()
virtual bool load(FILE *srcfile)
virtual int32_t get_num_vectors() const =0
A generic KernelMachine interface.
SGMatrix< float64_t > get_kernel_matrix()
static T * clone_vector(const T *vec, int32_t len)
virtual bool train_machine(CFeatures *data=NULL)
static float64_t dot(const bool *v1, const bool *v2, int32_t n)
compute dot product between v1 and v2 (blas optimized)
virtual bool save(FILE *dstfile)
The class Features is the base class of all feature objects.
void set_kernel(CKernel *k)
virtual bool has_features()
virtual void set_labels(CLabels *lab)