You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the SampleVB project there is this code for using clsOptDE, with two Console write-line statements I added:
'LeastSquaresMethod 最小二乗法
With Nothing
Console.WriteLine("------------------------------ BEGIN: DATA.CSV --------------------")
'評価関数
Dim objectiveFunction = New clsLeastSquaresMethod()
If objectiveFunction.Init("..\..\..\_sampledata\data.csv") = False Then
Return
End If
'最小化
Dim opt As New LibOptimization.Optimization.clsOptDE(objectiveFunction)
opt.Init()
LibOptimization.Util.clsUtil.DebugValue(opt)
While (opt.DoIteration(50) = False)
LibOptimization.Util.clsUtil.DebugValue(opt, ai_isOutValue:=False)
End While
LibOptimization.Util.clsUtil.DebugValue(opt)
Console.WriteLine("------------------------------ END: DATA.CSV --------------------")
End With
I'm trying to figure out how to use clsOptDE with my app, where I need to call a particular function (the "fitness" function in GA terms) that analyzes a particular test vector against my fitness function. My fitness function uses the field values in the test vector to run a test against a data set.
The text was updated successfully, but these errors were encountered:
A purpose of this class is to find a multinomial expression function coefficient.
At first This class read "data.csv" in Init() function. "data.csv" is a point of the following multinomial expression function.
f(x) = a1 x^4 + a2 x^3 - a3 x^2 - a4 x + a5
By the way, the answer is;
a1 = 0.05
a2 = 1
a3 = -10
a4 = -100
a5 = 100
Objective function implements it in F(). This F() calculates a point value and the residual sum of squares of the Objective function.
temp(0) is value of x. temp(1) is value of y.
In the SampleVB project there is this code for using clsOptDE, with two Console write-line statements I added:
When I run the program I get:
------------------------------ BEGIN: DATA.CSV --------------------
TargetFunction:clsLeastSquaresMethod Dimension:5
OptimizeMethod:clsOptDE
Eval :59438373.1751817
IterationCount:0
Result :
-0.0158704898822757
-0.381333913044383
4.93756533831767
-4.28593948466842
3.24185321532233
Eval :1429.78513592157
Eval :0.956465983765879
Eval :0.000497619640101209
Eval :3.08647227393116E-07
Eval :1.38365563205351E-10
Eval :1.84394063162285E-13
Eval :1.06744757544432E-16
Eval :4.16369815393116E-20
Eval :2.33202429712711E-23
TargetFunction:clsLeastSquaresMethod Dimension:5
OptimizeMethod:clsOptDE
Eval :3.04300885378471E-24
IterationCount:460
Result :
0.0499999999999999
0.999999999999999
-9.99999999999997
-99.9999999999999
99.9999999999983
------------------------------ END: DATA.CSV --------------------
Can someone tell me how this relates to the data found in data.csv, the data file used with the object function?:
x,y
-20,-1900
-19.8,-1918.02392
-18.8,-1953.08032
-7.2,62.72128
3.8,-359.10232
7.2,-630.78272
I'm trying to figure out how to use clsOptDE with my app, where I need to call a particular function (the "fitness" function in GA terms) that analyzes a particular test vector against my fitness function. My fitness function uses the field values in the test vector to run a test against a data set.
The text was updated successfully, but these errors were encountered: