Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/04/17 13:59:42 (8 years ago)
Author:
gkronber
Message:

#2631: merged r14107 and r14230 from trunk to stable

Location:
stable
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Algorithms.DataAnalysis

  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IRandomForestModel.cs

    r14186 r14822  
    2929  /// Interface to represent a random forest model for either regression or classification
    3030  /// </summary>
    31   public interface IRandomForestModel : IRegressionModel, IClassificationModel {
     31  public interface IRandomForestModel : IConfidenceRegressionModel, IClassificationModel {
    3232  }
    3333}
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IRandomForestRegressionSolution.cs

    r14186 r14822  
    2828  /// Interface to represent a random forest regression solution
    2929  /// </summary>
    30   public interface IRandomForestRegressionSolution : IRegressionSolution {
     30  public interface IRandomForestRegressionSolution : IConfidenceRegressionSolution {
    3131    new IRandomForestModel Model { get; }
    3232  }
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs

    r14186 r14822  
    152152    }
    153153
     154    public IEnumerable<double> GetEstimatedVariances(IDataset dataset, IEnumerable<int> rows) {
     155      double[,] inputData = AlglibUtil.PrepareInputMatrix(dataset, AllowedInputVariables, rows);
     156      AssertInputMatrix(inputData);
     157
     158      int n = inputData.GetLength(0);
     159      int columns = inputData.GetLength(1);
     160      double[] x = new double[columns];
     161      double[] ys = new double[this.RandomForest.innerobj.ntrees];
     162
     163      for (int row = 0; row < n; row++) {
     164        for (int column = 0; column < columns; column++) {
     165          x[column] = inputData[row, column];
     166        }
     167        alglib.dforest.dfprocessraw(RandomForest.innerobj, x, ref ys);
     168        yield return ys.VariancePop();
     169      }
     170    }
     171
    154172    public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
    155173      double[,] inputData = AlglibUtil.PrepareInputMatrix(dataset, AllowedInputVariables, rows);
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegressionSolution.cs

    r14186 r14822  
    3131  [Item("RandomForestRegressionSolution", "Represents a random forest solution for a regression problem which can be visualized in the GUI.")]
    3232  [StorableClass]
    33   public sealed class RandomForestRegressionSolution : RegressionSolution, IRandomForestRegressionSolution {
     33  public sealed class RandomForestRegressionSolution : ConfidenceRegressionSolution, IRandomForestRegressionSolution {
    3434
    3535    public new IRandomForestModel Model {
Note: See TracChangeset for help on using the changeset viewer.