On Fri, Oct 28, 2011 at 04:17:01PM +0200, Olivier Grisel wrote:
> > I am actually not sure that I have understood the usecase that we are
> > discussing.
> I think the use case is performing a grid search for a single
> predefined train / validation datasets pair.
scores = [estimator.set_param(param=param
).fit(X_train, y_train
).score(X_test, y_test)
for param in param_list]
If you want to use joblib.Parallel there is a little bit more work, and
the most pragmatic solution is to define a helper function.
I guess that in terms of general feeing for the API of the scikit, I tend
to prefer an API with not to many words but a very expressive gramar, and
in which you write sentences, rather than an API with many functions that
catter for many usecases. I find that the latter is not only harder to
read, but also makes the package harder to grok for people who don't know
it will. Indeed when using a package with many, many helper functions to
replace 3-liners, I find myself looking at the code of these functions
all the time to know what they really do. I agree that writing the right
three-liners requires knowing idiomatic Python tricks such as list
comprehension, but I would rather teach that to people than a specific
API. Besides, it makes documenting the package harder :).
OK, the above paragraph is more of philosophic point of view than a
practical contribution to the discussion :$.
With regards to the dicussion, I am -10 on modifying the objects to take
a separate validation set, -1 on a new function, and -0 on a specific
cross-val generator.
G
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general