alglib 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/Manifest.txt +253 -0
- data/README.txt +33 -0
- data/Rakefile +27 -0
- data/ext/Rakefile +24 -0
- data/ext/alglib.i +24 -0
- data/ext/alglib/Makefile +157 -0
- data/ext/alglib/airyf.cpp +372 -0
- data/ext/alglib/airyf.h +81 -0
- data/ext/alglib/alglib.cpp +8558 -0
- data/ext/alglib/alglib_util.cpp +19 -0
- data/ext/alglib/alglib_util.h +14 -0
- data/ext/alglib/ap.cpp +877 -0
- data/ext/alglib/ap.english.html +364 -0
- data/ext/alglib/ap.h +666 -0
- data/ext/alglib/ap.russian.html +442 -0
- data/ext/alglib/apvt.h +754 -0
- data/ext/alglib/bdss.cpp +1500 -0
- data/ext/alglib/bdss.h +251 -0
- data/ext/alglib/bdsvd.cpp +1339 -0
- data/ext/alglib/bdsvd.h +164 -0
- data/ext/alglib/bessel.cpp +1226 -0
- data/ext/alglib/bessel.h +331 -0
- data/ext/alglib/betaf.cpp +105 -0
- data/ext/alglib/betaf.h +74 -0
- data/ext/alglib/bidiagonal.cpp +1328 -0
- data/ext/alglib/bidiagonal.h +350 -0
- data/ext/alglib/binomialdistr.cpp +247 -0
- data/ext/alglib/binomialdistr.h +153 -0
- data/ext/alglib/blas.cpp +576 -0
- data/ext/alglib/blas.h +132 -0
- data/ext/alglib/cblas.cpp +226 -0
- data/ext/alglib/cblas.h +57 -0
- data/ext/alglib/cdet.cpp +138 -0
- data/ext/alglib/cdet.h +92 -0
- data/ext/alglib/chebyshev.cpp +216 -0
- data/ext/alglib/chebyshev.h +76 -0
- data/ext/alglib/chisquaredistr.cpp +157 -0
- data/ext/alglib/chisquaredistr.h +144 -0
- data/ext/alglib/cholesky.cpp +285 -0
- data/ext/alglib/cholesky.h +86 -0
- data/ext/alglib/cinverse.cpp +298 -0
- data/ext/alglib/cinverse.h +111 -0
- data/ext/alglib/clu.cpp +337 -0
- data/ext/alglib/clu.h +120 -0
- data/ext/alglib/correlation.cpp +280 -0
- data/ext/alglib/correlation.h +77 -0
- data/ext/alglib/correlationtests.cpp +726 -0
- data/ext/alglib/correlationtests.h +134 -0
- data/ext/alglib/crcond.cpp +826 -0
- data/ext/alglib/crcond.h +148 -0
- data/ext/alglib/creflections.cpp +310 -0
- data/ext/alglib/creflections.h +165 -0
- data/ext/alglib/csolve.cpp +312 -0
- data/ext/alglib/csolve.h +99 -0
- data/ext/alglib/ctrinverse.cpp +387 -0
- data/ext/alglib/ctrinverse.h +98 -0
- data/ext/alglib/ctrlinsolve.cpp +297 -0
- data/ext/alglib/ctrlinsolve.h +81 -0
- data/ext/alglib/dawson.cpp +234 -0
- data/ext/alglib/dawson.h +74 -0
- data/ext/alglib/descriptivestatistics.cpp +436 -0
- data/ext/alglib/descriptivestatistics.h +112 -0
- data/ext/alglib/det.cpp +140 -0
- data/ext/alglib/det.h +94 -0
- data/ext/alglib/dforest.cpp +1819 -0
- data/ext/alglib/dforest.h +316 -0
- data/ext/alglib/elliptic.cpp +497 -0
- data/ext/alglib/elliptic.h +217 -0
- data/ext/alglib/estnorm.cpp +429 -0
- data/ext/alglib/estnorm.h +107 -0
- data/ext/alglib/expintegrals.cpp +422 -0
- data/ext/alglib/expintegrals.h +108 -0
- data/ext/alglib/faq.english.html +258 -0
- data/ext/alglib/faq.russian.html +272 -0
- data/ext/alglib/fdistr.cpp +202 -0
- data/ext/alglib/fdistr.h +163 -0
- data/ext/alglib/fresnel.cpp +211 -0
- data/ext/alglib/fresnel.h +91 -0
- data/ext/alglib/gammaf.cpp +338 -0
- data/ext/alglib/gammaf.h +104 -0
- data/ext/alglib/gqgengauss.cpp +235 -0
- data/ext/alglib/gqgengauss.h +92 -0
- data/ext/alglib/gqgenhermite.cpp +268 -0
- data/ext/alglib/gqgenhermite.h +63 -0
- data/ext/alglib/gqgenjacobi.cpp +297 -0
- data/ext/alglib/gqgenjacobi.h +72 -0
- data/ext/alglib/gqgenlaguerre.cpp +265 -0
- data/ext/alglib/gqgenlaguerre.h +69 -0
- data/ext/alglib/gqgenlegendre.cpp +300 -0
- data/ext/alglib/gqgenlegendre.h +62 -0
- data/ext/alglib/gqgenlobatto.cpp +305 -0
- data/ext/alglib/gqgenlobatto.h +97 -0
- data/ext/alglib/gqgenradau.cpp +232 -0
- data/ext/alglib/gqgenradau.h +95 -0
- data/ext/alglib/hbisinv.cpp +480 -0
- data/ext/alglib/hbisinv.h +183 -0
- data/ext/alglib/hblas.cpp +228 -0
- data/ext/alglib/hblas.h +64 -0
- data/ext/alglib/hcholesky.cpp +339 -0
- data/ext/alglib/hcholesky.h +91 -0
- data/ext/alglib/hermite.cpp +114 -0
- data/ext/alglib/hermite.h +49 -0
- data/ext/alglib/hessenberg.cpp +370 -0
- data/ext/alglib/hessenberg.h +152 -0
- data/ext/alglib/hevd.cpp +247 -0
- data/ext/alglib/hevd.h +107 -0
- data/ext/alglib/hsschur.cpp +1316 -0
- data/ext/alglib/hsschur.h +108 -0
- data/ext/alglib/htridiagonal.cpp +734 -0
- data/ext/alglib/htridiagonal.h +180 -0
- data/ext/alglib/ialglib.cpp +6 -0
- data/ext/alglib/ialglib.h +9 -0
- data/ext/alglib/ibetaf.cpp +960 -0
- data/ext/alglib/ibetaf.h +125 -0
- data/ext/alglib/igammaf.cpp +430 -0
- data/ext/alglib/igammaf.h +157 -0
- data/ext/alglib/inv.cpp +274 -0
- data/ext/alglib/inv.h +115 -0
- data/ext/alglib/inverseupdate.cpp +480 -0
- data/ext/alglib/inverseupdate.h +185 -0
- data/ext/alglib/jacobianelliptic.cpp +164 -0
- data/ext/alglib/jacobianelliptic.h +94 -0
- data/ext/alglib/jarquebera.cpp +2271 -0
- data/ext/alglib/jarquebera.h +80 -0
- data/ext/alglib/kmeans.cpp +356 -0
- data/ext/alglib/kmeans.h +76 -0
- data/ext/alglib/laguerre.cpp +94 -0
- data/ext/alglib/laguerre.h +48 -0
- data/ext/alglib/lbfgs.cpp +1167 -0
- data/ext/alglib/lbfgs.h +218 -0
- data/ext/alglib/lda.cpp +434 -0
- data/ext/alglib/lda.h +133 -0
- data/ext/alglib/ldlt.cpp +1130 -0
- data/ext/alglib/ldlt.h +124 -0
- data/ext/alglib/leastsquares.cpp +1252 -0
- data/ext/alglib/leastsquares.h +290 -0
- data/ext/alglib/legendre.cpp +107 -0
- data/ext/alglib/legendre.h +49 -0
- data/ext/alglib/linreg.cpp +1185 -0
- data/ext/alglib/linreg.h +380 -0
- data/ext/alglib/logit.cpp +1523 -0
- data/ext/alglib/logit.h +333 -0
- data/ext/alglib/lq.cpp +399 -0
- data/ext/alglib/lq.h +160 -0
- data/ext/alglib/lu.cpp +462 -0
- data/ext/alglib/lu.h +119 -0
- data/ext/alglib/mannwhitneyu.cpp +4490 -0
- data/ext/alglib/mannwhitneyu.h +115 -0
- data/ext/alglib/minlm.cpp +918 -0
- data/ext/alglib/minlm.h +312 -0
- data/ext/alglib/mlpbase.cpp +3375 -0
- data/ext/alglib/mlpbase.h +589 -0
- data/ext/alglib/mlpe.cpp +1369 -0
- data/ext/alglib/mlpe.h +552 -0
- data/ext/alglib/mlptrain.cpp +1056 -0
- data/ext/alglib/mlptrain.h +283 -0
- data/ext/alglib/nearunityunit.cpp +91 -0
- data/ext/alglib/nearunityunit.h +17 -0
- data/ext/alglib/normaldistr.cpp +377 -0
- data/ext/alglib/normaldistr.h +175 -0
- data/ext/alglib/nsevd.cpp +1869 -0
- data/ext/alglib/nsevd.h +140 -0
- data/ext/alglib/pca.cpp +168 -0
- data/ext/alglib/pca.h +87 -0
- data/ext/alglib/poissondistr.cpp +143 -0
- data/ext/alglib/poissondistr.h +130 -0
- data/ext/alglib/polinterpolation.cpp +685 -0
- data/ext/alglib/polinterpolation.h +206 -0
- data/ext/alglib/psif.cpp +173 -0
- data/ext/alglib/psif.h +88 -0
- data/ext/alglib/qr.cpp +414 -0
- data/ext/alglib/qr.h +168 -0
- data/ext/alglib/ratinterpolation.cpp +134 -0
- data/ext/alglib/ratinterpolation.h +72 -0
- data/ext/alglib/rcond.cpp +705 -0
- data/ext/alglib/rcond.h +140 -0
- data/ext/alglib/reflections.cpp +504 -0
- data/ext/alglib/reflections.h +165 -0
- data/ext/alglib/rotations.cpp +473 -0
- data/ext/alglib/rotations.h +128 -0
- data/ext/alglib/rsolve.cpp +221 -0
- data/ext/alglib/rsolve.h +99 -0
- data/ext/alglib/sbisinv.cpp +217 -0
- data/ext/alglib/sbisinv.h +171 -0
- data/ext/alglib/sblas.cpp +185 -0
- data/ext/alglib/sblas.h +64 -0
- data/ext/alglib/schur.cpp +156 -0
- data/ext/alglib/schur.h +102 -0
- data/ext/alglib/sdet.cpp +193 -0
- data/ext/alglib/sdet.h +101 -0
- data/ext/alglib/sevd.cpp +116 -0
- data/ext/alglib/sevd.h +99 -0
- data/ext/alglib/sinverse.cpp +672 -0
- data/ext/alglib/sinverse.h +138 -0
- data/ext/alglib/spddet.cpp +138 -0
- data/ext/alglib/spddet.h +96 -0
- data/ext/alglib/spdgevd.cpp +842 -0
- data/ext/alglib/spdgevd.h +200 -0
- data/ext/alglib/spdinverse.cpp +509 -0
- data/ext/alglib/spdinverse.h +122 -0
- data/ext/alglib/spdrcond.cpp +421 -0
- data/ext/alglib/spdrcond.h +118 -0
- data/ext/alglib/spdsolve.cpp +275 -0
- data/ext/alglib/spdsolve.h +105 -0
- data/ext/alglib/spline2d.cpp +1192 -0
- data/ext/alglib/spline2d.h +301 -0
- data/ext/alglib/spline3.cpp +1264 -0
- data/ext/alglib/spline3.h +290 -0
- data/ext/alglib/srcond.cpp +595 -0
- data/ext/alglib/srcond.h +127 -0
- data/ext/alglib/ssolve.cpp +895 -0
- data/ext/alglib/ssolve.h +139 -0
- data/ext/alglib/stdafx.h +0 -0
- data/ext/alglib/stest.cpp +131 -0
- data/ext/alglib/stest.h +94 -0
- data/ext/alglib/studenttdistr.cpp +222 -0
- data/ext/alglib/studenttdistr.h +115 -0
- data/ext/alglib/studentttests.cpp +377 -0
- data/ext/alglib/studentttests.h +178 -0
- data/ext/alglib/svd.cpp +620 -0
- data/ext/alglib/svd.h +126 -0
- data/ext/alglib/tdbisinv.cpp +2608 -0
- data/ext/alglib/tdbisinv.h +228 -0
- data/ext/alglib/tdevd.cpp +1229 -0
- data/ext/alglib/tdevd.h +115 -0
- data/ext/alglib/tridiagonal.cpp +594 -0
- data/ext/alglib/tridiagonal.h +171 -0
- data/ext/alglib/trigintegrals.cpp +490 -0
- data/ext/alglib/trigintegrals.h +131 -0
- data/ext/alglib/trinverse.cpp +345 -0
- data/ext/alglib/trinverse.h +98 -0
- data/ext/alglib/trlinsolve.cpp +926 -0
- data/ext/alglib/trlinsolve.h +73 -0
- data/ext/alglib/tsort.cpp +405 -0
- data/ext/alglib/tsort.h +54 -0
- data/ext/alglib/variancetests.cpp +245 -0
- data/ext/alglib/variancetests.h +134 -0
- data/ext/alglib/wsr.cpp +6285 -0
- data/ext/alglib/wsr.h +96 -0
- data/ext/ap.i +97 -0
- data/ext/correlation.i +24 -0
- data/ext/extconf.rb +6 -0
- data/ext/logit.i +89 -0
- data/lib/alglib.rb +71 -0
- data/lib/alglib/correlation.rb +26 -0
- data/lib/alglib/linearregression.rb +63 -0
- data/lib/alglib/logit.rb +42 -0
- data/test/test_alglib.rb +52 -0
- data/test/test_correlation.rb +44 -0
- data/test/test_correlationtest.rb +45 -0
- data/test/test_linreg.rb +35 -0
- data/test/test_logit.rb +43 -0
- data/test/test_pca.rb +27 -0
- metadata +326 -0
data/ext/alglib/mlpe.h
ADDED
@@ -0,0 +1,552 @@
|
|
1
|
+
/*************************************************************************
|
2
|
+
Copyright (c) 2007-2008, Sergey Bochkanov (ALGLIB project).
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are
|
6
|
+
met:
|
7
|
+
|
8
|
+
- Redistributions of source code must retain the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
10
|
+
|
11
|
+
- Redistributions in binary form must reproduce the above copyright
|
12
|
+
notice, this list of conditions and the following disclaimer listed
|
13
|
+
in this license in the documentation and/or other materials
|
14
|
+
provided with the distribution.
|
15
|
+
|
16
|
+
- Neither the name of the copyright holders nor the names of its
|
17
|
+
contributors may be used to endorse or promote products derived from
|
18
|
+
this software without specific prior written permission.
|
19
|
+
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
23
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
24
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
25
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
26
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
27
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
28
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
29
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
+
*************************************************************************/
|
32
|
+
|
33
|
+
#ifndef _mlpe_h
|
34
|
+
#define _mlpe_h
|
35
|
+
|
36
|
+
#include "ap.h"
|
37
|
+
#include "ialglib.h"
|
38
|
+
|
39
|
+
#include "mlpbase.h"
|
40
|
+
#include "trinverse.h"
|
41
|
+
#include "lbfgs.h"
|
42
|
+
#include "cholesky.h"
|
43
|
+
#include "spdsolve.h"
|
44
|
+
#include "mlptrain.h"
|
45
|
+
#include "tsort.h"
|
46
|
+
#include "descriptivestatistics.h"
|
47
|
+
#include "bdss.h"
|
48
|
+
|
49
|
+
|
50
|
+
struct mlpensemble
|
51
|
+
{
|
52
|
+
ap::integer_1d_array structinfo;
|
53
|
+
int ensemblesize;
|
54
|
+
int nin;
|
55
|
+
int nout;
|
56
|
+
int wcount;
|
57
|
+
bool issoftmax;
|
58
|
+
bool postprocessing;
|
59
|
+
ap::real_1d_array weights;
|
60
|
+
ap::real_1d_array columnmeans;
|
61
|
+
ap::real_1d_array columnsigmas;
|
62
|
+
int serializedlen;
|
63
|
+
ap::real_1d_array serializedmlp;
|
64
|
+
ap::real_1d_array tmpweights;
|
65
|
+
ap::real_1d_array tmpmeans;
|
66
|
+
ap::real_1d_array tmpsigmas;
|
67
|
+
ap::real_1d_array neurons;
|
68
|
+
ap::real_1d_array dfdnet;
|
69
|
+
ap::real_1d_array y;
|
70
|
+
};
|
71
|
+
|
72
|
+
|
73
|
+
/*************************************************************************
|
74
|
+
Like MLPCreate0, but for ensembles.
|
75
|
+
|
76
|
+
-- ALGLIB --
|
77
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
78
|
+
*************************************************************************/
|
79
|
+
void mlpecreate0(int nin, int nout, int ensemblesize, mlpensemble& ensemble);
|
80
|
+
|
81
|
+
|
82
|
+
/*************************************************************************
|
83
|
+
Like MLPCreate1, but for ensembles.
|
84
|
+
|
85
|
+
-- ALGLIB --
|
86
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
87
|
+
*************************************************************************/
|
88
|
+
void mlpecreate1(int nin,
|
89
|
+
int nhid,
|
90
|
+
int nout,
|
91
|
+
int ensemblesize,
|
92
|
+
mlpensemble& ensemble);
|
93
|
+
|
94
|
+
|
95
|
+
/*************************************************************************
|
96
|
+
Like MLPCreate2, but for ensembles.
|
97
|
+
|
98
|
+
-- ALGLIB --
|
99
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
100
|
+
*************************************************************************/
|
101
|
+
void mlpecreate2(int nin,
|
102
|
+
int nhid1,
|
103
|
+
int nhid2,
|
104
|
+
int nout,
|
105
|
+
int ensemblesize,
|
106
|
+
mlpensemble& ensemble);
|
107
|
+
|
108
|
+
|
109
|
+
/*************************************************************************
|
110
|
+
Like MLPCreateB0, but for ensembles.
|
111
|
+
|
112
|
+
-- ALGLIB --
|
113
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
114
|
+
*************************************************************************/
|
115
|
+
void mlpecreateb0(int nin,
|
116
|
+
int nout,
|
117
|
+
double b,
|
118
|
+
double d,
|
119
|
+
int ensemblesize,
|
120
|
+
mlpensemble& ensemble);
|
121
|
+
|
122
|
+
|
123
|
+
/*************************************************************************
|
124
|
+
Like MLPCreateB1, but for ensembles.
|
125
|
+
|
126
|
+
-- ALGLIB --
|
127
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
128
|
+
*************************************************************************/
|
129
|
+
void mlpecreateb1(int nin,
|
130
|
+
int nhid,
|
131
|
+
int nout,
|
132
|
+
double b,
|
133
|
+
double d,
|
134
|
+
int ensemblesize,
|
135
|
+
mlpensemble& ensemble);
|
136
|
+
|
137
|
+
|
138
|
+
/*************************************************************************
|
139
|
+
Like MLPCreateB2, but for ensembles.
|
140
|
+
|
141
|
+
-- ALGLIB --
|
142
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
143
|
+
*************************************************************************/
|
144
|
+
void mlpecreateb2(int nin,
|
145
|
+
int nhid1,
|
146
|
+
int nhid2,
|
147
|
+
int nout,
|
148
|
+
double b,
|
149
|
+
double d,
|
150
|
+
int ensemblesize,
|
151
|
+
mlpensemble& ensemble);
|
152
|
+
|
153
|
+
|
154
|
+
/*************************************************************************
|
155
|
+
Like MLPCreateR0, but for ensembles.
|
156
|
+
|
157
|
+
-- ALGLIB --
|
158
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
159
|
+
*************************************************************************/
|
160
|
+
void mlpecreater0(int nin,
|
161
|
+
int nout,
|
162
|
+
double a,
|
163
|
+
double b,
|
164
|
+
int ensemblesize,
|
165
|
+
mlpensemble& ensemble);
|
166
|
+
|
167
|
+
|
168
|
+
/*************************************************************************
|
169
|
+
Like MLPCreateR1, but for ensembles.
|
170
|
+
|
171
|
+
-- ALGLIB --
|
172
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
173
|
+
*************************************************************************/
|
174
|
+
void mlpecreater1(int nin,
|
175
|
+
int nhid,
|
176
|
+
int nout,
|
177
|
+
double a,
|
178
|
+
double b,
|
179
|
+
int ensemblesize,
|
180
|
+
mlpensemble& ensemble);
|
181
|
+
|
182
|
+
|
183
|
+
/*************************************************************************
|
184
|
+
Like MLPCreateR2, but for ensembles.
|
185
|
+
|
186
|
+
-- ALGLIB --
|
187
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
188
|
+
*************************************************************************/
|
189
|
+
void mlpecreater2(int nin,
|
190
|
+
int nhid1,
|
191
|
+
int nhid2,
|
192
|
+
int nout,
|
193
|
+
double a,
|
194
|
+
double b,
|
195
|
+
int ensemblesize,
|
196
|
+
mlpensemble& ensemble);
|
197
|
+
|
198
|
+
|
199
|
+
/*************************************************************************
|
200
|
+
Like MLPCreateC0, but for ensembles.
|
201
|
+
|
202
|
+
-- ALGLIB --
|
203
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
204
|
+
*************************************************************************/
|
205
|
+
void mlpecreatec0(int nin, int nout, int ensemblesize, mlpensemble& ensemble);
|
206
|
+
|
207
|
+
|
208
|
+
/*************************************************************************
|
209
|
+
Like MLPCreateC1, but for ensembles.
|
210
|
+
|
211
|
+
-- ALGLIB --
|
212
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
213
|
+
*************************************************************************/
|
214
|
+
void mlpecreatec1(int nin,
|
215
|
+
int nhid,
|
216
|
+
int nout,
|
217
|
+
int ensemblesize,
|
218
|
+
mlpensemble& ensemble);
|
219
|
+
|
220
|
+
|
221
|
+
/*************************************************************************
|
222
|
+
Like MLPCreateC2, but for ensembles.
|
223
|
+
|
224
|
+
-- ALGLIB --
|
225
|
+
Copyright 18.02.2009 by Bochkanov Sergey
|
226
|
+
*************************************************************************/
|
227
|
+
void mlpecreatec2(int nin,
|
228
|
+
int nhid1,
|
229
|
+
int nhid2,
|
230
|
+
int nout,
|
231
|
+
int ensemblesize,
|
232
|
+
mlpensemble& ensemble);
|
233
|
+
|
234
|
+
|
235
|
+
/*************************************************************************
|
236
|
+
Creates ensemble from network. Only network geometry is copied.
|
237
|
+
|
238
|
+
-- ALGLIB --
|
239
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
240
|
+
*************************************************************************/
|
241
|
+
void mlpecreatefromnetwork(const multilayerperceptron& network,
|
242
|
+
int ensemblesize,
|
243
|
+
mlpensemble& ensemble);
|
244
|
+
|
245
|
+
|
246
|
+
/*************************************************************************
|
247
|
+
Copying of MLPEnsemble strucure
|
248
|
+
|
249
|
+
INPUT PARAMETERS:
|
250
|
+
Ensemble1 - original
|
251
|
+
|
252
|
+
OUTPUT PARAMETERS:
|
253
|
+
Ensemble2 - copy
|
254
|
+
|
255
|
+
-- ALGLIB --
|
256
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
257
|
+
*************************************************************************/
|
258
|
+
void mlpecopy(const mlpensemble& ensemble1, mlpensemble& ensemble2);
|
259
|
+
|
260
|
+
|
261
|
+
/*************************************************************************
|
262
|
+
Serialization of MLPEnsemble strucure
|
263
|
+
|
264
|
+
INPUT PARAMETERS:
|
265
|
+
Ensemble- original
|
266
|
+
|
267
|
+
OUTPUT PARAMETERS:
|
268
|
+
RA - array of real numbers which stores ensemble,
|
269
|
+
array[0..RLen-1]
|
270
|
+
RLen - RA lenght
|
271
|
+
|
272
|
+
-- ALGLIB --
|
273
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
274
|
+
*************************************************************************/
|
275
|
+
void mlpeserialize(mlpensemble& ensemble, ap::real_1d_array& ra, int& rlen);
|
276
|
+
|
277
|
+
|
278
|
+
/*************************************************************************
|
279
|
+
Unserialization of MLPEnsemble strucure
|
280
|
+
|
281
|
+
INPUT PARAMETERS:
|
282
|
+
RA - real array which stores ensemble
|
283
|
+
|
284
|
+
OUTPUT PARAMETERS:
|
285
|
+
Ensemble- restored structure
|
286
|
+
|
287
|
+
-- ALGLIB --
|
288
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
289
|
+
*************************************************************************/
|
290
|
+
void mlpeunserialize(const ap::real_1d_array& ra, mlpensemble& ensemble);
|
291
|
+
|
292
|
+
|
293
|
+
/*************************************************************************
|
294
|
+
Randomization of MLP ensemble
|
295
|
+
|
296
|
+
-- ALGLIB --
|
297
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
298
|
+
*************************************************************************/
|
299
|
+
void mlperandomize(mlpensemble& ensemble);
|
300
|
+
|
301
|
+
|
302
|
+
/*************************************************************************
|
303
|
+
Return ensemble properties (number of inputs and outputs).
|
304
|
+
|
305
|
+
-- ALGLIB --
|
306
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
307
|
+
*************************************************************************/
|
308
|
+
void mlpeproperties(const mlpensemble& ensemble, int& nin, int& nout);
|
309
|
+
|
310
|
+
|
311
|
+
/*************************************************************************
|
312
|
+
Return normalization type (whether ensemble is SOFTMAX-normalized or not).
|
313
|
+
|
314
|
+
-- ALGLIB --
|
315
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
316
|
+
*************************************************************************/
|
317
|
+
bool mlpeissoftmax(const mlpensemble& ensemble);
|
318
|
+
|
319
|
+
|
320
|
+
/*************************************************************************
|
321
|
+
Procesing
|
322
|
+
|
323
|
+
INPUT PARAMETERS:
|
324
|
+
Ensemble- neural networks ensemble
|
325
|
+
X - input vector, array[0..NIn-1].
|
326
|
+
|
327
|
+
OUTPUT PARAMETERS:
|
328
|
+
Y - result. Regression estimate when solving regression task,
|
329
|
+
vector of posterior probabilities for classification task.
|
330
|
+
Subroutine does not allocate memory for this vector, it is
|
331
|
+
responsibility of a caller to allocate it. Array must be
|
332
|
+
at least [0..NOut-1].
|
333
|
+
|
334
|
+
-- ALGLIB --
|
335
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
336
|
+
*************************************************************************/
|
337
|
+
void mlpeprocess(mlpensemble& ensemble,
|
338
|
+
const ap::real_1d_array& x,
|
339
|
+
ap::real_1d_array& y);
|
340
|
+
|
341
|
+
|
342
|
+
/*************************************************************************
|
343
|
+
Relative classification error on the test set
|
344
|
+
|
345
|
+
INPUT PARAMETERS:
|
346
|
+
Ensemble- ensemble
|
347
|
+
XY - test set
|
348
|
+
NPoints - test set size
|
349
|
+
|
350
|
+
RESULT:
|
351
|
+
percent of incorrectly classified cases.
|
352
|
+
Works both for classifier betwork and for regression networks which
|
353
|
+
are used as classifiers.
|
354
|
+
|
355
|
+
-- ALGLIB --
|
356
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
357
|
+
*************************************************************************/
|
358
|
+
double mlperelclserror(mlpensemble& ensemble,
|
359
|
+
const ap::real_2d_array& xy,
|
360
|
+
int npoints);
|
361
|
+
|
362
|
+
|
363
|
+
/*************************************************************************
|
364
|
+
Average cross-entropy (in bits per element) on the test set
|
365
|
+
|
366
|
+
INPUT PARAMETERS:
|
367
|
+
Ensemble- ensemble
|
368
|
+
XY - test set
|
369
|
+
NPoints - test set size
|
370
|
+
|
371
|
+
RESULT:
|
372
|
+
CrossEntropy/(NPoints*LN(2)).
|
373
|
+
Zero if ensemble solves regression task.
|
374
|
+
|
375
|
+
-- ALGLIB --
|
376
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
377
|
+
*************************************************************************/
|
378
|
+
double mlpeavgce(mlpensemble& ensemble,
|
379
|
+
const ap::real_2d_array& xy,
|
380
|
+
int npoints);
|
381
|
+
|
382
|
+
|
383
|
+
/*************************************************************************
|
384
|
+
RMS error on the test set
|
385
|
+
|
386
|
+
INPUT PARAMETERS:
|
387
|
+
Ensemble- ensemble
|
388
|
+
XY - test set
|
389
|
+
NPoints - test set size
|
390
|
+
|
391
|
+
RESULT:
|
392
|
+
root mean square error.
|
393
|
+
Its meaning for regression task is obvious. As for classification task
|
394
|
+
RMS error means error when estimating posterior probabilities.
|
395
|
+
|
396
|
+
-- ALGLIB --
|
397
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
398
|
+
*************************************************************************/
|
399
|
+
double mlpermserror(mlpensemble& ensemble,
|
400
|
+
const ap::real_2d_array& xy,
|
401
|
+
int npoints);
|
402
|
+
|
403
|
+
|
404
|
+
/*************************************************************************
|
405
|
+
Average error on the test set
|
406
|
+
|
407
|
+
INPUT PARAMETERS:
|
408
|
+
Ensemble- ensemble
|
409
|
+
XY - test set
|
410
|
+
NPoints - test set size
|
411
|
+
|
412
|
+
RESULT:
|
413
|
+
Its meaning for regression task is obvious. As for classification task
|
414
|
+
it means average error when estimating posterior probabilities.
|
415
|
+
|
416
|
+
-- ALGLIB --
|
417
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
418
|
+
*************************************************************************/
|
419
|
+
double mlpeavgerror(mlpensemble& ensemble,
|
420
|
+
const ap::real_2d_array& xy,
|
421
|
+
int npoints);
|
422
|
+
|
423
|
+
|
424
|
+
/*************************************************************************
|
425
|
+
Average relative error on the test set
|
426
|
+
|
427
|
+
INPUT PARAMETERS:
|
428
|
+
Ensemble- ensemble
|
429
|
+
XY - test set
|
430
|
+
NPoints - test set size
|
431
|
+
|
432
|
+
RESULT:
|
433
|
+
Its meaning for regression task is obvious. As for classification task
|
434
|
+
it means average relative error when estimating posterior probabilities.
|
435
|
+
|
436
|
+
-- ALGLIB --
|
437
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
438
|
+
*************************************************************************/
|
439
|
+
double mlpeavgrelerror(mlpensemble& ensemble,
|
440
|
+
const ap::real_2d_array& xy,
|
441
|
+
int npoints);
|
442
|
+
|
443
|
+
|
444
|
+
/*************************************************************************
|
445
|
+
Training neural networks ensemble using bootstrap aggregating (bagging).
|
446
|
+
Modified Levenberg-Marquardt algorithm is used as base training method.
|
447
|
+
|
448
|
+
INPUT PARAMETERS:
|
449
|
+
Ensemble - model with initialized geometry
|
450
|
+
XY - training set
|
451
|
+
NPoints - training set size
|
452
|
+
Decay - weight decay coefficient, >=0.001
|
453
|
+
Restarts - restarts, >0.
|
454
|
+
|
455
|
+
OUTPUT PARAMETERS:
|
456
|
+
Ensemble - trained model
|
457
|
+
Info - return code:
|
458
|
+
* -2, if there is a point with class number
|
459
|
+
outside of [0..NClasses-1].
|
460
|
+
* -1, if incorrect parameters was passed
|
461
|
+
(NPoints<0, Restarts<1).
|
462
|
+
* 2, if task has been solved.
|
463
|
+
Rep - training report.
|
464
|
+
OOBErrors - out-of-bag generalization error estimate
|
465
|
+
|
466
|
+
-- ALGLIB --
|
467
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
468
|
+
*************************************************************************/
|
469
|
+
void mlpebagginglm(mlpensemble& ensemble,
|
470
|
+
const ap::real_2d_array& xy,
|
471
|
+
int npoints,
|
472
|
+
double decay,
|
473
|
+
int restarts,
|
474
|
+
int& info,
|
475
|
+
mlpreport& rep,
|
476
|
+
mlpcvreport& ooberrors);
|
477
|
+
|
478
|
+
|
479
|
+
/*************************************************************************
|
480
|
+
Training neural networks ensemble using bootstrap aggregating (bagging).
|
481
|
+
L-BFGS algorithm is used as base training method.
|
482
|
+
|
483
|
+
INPUT PARAMETERS:
|
484
|
+
Ensemble - model with initialized geometry
|
485
|
+
XY - training set
|
486
|
+
NPoints - training set size
|
487
|
+
Decay - weight decay coefficient, >=0.001
|
488
|
+
Restarts - restarts, >0.
|
489
|
+
WStep - stopping criterion, same as in MLPTrainLBFGS
|
490
|
+
MaxIts - stopping criterion, same as in MLPTrainLBFGS
|
491
|
+
|
492
|
+
OUTPUT PARAMETERS:
|
493
|
+
Ensemble - trained model
|
494
|
+
Info - return code:
|
495
|
+
* -8, if both WStep=0 and MaxIts=0
|
496
|
+
* -2, if there is a point with class number
|
497
|
+
outside of [0..NClasses-1].
|
498
|
+
* -1, if incorrect parameters was passed
|
499
|
+
(NPoints<0, Restarts<1).
|
500
|
+
* 2, if task has been solved.
|
501
|
+
Rep - training report.
|
502
|
+
OOBErrors - out-of-bag generalization error estimate
|
503
|
+
|
504
|
+
-- ALGLIB --
|
505
|
+
Copyright 17.02.2009 by Bochkanov Sergey
|
506
|
+
*************************************************************************/
|
507
|
+
void mlpebagginglbfgs(mlpensemble& ensemble,
|
508
|
+
const ap::real_2d_array& xy,
|
509
|
+
int npoints,
|
510
|
+
double decay,
|
511
|
+
int restarts,
|
512
|
+
double wstep,
|
513
|
+
int maxits,
|
514
|
+
int& info,
|
515
|
+
mlpreport& rep,
|
516
|
+
mlpcvreport& ooberrors);
|
517
|
+
|
518
|
+
|
519
|
+
/*************************************************************************
|
520
|
+
Training neural networks ensemble using early stopping.
|
521
|
+
|
522
|
+
INPUT PARAMETERS:
|
523
|
+
Ensemble - model with initialized geometry
|
524
|
+
XY - training set
|
525
|
+
NPoints - training set size
|
526
|
+
Decay - weight decay coefficient, >=0.001
|
527
|
+
Restarts - restarts, >0.
|
528
|
+
|
529
|
+
OUTPUT PARAMETERS:
|
530
|
+
Ensemble - trained model
|
531
|
+
Info - return code:
|
532
|
+
* -2, if there is a point with class number
|
533
|
+
outside of [0..NClasses-1].
|
534
|
+
* -1, if incorrect parameters was passed
|
535
|
+
(NPoints<0, Restarts<1).
|
536
|
+
* 2, if task has been solved.
|
537
|
+
Rep - training report.
|
538
|
+
OOBErrors - out-of-bag generalization error estimate
|
539
|
+
|
540
|
+
-- ALGLIB --
|
541
|
+
Copyright 10.03.2009 by Bochkanov Sergey
|
542
|
+
*************************************************************************/
|
543
|
+
void mlpetraines(mlpensemble& ensemble,
|
544
|
+
const ap::real_2d_array& xy,
|
545
|
+
int npoints,
|
546
|
+
double decay,
|
547
|
+
int restarts,
|
548
|
+
int& info,
|
549
|
+
mlpreport& rep);
|
550
|
+
|
551
|
+
|
552
|
+
#endif
|