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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
/*********************************************************************
FLAME Implementation in MLDemos
Copyright (C) Pierre-Antoine Sondag (pasondag@gmail.com) 2012
Based on the standard implementation of FLAME data clustering algorithm.
Copyright (C) 2007, Fu Limin (phoolimin@gmail.com).
All rights reserved.
MLDemos: A User-Friendly visualization toolkit for machine learning
Copyright (C) 2010 Basilio Noris
Contact: mldemos@b4silio.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License,
version 3 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*********************************************************************/
#ifndef INTERFACEFLAMECLUSTER_H
#define INTERFACEFLAMECLUSTER_H
#include <vector>
#include <interfaces.h>
#include "clustererFlame.h"
#include "ui_paramsFlame.h"
/**
Example of plugin interface for a clustering algorithm
*/
class ClustFlame : public QObject, public ClustererInterface
{
Q_OBJECT
Q_INTERFACES(ClustererInterface)
private:
QWidget *widget; // the widget that will hold the hyperparameter panel
Ui::ParametersFlame *params; // the hyperparameter panel (instantiated from the ui form)
public:
/*!
Constructor, it instantiates the widget and parameter panel
*/
ClustFlame();
~ClustFlame();
/*!
The function called by the main program to obtain the clusterer.
It should generate the clusterer and set its parameter to match the user choice.
*/
Clusterer *GetClusterer();
/*!
The function called by the main program to draw the learned model (e.g. the classified samples)
*/
void DrawInfo(Canvas *canvas, QPainter &painter, Clusterer *clusterer);
/*!
The function called by the main program to draw the model information
(e.g. the projection axes, cluster centers or class boundaries, if these are available)
*/
void DrawModel(Canvas *canvas, QPainter &painter, Clusterer *clusterer);
void DrawGL(Canvas *canvas, GLWidget *glw, Clusterer *clusterer){}
// virtual functions to manage the GUI and I/O
/*!
Function that returns the name of the algorithm (will appear in the algorithm options panel tab)
*/
QString GetName(){return QString("Flame");}
/*!
The unique string describing the algorithm and options currently used (displayed in the Compare panel)
*/
QString GetAlgoString(){ return GetName();}
/*!
Link to the html page containing a description of the algorithm and/or implementation details
*/
QString GetInfoFile(){return "Flame.html";}
/*!
Returns the option widget, used by the main program to get the hyperparameter panel
*/
QWidget *GetParameterWidget(){return widget;}
/*!
Sets the parameter for the classifier
*/
void SetParams(Clusterer *clusterer);
/*!
Saves the hyperparameter options to the system's registry
*/
void SaveOptions(QSettings &settings);
/*!
Loads the hyperparameter options from the system's registry
*/
bool LoadOptions(QSettings &settings);
/*!
Saves the parameter to file (or to string for the compare dialog)
*/
void SaveParams(QTextStream &stream);
/*!
Loads the parameter from file (or from string for the compare dialog)
*/
bool LoadParams(QString name, float value);
void SetParams(Clusterer *clusterer, fvec parameters);
fvec GetParams();
void GetParameterList(std::vector<QString> ¶meterNames,
std::vector<QString> ¶meterTypes,
std::vector< std::vector<QString> > ¶meterValues);
};
#endif // INTERFACEFLAMECLUSTER_H
|