[17737] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 |
|
---|
| 4 | namespace HeuristicLab.Algorithms.DataAnalysis.FastFunctionExtraction {
|
---|
| 5 | internal struct Approach {
|
---|
[17779] | 6 | public bool AllowInteractions { get; set; }
|
---|
| 7 | public bool AllowDenominators { get; set; }
|
---|
[17737] | 8 | public bool AllowExp { get; set; }
|
---|
[17779] | 9 | public bool AllowNonLinearFunctions { get; set; }
|
---|
[17737] | 10 | public bool AllowHinge { get; set; }
|
---|
| 11 | public HashSet<double> Exponents { get; set; }
|
---|
[17779] | 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; }
|
---|
[17737] | 17 | public int MaxNumBases { get; set; }
|
---|
| 18 |
|
---|
| 19 | public override string ToString() {
|
---|
[17779] | 20 | return $"Interactions{AllowInteractions} Denominator{AllowDenominators} Exponential{AllowExp} NonLinearFunctions{AllowNonLinearFunctions} HingeFunctions{AllowHinge}";
|
---|
[17737] | 21 | }
|
---|
| 22 |
|
---|
[17779] | 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;
|
---|
[17737] | 29 | if (AllowExp && exponents == null) throw new ArgumentNullException(nameof(exponents));
|
---|
| 30 | Exponents = exponents;
|
---|
[17779] | 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;
|
---|
[17737] | 37 | MaxNumBases = maxNumBases;
|
---|
| 38 | }
|
---|
| 39 | }
|
---|
| 40 | } |
---|