Is there a way to run a grid search over parameter values optimised for a score (e.g. 'f1') on a selected class, rather than the default score for all the classes? 

[Edit] The assumption is that such a grid search should return a set of parameters maximising a score (e.g. 'f1', 'accuracy', 'recall') only for a selected class, rather than the overall score across all classes. Such an approach seems to be useful e.g. for highly unbalanced data-sets, when attempting to construct a classifier that does a reasonable job on a class with a small number of instances. 

An example of a GridSearchCV with a default scoring approach (here: 'f1' over all the classes):

```
from __future__ import print_function

from sklearn.cross_validation import train_test_split
from sklearn.grid_search import GridSearchCV
from sklearn.metrics import classification_report
from sklearn.svm import SVC

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=0)

tuned_parameters = [{'kernel': ['rbf'], 'gamma': [1e-3, 1e-4, 1e-5],
                 'C': [1, 50, 100, 500, 1000, 5000]},
                {'kernel': ['linear'], 'C': [1, 100, 500, 1000, 5000]}]

clf = GridSearchCV(SVC(), tuned_parameters, cv=4, scoring='f1', n_jobs=-1)
clf.fit(X_train, y_train)

print("Best parameters set found on development set:")
print()
print(clf.best_estimator_)

y_true, y_pred = y_test, clf.predict(X_test)
print(classification_report(y_true, y_pred))

```

How to optimise parameters for a best performance on a selected class, or incorporate a test of a range of class\_weight in GridSearchCV?