@_log<EOL><INDENT>def fit_classifier(self, name, analytes, method, samples=None,<EOL>subset=None, filt=True, sort_by=<NUM_LIT:0>, **kwargs):<DEDENT>
<EOL>if samples is not None:<EOL><INDENT>subset = self.make_subset(samples)<EOL><DEDENT>self.get_focus(subset=subset, filt=filt)<EOL>c = classifier(analytes,<EOL>sort_by)<EOL>c.fit(data=self.focus,<EOL>method=method,<EOL>**kwargs)<EOL>self.classifiers[name] = c<EOL>return name<EOL>
Create a clustering classifier based on all samples, or a subset.

Parameters
----------
name : str
    The name of the classifier.
analytes : str or iterable
    Which analytes the clustering algorithm should consider.
method : str
    Which clustering algorithm to use. Can be:

    'meanshift'
        The `sklearn.cluster.MeanShift` algorithm.
        Automatically determines number of clusters
        in data based on the `bandwidth` of expected
        variation.
    'kmeans'
        The `sklearn.cluster.KMeans` algorithm. Determines
        the characteristics of a known number of clusters
        within the data. Must provide `n_clusters` to specify
        the expected number of clusters.
samples : iterable
    list of samples to consider. Overrides 'subset'.
subset : str
    The subset of samples used to fit the classifier. Ignored if
    'samples' is specified.
sort_by : int
    Which analyte the resulting clusters should be sorted
    by - defaults to 0, which is the first analyte.
**kwargs :
    method-specific keyword parameters - see below.
Meanshift Parameters
    bandwidth : str or float
        The bandwith (float) or bandwidth method ('scott' or 'silverman')
        used to estimate the data bandwidth.
    bin_seeding : bool
        Modifies the behaviour of the meanshift algorithm. Refer to
        sklearn.cluster.meanshift documentation.
K - Means Parameters
    n_clusters : int
        The number of clusters expected in the data.

Returns
-------
name : str