/// <summary> /// Processes the data. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="model">The model.</param> /// <param name="sourceSet">The source set.</param> /// <param name="selector">The selector.</param> public static void ProcessData <T>(this histogramModel model, IEnumerable <T> sourceSet, Func <T, double> selector) { foreach (var s in sourceSet) { model.ranger.Learn(selector(s)); } model.processData(); }
/// <summary> /// Gets the histogram model. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="sourceSet">The source set.</param> /// <param name="name">The name.</param> /// <param name="selector">The selector.</param> /// <param name="bins">The bins.</param> /// <returns></returns> public static histogramModel GetHistogramModel <T>(this IEnumerable <T> sourceSet, String name, Func <T, double> selector, Int32 bins = 10) { histogramModel model = new histogramModel(bins, name); foreach (var s in sourceSet) { model.ranger.Learn(selector(s)); } model.processData(); return(model); }