38 using namespace shogun;
53 SG_ERROR(
"Only features with equal number of vectors "
54 "are currently possible\n");
65 SG_ERROR(
"Only features with equal number of vectors "
66 "are currently possible\n");
81 void CQuadraticTimeMMD::init()
84 " for spectrum method null-distribution approximation",
87 " Eigenvalues for spectrum method null-distribution approximation",
134 return first+second-third;
172 return first+second-third;
190 SG_ERROR(
"Unknown statistic type!\n");
209 null_samples.
qsort();
213 SG_ERROR(
"Only possible if shogun is compiled with LAPACK enabled\n");
214 #endif // HAVE_LAPACK
235 bool multiple_kernels)
238 if (!multiple_kernels)
247 "multiple kernels specified, but underlying kernel is not of type "
259 CKernel* current=combined->get_kernel(i);
287 null_samples.
qsort();
290 SG_ERROR(
"Only possible if shogun is compiled with LAPACK enabled\n");
291 #endif // HAVE_LAPACK
320 "(%d, %d): No features set and no custom kernel in use!\n",
321 num_samples, num_eigenvalues);
330 SG_ERROR(
"Currently, only equal sample sizes are supported\n");
334 SG_ERROR(
"Number of samples has to be at least 2, "
335 "better in the hundreds");
338 if (num_eigenvalues>2*
m_m-1)
339 SG_ERROR(
"Number of Eigenvalues too large\n");
341 if (num_eigenvalues<1)
342 SG_ERROR(
"Number of Eigenvalues too small\n");
348 "to be BIASED. Please ensure that! To get rid of warning,"
349 "call %s::set_statistic_type(BIASED)\n",
get_name());
367 for (
index_t i=0; i<num_eigenvalues; ++i)
369 1.0/2/
m_m*eigenvalues[eigenvalues.
vlen-1-i]);
373 for (
index_t i=0; i<num_samples; ++i)
385 #endif // HAVE_LAPACK
391 "No features set and no custom kernel in use!\n");
400 SG_ERROR(
"Currently, only equal sample sizes are supported\n");
406 "to be BIASED. Please ensure that! To get rid of warning,"
407 "call %s::set_statistic_type(BIASED)\n",
get_name());
426 mean_mmd=2.0/m_m*(1.0-1.0/m_m*mean_mmd);
437 if (i==j || m_m+i==j || m_m+j==i)
447 var_mmd*=2.0/m_m/(m_m-1)*1.0/m_m/(m_m-1);
461 num_samples_spectrum)
467 index_t num_eigenvalues_spectrum)