45 for (
index_t k_idx=0; k_idx<combined->get_num_kernels(); k_idx++)
47 CKernel* subkernel=combined->get_kernel(k_idx);
48 REQUIRE(kernel,
"%s::%s(): Subkernel (%d) of current kernel is not"
60 "Only 64 bit float dense features allowed, these are \"%s\""
71 "Only 64 bit float streaming dense features allowed, these (p) "
72 "are \"%s\" and of type %d\n",
77 "Only 64 bit float streaming dense features allowed, these (q) "
78 "are \"%s\" and of type %d\n",
97 void CMMDKernelSelectionMedian::init()
108 SG_ERROR(
"%s::compute_measures(): Not implemented. Use select_kernel() "
129 for (
index_t i=0; i<num_data; ++i)
133 subset[i+num_data]=i+m;
190 for (
index_t i=0; i<dists.num_rows; ++i)
192 for (
index_t j=i+1; j<dists.num_rows; ++j)
193 dist_vec[write_idx++]=dists(i,j);
197 CMath::qsort<float64_t>(dist_vec.
vector, dist_vec.
vlen);
199 SG_DEBUG(
"median_distance: %f\n", median_distance);
204 SG_DEBUG(
"kernel width (shogun): %f\n", shogun_sigma);
216 "%d-th kernel is not a Gaussian but \"%s\"!\n",
get_name(), i,
223 if (distance<min_distance)
virtual const char * get_name() const =0
float distance(CJLCoverTreePoint p1, CJLCoverTreePoint p2, float64_t upper_bound)
virtual CStreamingFeatures * get_streaming_q()
virtual CKernel * get_kernel()
virtual CStreamingFeatures * get_streaming_p()
virtual CFeatures * get_streamed_features(index_t num_elements)
Base class for kernel selection for MMD-based two-sample test statistic implementations. Provides abstract methods for selecting kernels and computing criteria or kernel weights for the implemented method. In order to implement new methods for kernel selection, simply write a new implementation of this class.
int32_t get_num_subkernels()
Kernel two sample test base class. Provides an interface for performing a two-sample test using a ker...
This class implements the quadratic time Maximum Mean Statistic as described in [1]. The MMD is the distance of two probability distributions and in a RKHS which we denote by .
CKernel * get_kernel(int32_t idx)
virtual EFeatureClass get_feature_class() const =0
The Combined kernel is used to combine a number of kernels into a single CombinedKernel object by lin...
CFeatures * create_merged_copy(CList *other)
The well known Gaussian kernel (swiss army knife for SVMs) computed on CDotFeatures.
CKernelTwoSampleTest * m_estimator
all of classes and functions are contained in the shogun namespace
virtual void remove_subset()
virtual EKernelType get_kernel_type()=0
The class Features is the base class of all feature objects.
Streaming features are features which are used for online algorithms.
This class implements the linear time Maximum Mean Statistic as described in [1] for streaming data (...
virtual EStatisticType get_statistic_type() const =0
SGMatrix< float64_t > get_distance_matrix()
virtual CFeatures * get_p_and_q()
static const float64_t MAX_REAL_NUMBER
virtual void add_subset(SGVector< index_t > subset)
virtual EFeatureType get_feature_type() const =0