Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/04/19 13:00:24 (5 years ago)
Author:
mkommend
Message:

#2955: Merged r16241, r16243, r16244, r16763 into stable.

Location:
stable
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Algorithms.DataAnalysis

  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4

  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs

    r16167 r17054  
    262262
    263263
     264    public bool IsProblemDataCompatible(IRegressionProblemData problemData, out string errorMessage) {
     265      return RegressionModel.IsProblemDataCompatible(this, problemData, out errorMessage);
     266    }
     267
     268    public override bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) {
     269      if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
     270
     271      var regressionProblemData = problemData as IRegressionProblemData;
     272      if (regressionProblemData != null)
     273        return IsProblemDataCompatible(regressionProblemData, out errorMessage);
     274
     275      var classificationProblemData = problemData as IClassificationProblemData;
     276      if (classificationProblemData != null)
     277        return IsProblemDataCompatible(classificationProblemData, out errorMessage);
     278
     279      throw new ArgumentException("The problem data is not compatible with this nearest neighbour model. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
     280    }
     281
    264282    IRegressionSolution IRegressionModel.CreateRegressionSolution(IRegressionProblemData problemData) {
    265283      return new NearestNeighbourRegressionSolution(this, new RegressionProblemData(problemData));
Note: See TracChangeset for help on using the changeset viewer.