scikit-learn/scikit-learn — pull request #3199 by mjbommar (2014-05-26 01:52:49+00:00)
Title: Handling out-of-bounds in IsotonicRegression (clean PR #3147)

Here's a clean, follow-up PR based on the other Isotonic merges today and conversation from PR #3147.

* Added argument ``out_of_bounds``
* Added test for each value case below
* Changed default behavior from "raise", i.e., ValueError, to "nan"

__Argument behavior__
* "nan": x-values not in training domain -> y-values = NaN
* "clip": x-values not in training domain -> y-values = y-value for nearest training x
* "raise": x-values not in training domain -> ValueError exception

Let me know if you want to see L296-310 differently. I'd like to clean up ``fit`` vs. ``fit_transform`` and some of the matrix/vector notation mismatch in the module anyway.

(My interpretation is also that there is no need for ``f`` to be created anew on each call to ``transform``.)