TStudentKernel.h

Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 2011 Andrew Tereskin
00008  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
00009  */
00010 
00011 #include <shogun/lib/config.h>
00012 
00013 #ifndef TSTUDENTKERNEL_H_
00014 #define TSTUDENTKERNEL_H_
00015 
00016 #include <shogun/lib/common.h>
00017 #include <shogun/kernel/Kernel.h>
00018 #include <shogun/distance/Distance.h>
00019 
00020 namespace shogun
00021 {
00022 
00023 class CDistance;
00024 
00035 class CTStudentKernel: public CKernel
00036 {
00037 public:
00039     CTStudentKernel();
00040 
00046     CTStudentKernel(int32_t cache, float64_t d, CDistance* dist);
00047 
00054     CTStudentKernel(CFeatures *l, CFeatures *r, float64_t d, CDistance* dist);
00055 
00056     virtual ~CTStudentKernel();
00057 
00063     virtual bool init(CFeatures* l, CFeatures* r);
00064 
00068     virtual EKernelType get_kernel_type() { return K_TSTUDENT; }
00069 
00073     virtual EFeatureType get_feature_type() { return distance->get_feature_type(); }
00074 
00078     virtual EFeatureClass get_feature_class() { return distance->get_feature_class(); }
00079 
00083     virtual const char* get_name() const { return "TStudentKernel"; }
00084 
00088     inline float64_t get_degree() { return this->degree; }
00089 
00093     inline void set_degree(float64_t value) { this->degree = value; }
00094 
00095 private:
00096     void init();
00097 
00098 protected:
00099 
00101     CDistance* distance;
00102 
00104     float64_t degree;
00105 
00113     virtual float64_t compute(int32_t idx_a, int32_t idx_b);
00114 };
00115 }
00116 
00117 #endif /* TSTUDENTKERNEL_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation