1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 |
|
---|
4 | namespace HeuristicLab.Algorithms.DataAnalysis.FastFunctionExtraction {
|
---|
5 | internal struct Approach {
|
---|
6 | public bool AllowInteractions { get; set; }
|
---|
7 | public bool AllowDenominators { get; set; }
|
---|
8 | public bool AllowExp { get; set; }
|
---|
9 | public bool AllowNonLinearFunctions { get; set; }
|
---|
10 | public bool AllowHinge { get; set; }
|
---|
11 | public HashSet<double> Exponents { get; set; }
|
---|
12 | public HashSet<NonlinearOperator> NonLinearFunctions { get; set; }
|
---|
13 | public double MinHingeThreshold { get; set; }
|
---|
14 | public double MaxHingeThreshold { get; set; }
|
---|
15 | public int NumHingeThresholds { get; set; }
|
---|
16 | public double ElasticNetPenalty { get; set; }
|
---|
17 | public int MaxNumBases { get; set; }
|
---|
18 |
|
---|
19 | public override string ToString() {
|
---|
20 | return $"Interactions{AllowInteractions} Denominator{AllowDenominators} Exponential{AllowExp} NonLinearFunctions{AllowNonLinearFunctions} HingeFunctions{AllowHinge}";
|
---|
21 | }
|
---|
22 |
|
---|
23 | public Approach(bool allowInteractions, bool allowDenominators, bool allowExp, bool allowNonLinearFunctions, bool allowHingeFunctions, HashSet<double> exponents, HashSet<NonlinearOperator> nonLinearFunctions, int maxNumBases, double elasticNetPenality, double minHingeThreshold, double maxHingeThreshold, int numHingeThresholds) {
|
---|
24 | this.AllowInteractions = allowInteractions;
|
---|
25 | this.AllowDenominators = allowDenominators;
|
---|
26 | this.AllowExp = allowExp;
|
---|
27 | this.AllowNonLinearFunctions = allowNonLinearFunctions;
|
---|
28 | this.AllowHinge = allowHingeFunctions;
|
---|
29 | if (AllowExp && exponents == null) throw new ArgumentNullException(nameof(exponents));
|
---|
30 | Exponents = exponents;
|
---|
31 | if (AllowNonLinearFunctions && nonLinearFunctions == null) throw new ArgumentNullException(nameof(nonLinearFunctions));
|
---|
32 | NonLinearFunctions = nonLinearFunctions;
|
---|
33 | MinHingeThreshold = minHingeThreshold;
|
---|
34 | MaxHingeThreshold = maxHingeThreshold;
|
---|
35 | NumHingeThresholds = numHingeThresholds;
|
---|
36 | ElasticNetPenalty = elasticNetPenality;
|
---|
37 | MaxNumBases = maxNumBases;
|
---|
38 | }
|
---|
39 | }
|
---|
40 | } |
---|