Changeset 12373
- Timestamp:
- 05/02/15 14:34:26 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GBT/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs
r12332 r12373 62 62 private const string LossFunctionParameterName = "LossFunction"; 63 63 private const string UpdateIntervalParameterName = "UpdateInterval"; 64 private const string CreateSolutionParameterName = "CreateSolution"; 64 65 #endregion 65 66 … … 91 92 public IFixedValueParameter<IntValue> UpdateIntervalParameter { 92 93 get { return (IFixedValueParameter<IntValue>)Parameters[UpdateIntervalParameterName]; } 94 } 95 public IFixedValueParameter<BoolValue> CreateSolutionParameter { 96 get { return (IFixedValueParameter<BoolValue>)Parameters[CreateSolutionParameterName]; } 93 97 } 94 98 #endregion … … 122 126 get { return MParameter.Value.Value; } 123 127 set { MParameter.Value.Value = value; } 128 } 129 public bool CreateSolution { 130 get { return CreateSolutionParameter.Value.Value; } 131 set { CreateSolutionParameter.Value.Value = value; } 124 132 } 125 133 #endregion … … 156 164 Parameters.Add(new FixedValueParameter<DoubleValue>(MParameterName, "Ratio of variables selected randomly in each step (0 < M <= 1)", new DoubleValue(0.5))); 157 165 Parameters.Add(new FixedValueParameter<DoubleValue>(NuParameterName, "Learning rate nu (step size for the gradient update, should be small 0 < nu < 0.1)", new DoubleValue(0.002))); 158 Parameters.Add(new FixedValueParameter<IntValue>("UpdateInterval", "", new IntValue(100))); 159 Parameters["UpdateInterval"].Hidden = true; 166 Parameters.Add(new FixedValueParameter<IntValue>(UpdateIntervalParameterName, "", new IntValue(100))); 167 Parameters[UpdateIntervalParameterName].Hidden = true; 168 Parameters.Add(new FixedValueParameter<BoolValue>(CreateSolutionParameterName, "Flag that indicates if a solution should be produced at the end of the run", new BoolValue(true))); 169 Parameters[CreateSolutionParameterName].Hidden = true; 160 170 161 171 var lossFunctionNames = ApplicationManager.Manager.GetInstances<ILossFunction>().Select(l => new StringValue(l.ToString()).AsReadOnly()); … … 179 189 Results.Add(new Result("Qualities", table)); 180 190 var curLoss = new DoubleValue(); 181 Results.Add(new Result(" Current loss", curLoss));191 Results.Add(new Result("Loss (train)", curLoss)); 182 192 183 193 // init … … 225 235 226 236 Results.Add(new Result("Variable relevance", impacts)); 237 Results.Add(new Result("Loss (test)", new DoubleValue(state.GetTestLoss()))); 227 238 228 239 // produce solution 229 Results.Add(new Result("Solution", new RegressionSolution(state.GetModel(), (IRegressionProblemData)problemData.Clone()))); 240 if (CreateSolution) 241 Results.Add(new Result("Solution", new RegressionSolution(state.GetModel(), (IRegressionProblemData)problemData.Clone()))); 230 242 } 231 243 }
Note: See TracChangeset
for help on using the changeset viewer.