Changeset 16017
- Timestamp:
- 07/25/18 19:04:33 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2904_CalculateImpacts/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs
r16016 r16017 37 37 [Item("RegressionSolution Impacts Calculator", "Calculation of the impacts of input variables for any regression solution")] 38 38 public sealed class RegressionSolutionVariableImpactsCalculator : ParameterizedNamedItem { 39 private static IOnlineCalculator calculator = new OnlinePearsonsRSquaredCalculator(); 40 39 41 public enum ReplacementMethodEnum { 40 42 Median, … … 54 56 } 55 57 56 //The PerasonsR²-Calculator is the default, but can be overwritten to any other IOnlineCalculator57 //Just remember to reset it after you're done58 private static IOnlineCalculator calculator = new OnlinePearsonsRSquaredCalculator();59 public static IOnlineCalculator Calculator60 {61 get { return calculator; }62 set { calculator = value; }63 }64 65 58 private const string ReplacementParameterName = "Replacement Method"; 59 private const string FactorReplacementParameterName = "Factor Replacement Method"; 66 60 private const string DataPartitionParameterName = "DataPartition"; 67 61 … … 69 63 { 70 64 get { return (IFixedValueParameter<EnumValue<ReplacementMethodEnum>>)Parameters[ReplacementParameterName]; } 65 } 66 public IFixedValueParameter<EnumValue<FactorReplacementMethodEnum>> FactorReplacementParameter 67 { 68 get { return (IFixedValueParameter<EnumValue<FactorReplacementMethodEnum>>)Parameters[FactorReplacementParameterName]; } 71 69 } 72 70 public IFixedValueParameter<EnumValue<DataPartitionEnum>> DataPartitionParameter … … 79 77 get { return ReplacementParameter.Value.Value; } 80 78 set { ReplacementParameter.Value.Value = value; } 79 } 80 public FactorReplacementMethodEnum FactorReplacementMethod 81 { 82 get { return FactorReplacementParameter.Value.Value; } 83 set { FactorReplacementParameter.Value.Value = value; } 81 84 } 82 85 public DataPartitionEnum DataPartition … … 98 101 : base() { 99 102 Parameters.Add(new FixedValueParameter<EnumValue<ReplacementMethodEnum>>(ReplacementParameterName, "The replacement method for variables during impact calculation.", new EnumValue<ReplacementMethodEnum>(ReplacementMethodEnum.Median))); 103 Parameters.Add(new FixedValueParameter<EnumValue<FactorReplacementMethodEnum>>(FactorReplacementParameterName, "The replacement method for factor variables during impact calculation.", new EnumValue<FactorReplacementMethodEnum>(FactorReplacementMethodEnum.Best))); 100 104 Parameters.Add(new FixedValueParameter<EnumValue<DataPartitionEnum>>(DataPartitionParameterName, "The data partition on which the impacts are calculated.", new EnumValue<DataPartitionEnum>(DataPartitionEnum.Training))); 101 105 } … … 322 326 IRegressionModel model, string variable, ModifiableDataset dataset, 323 327 IEnumerable<int> rows, 324 FactorReplacementMethodEnum replacement = FactorReplacementMethodEnum. Shuffle) {328 FactorReplacementMethodEnum replacement = FactorReplacementMethodEnum.Best) { 325 329 var originalValues = dataset.GetReadOnlyStringValues(variable).ToList(); 326 330 List<string> replacementValues;
Note: See TracChangeset
for help on using the changeset viewer.