Currently BaseSearchCV expects a predetermined sequence of parameter
settings, which is unideal for some cases. SciPy opts for a callback
approach. I've not used that interface, but I gather something like this
might work:

class MinimizeCV(BaseEstimator):
    def __init__(self, minimiser, clf, param_init, scoring, cv,
minimise_kwargs={}):
        self.clf = clf
        self.param_init = param_init
        self.scoring = scoring
        self.cv = cv
        self.minimiser = minimiser
        self.minimise_kwargs = minimise_kwargs

    def fit(self, X, y=None):
        def objective(param_values):
            """"""
            # TODO: parallelise fold fitting
            return aggregate(
                fit_grid_point(X, y, self.clf, dict(zip(param_list,
param_values)), self.scoring, ...)
                for train, test in self.cv)
        res = self.minimiser(objective, X0=[v for k, v in
sorted(self.param_init.iteritems())], **self.minimise_kwargs)
        # TODO: store results and perhaps search history

I think a variant could be implemented that shares most of its code with
the existing BaseSearchCV.

I haven't looked at hyperopt's interface yet.

- Joel

> On Sun, Apr 7, 2013 at 6:35 PM, Roman Sinayev <[email protected]> wrote:

> >
> > It seems like brute force Grid Search takes forever when attempting to
> > determine best parameters with many classifiers.  Let's say the
> > parameter space looks something like this
> > http://i.imgur.com/AiBl8Wt.png .  Why not use the SciPy simulated
> > annealing or some simple genetic algorithm instead of searching
> > through all the possible parameter space of every classifier?
>
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to