00001 /* 00002 * Copyright (c) 2009 Yahoo! Inc. All rights reserved. The copyrights 00003 * embodied in the content of this file are licensed under the BSD 00004 * (revised) open source license. 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * Written (W) 2011 Shashwat Lal Das 00012 * Adaptation of Vowpal Wabbit v5.1. 00013 * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society. 00014 */ 00015 00016 #ifndef _VW_ADAPTIVE_H__ 00017 #define _VW_ADAPTIVE_H__ 00018 00019 #include <shogun/classifier/vw/VwLearner.h> 00020 #include <shogun/classifier/vw/vw_common.h> 00021 00022 namespace shogun 00023 { 00031 class CVwAdaptiveLearner: public CVwLearner 00032 { 00033 public: 00037 CVwAdaptiveLearner(); 00038 00045 CVwAdaptiveLearner(CVwRegressor* regressor, CVwEnvironment* vw_env); 00046 00050 virtual ~CVwAdaptiveLearner(); 00051 00058 virtual void train(VwExample* &ex, float32_t update); 00059 00065 virtual const char* get_name() const { return "VwAdaptiveLearner"; } 00066 00067 private: 00080 void quad_update(float32_t* weights, VwFeature& page_feature, 00081 v_array<VwFeature> &offer_features, vw_size_t mask, 00082 float32_t update, float32_t g, VwExample* ex, vw_size_t& ctr); 00083 }; 00084 } 00085 00086 #endif // _VW_ADAPTIVE_H__