File: projector.h

package info (click to toggle)
mldemos 0.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 32,224 kB
  • ctags: 46,525
  • sloc: cpp: 306,887; ansic: 167,718; ml: 126; sh: 109; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 769 bytes parent folder | download | duplicates (2)
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
#ifndef PROJECTOR_H
#define PROJECTOR_H

#include <vector>
#include "mymaths.h"

class Projector
{
public:
    std::vector<fvec> projected;
    std::vector<fvec> source;
    u32 dim;
    u32 startIndex, stopIndex;

    Projector() : dim(2), startIndex(0), stopIndex(-1) {}
    virtual ~Projector(){}

    virtual void Train(std::vector< fvec > samples, ivec labels){}
    virtual fvec Project(const fvec &sample){ return sample; }
    virtual float Project1D(const fvec &sample){ fvec proj = Project(sample); return proj.size() ? proj[0] : 0; }
    virtual fvec Project(const fVec &sample){ return Project((fvec)sample); }
    virtual const char *GetInfoString(){return NULL;}
    virtual std::vector<fvec> GetProjected(){ return projected; }
};

#endif // PROJECTOR_H