Ignore:
Timestamp:
02/16/18 11:35:54 (2 years ago)
Author:
fholzing
Message:

#2902: Changed from Cast to Iterator and adapted all occurrences.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs

    r15583 r15783  
    8080      var inputMatrix = binaryMatrix.HorzCat(doubleVarMatrix);
    8181
    82       if (inputMatrix.Cast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))
     82      if (inputMatrix.ContainsNanInf())
    8383        throw new NotSupportedException("Linear regression does not support NaN or infinity values in the input dataset.");
    8484
     
    100100      int nVarCoeff = doubleVariables.Count();
    101101      var tree = LinearModelToTreeConverter.CreateTree(factorVariables, coefficients.Take(nFactorCoeff).ToArray(),
    102         doubleVariables.ToArray(), coefficients.Skip(nFactorCoeff).Take(nVarCoeff).ToArray(), 
     102        doubleVariables.ToArray(), coefficients.Skip(nFactorCoeff).Take(nVarCoeff).ToArray(),
    103103        @const: coefficients[nFeatures]);
    104      
     104
    105105      SymbolicRegressionSolution solution = new SymbolicRegressionSolution(new SymbolicRegressionModel(problemData.TargetVariable, tree, new SymbolicDataAnalysisExpressionTreeLinearInterpreter()), (IRegressionProblemData)problemData.Clone());
    106106      solution.Model.Name = "Linear Regression Model";
Note: See TracChangeset for help on using the changeset viewer.