Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3022-FastFunctionExtraction/FFX/GeneralizedLinearModel.cs @ 18242

Last change on this file since 18242 was 17227, checked in by lleko, 5 years ago

#3022: Add implementation for FFX.

File size: 1022 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Diagnostics;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7
8namespace 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.