Changeset 12024 for branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization.SymbReg/SymbolicRegressionProblem.cs
- Timestamp:
- 02/17/15 16:03:49 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization.SymbReg/SymbolicRegressionProblem.cs
r12014 r12024 126 126 127 127 public double Evaluate(string sentence) { 128 var extender = new ExpressionExtender(); 129 sentence = extender.CanonicalRepresentation(sentence); 128 130 if (useConstantOpt) 129 131 return OptimizeConstantsAndEvaluate(sentence); 130 132 else { 131 var extender = new ExpressionExtender();132 133 133 134 Debug.Assert(SimpleEvaluate(sentence) == SimpleEvaluate(extender.CanonicalRepresentation(sentence))); … … 152 153 153 154 public IEnumerable<Feature> GetFeatures(string phrase) { 155 // throw new NotImplementedException(); 154 156 phrase = CanonicalRepresentation(phrase); 155 return new Feature[] { new Feature(phrase, 1.0) }; 157 return phrase.Split('+').Distinct().Select(t => new Feature(t, 1.0)); 158 // return new Feature[] { new Feature(phrase, 1.0) }; 156 159 } 157 160
Note: See TracChangeset
for help on using the changeset viewer.