// Substitution public double this[double value] { get { return(Coefficients.Sum(c => c.Value * Math.Pow(value, c.Key))); } }
private double GetEstimatedValue(IDataset dataset, int row) { return(Intercept + (Coefficients.Count == 0 ? 0 : Coefficients.Sum(s => s.Value * dataset.GetDoubleValue(s.Key, row)))); }