Changeset 17779 for branches/3022-FastFunctionExtraction/FFX/Approach.cs
- Timestamp:
- 10/29/20 15:24:40 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3022-FastFunctionExtraction/FFX/Approach.cs
r17737 r17779 4 4 namespace HeuristicLab.Algorithms.DataAnalysis.FastFunctionExtraction { 5 5 internal struct Approach { 6 public bool AllowInter { get; set; }7 public bool AllowDenom { get; set; }6 public bool AllowInteractions { get; set; } 7 public bool AllowDenominators { get; set; } 8 8 public bool AllowExp { get; set; } 9 public bool AllowNon linFuncs { get; set; }9 public bool AllowNonLinearFunctions { get; set; } 10 10 public bool AllowHinge { get; set; } 11 11 public HashSet<double> Exponents { get; set; } 12 public HashSet<NonlinearOperator> Non linFuncs { get; set; }13 public double MinHingeThr { get; set; }14 public double MaxHingeThr { get; set; }15 public int NumHingeThr s { get; set; }16 public double El netPenalty { 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 17 public int MaxNumBases { get; set; } 18 18 19 private static int Int(bool b) => b ? 1 : 0;20 21 19 public override string ToString() { 22 return $"Inter {Int(AllowInter)} Denom{Int(AllowDenom)} Exp{Int((AllowExp))} Nonlin{Int(AllowNonlinFuncs)} Hinge{Int(AllowHinge)}";20 return $"Interactions{AllowInteractions} Denominator{AllowDenominators} Exponential{AllowExp} NonLinearFunctions{AllowNonLinearFunctions} HingeFunctions{AllowHinge}"; 23 21 } 24 22 25 public Approach(bool inter, bool denom, bool exp, bool nonlin, bool hinge, HashSet<double> exponents, HashSet<NonlinearOperator> nonlinFuncs, int maxNumBases, double penalty, double minHingeThr, double maxHingeThr, int numHingeThrs) {26 this.AllowInter = inter;27 this.AllowDenom = denom;28 this.AllowExp = exp;29 this.AllowNon linFuncs = nonlin;30 this.AllowHinge = hinge;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; 31 29 if (AllowExp && exponents == null) throw new ArgumentNullException(nameof(exponents)); 32 30 Exponents = exponents; 33 if (AllowNon linFuncs && nonlinFuncs == null) throw new ArgumentNullException(nameof(nonlinFuncs));34 Non linFuncs = nonlinFuncs;35 MinHingeThr = minHingeThr;36 MaxHingeThr = maxHingeThr;37 NumHingeThr s = numHingeThrs;38 El netPenalty = penalty;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; 39 37 MaxNumBases = maxNumBases; 40 38 }
Note: See TracChangeset
for help on using the changeset viewer.