/usr/include/shogun/statistics/MMDKernelSelectionOpt.h is in libshogun-dev 3.2.0-7.3build4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2012-2013 Heiko Strathmann
*/
#ifndef __MMDKERNELSELECTIONOPTSINGLE_H_
#define __MMDKERNELSELECTIONOPTSINGLE_H_
#include <shogun/statistics/MMDKernelSelection.h>
namespace shogun
{
class CLinearTimeMMD;
/** @brief Implements optimal kernel selection for single kernels.
* Given a number of baseline kernels, this method selects the one that
* minimizes the type II error for a given type I error for a two-sample test.
* This only works for the CLinearTimeMMD statistic.
*
* The idea is to maximise the ratio of MMD and its standard deviation.
*
* IMPORTANT: The kernel has to be selected on different data than the two-sample
* test is performed on.
*
* Described in
* Gretton, A., Sriperumbudur, B., Sejdinovic, D., Strathmann, H.,
* Balakrishnan, S., Pontil, M., & Fukumizu, K. (2012).
* Optimal kernel choice for large-scale two-sample tests.
* Advances in Neural Information Processing Systems.
*/
class CMMDKernelSelectionOpt: public CMMDKernelSelection
{
public:
/** Default constructor */
CMMDKernelSelectionOpt();
/** Constructor that initialises the underlying MMD instance. Currently,
* only the linear time MMD is supported
*
* @param mmd MMD instance to use
* @param lambda ridge that is added to standard deviation in order to
* prevent division by zero. A sensivle value is for example 1E-5.
*/
CMMDKernelSelectionOpt(CKernelTwoSampleTestStatistic* mmd,
float64_t lambda=10E-5);
/** Destructor */
virtual ~CMMDKernelSelectionOpt();
/** Overwrites superclass method and ensures that all statistics are
* computed on the same data. Since linear time MMD is a streaming
* statistic, just computing all statistics one after another would use
* different data. This method makes sure that all kernels are used at once
*
* @return vector with kernel criterion values for all attached kernels
*/
virtual SGVector<float64_t> compute_measures();
/** @return name of the SGSerializable */
const char* get_name() const { return "MMDKernelSelectionOpt"; }
private:
/** Initializer */
void init();
protected:
/** Ridge that is added to the denumerator of the ratio of MMD and its
* standard deviation */
float64_t m_lambda;
};
}
#endif /* __MMDKERNELSELECTIONOPTSINGLE_H_ */
|