Rev | Line | |
---|
[17227] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Diagnostics;
|
---|
| 4 | using System.Linq;
|
---|
| 5 | using System.Text;
|
---|
| 6 | using System.Threading.Tasks;
|
---|
| 7 |
|
---|
| 8 | namespace HeuristicLab.Algorithms.DataAnalysis.FastFunctionExtraction
|
---|
| 9 | {
|
---|
| 10 | // A GLM is a function in the form of a linear combination of basis functions (plus an offset)
|
---|
| 11 | class GeneralizedLinearModel
|
---|
| 12 | {
|
---|
| 13 | public double Offset { get; }
|
---|
| 14 | public double[] Coefficients { get; }
|
---|
| 15 | public BasisFunction[] BasisFunctions { get; }
|
---|
| 16 | public int Complexity() => BasisFunctions.Length + BasisFunctions.Sum(x => x.Complexity());
|
---|
| 17 |
|
---|
| 18 | public GeneralizedLinearModel(double offset, double[] coefficients, BasisFunction[] basisFunctions)
|
---|
| 19 | {
|
---|
| 20 | Offset = offset;
|
---|
| 21 | Coefficients = coefficients;
|
---|
| 22 | BasisFunctions = basisFunctions;
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | public double eval()
|
---|
| 26 | {
|
---|
| 27 | Debug.Assert(Coefficients.Length == BasisFunctions.Length);
|
---|
| 28 | return 0;
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.