cytoflowgui.workflow.operations.kmeans#

class cytoflowgui.workflow.operations.kmeans.KMeansWorkflowOp[source]#

Bases: WorkflowOperation, KMeansOp

default_view(**kwargs)[source]#

Returns a diagnostic plot of the k-means clustering.

Returns:

IView

Return type:

an IView, call KMeans1DView.plot to see the diagnostic plot.

estimate(experiment)[source]#

Estimate the k-means clusters

Parameters:
  • experiment (Experiment) – The Experiment to use to estimate the k-means clusters

  • subset (str (default = None)) – A Python expression that specifies a subset of the data in experiment to use to parameterize the operation.

apply(experiment)[source]#

Apply the KMeans clustering to the data.

Returns:

a new Experiment with one additional entry in Experiment.conditions named name, of type category. The new category has values name_1, name_2, etc to indicate which k-means cluster an event is a member of.

The new Experiment also has one new statistic called centers, which is a list of tuples encoding the centroids of each k-means cluster.

Return type:

Experiment

clear_estimate()[source]#
get_notebook_code(idx)[source]#
class cytoflowgui.workflow.operations.kmeans.KMeansWorkflowView[source]#

Bases: WorkflowByView

id = 'cytoflowgui.op_plugins.kmeans'#
friendly_id = 'KMeans'#
plot(experiment, **kwargs)[source]#

A default plot that passes current_plot as the plot name.

enum_plots(experiment)[source]#
get_notebook_code(idx)[source]#