public AppendKExtremes ( IResult near, IResult far, List |
||
near | IResult | |
far | IResult | |
items | List |
|
return | void |
protected override void SearchExtremes(DynamicSequential idx, List<ItemPair> items, object piv, double quantile, int min_bs, out IResult near, out IResult far, out DynamicSequential.Stats stats) { items.Clear(); idx.ComputeDistances (piv, items, out stats); DynamicSequential.SortByDistance(items); var n = idx.Count; min_bs = Math.Max ((int)(quantile * n), min_bs); near = new Result (min_bs); far = new Result (min_bs); idx.AppendKExtremes(near, far, items); }
protected override void SearchExtremes(DynamicSequential idx, List<ItemPair> items, object piv, double alpha_stddev, int min_bs, out IResult near, out IResult far, out DynamicSequential.Stats stats) { items.Clear(); idx.ComputeDistances (piv, items, out stats); // var radius = stats.min; // stats.stddev * alpha_stddev; near = new Result (min_bs); far = new Result (min_bs); // idx.DropCloseToMean (stats.mean - radius, stats.mean + radius, near, far, items); // if (near.Count == 0 && far.Count == 0 & min_bs > 0) { idx.AppendKExtremes(near, far, items); // } }