├── documentation
├── .gitignore
├── documentation.footer.htm
└── build.py
├── readme.md
├── library
└── .gitignore
├── .gitignore
├── distances
├── ncd.i
├── norm
│ └── euclid.i
├── distances.h
└── distance.i
├── examples
├── java
│ ├── tools
│ │ ├── build.py
│ │ ├── eigen.java
│ │ ├── svd.java
│ │ └── random.java
│ ├── reducing
│ │ ├── build.py
│ │ ├── mds.java
│ │ └── pca.java
│ └── clustering
│ │ ├── build.py
│ │ ├── rng.java
│ │ └── spectral.java
├── distance
│ ├── build.py
│ └── ncd.cpp
├── classifier
│ └── build.py
├── geneticalgorithm
│ └── build.py
├── reducing
│ ├── build.py
│ └── pca.cpp
├── sources
│ ├── build.py
│ ├── wikipedia.cpp
│ └── newsgroup.cpp
├── other
│ ├── build.py
│ └── matlab
│ │ ├── plotfiles.m
│ │ ├── plotwiki.m
│ │ ├── plotnntp.m
│ │ └── plottwitter.m
└── clustering
│ └── build.py
├── tools
├── random.i
├── iostreams
│ ├── iostreams.h
│ └── urlencoder.h
├── files
│ ├── files.h
│ └── hdf.i
├── tools.h
├── lapack.i
├── language
│ ├── build.py
│ └── bindings.h
├── vector.i
├── matrix.i
├── sources
│ └── sources.h
└── typeinfo.h
├── classifier
├── classifier.h
└── classifier.hpp
├── neighborhood
├── neighborhood.h
└── neighborhood.hpp
├── dimensionreduce
├── nonsupervised
│ ├── mds.i
│ ├── pca.i
│ ├── reduce.i
│ └── reduce.hpp
├── supervised
│ ├── lda.i
│ ├── reduce.hpp
│ └── reduce.i
└── dimensionreduce.h
├── textprocess
└── textprocess.h
├── clustering
├── nonsupervised
│ ├── kmeans.i
│ ├── neuralgas.i
│ ├── relational_neuralgas.i
│ └── spectralclustering.i
├── supervised
│ ├── rlvq.i
│ └── clustering.hpp
└── clustering.h
├── functionoptimization
└── functionoptimization.h
├── geneticalgorithm
├── fitness
│ ├── fitness.h
│ └── fitness.hpp
├── crossover
│ ├── crossover.h
│ └── crossover.hpp
├── individual
│ ├── individual.h
│ └── individual.hpp
├── selection
│ ├── selection.h
│ ├── selection.hpp
│ └── bestof.hpp
└── geneticalgorithm.h
├── errorhandling
├── exception.hpp
├── assert.h
└── exception.implementation.hpp
└── machinelearning.cpp
/documentation/.gitignore:
--------------------------------------------------------------------------------
1 | html
2 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | MachineLearning
2 | ===============
3 |
4 | C++ framework that implements machinelearning algorithms (clustering, dimension reducing, genetic algorithms)
5 |
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | *.tgz
2 | *.tar.*
3 | build_*
4 | ginac*
5 | cln*
6 | hdf5*
7 | atlas*
8 | ATLAS
9 | jsoncpp-src-*
10 | libxml2*
11 | boost*
12 | zlib*
13 | bzip2*
14 |
--------------------------------------------------------------------------------
/documentation/documentation.footer.htm:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.bak
2 | *.bz2
3 | *.bzip
4 | *.cbp
5 | *.class
6 | *.core
7 | *.dblite
8 | *.dll
9 | *.dylib
10 | *.git*
11 | *.gzip
12 | *.hdf*
13 | *.jpg
14 | *.layout
15 | *.log
16 | *.os
17 | *.png
18 | *.pyc
19 | *.so
20 | *.o
21 | *.a
22 | *.lib
23 | *.stackdump
24 | *.xcodeproj
25 | *.zip
26 | .sconf_temp
27 | build
28 |
--------------------------------------------------------------------------------
/distances/ncd.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for the NCD **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "ncdmodule"
29 | %include "../swig/java/java.i"
30 | #endif
31 |
32 |
33 | %include "ncd.hpp"
34 | %template(NCD) machinelearning::distances::ncd;
35 |
--------------------------------------------------------------------------------
/documentation/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 |
23 | # build script for the documentation
24 |
25 | import os
26 | Import("*")
27 |
28 | env.Clean(
29 | env.Alias( "documentation",
30 | env.Command("documentation", "documentation.doxyfile", "doxygen $SOURCE")
31 | ),
32 | os.path.join("#", "documentation", "html")
33 | )
--------------------------------------------------------------------------------
/examples/java/tools/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 |
23 | # build script for the Java tools
24 |
25 | import os
26 | Import("*")
27 |
28 |
29 | env.Alias( "javatools",
30 | env.Java( os.path.join("#build", env["buildtype"], "java", "tools"), Dir("."), JAVACLASSPATH = [os.path.join("build", env["buildtype"], "machinelearning.jar")] )
31 | )
--------------------------------------------------------------------------------
/tools/random.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for the Random calls **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "randommodule"
29 | %include "../swig/java/java.i"
30 | %rename(Random) random;
31 | #endif
32 |
33 |
34 | %include "random.hpp"
35 | %template(get) machinelearning::tools::random::get;
36 |
--------------------------------------------------------------------------------
/classifier/classifier.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** header file to connect all clustering algorithm for one include **/
25 |
26 | #ifndef __MACHINELEARNING_CLASSIFIER_CLASSIFIER_H
27 | #define __MACHINELEARNING_CLASSIFIER_CLASSIFIER_H
28 |
29 | #include "classifier.hpp"
30 |
31 | #include "lazylearner.hpp"
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/examples/java/reducing/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 |
23 | # build script for the Java reducing
24 |
25 | import os
26 | Import("*")
27 |
28 |
29 | env.Alias( "javareduce",
30 | env.Java( os.path.join("#build", env["buildtype"], "java", "reducing"), Dir("."), JAVACLASSPATH = [os.path.join("build", env["buildtype"], "machinelearning.jar")] )
31 | )
--------------------------------------------------------------------------------
/examples/java/clustering/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 |
23 | # build script for the Java clustering
24 |
25 | import os
26 | Import("*")
27 |
28 |
29 | env.Alias( "javaclustering",
30 | env.Java( os.path.join("#build", env["buildtype"], "java", "clustering"), Dir("."), JAVACLASSPATH = [os.path.join("build", env["buildtype"], "machinelearning.jar")] )
31 | )
--------------------------------------------------------------------------------
/neighborhood/neighborhood.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** header file to connect all neighborhood algorithms for one include **/
25 |
26 | #ifndef __MACHINELEARNING_NEIGHBORHOOD_NEIGHBORHOOD_H
27 | #define __MACHINELEARNING_NEIGHBORHOOD_NEIGHBORHOOD_H
28 |
29 | #include "neighborhood.hpp"
30 | #include "knn.hpp"
31 | #include "kapproximation.hpp"
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/dimensionreduce/nonsupervised/mds.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for MDS **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "mdsmodule"
29 | %include "../../swig/java/java.i"
30 |
31 | %typemap(javainterfaces) machinelearning::dimensionreduce::nonsupervised::mds "Reduce";
32 | #endif
33 |
34 |
35 | %include "mds.hpp"
36 | %template(MDS) machinelearning::dimensionreduce::nonsupervised::mds;
37 |
--------------------------------------------------------------------------------
/dimensionreduce/nonsupervised/pca.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for PCA **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "pcamodule"
29 | %include "../../swig/java/java.i"
30 |
31 | %typemap(javainterfaces) machinelearning::dimensionreduce::nonsupervised::pca "Reduce";
32 | #endif
33 |
34 |
35 | %include "pca.hpp"
36 | %template(PCA) machinelearning::dimensionreduce::nonsupervised::pca;
37 |
--------------------------------------------------------------------------------
/textprocess/textprocess.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 |
26 | #ifndef __MACHINELEARNING_TEXTPROCESS_TEXTPROCESS_H
27 | #define __MACHINELEARNING_TEXTPROCESS_TEXTPROCESS_H
28 |
29 | namespace machinelearning {
30 |
31 | /** namespace for all textprocessing algorithm **/
32 | namespace textprocess {}
33 |
34 | }
35 |
36 |
37 |
38 | #include "termfrequency.h"
39 | #include "stopwordreduction.h"
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/clustering/nonsupervised/kmeans.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for k-means **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "kmeansmodule"
29 | %include "../../swig/java/java.i"
30 |
31 | %typemap(javainterfaces) machinelearning::clustering::nonsupervised::kmeans "Clustering";
32 | #endif
33 |
34 |
35 | %include "kmeans.hpp"
36 | %template(kMeans) machinelearning::clustering::nonsupervised::kmeans;
37 |
--------------------------------------------------------------------------------
/functionoptimization/functionoptimization.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | #ifndef __MACHINELEARNING_FUNCTIONOPTIMIZATION_FUNCTIONOPTIMIZATION_H
26 | #define __MACHINELEARNING_FUNCTIONOPTIMIZATION_FUNCTIONOPTIMIZATION_H
27 |
28 | namespace machinelearning {
29 |
30 | /** namespace with structurs for fitting functions **/
31 | namespace functionaloptimization {}
32 | }
33 |
34 | #include "gradientdescent.hpp"
35 |
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/geneticalgorithm/fitness/fitness.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | #ifndef __MACHINELEARNING_GENETICALGORITHM_FITNESS_FITNESS_H
26 | #define __MACHINELEARNING_GENETICALGORITHM_FITNESS_FITNESS_H
27 |
28 | namespace machinelearning { namespace geneticalgorithm {
29 |
30 | /** namespace of the genetic algorithms for fitness structures **/
31 | namespace fitness {}
32 |
33 | }}
34 |
35 | #include "fitness.hpp"
36 |
37 | #endif
38 |
39 |
--------------------------------------------------------------------------------
/tools/iostreams/iostreams.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | #ifndef __MACHINELEARNING_TOOLS_IOSTREAMS_IOSTREAMS_H
25 | #define __MACHINELEARNING_TOOLS_IOSTREAMS_IOSTREAMS_H
26 |
27 | namespace machinelearning {
28 | namespace tools {
29 |
30 | /** namespace with classes for iostreams (eg URL encoding / decoding) **/
31 | namespace iostreams {}
32 |
33 | }
34 | }
35 |
36 | #include "urlencoder.h"
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/tools/files/files.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | #ifdef MACHINELEARNING_FILES
25 |
26 | #ifndef __MACHINELEARNING_TOOLS_FILES_FILES_H
27 | #define __MACHINELEARNING_TOOLS_FILES_FILES_H
28 |
29 | namespace machinelearning {
30 | namespace tools {
31 |
32 | /** namespace for file support **/
33 | namespace files {}
34 |
35 | }
36 | }
37 |
38 |
39 | #include "csv.hpp"
40 | #include "hdf.hpp"
41 |
42 | #endif
43 | #endif
44 |
--------------------------------------------------------------------------------
/distances/norm/euclid.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for the euclidian norm, set base classe manually **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "euclidmodule"
29 | %include "../../swig/java/java.i"
30 |
31 | %typemap(javainterfaces) machinelearning::distances::norm::euclid "machinelearning.distances.Distance";
32 | #endif
33 |
34 |
35 | %include "euclid.hpp"
36 | %template(Euclid) machinelearning::distances::norm::euclid;
37 |
--------------------------------------------------------------------------------
/clustering/nonsupervised/neuralgas.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for neural gas **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "neuralgasmodule"
29 | %include "../../swig/java/java.i"
30 |
31 | %typemap(javainterfaces) machinelearning::clustering::nonsupervised::neuralgas "Clustering, PatchClustering";
32 | #endif
33 |
34 |
35 | %include "neuralgas.hpp"
36 | %template(NeuralGas) machinelearning::clustering::nonsupervised::neuralgas;
37 |
--------------------------------------------------------------------------------
/geneticalgorithm/crossover/crossover.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | #ifndef __MACHINELEARNING_GENETICALGORITHM_CROSSOVER_CROSSOVER_H
26 | #define __MACHINELEARNING_GENETICALGORITHM_CROSSOVER_CROSSOVER_H
27 |
28 | namespace machinelearning { namespace geneticalgorithm {
29 |
30 | /** namespace of the genetic algorithms for crossover structures **/
31 | namespace crossover {}
32 |
33 | }}
34 |
35 | #include "crossover.hpp"
36 | #include "kcrossover.hpp"
37 |
38 | #endif
39 |
40 |
--------------------------------------------------------------------------------
/examples/distance/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 | # build script for the distance example
23 |
24 | import os
25 | Import("*")
26 |
27 | buildlist = []
28 |
29 | if env["withfiles"] :
30 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "distance", "ncd"), source=defaultcpp + ["ncd.cpp"] ) )
31 |
32 | if env["uselocallibrary"] or env["copylibrary"] :
33 | Depends(buildlist, env.LibraryCopy( os.path.join("#build", env["buildtype"], "distance"), [] ))
34 |
35 | env.Alias( "distance", buildlist )
--------------------------------------------------------------------------------
/geneticalgorithm/individual/individual.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | #ifndef __MACHINELEARNING_GENETICALGORITHM_INDIVIDUAL_INDIVIDUAL_H
26 | #define __MACHINELEARNING_GENETICALGORITHM_INDIVIDUAL_INDIVIDUAL_H
27 |
28 | namespace machinelearning { namespace geneticalgorithm {
29 |
30 | /** namespace of the genetic algorithms for individual structures **/
31 | namespace individual {}
32 |
33 | }}
34 |
35 | #include "individual.hpp"
36 | #include "binaryindividual.hpp"
37 |
38 | #endif
39 |
40 |
--------------------------------------------------------------------------------
/clustering/nonsupervised/relational_neuralgas.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for relational neuralgas **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "rngmodule"
29 | %include "../../swig/java/java.i"
30 |
31 | %typemap(javainterfaces) machinelearning::clustering::nonsupervised::relational_neuralgas "Clustering";
32 | #endif
33 |
34 |
35 | %include "relational_neuralgas.hpp"
36 | %template(RelationalNeuralGas) machinelearning::clustering::nonsupervised::relational_neuralgas;
37 |
--------------------------------------------------------------------------------
/clustering/nonsupervised/spectralclustering.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for spectral clustering **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "spectralclusteringmodule"
29 | %include "../../swig/java/java.i"
30 |
31 | %typemap(javainterfaces) machinelearning::clustering::nonsupervised::spectralclustering "Clustering";
32 | #endif
33 |
34 |
35 | %include "spectralclustering.hpp"
36 | %template(SpectralClustering) machinelearning::clustering::nonsupervised::spectralclustering;
37 |
--------------------------------------------------------------------------------
/examples/classifier/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 | # build script for the classifier example
23 |
24 | import os
25 | Import("*")
26 |
27 | buildlist = []
28 |
29 | if env["withfiles"] :
30 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "classifier", "lazy"), source=defaultcpp + ["lazy.cpp"] ) )
31 |
32 | if env["uselocallibrary"] or env["copylibrary"] :
33 | Depends(buildlist, env.LibraryCopy( os.path.join("#build", env["buildtype"], "classifier"), [] ))
34 |
35 | env.Alias( "classifier", buildlist )
--------------------------------------------------------------------------------
/geneticalgorithm/selection/selection.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | #ifndef __MACHINELEARNING_GENETICALGORITHM_SELECTION_SELECTION_H
26 | #define __MACHINELEARNING_GENETICALGORITHM_SELECTION_SELECTION_H
27 |
28 | namespace machinelearning { namespace geneticalgorithm {
29 |
30 | /** namespace of the genetic algorithms for selection structures **/
31 | namespace selection {}
32 |
33 | }}
34 |
35 | #include "selection.hpp"
36 | #include "roulettewheel.hpp"
37 | #include "bestof.hpp"
38 |
39 | #endif
40 |
41 |
--------------------------------------------------------------------------------
/examples/geneticalgorithm/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 |
23 | # build script for the genetic algorithm example
24 |
25 | import os
26 | Import("*")
27 |
28 | buildlist = []
29 |
30 | if env["withfiles"] :
31 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "geneticalgorithm", "knapsack"), source=defaultcpp + ["knapsack.cpp"] ) )
32 |
33 | if env["uselocallibrary"] or env["copylibrary"] :
34 | Depends(buildlist, env.LibraryCopy( os.path.join("#build", env["buildtype"], "geneticalgorithm"), [] ))
35 |
36 | env.Alias( "ga", buildlist )
--------------------------------------------------------------------------------
/distances/distances.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 |
26 | /** header file to connect all tools library for one includ **/
27 |
28 | #ifndef __MACHINELEARNING_DISTANCES_DISTANCES_H
29 | #define __MACHINELEARNING_DISTANCES_DISTANCES_H
30 |
31 |
32 | namespace machinelearning {
33 |
34 | /** distance namespace for structures which calculates distances **/
35 | namespace distances {
36 |
37 | /** namespace for norm structures **/
38 | namespace norm { }
39 |
40 | }
41 | }
42 |
43 |
44 | #include "distance.hpp"
45 | #include "ncd.hpp"
46 | #include "norm/euclid.hpp"
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/dimensionreduce/supervised/lda.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for LDA **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "ldamodule"
29 | %include "../../swig/java/java.i"
30 |
31 | %typemap(javainterfaces) machinelearning::dimensionreduce::supervised::lda "ReduceString";
32 | %typemap(javainterfaces) machinelearning::dimensionreduce::supervised::lda "ReduceLong";
33 | #endif
34 |
35 |
36 | %include "lda.hpp"
37 | %template(LDAString) machinelearning::dimensionreduce::supervised::lda;
38 | %template(LDALong) machinelearning::dimensionreduce::supervised::lda;
--------------------------------------------------------------------------------
/clustering/supervised/rlvq.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for rlvq **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "rlvqmodule"
29 | %include "../../swig/java/java.i"
30 |
31 | %typemap(javainterfaces) machinelearning::clustering::supervised::rlvq "ClusteringString";
32 | %typemap(javainterfaces) machinelearning::clustering::supervised::rlvq "ClusteringLong";
33 | #endif
34 |
35 |
36 | %include "rlvq.hpp"
37 | %template(RLVQString) machinelearning::clustering::supervised::rlvq;
38 | %template(RLVQLong) machinelearning::clustering::supervised::rlvq;
39 |
--------------------------------------------------------------------------------
/tools/tools.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 |
26 | #ifndef __MACHINELEARNING_TOOLS_TOOLS_H
27 | #define __MACHINELEARNING_TOOLS_TOOLS_H
28 |
29 | namespace machinelearning {
30 |
31 | /** namespace for all tools, which are used within the toolbox **/
32 | namespace tools {}
33 |
34 | }
35 |
36 |
37 | #include "typeinfo.h"
38 | #include "random.hpp"
39 | #include "function.hpp"
40 | #include "matrix.hpp"
41 | #include "vector.hpp"
42 | #include "lapack.hpp"
43 | #include "logger.hpp"
44 | #include "sources/sources.h"
45 | #include "files/files.h"
46 | #include "language/language.h"
47 | #include "iostreams/iostreams.h"
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/tools/lapack.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for the Lapack calls **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "lapackmodule"
29 | %include "../swig/java/java.i"
30 | %rename(Lapack) lapack;
31 | #endif
32 |
33 |
34 | %include "lapack.hpp"
35 | %template(eigen) machinelearning::tools::lapack::eigen;
36 | %template(svd) machinelearning::tools::lapack::svd;
37 | %template(perronFrobenius) machinelearning::tools::lapack::perronfrobenius;
38 | %template(unnormalizedGraphLaplacian) machinelearning::tools::lapack::unnormalizedGraphLaplacian;
39 | %template(normalizedGraphLaplacian) machinelearning::tools::lapack::normalizedGraphLaplacian;
40 |
--------------------------------------------------------------------------------
/dimensionreduce/dimensionreduce.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** header file to connect all dimensional reducing algorithm for one include **/
25 |
26 | #ifndef __MACHINELEARNING_DIMENSIONREDUCE_DIMENSIONREDUCE_H
27 | #define __MACHINELEARNING_DIMENSIONREDUCE_DIMENSIONREDUCE_H
28 |
29 |
30 | namespace machinelearning {
31 |
32 | /** namespace for all algorithms to reduce data dimension **/
33 | namespace dimensionreduce { }
34 |
35 | }
36 |
37 |
38 | #include "supervised/reduce.hpp"
39 | #include "supervised/lda.hpp"
40 |
41 | #include "nonsupervised/reduce.hpp"
42 | #include "nonsupervised/pca.hpp"
43 | #include "nonsupervised/lle.hpp"
44 | #include "nonsupervised/mds.hpp"
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/examples/reducing/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 | # build script for the reducing example
23 |
24 | import os
25 | Import("*")
26 |
27 | buildlist = []
28 |
29 | if env["withfiles"] :
30 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "reducing", "lda"), source=defaultcpp+["lda.cpp"] ) )
31 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "reducing", "mds"), source=defaultcpp+["mds.cpp"] ) )
32 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "reducing", "pca"), source=defaultcpp+["pca.cpp"] ) )
33 |
34 | if env["uselocallibrary"] or env["copylibrary"] :
35 | Depends(buildlist, env.LibraryCopy( os.path.join("#build", env["buildtype"], "reducing"), [] ))
36 |
37 | env.Alias( "reducing", buildlist )
--------------------------------------------------------------------------------
/tools/language/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 |
23 | # build script for the multilanguage of the framework
24 |
25 | import os
26 | Import("*")
27 |
28 |
29 | env.Tool("gettext")
30 | env.AppendUnique(MSGMERGEFLAGS = ["--no-wrap", "--update"])
31 | env.AppendUnique(XGETTEXTFLAGS = ["--keyword=_", "--language=c++", "--no-wrap"])
32 |
33 | po = env.Translate(["de"], GlobRekursiv(os.path.join("..", ".."), env["CPPSUFFIXES"], ["swig", "examples", "documentation", "library", "buildenvironment"]), POAUTOINIT = True)
34 | mo = env.MOFiles(po)
35 |
36 | env.Clean(
37 | env.Alias("language", [
38 | env.InstallAs( os.path.join("#build", "language", "de_DE.UTF-8", "LC_MESSAGES", "machinelearning.mo"), "de.mo")
39 | ]),
40 | [
41 | "messages.pot",
42 | Glob("*.po~")
43 | ]
44 | )
45 |
--------------------------------------------------------------------------------
/clustering/clustering.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** header file to connect all clustering algorithm for one include **/
25 |
26 | #ifndef __MACHINELEARNING_CLUSTERING_CLUSTERING_H
27 | #define __MACHINELEARNING_CLUSTERING_CLUSTERING_H
28 |
29 | namespace machinelearning {
30 |
31 | /** namespace for all clustering algorithms
32 | * @todo adding SOM http://www.cis.hut.fi/research/som-research/
33 | **/
34 | namespace clustering { }
35 |
36 | }
37 |
38 |
39 | #include "nonsupervised/clustering.hpp"
40 | #include "nonsupervised/neuralgas.hpp"
41 | #include "nonsupervised/relational_neuralgas.hpp"
42 | #include "nonsupervised/kmeans.hpp"
43 | #include "nonsupervised/spectralclustering.hpp"
44 |
45 | #include "supervised/clustering.hpp"
46 | #include "supervised/rlvq.hpp"
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/geneticalgorithm/geneticalgorithm.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** header file to connect all genetic algorithm for one include **/
25 |
26 | #ifndef __MACHINELEARNING_GENETICALGORITHM_GENETICALGORITHM_H
27 | #define __MACHINELEARNING_GENETICALGORITHM_GENETICALGORITHM_H
28 |
29 |
30 | namespace machinelearning {
31 |
32 | /** namespace for genetic algorithms
33 | * @todo adding different individuals, crossover and fitness function for example use
34 | * @todo adding LUA ( http://en.wikipedia.org/wiki/Lua_(programming_language) ) support for
35 | **/
36 | namespace geneticalgorithm {}
37 |
38 | }
39 |
40 |
41 | #include "population.hpp"
42 |
43 | #include "fitness/fitness.h"
44 | #include "selection/selection.h"
45 | #include "individual/individual.h"
46 | #include "crossover/crossover.h"
47 |
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/tools/vector.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for the vector calls **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "vectormodule"
29 | %include "../swig/java/java.i"
30 | %rename(Vector) vector;
31 |
32 | %typemap(javabody) machinelearning::tools::vector ""
33 | %typemap(javafinalize) machinelearning::tools::vector ""
34 | %typemap(javadestruct) machinelearning::tools::vector ""
35 | #endif
36 |
37 |
38 | %nodefaultctor machinelearning::tools::vector;
39 | %nodefaultdtor machinelearning::tools::vector;
40 |
41 |
42 | %include "vector.hpp"
43 | %template(min) machinelearning::tools::vector::min;
44 | %template(max) machinelearning::tools::vector::max;
45 | %template(mean) machinelearning::tools::vector::mean;
46 | %template(variance) machinelearning::tools::vector::variance;
47 |
--------------------------------------------------------------------------------
/examples/sources/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 | # build script for the source example
23 |
24 | import os
25 | Import("*")
26 |
27 | buildlist = []
28 |
29 | if env["withsources"] :
30 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "sources", "twitter"), source=defaultcpp+["twitter.cpp"] ) )
31 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "sources", "newsgroup"), source=defaultcpp+["newsgroup.cpp"] ) )
32 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "sources", "wikipedia"), source=defaultcpp+["wikipedia.cpp"] ) )
33 |
34 | if env["withfiles"] :
35 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "sources", "cloud"), source=defaultcpp+["cloud.cpp"] ) )
36 |
37 | if env["uselocallibrary"] or env["copylibrary"] :
38 | Depends(buildlist, env.LibraryCopy( os.path.join("#build", env["buildtype"], "sources"), [] ))
39 |
40 | env.Alias( "sources", buildlist )
--------------------------------------------------------------------------------
/examples/other/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 | # build script for the other example
23 |
24 | import os
25 | Import("*")
26 |
27 | buildlist = []
28 |
29 | if env["withfiles"] :
30 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "other", "mds_file"), source=defaultcpp+["mds_file.cpp"] ) )
31 |
32 | if env["withsources"] :
33 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "other", "mds_nntp"), source=defaultcpp+["mds_nntp.cpp"] ) )
34 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "other", "mds_wikipedia"), source=defaultcpp+["mds_wikipedia.cpp"] ) )
35 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "other", "mds_twitter"), source=defaultcpp+["mds_twitter.cpp"] ) )
36 |
37 | if env["uselocallibrary"] or env["copylibrary"] :
38 | Depends(buildlist, env.LibraryCopy( os.path.join("#build", env["buildtype"], "other"), [] ))
39 |
40 | env.Alias( "other", buildlist )
--------------------------------------------------------------------------------
/errorhandling/exception.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | #ifndef __MACHINELEARNING_ERRORHANDLING_EXCEPTION_HPP
25 | #define __MACHINELEARNING_ERRORHANDLING_EXCEPTION_HPP
26 |
27 | #include
28 | #include
29 |
30 |
31 | namespace machinelearning {
32 |
33 | /** namespace for all exceptions of the framework
34 | * @todo adding more exceptions for a better error handling
35 | **/
36 | namespace exception {
37 |
38 |
39 | /** exception class for throwing on runtime errors **/
40 | class runtime : public std::runtime_error
41 | {
42 | public :
43 |
44 | explicit runtime( const std::string& );
45 | template explicit runtime( const std::string&, const T* );
46 | template explicit runtime( const std::string&, const T& );
47 | };
48 |
49 |
50 | }
51 | }
52 |
53 |
54 | #include "exception.implementation.hpp"
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/tools/matrix.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for the matrix calls **/
25 |
26 |
27 | #ifdef SWIGJAVA
28 | %module "matrixmodule"
29 | %include "../swig/java/java.i"
30 | %rename(Matrix) matrix;
31 |
32 | %typemap(javabody) machinelearning::tools::matrix ""
33 | %typemap(javafinalize) machinelearning::tools::matrix ""
34 | %typemap(javadestruct) machinelearning::tools::matrix ""
35 | #endif
36 |
37 |
38 | %nodefaultctor machinelearning::tools::matrix;
39 | %nodefaultdtor machinelearning::tools::matrix;
40 |
41 |
42 | %include "matrix.hpp"
43 | %template(max) machinelearning::tools::matrix::max;
44 | %template(min) machinelearning::tools::matrix::min;
45 | %template(mean) machinelearning::tools::matrix::mean;
46 | %template(variance) machinelearning::tools::matrix::variance;
47 | %template(sum) machinelearning::tools::matrix::sum;
48 | %template(trace) machinelearning::tools::matrix::trace;
49 | %template(cov) machinelearning::tools::matrix::cov;
--------------------------------------------------------------------------------
/examples/clustering/build.py:
--------------------------------------------------------------------------------
1 | ############################################################################
2 | # LGPL License #
3 | # #
4 | # This file is part of the Machine Learning Framework. #
5 | # Copyright (c) 2010-2012, Philipp Kraus, #
6 | # This program is free software: you can redistribute it and/or modify #
7 | # it under the terms of the GNU Lesser General Public License as #
8 | # published by the Free Software Foundation, either version 3 of the #
9 | # License, or (at your option) any later version. #
10 | # #
11 | # This program is distributed in the hope that it will be useful, #
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | # GNU Lesser General Public License for more details. #
15 | # #
16 | # You should have received a copy of the GNU Lesser General Public License #
17 | # along with this program. If not, see . #
18 | ############################################################################
19 |
20 | # -*- coding: utf-8 -*-
21 |
22 | # build script for the clustering example
23 |
24 | import os
25 | Import("*")
26 |
27 | buildlist = []
28 |
29 | if env["withfiles"] :
30 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "clustering", "rlvq"), source=defaultcpp+["rlvq.cpp"] ) )
31 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "clustering", "kmeans"), source=defaultcpp+["kmeans.cpp"] ) )
32 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "clustering", "neuralgas"), source=defaultcpp+["neuralgas.cpp"] ) )
33 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "clustering", "patch_neuralgas"), source=defaultcpp+["patch_neuralgas.cpp"] ) )
34 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "clustering", "relational_neuralgas"), source=defaultcpp+["relational_neuralgas.cpp"] ) )
35 | buildlist.append( env.Program( target=os.path.join("#build", env["buildtype"], "clustering", "spectral"), source=defaultcpp+["spectral.cpp"] ) )
36 |
37 | if env["uselocallibrary"] or env["copylibrary"] :
38 | Depends(buildlist, env.LibraryCopy( os.path.join("#build", env["buildtype"], "clustering"), [] ))
39 |
40 | env.Alias( "clustering", buildlist )
--------------------------------------------------------------------------------
/examples/other/matlab/plotfiles.m:
--------------------------------------------------------------------------------
1 | % ############################################################################
2 | % # LGPL License #
3 | % # #
4 | % # This file is part of the Machine Learning Framework. #
5 | % # Copyright (c) 2010-2012, Philipp Kraus, #
6 | % # This program is free software: you can redistribute it and/or modify #
7 | % # it under the terms of the GNU Lesser General Public License as #
8 | % # published by the Free Software Foundation, either version 3 of the #
9 | % # License, or (at your option) any later version. #
10 | % # #
11 | % # This program is distributed in the hope that it will be useful, #
12 | % # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | % # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | % # GNU Lesser General Public License for more details. #
15 | % # #
16 | % # You should have received a copy of the GNU Lesser General Public License #
17 | % # along with this program. If not, see . #
18 | % ############################################################################
19 |
20 |
21 | % plots a HDF file that is created by the "mds_file" example
22 | % @pcfile HDF file
23 | function plotfiles( pcfile )
24 | lmarkersize = 5;
25 |
26 | % get data
27 | data = hdf5read( pcfile, '/project');
28 | if (size(data,2) ~= 2) && (size(data,2) ~= 3)
29 | error('plot only with 2D or 3D');
30 | end
31 | label = hdf5read( pcfile, '/files');
32 | datatxt=cell(1,size(data,1));
33 | for i=1:numel(datatxt)
34 | datatxt{i} = char(label(i).data);
35 | end
36 |
37 | % create plot
38 | figure;
39 | grid on;
40 | hold on;
41 | set(datacursormode(gcf), 'DisplayStyle','datatip', 'SnapToDataVertex','off','Enable','on', 'UpdateFcn',{@showlabel,datatxt});
42 |
43 | if size(data,2) == 2
44 | plot(data(:,1), data(:,2), '.', 'MarkerSize', lmarkersize);
45 | elseif size(data,2) == 3
46 | plot3(data(:,1), data(:,2), data(:,3), '.', 'MarkerSize', lmarkersize);
47 | end
48 |
49 | set(gca,'fontsize',1);
50 |
51 | if size(data,2) == 3
52 | view([-45 45]);
53 | end
54 |
55 |
56 |
57 |
58 | % label function for create "mouse over effect"
59 | % @param varargin input data
60 | % @return label text
61 | function txt = showlabel(varargin)
62 | label = varargin{3};
63 | txt = label{get(varargin{2}, 'DataIndex')};
64 |
--------------------------------------------------------------------------------
/machinelearning.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** implementation for initialization of static member
25 | * or different code structures that must run only once
26 | **/
27 |
28 | #include
29 | #include
30 | #include
31 |
32 | #ifdef MACHINELEARNING_MPI
33 | #include
34 | #endif
35 |
36 | #ifdef MACHINELEARNING_RANDOMDEVICE
37 | #include
38 | #endif
39 |
40 |
41 | #include "machinelearning.h"
42 |
43 |
44 | namespace machinelearning {
45 |
46 | /** initialization of the random device **/
47 | #ifdef MACHINELEARNING_RANDOMDEVICE
48 | boost::random_device tools::random::m_random;
49 | #else
50 |
51 | #ifdef MACHINELEARNING_MPI
52 | boost::mpi::environment l_mpienv;
53 | boost::mpi::communicator l_mpi;
54 | boost::mt19937 tools::random::m_random( time(NULL) * (l_mpi.rank()+1) );
55 | #else
56 | boost::mt19937 tools::random::m_random( time(NULL) );
57 | #endif
58 |
59 | #endif
60 |
61 |
62 | /** initialization of the logger instance **/
63 | #ifdef MACHINELEARNING_LOGGER
64 | tools::logger* tools::logger::m_instance = NULL;
65 |
66 | #ifdef MACHINELEARNING_MPI
67 | std::size_t tools::logger::m_mpitag = 999;
68 | std::string tools::logger::m_mpieot = "$EOT$";
69 | #endif
70 |
71 | #endif
72 |
73 | }
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/dimensionreduce/nonsupervised/reduce.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for the supervived reduce class, that should be
25 | * an java interface, because we can use the multiple inheritance and
26 | * disable all body parts
27 | **/
28 |
29 |
30 | #ifdef SWIGJAVA
31 | %module "nonsupervicedreduceemodule"
32 | %include "../../swig/java/java.i"
33 |
34 | %typemap(javaclassmodifiers) machinelearning::dimensionreduce::nonsupervised::reduce "public interface"
35 | %typemap(javabody) machinelearning::dimensionreduce::nonsupervised::reduce ""
36 | %typemap(javafinalize) machinelearning::dimensionreduce::nonsupervised::reduce ""
37 | %typemap(javadestruct) machinelearning::dimensionreduce::nonsupervised::reduce ""
38 |
39 | %typemap(javaout) ublas::matrix machinelearning::dimensionreduce::nonsupervised::reduce::map ";"
40 | %typemap(javaout) std::size_t machinelearning::dimensionreduce::nonsupervised::reduce::getDimension ";"
41 | #endif
42 |
43 |
44 | %nodefaultctor machinelearning::dimensionreduce::nonsupervised::reduce;
45 | %nodefaultdtor machinelearning::dimensionreduce::nonsupervised::reduce;
46 |
47 |
48 | %include "reduce.hpp"
49 | %template(Reduce) machinelearning::dimensionreduce::nonsupervised::reduce;
50 |
--------------------------------------------------------------------------------
/dimensionreduce/supervised/reduce.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | #ifndef __MACHINELEARNING_DIMENSIONREDUCE_SUPERVISED_REDUCE_HPP
26 | #define __MACHINELEARNING_DIMENSIONREDUCE_SUPERVISED_REDUCE_HPP
27 |
28 |
29 | #include
30 | #include
31 |
32 | #ifdef MACHINELEARNING_MPI
33 | #include
34 | #endif
35 |
36 | #include "../../errorhandling/exception.hpp"
37 | #include "../../tools/tools.h"
38 |
39 |
40 | namespace machinelearning { namespace dimensionreduce {
41 |
42 | /** namespace for all supervised reducing algorithms **/
43 | namespace supervised {
44 |
45 | #ifndef SWIG
46 | namespace ublas = boost::numeric::ublas;
47 | #endif
48 |
49 |
50 | /** abstract class for supervised dimension reducing classes **/
51 | template class reduce
52 | {
53 | #ifndef SWIG
54 | BOOST_STATIC_ASSERT( !boost::is_integral::value );
55 | #endif
56 |
57 |
58 | public :
59 |
60 | /** maps data to target dimension **/
61 | virtual ublas::matrix map( const ublas::matrix&, const std::vector& ) = 0;
62 |
63 | /** returns the mapped dimension **/
64 | virtual std::size_t getDimension( void ) const = 0;
65 |
66 | };
67 |
68 | }
69 |
70 | } }
71 | #endif
72 |
--------------------------------------------------------------------------------
/tools/files/hdf.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for the HDF calls,
25 | * we use always double types, so for writing we
26 | * set the HDF datatype by a fixed value
27 | **/
28 |
29 | #ifdef MACHINELEARNING_FILES_HDF
30 |
31 | #ifdef SWIGJAVA
32 | %module "hdfmodule"
33 | %include "../../swig/java/java.i"
34 | %rename(HDF) hdf;
35 |
36 | %exception %{
37 | try {
38 | $action
39 | }
40 | catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what() ); }
41 | catch( const H5::Exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.getCDetailMsg() ); }
42 | catch (...) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "exception in machinelearning framework"); }
43 | %}
44 | #endif
45 |
46 |
47 |
48 |
49 | %include "hdf.hpp"
50 |
51 | %template(readBlasMatrix) machinelearning::tools::files::hdf::readBlasMatrix;
52 | %template(readBlasVector) machinelearning::tools::files::hdf::readBlasVector;
53 | %template(readValue) machinelearning::tools::files::hdf::readValue;
54 |
55 | %extend machinelearning::tools::files::hdf {
56 | void writeValue( const std::string& p_path, const double& p_val ) { $self->writeValue(p_path, p_val, tools::files::hdf::NATIVE_DOUBLE); }
57 | void writeBlasVector( const std::string& p_path, const ublas::vector& p_vector ) { $self->writeBlasVector(p_path, p_vector, tools::files::hdf::NATIVE_DOUBLE); }
58 | void writeBlasMatrix( const std::string& p_path, const ublas::matrix& p_matrix ) { $self->writeBlasMatrix(p_path, p_matrix, tools::files::hdf::NATIVE_DOUBLE); }
59 | }
60 |
61 | #endif
62 |
--------------------------------------------------------------------------------
/tools/sources/sources.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | #ifdef MACHINELEARNING_SOURCES
25 |
26 | #ifndef __MACHINELEARNING_TOOLS_SOURCES_SOURCES_H
27 | #define __MACHINELEARNING_TOOLS_SOURCES_SOURCES_H
28 |
29 | namespace machinelearning {
30 | namespace tools {
31 |
32 | /** namespace with classes for generating example data
33 | * @todo adding support for OpenStreetMap http://wiki.openstreetmap.org/wiki/API / http://wiki.openstreetmap.org/wiki/Overpass_API
34 | * @todo adding support for Apache Cassandra http://en.wikipedia.org/wiki/Apache_Cassandra
35 | * @todo adding support for Hadoop http://hadoop.apache.org/
36 | * @todo adding support for MangoDB http://www.mongodb.org/
37 | * @todo adding support for MonetDB http://www.monetdb.org/
38 | * @todo adding support for graph databases http://en.wikipedia.org/wiki/Graph_database
39 | * @todo adding support for mySQL / MS SQL / Postgres SQL / Oracle via eg http://www.sqlapi.com/
40 | * @todo adding twitter streaming support https://dev.twitter.com/docs/streaming-api/methods
41 | * @todo adding support for reading HTML data with WGet / Curl
42 | * @todo adding support for http://en.wikipedia.org/wiki/CouchDB
43 | * @todo adding support for web-sockets http://www.whatwg.org/specs/web-socket-protocol/
44 | * @todo adding support for differnt source of http://datacatalogs.org/
45 | * @todo adding support for http://www.data.gov/
46 | **/
47 | namespace sources {}
48 |
49 | }
50 | }
51 |
52 | #include "nntp.h"
53 | #include "wikipedia.h"
54 | #include "cloud.hpp"
55 | #include "twitter.h"
56 |
57 | #endif
58 | #endif
59 |
--------------------------------------------------------------------------------
/tools/language/bindings.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | #ifndef MACHINELEARNING_MULTILANGUAGE
25 | #define _(string) string
26 | #else
27 |
28 | #ifndef __MACHINELEARNING_TOOLS_LANGUAGE_BINDINGS_H
29 | #define __MACHINELEARNING_TOOLS_LANGUAGE_BINDINGS_H
30 |
31 | extern "C" {
32 | #include
33 | }
34 | #include
35 |
36 | #define _(string) gettext(string)
37 |
38 |
39 | namespace machinelearning { namespace tools { namespace language {
40 |
41 |
42 | /** class for create langugage bindings **/
43 | class bindings
44 | {
45 |
46 | public :
47 |
48 | static std::string getLanguage( void );
49 | static void bind( const std::string& = "machinelearning", const std::string& = "language", const std::string& = "" );
50 |
51 |
52 | };
53 |
54 |
55 | /** returns the environmental language
56 | * @return string with language
57 | **/
58 | inline std::string bindings::getLanguage( void )
59 | {
60 | return getenv("LANG");
61 | }
62 |
63 |
64 | /** bind the textdomain for different language
65 | * @param p_name name of language file (default: machinelearning)
66 | * @param p_path path to language file (default: language directory, relative to the executable / eg: language files locate under p_path / p_lang / p_name.mo)
67 | * @param p_lang language (empty for system value)
68 | **/
69 | inline void bindings::bind( const std::string& p_name, const std::string& p_path, const std::string& p_lang )
70 | {
71 | setlocale(LC_ALL, p_lang.c_str());
72 | bindtextdomain(p_name.c_str(), p_path.c_str());
73 | textdomain(p_name.c_str());
74 | }
75 |
76 |
77 | }}}
78 | #endif
79 | #endif
80 |
--------------------------------------------------------------------------------
/tools/typeinfo.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 |
26 | #ifndef __MACHINELEARNING_TOOLS_TYPEINFO_H
27 | #define __MACHINELEARNING_TOOLS_TYPEINFO_H
28 |
29 | #include
30 | #include
31 |
32 | #ifdef __GNUC__
33 | #include
34 | #endif
35 |
36 | namespace machinelearning { namespace tools {
37 |
38 |
39 | /** class that creates a typeinfo interface **/
40 | class typeinfo
41 | {
42 |
43 | public :
44 |
45 | template static std::string getClassName( const T* );
46 | template static std::string getClassName( const T& );
47 | };
48 |
49 |
50 | /** returns the class name of a pointer
51 | * @param p_ptr pointer
52 | * @return string with class name and namespaces
53 | **/
54 | template inline std::string typeinfo::getClassName( const T* p_ptr )
55 | {
56 | try {
57 |
58 | #ifdef __GNUC__
59 | return std::string(abi::__cxa_demangle( typeid(*p_ptr).name(), NULL, 0, NULL ));
60 | #endif
61 |
62 |
63 | } catch (...) {}
64 |
65 | return std::string();
66 | }
67 |
68 |
69 | /** returns the class name of a reference
70 | * @param p_obj reference
71 | * @return string with class name and namespaces
72 | **/
73 | template inline std::string typeinfo::getClassName( const T& p_obj )
74 | {
75 | try {
76 |
77 | #ifdef __GNUC__
78 | return std::string(abi::__cxa_demangle( typeid(p_obj).name(), NULL, 0, NULL ));
79 | #endif
80 |
81 |
82 | } catch (...) {}
83 |
84 | return std::string();
85 | }
86 |
87 |
88 | }}
89 | #endif
90 |
--------------------------------------------------------------------------------
/errorhandling/assert.h:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** preprocessor command for framework asserts, which can be added to the logger
25 | * if the logger exists
26 | **/
27 |
28 | #ifndef __MACHINELEARNING_ERRORHANDLING_ASSERT_H
29 | #define __MACHINELEARNING_ERRORHANDLING_ASSERT_H
30 |
31 | #include
32 | #include
33 | #include
34 |
35 | #include "../tools/logger.hpp"
36 |
37 |
38 |
39 | #ifdef MACHINELEARNING_NDEBUG
40 |
41 | #define MACHINELEARNING_ASSERT( p_expression, p_message )
42 |
43 | #else
44 |
45 | #ifdef MACHINELEARNING_LOGGER
46 |
47 | #define MACHINELEARNING_ASSERT( p_expression, p_message ) \
48 | { \
49 | if (!p_expression) { \
50 | if (machinelearning::tools::logger::exists()) { \
51 | std::stringstream l_msg; \
52 | l_msg << p_message << ", " << __FILE__ << ", line " << __LINE__; \
53 | machinelearning::tools::logger::getInstance()->write( machinelearning::tools::logger::assert, l_msg.str() ); \
54 | } \
55 | std::cerr << "Machinlearning Assertion failed: " << p_message << ", " << __FILE__ << ", line " << __LINE__ << std::endl; \
56 | exit(EXIT_FAILURE); \
57 | } \
58 | }
59 |
60 | #else
61 |
62 | #define MACHINELEARNING_ASSERT( p_expression, p_message ) \
63 | { \
64 | if (!p_expression) { \
65 | std::cerr << "Machinlearning Assertion failed: " << p_message << ", " << __FILE__ << ", line " << __LINE__ << std::endl; \
66 | exit(EXIT_FAILURE); \
67 | } \
68 | }
69 |
70 | #endif
71 |
72 | #endif
73 |
74 |
75 |
76 | #endif
77 |
--------------------------------------------------------------------------------
/geneticalgorithm/individual/individual.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | #ifndef __MACHINELEARNING_GENETICALGORITHM_INDIVIDUAL_INDIVIDUAL_HPP
26 | #define __MACHINELEARNING_GENETICALGORITHM_INDIVIDUAL_INDIVIDUAL_HPP
27 |
28 | #include
29 |
30 |
31 |
32 | namespace machinelearning { namespace geneticalgorithm { namespace individual {
33 |
34 | /** abstract class of an indivdual of the population **/
35 | template class individual
36 | {
37 |
38 | public :
39 |
40 | /** method for cloning the object. The method should be create a new individual for the population
41 | * initialization on the heap and returns the smart-pointer to the heap object within the reference parameter.
42 | * @param p_individual reference in which the new individual smart-pointer object is written
43 | **/
44 | virtual void clone( boost::shared_ptr< individual >& p_individual ) const = 0;
45 |
46 | /** returns a value of a data element at the position of the individual
47 | * @param p_index index position of the gen position
48 | **/
49 | virtual T operator[]( const std::size_t& p_index ) const = 0;
50 |
51 | /** returns a reference of a data element at the position of the individual
52 | * @param p_index index position of the gen position
53 | **/
54 | virtual T& operator[]( const std::size_t& p_index ) = 0;
55 |
56 | /** mutates the individual **/
57 | virtual void mutate( void ) = 0;
58 |
59 | /** returns the number of positions / length
60 | * @return length / size of the gen sequence
61 | **/
62 | virtual std::size_t size( void ) const = 0;
63 |
64 | };
65 |
66 | }}}
67 | #endif
68 |
69 |
--------------------------------------------------------------------------------
/neighborhood/neighborhood.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 |
26 | #ifndef __MACHINELEARNING_NEIGHBORHOOD_NEIGHBORHOOD_HPP
27 | #define __MACHINELEARNING_NEIGHBORHOOD_NEIGHBORHOOD_HPP
28 |
29 |
30 | #include
31 | #include
32 |
33 | #include "../tools/tools.h"
34 |
35 |
36 | namespace machinelearning {
37 |
38 |
39 | /** neighborhood namespace for all structures to calculate neighbors
40 | **/
41 | namespace neighborhood {
42 |
43 |
44 | namespace ublas = boost::numeric::ublas;
45 |
46 |
47 |
48 | /** abstract class for neighborhood classes
49 | * @todo recreate base class for neighborhood
50 | **/
51 | template class neighborhood
52 | {
53 | BOOST_STATIC_ASSERT( !boost::is_integral::value );
54 |
55 |
56 | public :
57 |
58 | /** function for calculating the neighborhoods **/
59 | virtual ublas::matrix get( const ublas::matrix& ) const = 0;
60 |
61 | /** function for calculating the neighborhoods between different datapoints **/
62 | virtual ublas::matrix get( const ublas::matrix&, const ublas::matrix& ) const = 0;
63 |
64 | /** calculates the distance between two vectors **/
65 | virtual T calculateDistance( const ublas::vector&, const ublas::vector& ) const = 0;
66 |
67 | /** invert a value **/
68 | virtual T invert( const T& ) const = 0;
69 |
70 | /** returns the number of neighbors **/
71 | virtual std::size_t getNeighborCount( void ) const = 0;
72 |
73 | };
74 |
75 | }
76 | }
77 | #endif
78 |
--------------------------------------------------------------------------------
/examples/java/reducing/mds.java:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | import machinelearning.dimensionreduce.nonsupervised.*;
26 | import java.util.Random;
27 |
28 |
29 | /** java testprogram for using MDS **/
30 | public class mds {
31 |
32 |
33 | /** main method
34 | * @param p_args input arguments
35 | **/
36 | public static void main(String[] p_args)
37 | {
38 | // generates random datapoints
39 | Random l_rand = new Random();
40 |
41 | Double[][] l_data = new Double[8][8];
42 | for(int i=0; i < l_data.length; i++) {
43 | for (int j=0; j < l_data[i].length; j++) {
44 | if (i==j)
45 | l_data[i][j] = new Double(0);
46 | else
47 | l_data[i][j] = l_rand.nextDouble();
48 | System.out.print(l_data[i][j] + "\t");
49 | }
50 | System.out.println("");
51 | }
52 |
53 | // create MDS object
54 | MDS l_mds = new MDS(3, MDS.project.metric);
55 |
56 |
57 | // maps the random data points
58 | Double[][] l_result = l_mds.map(l_data);
59 | System.out.println("\nproject data:");
60 | if (l_result == null)
61 | System.out.println("no data is returned");
62 | else
63 | for(int i=0; i < l_result.length; i++) {
64 | for(int j=0; j < l_result[i].length; ++j)
65 | System.out.print(l_result[i][j] + "\t");
66 | System.out.println("");
67 | }
68 |
69 |
70 | // delete manually the PCA object (call destructor), should be
71 | // do the finalizer, but there is no guarantee.
72 | l_mds.delete();
73 |
74 | // set objects to null for gc removing
75 | l_mds = null;
76 | l_result = null;
77 | l_data = null;
78 | l_rand = null;
79 | }
80 |
81 | }
--------------------------------------------------------------------------------
/geneticalgorithm/fitness/fitness.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | #ifndef __MACHINELEARNING_GENETICALGORITHM_FITNESS_FITNESS_HPP
26 | #define __MACHINELEARNING_GENETICALGORITHM_FITNESS_FITNESS_HPP
27 |
28 | #include
29 | #include
30 |
31 | #include "../individual/individual.hpp"
32 |
33 |
34 | namespace machinelearning { namespace geneticalgorithm { namespace fitness {
35 |
36 | /** abstract class of the fitness function **/
37 | template class fitness
38 | {
39 | BOOST_STATIC_ASSERT( !boost::is_integral::value );
40 |
41 | public :
42 |
43 | /** method for calculating the fitness value of an individual / return value should be [0, best value]
44 | * @param p_individual reference to an individual
45 | **/
46 | virtual T getFitness( const individual::individual& p_individual ) = 0;
47 |
48 | /** bool method, that will be true if the optimal fitness values is reached. The
49 | * iteration process will bes stopped immediately, but the elite individual will
50 | * be added basis of the fitness value to the elite list
51 | * @return bool for stopping iteration process
52 | **/
53 | virtual bool isOptimumReached( void ) const = 0;
54 |
55 | /** method for cloning the object, for using on multithread
56 | * @param p_ptr smart-pointer object
57 | **/
58 | virtual void clone( boost::shared_ptr< fitness >& p_ptr ) const = 0;
59 |
60 | /** method that is called at the end of each iteration
61 | * @param p_population population
62 | **/
63 | virtual void onEachIteration( const std::vector< boost::shared_ptr< individual::individual > >& p_population ) = 0;
64 |
65 | };
66 |
67 | }}}
68 | #endif
69 |
70 |
--------------------------------------------------------------------------------
/geneticalgorithm/crossover/crossover.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | #ifndef __MACHINELEARNING_GENETICALGORITHM_CROSSOVER_CROSSOVER_HPP
26 | #define __MACHINELEARNING_GENETICALGORITHM_CROSSOVER_CROSSOVER_HPP
27 |
28 | #include
29 |
30 | #include "../individual/individual.hpp"
31 |
32 |
33 | namespace machinelearning { namespace geneticalgorithm { namespace crossover {
34 |
35 | /** abstract class of the crossover function **/
36 | template class crossover
37 | {
38 |
39 | public :
40 |
41 | /** returns the number how many individuals are needed for the crossover (default should be two)
42 | * @return number of needed individuals
43 | **/
44 | virtual std::size_t getNumberOfIndividuals( void ) const = 0;
45 |
46 | /** set the individuals with a smart-pointer
47 | * @param p_individual smart-pointer object to an individual
48 | **/
49 | virtual void setIndividual( const boost::shared_ptr< individual::individual >& p_individual ) = 0;
50 |
51 | /** creates a new smart-pointer object with the new individual data
52 | * @return a new smart-pointer object of the individual that should be replaced
53 | **/
54 | virtual boost::shared_ptr< individual::individual > combine( void ) = 0;
55 |
56 | /** method for cloning the object, for using on multithread
57 | * @param p_ptr smart-pointer object
58 | **/
59 | virtual void clone( boost::shared_ptr< crossover >& p_ptr ) const = 0;
60 |
61 | /** method that is called at the end of each iteration
62 | * @param p_population population
63 | **/
64 | virtual void onEachIteration( const std::vector< boost::shared_ptr< individual::individual > >& p_population ) = 0;
65 | };
66 |
67 | }}}
68 | #endif
69 |
70 |
--------------------------------------------------------------------------------
/examples/other/matlab/plotwiki.m:
--------------------------------------------------------------------------------
1 | % ############################################################################
2 | % # LGPL License #
3 | % # #
4 | % # This file is part of the Machine Learning Framework. #
5 | % # Copyright (c) 2010-2012, Philipp Kraus, #
6 | % # This program is free software: you can redistribute it and/or modify #
7 | % # it under the terms of the GNU Lesser General Public License as #
8 | % # published by the Free Software Foundation, either version 3 of the #
9 | % # License, or (at your option) any later version. #
10 | % # #
11 | % # This program is distributed in the hope that it will be useful, #
12 | % # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | % # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | % # GNU Lesser General Public License for more details. #
15 | % # #
16 | % # You should have received a copy of the GNU Lesser General Public License #
17 | % # along with this program. If not, see . #
18 | % ############################################################################
19 |
20 |
21 | % plots a HDF file that is created by the "mds_wikipedia" example
22 | % @param pcfile HDF file
23 | % @param pnnodes number of nodes
24 | function plotwiki( pcfile, pnnodes )
25 | lmarkersize=5;
26 |
27 | % get data (if only one file is used)
28 | if nargin < 2 || isempty(pnnodes)
29 | data = hdf5read( pcfile, '/project');
30 | label = hdf5read( pcfile, '/label');
31 | else
32 | %if files of the cluster nodes are used
33 | loaddata = cell(pnnodes,1);
34 | loadlabel = cell(pnnodes,1);
35 | for i=1:pnnodes
36 | loaddata{i} = hdf5read( strcat('node', num2str(i-1), '_', pcfile), '/project');
37 | loadlabel{i} = hdf5read( strcat('node', num2str(i-1), '_', pcfile), '/label');
38 | end
39 |
40 | data = cell2mat(loaddata);
41 | label = cell2mat(loadlabel);
42 | end
43 |
44 |
45 | if (size(data,2) ~= 2) && (size(data,2) ~= 3)
46 | error('plot only with 2D or 3D');
47 | end
48 | datatxt=cell(size(label,1), 1);
49 | for i=1:size(datatxt,1)
50 | datatxt{i} = char(label(i).data);
51 | end
52 |
53 |
54 |
55 | % create plot
56 | figure;
57 | grid on;
58 | hold on;
59 | set(datacursormode(gcf), 'DisplayStyle','datatip', 'SnapToDataVertex','off','Enable','on', 'UpdateFcn',{@showlabel,datatxt});
60 |
61 |
62 | if size(data,2) == 2
63 | plot(data(:,1), data(:,2), '.', 'MarkerSize', lmarkersize);
64 | elseif size(data,2) == 3
65 | plot3(data(:,1), data(:,2), data(:,3), '.', 'MarkerSize', lmarkersize);
66 | end
67 | set(gca,'fontsize',1);
68 |
69 | if size(data,2) == 3
70 | view([-45 45]);
71 | end
72 |
73 |
74 |
75 | % label function for create "mouse over effect"
76 | % @param varargin input data
77 | % @return label text
78 | function txt = showlabel(varargin)
79 | label = varargin{3};
80 | txt = label{get(varargin{2}, 'DataIndex')};
81 |
--------------------------------------------------------------------------------
/examples/java/clustering/rng.java:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | import machinelearning.clustering.nonsupervised.*;
26 | import java.util.Random;
27 |
28 |
29 | /** java testprogram for using relational neural gas **/
30 | public class rng {
31 |
32 |
33 | /** main method
34 | * @param p_args input arguments
35 | **/
36 | public static void main(String[] p_args)
37 | {
38 | // generates random datapoints
39 | Random l_rand = new Random();
40 |
41 | Double[][] l_data = new Double[8][8];
42 | for(int i=0; i < l_data.length; i++) {
43 | for (int j=0; j < l_data[i].length; j++) {
44 | if (i==j)
45 | l_data[i][j] = new Double(0);
46 | else
47 | l_data[i][j] = l_rand.nextDouble();
48 | System.out.print(l_data[i][j] + "\t");
49 | }
50 | System.out.println("");
51 | }
52 |
53 | // create RNG object and train data
54 | RelationalNeuralGas l_rng = new RelationalNeuralGas(4, l_data.length);
55 | l_rng.train(l_data, 10);
56 |
57 | // show RNG prototypes
58 | Double[][] l_proto = l_rng.getPrototypes();
59 | System.out.println("\nprototypes:");
60 | if (l_proto == null)
61 | System.out.println("no data is returned");
62 | else
63 | for(int i=0; i < l_proto.length; i++) {
64 | for(int j=0; j < l_proto[i].length; ++j)
65 | System.out.print(l_proto[i][j] + "\t");
66 | System.out.println("");
67 | }
68 |
69 |
70 | // delete manually the RNG object (call destructor), should be
71 | // do the finalizer, but there is no guarantee.
72 | l_rng.delete();
73 |
74 |
75 | // set objects to null for gc removing
76 | l_rng = null;
77 | l_data = null;
78 | l_proto = null;
79 | l_rand = null;
80 | }
81 |
82 | }
--------------------------------------------------------------------------------
/distances/distance.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for the distance class, that must create an abstract class
25 | * without any methods and properties, because the C++ class are pure virtual
26 | * and the methods are only called in the implementated JNI functions
27 | **/
28 |
29 |
30 | #ifdef SWIGJAVA
31 | %module "distancemodule"
32 | %include "../swig/java/java.i"
33 |
34 | %typemap(javaclassmodifiers) machinelearning::distances::distance "public interface"
35 | %typemap(javabody) machinelearning::distances::distance ""
36 | %typemap(javafinalize) machinelearning::distances::distance ""
37 | %typemap(javadestruct) machinelearning::distances::distance ""
38 |
39 | %typemap(javaout) ublas::vector machinelearning::distances::distance::getNormalize ";"
40 | %typemap(javaout) ublas::matrix machinelearning::distances::distance::getNormalize ";"
41 | %typemap(javaout) double machinelearning::distances::distance::getLength ";"
42 | %typemap(javaout) ublas::vector machinelearning::distances::distance::getLength ";"
43 | %typemap(javaout) double machinelearning::distances::distance::getInvert ";"
44 | %typemap(javaout) ublas::vector machinelearning::distances::distance::getAbs ";"
45 | %typemap(javaout) double machinelearning::distances::distance::getDistance ";"
46 | %typemap(javaout) ublas::vector machinelearning::distances::distance::getDistance ";"
47 | #endif
48 |
49 |
50 | %nodefaultctor machinelearning::distances::distance;
51 | %nodefaultdtor machinelearning::distances::distance;
52 |
53 |
54 | %include "distance.hpp"
55 | %template(Distance) machinelearning::distances::distance;
--------------------------------------------------------------------------------
/examples/java/clustering/spectral.java:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | import machinelearning.clustering.nonsupervised.*;
26 | import java.util.Random;
27 |
28 |
29 | /** java testprogram for using Spectral Clustering **/
30 | public class spectral {
31 |
32 |
33 | /** main method
34 | * @param p_args input arguments
35 | **/
36 | public static void main(String[] p_args)
37 | {
38 |
39 | // generates random datapoints
40 | Random l_rand = new Random();
41 |
42 | Double[][] l_data = new Double[8][8];
43 | for(int i=0; i < l_data.length; i++) {
44 | for (int j=0; j < l_data[i].length; j++) {
45 | if (i==j)
46 | l_data[i][j] = new Double(0);
47 | else
48 | l_data[i][j] = l_rand.nextDouble();
49 |
50 | System.out.print(l_data[i][j] + "\t");
51 | }
52 | System.out.println("");
53 | }
54 |
55 | // create SpectralClustering object and train data
56 | SpectralClustering l_spectral = new SpectralClustering(3);
57 | l_spectral.train(l_data, 10);
58 |
59 | // show SpectralClustering prototypes
60 | Double[][] l_proto = l_spectral.getPrototypes();
61 | System.out.println("\nprototypes:");
62 | if (l_proto == null)
63 | System.out.println("no data is returned");
64 | else
65 | for(int i=0; i < l_proto.length; i++) {
66 | for(int j=0; j < l_proto[i].length; ++j)
67 | System.out.print(l_proto[i][j] + "\t");
68 | System.out.println("");
69 | }
70 |
71 |
72 | // delete manually the SpectralClustering object (call destructor), should be
73 | // do the finalizer, but there is no guarantee.
74 | l_spectral.delete();
75 |
76 |
77 | // set objects to null for gc removing
78 | l_spectral = null;
79 | l_data = null;
80 | l_proto = null;
81 | l_rand = null;
82 | }
83 |
84 | }
--------------------------------------------------------------------------------
/dimensionreduce/nonsupervised/reduce.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | #ifndef __MACHINELEARNING_DIMENSIONREDUCE_NONSUPERVISED_REDUCE_HPP
26 | #define __MACHINELEARNING_DIMENSIONREDUCE_NONSUPERVISED_REDUCE_HPP
27 |
28 |
29 | #include
30 | #include
31 |
32 | #ifdef MACHINELEARNING_MPI
33 | #include
34 | #endif
35 |
36 | #include "../../errorhandling/exception.hpp"
37 | #include "../../tools/tools.h"
38 |
39 |
40 | namespace machinelearning { namespace dimensionreduce {
41 |
42 | /** namespace for all non-supervised reducing algorithms **/
43 | namespace nonsupervised {
44 |
45 | #ifndef SWIG
46 | namespace ublas = boost::numeric::ublas;
47 | #ifdef MACHINELEARNING_MPI
48 | namespace mpi = boost::mpi;
49 | #endif
50 | #endif
51 |
52 |
53 | /** abstract class for nonsupervised dimension reducing classes **/
54 | template class reduce
55 | {
56 | #ifndef SWIG
57 | BOOST_STATIC_ASSERT( !boost::is_integral::value );
58 | #endif
59 |
60 |
61 | public :
62 |
63 | /** maps data to target dimension **/
64 | virtual ublas::matrix map( const ublas::matrix& ) = 0;
65 |
66 | /** returns the mapped dimension **/
67 | virtual std::size_t getDimension( void ) const = 0;
68 |
69 | };
70 |
71 |
72 | #ifdef MACHINELEARNING_MPI
73 |
74 | /** abstract class for nonsupervised dimension reducing classes with MPI support **/
75 | template class reducempi
76 | {
77 | BOOST_STATIC_ASSERT( !boost::is_integral::value );
78 |
79 |
80 | public :
81 |
82 | /** maps data to target dimension **/
83 | virtual ublas::matrix map( const mpi::communicator&, const ublas::matrix& ) = 0;
84 |
85 | };
86 |
87 | #endif
88 | }
89 |
90 | } }
91 | #endif
92 |
--------------------------------------------------------------------------------
/examples/java/reducing/pca.java:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | import machinelearning.dimensionreduce.nonsupervised.*;
26 | import java.util.Random;
27 |
28 |
29 | /** java testprogram for using PCA **/
30 | public class pca {
31 |
32 |
33 | /** main method
34 | * @param p_args input arguments
35 | **/
36 | public static void main(String[] p_args)
37 | {
38 | // generates random datapoints
39 | Random l_rand = new Random();
40 |
41 | Double[][] l_data = new Double[15][8];
42 | for(int i=0; i < l_data.length; i++) {
43 | for (int j=0; j < l_data[i].length; j++) {
44 | l_data[i][j] = l_rand.nextDouble() * 500;
45 | System.out.print(l_data[i][j] + "\t");
46 | }
47 | System.out.println("");
48 | }
49 |
50 | // create PCA object
51 | PCA l_pca = new PCA(3);
52 |
53 |
54 | // maps the random data points
55 | Double[][] l_result = l_pca.map(l_data);
56 | System.out.println("\nproject data:");
57 | if (l_result == null)
58 | System.out.println("no data is returned");
59 | else
60 | for(int i=0; i < l_result.length; i++) {
61 | for(int j=0; j < l_result[i].length; ++j)
62 | System.out.print(l_result[i][j] + "\t");
63 | System.out.println("");
64 | }
65 |
66 | // show PCA eigenvectors
67 | Double[][] l_eig = l_pca.getProject();
68 | System.out.println("\neigenvectors:");
69 | if (l_eig == null)
70 | System.out.println("no data is returned");
71 | else
72 | for(int i=0; i < l_eig.length; i++) {
73 | for(int j=0; j < l_eig[i].length; ++j)
74 | System.out.print(l_eig[i][j] + "\t");
75 | System.out.println("");
76 | }
77 |
78 |
79 | // delete manually the PCA object (call destructor), should be
80 | // do the finalizer, but there is no guarantee.
81 | l_pca.delete();
82 |
83 |
84 | // set objects to null for gc removing
85 | l_pca = null;
86 | l_result = null;
87 | l_data = null;
88 | l_eig = null;
89 | l_rand = null;
90 | }
91 |
92 | }
--------------------------------------------------------------------------------
/examples/java/tools/eigen.java:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | import machinelearning.tools.*;
26 | import java.util.*;
27 |
28 |
29 | /** java testprogram for using eigenvalue algorithms **/
30 | public class eigen {
31 |
32 |
33 | /** main method
34 | * @param p_args input arguments
35 | **/
36 | public static void main(String[] p_args)
37 | {
38 | // generates random datapoints
39 | java.util.Random l_rand = new java.util.Random();
40 |
41 | Double[][] l_data = new Double[6][6];
42 | for(int i=0; i < l_data.length; i++) {
43 | for (int j=0; j < l_data[i].length; j++) {
44 | l_data[i][j] = l_rand.nextDouble() * 500;
45 | System.out.print(l_data[i][j] + "\t");
46 | }
47 | System.out.println("");
48 | }
49 |
50 |
51 | // create eigenvectors / -values
52 | ArrayList l_eigenvals = new ArrayList();
53 | ArrayList l_eigenvecs = new ArrayList();
54 |
55 | Lapack.eigen(l_data, l_eigenvals, l_eigenvecs);
56 |
57 |
58 |
59 | System.out.println("\neigenvalues:");
60 | for(int i=0; i < l_eigenvals.size(); i++)
61 | System.out.print(l_eigenvals.get(i) + "\t");
62 | System.out.println("");
63 | l_eigenvals = null;
64 |
65 |
66 |
67 | System.out.println("\neigenvectors:\n");
68 | for(int j=0; j < l_eigenvecs.size(); j++) {
69 | System.out.print( (j+1) + " eigenvector:\t");
70 | for(int i=0; i < l_eigenvecs.get(j).length; i++)
71 | System.out.print(l_eigenvecs.get(j)[i] + "\t");
72 | System.out.println("\n");
73 | }
74 | l_eigenvecs = null;
75 |
76 |
77 | // get the largest eigenvector with perron-frobenius
78 | Double[] l_perron = Lapack.perronFrobenius( l_data, 2*l_data.length );
79 |
80 | System.out.println("\nlargest eigenvector with perron-frobenius-theorem:");
81 | for(int i=0; i < l_perron.length; i++)
82 | System.out.print(l_perron[i] + "\t");
83 | System.out.println("");
84 | l_perron = null;
85 |
86 | l_data = null;
87 | l_rand = null;
88 | }
89 |
90 | }
--------------------------------------------------------------------------------
/examples/java/tools/svd.java:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 |
25 | import machinelearning.tools.*;
26 | import java.util.*;
27 |
28 |
29 | /** java testprogram for using svd algorithms **/
30 | public class svd {
31 |
32 |
33 | /** main method
34 | * @param p_args input arguments
35 | **/
36 | public static void main(String[] p_args)
37 | {
38 | // generates random datapoints
39 | java.util.Random l_rand = new java.util.Random();
40 |
41 | Double[][] l_data = new Double[4][8];
42 | for(int i=0; i < l_data.length; i++) {
43 | for (int j=0; j < l_data[i].length; j++) {
44 | l_data[i][j] = l_rand.nextDouble() * 500;
45 | System.out.print(l_data[i][j] + "\t");
46 | }
47 | System.out.println("");
48 | }
49 |
50 |
51 | // create SVD
52 | ArrayList l_svdvals = new ArrayList();
53 | ArrayList l_svdvecs1 = new ArrayList();
54 | ArrayList l_svdvecs2 = new ArrayList();
55 |
56 | Lapack.svd(l_data, l_svdvals, l_svdvecs1, l_svdvecs2);
57 |
58 |
59 |
60 | System.out.println("\nsvd values:");
61 | for(int i=0; i < l_svdvals.size(); i++)
62 | System.out.print(l_svdvals.get(i) + "\t");
63 | System.out.println("");
64 | l_svdvals = null;
65 |
66 |
67 |
68 | System.out.println("\nsvd vectors 1:\n");
69 | for(int j=0; j < l_svdvecs1.size(); j++) {
70 | System.out.print( (j+1) + " svd vector:\t");
71 | for(int i=0; i < l_svdvecs1.get(j).length; i++)
72 | System.out.print(l_svdvecs1.get(j)[i] + "\t");
73 | System.out.println("\n");
74 | }
75 | l_svdvecs1 = null;
76 |
77 |
78 |
79 | System.out.println("\nsvd vectors 2:\n");
80 | for(int j=0; j < l_svdvecs2.size(); j++) {
81 | System.out.print( (j+1) + " svd vector:\t");
82 | for(int i=0; i < l_svdvecs2.get(j).length; i++)
83 | System.out.print(l_svdvecs2.get(j)[i] + "\t");
84 | System.out.println("\n");
85 | }
86 | l_svdvecs2 = null;
87 |
88 |
89 | l_data = null;
90 | l_rand = null;
91 | }
92 |
93 | }
--------------------------------------------------------------------------------
/classifier/classifier.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | #ifndef __MACHINELEARNING_CLASSIFIER_CLASSIFIER_HPP
25 | #define __MACHINELEARNING_CLASSIFIER_CLASSIFIER_HPP
26 |
27 |
28 | #include
29 | #include
30 |
31 | #include "../errorhandling/exception.hpp"
32 | #include "../distances/distances.h"
33 |
34 |
35 | namespace machinelearning {
36 |
37 | /** namespace for all classifier algorithms **/
38 | namespace classifier {
39 |
40 | namespace ublas = boost::numeric::ublas;
41 |
42 |
43 |
44 | /** abstract class for classificator
45 | * @note every data matrix must be row orientated.
46 | * data matrix NxM with n number of datapoints and M data dimension
47 | * @todo checking method names and parameters (it's not optimal for using)
48 | **/
49 | template class classifier
50 | {
51 | BOOST_STATIC_ASSERT( !boost::is_integral::value );
52 |
53 |
54 | public :
55 |
56 | /** method for training prototypes **/
57 | virtual void setDatabase( const ublas::matrix&, const std::vector& ) = 0;
58 |
59 | /** method which returns prototypes **/
60 | virtual ublas::matrix getDatabasePoints( void ) const = 0;
61 |
62 | /** return lables of prototypes **/
63 | virtual std::vector getDatabaseLabel( void ) const = 0;
64 |
65 | /** disable and enable logging **/
66 | virtual void setLogging( const bool& ) = 0;
67 |
68 | /** returns dimension of data points **/
69 | virtual std::size_t getDatabaseSize( void ) const = 0;
70 |
71 | /** returns number of data points **/
72 | virtual std::size_t getDatabaseCount( void ) const = 0;
73 |
74 | /** shows logging status **/
75 | virtual bool getLogging( void ) const = 0;
76 |
77 | /** return the quantizationerror **/
78 | virtual std::vector getLoggedQuantizationError( void ) const = 0;
79 |
80 | /** calculate label for unkown datapoints **/
81 | virtual std::vector use( const ublas::matrix& ) const = 0;
82 |
83 | };
84 |
85 | }
86 | }
87 |
88 | #endif
89 |
--------------------------------------------------------------------------------
/errorhandling/exception.implementation.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | #ifndef __MACHINELEARNING_ERRORHANDLING_EXCEPTION_HPP
25 | #error never include this file directly
26 | #elif !defined __MACHINELEARNING_ERRORHANDLING_EXCEPTION_IMPLEMENTATION_HPP
27 | #define __MACHINELEARNING_ERRORHANDLING_EXCEPTION_IMPLEMENTATION_HPP
28 |
29 | #include
30 | #include
31 |
32 | #include "../tools/language/language.h"
33 | #include "../tools/typeinfo.h"
34 | #include "../tools/logger.hpp"
35 |
36 |
37 |
38 | namespace machinelearning { namespace exception {
39 |
40 | /** creates the exception with a message
41 | * @param p_msg error message
42 | **/
43 | inline runtime::runtime( const std::string& p_msg ) :
44 | std::runtime_error( p_msg )
45 | {
46 | #ifdef MACHINELEARNING_LOGGER
47 | if (tools::logger::exists())
48 | tools::logger::getInstance()->write( tools::logger::exception, _("runtime exception is thrown: ") + p_msg);
49 | #endif
50 | }
51 |
52 |
53 | /** creates the exception with a message and a class name
54 | * @param p_msg error message
55 | * @param p_ptr pointer to an class object
56 | **/
57 | template inline runtime::runtime( const std::string& p_msg, const T* p_ptr ) :
58 | std::runtime_error( p_msg + ( !tools::typeinfo::getClassName(p_ptr).empty() ? " ["+tools::typeinfo::getClassName(p_ptr)+"]" : "") )
59 | {
60 | #ifdef MACHINELEARNING_LOGGER
61 | if (tools::logger::exists())
62 | tools::logger::getInstance()->write( tools::logger::exception, _("runtime exception is thrown: ") + p_msg + ( !tools::typeinfo::getClassName(p_ptr).empty() ? " ["+tools::typeinfo::getClassName(p_ptr)+"]" : ""));
63 | #endif
64 | }
65 |
66 |
67 | /** creates the exception with a message and a class name
68 | * @param p_msg error message
69 | * @param p_obj reference to a classobject
70 | **/
71 | template inline runtime::runtime( const std::string& p_msg, const T& p_obj ) :
72 | std::runtime_error( p_msg + ( !tools::typeinfo::getClassName(p_obj).empty() ? " ["+tools::typeinfo::getClassName(p_obj)+"]" : "") )
73 | {
74 | #ifdef MACHINELEARNING_LOGGER
75 | if (tools::logger::exists())
76 | tools::logger::getInstance()->write( tools::logger::exception, _("runtime exception is thrown: ") + p_msg + ( !tools::typeinfo::getClassName(p_obj).empty() ? " ["+tools::typeinfo::getClassName(p_obj)+"]" : ""));
77 | #endif
78 | }
79 |
80 |
81 | }}
82 |
83 | #endif
84 |
--------------------------------------------------------------------------------
/examples/other/matlab/plotnntp.m:
--------------------------------------------------------------------------------
1 | % ############################################################################
2 | % # LGPL License #
3 | % # #
4 | % # This file is part of the Machine Learning Framework. #
5 | % # Copyright (c) 2010-2012, Philipp Kraus, #
6 | % # This program is free software: you can redistribute it and/or modify #
7 | % # it under the terms of the GNU Lesser General Public License as #
8 | % # published by the Free Software Foundation, either version 3 of the #
9 | % # License, or (at your option) any later version. #
10 | % # #
11 | % # This program is distributed in the hope that it will be useful, #
12 | % # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 | % # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 | % # GNU Lesser General Public License for more details. #
15 | % # #
16 | % # You should have received a copy of the GNU Lesser General Public License #
17 | % # along with this program. If not, see . #
18 | % ############################################################################
19 |
20 |
21 | % plots a HDF file that is created by the "mds_nntp" example
22 | % @param pcfile HDF file
23 | function plotnntp( pcfile )
24 | lmarkersize=5;
25 |
26 | % create colors
27 | textlabel = hdf5read( pcfile, '/uniquegroup');
28 | label = cell(size(textlabel,1),1);
29 | labelcolor = cell(size(textlabel,1),1);
30 |
31 | col = jet(size(textlabel,1));
32 | %col = hsv(size(textlabel,1));
33 | for i=1:size(labelcolor,1)
34 | label{i} = char(textlabel(i).data);
35 | labelcolor{i} = col(i, :);
36 | end
37 |
38 | % we create for each label group a data matrix
39 | data = hdf5read( pcfile, '/project');
40 | if (size(data,2) ~= 2) && (size(data,2) ~= 3)
41 | error('plot only with 2D or 3D');
42 | end
43 |
44 | datalabel = hdf5read( pcfile, '/group');
45 |
46 | datacell = cell(size(label,1),1);
47 | maxcount = zeros(size(label,1),1);
48 |
49 | for i=1:size(textlabel,1)
50 | datacell{i} = zeros( size(data,1), size(data,2) );
51 | end
52 |
53 | for i=1:size(data,1)
54 | pos = strmatch(char(datalabel(i).data), label, 'exact');
55 | point = datacell{pos};
56 |
57 | point(maxcount(pos)+1,:) = data(i,:);
58 |
59 | datacell{pos} = point;
60 | maxcount(pos) = maxcount(pos) + 1;
61 | end
62 |
63 | % remove non-existing datasets
64 | emptycell = maxcount == 0;
65 | for i=1:numel(emptycell)
66 | if emptycell(i)
67 | datacell(i) = [];
68 | labelcolor(i) = [];
69 | label(i) = [];
70 | maxcount(i) = [];
71 | end
72 | end
73 |
74 | % create plot
75 | figure;
76 | grid on;
77 | hold on;
78 |
79 | phandle = zeros(numel(datacell),1);
80 | for i=1:numel(datacell)
81 |
82 | point = datacell{i};
83 | point = point(1:maxcount(i), :);
84 |
85 | if size(point,2) == 2
86 | phandle(i) = plot(point(:,1), point(:,2), '.', 'Color', labelcolor{i}, 'DisplayName', label{i}, MarkerSize', lmarkersize);
87 | elseif size(point,2) == 3
88 | phandle(i) = plot3(point(:,1), point(:,2), point(:,3), '.', 'Color', labelcolor{i}, 'DisplayName', label{i}, 'MarkerSize', lmarkersize);
89 | end
90 | end
91 | set(gca,'fontsize',8);
92 | legend(phandle);
93 |
94 | if size(datacell{1},2) == 3
95 | view([-45 45]);
96 | end
--------------------------------------------------------------------------------
/dimensionreduce/supervised/reduce.i:
--------------------------------------------------------------------------------
1 | /**
2 | @cond
3 | ############################################################################
4 | # LGPL License #
5 | # #
6 | # This file is part of the Machine Learning Framework. #
7 | # Copyright (c) 2010-2012, Philipp Kraus, #
8 | # This program is free software: you can redistribute it and/or modify #
9 | # it under the terms of the GNU Lesser General Public License as #
10 | # published by the Free Software Foundation, either version 3 of the #
11 | # License, or (at your option) any later version. #
12 | # #
13 | # This program is distributed in the hope that it will be useful, #
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 | # GNU Lesser General Public License for more details. #
17 | # #
18 | # You should have received a copy of the GNU Lesser General Public License #
19 | # along with this program. If not, see . #
20 | ############################################################################
21 | @endcond
22 | **/
23 |
24 | /** interface file for the supervived reduce class, that should be
25 | * an java interface, because we can use the multiple inheritance and
26 | * disable all body parts
27 | **/
28 |
29 |
30 | #ifdef SWIGJAVA
31 | %module "supervicedreduceemodule"
32 | %include "../../swig/java/java.i"
33 |
34 | %typemap(javaclassmodifiers) machinelearning::dimensionreduce::supervised::reduce "public interface"
35 | %typemap(javabody) machinelearning::dimensionreduce::supervised::reduce ""
36 | %typemap(javafinalize) machinelearning::dimensionreduce::supervised::reduce ""
37 | %typemap(javadestruct) machinelearning::dimensionreduce::supervised::reduce ""
38 |
39 | %typemap(javaout) ublas::matrix machinelearning::dimensionreduce::supervised::reduce::map ";"
40 | %typemap(javaout) std::size_t machinelearning::dimensionreduce::supervised::reduce::getDimension ";"
41 |
42 |
43 | %typemap(javaclassmodifiers) machinelearning::dimensionreduce::supervised::reduce "public interface"
44 | %typemap(javabody) machinelearning::dimensionreduce::supervised::reduce ""
45 | %typemap(javafinalize) machinelearning::dimensionreduce::supervised::reduce ""
46 | %typemap(javadestruct) machinelearning::dimensionreduce::supervised::reduce ""
47 |
48 | %typemap(javaout) ublas::matrix machinelearning::dimensionreduce::supervised::reduce::map ";"
49 | %typemap(javaout) std::size_t machinelearning::dimensionreduce::supervised::reduce::getDimension ";"
50 | #endif
51 |
52 |
53 | %nodefaultctor machinelearning::dimensionreduce::supervised::reduce;
54 | %nodefaultdtor machinelearning::dimensionreduce::supervised::reduce