cytoflowgui.workflow.operations.kmeans¶
- class cytoflowgui.workflow.operations.kmeans.KMeansWorkflowOp[source]¶
Bases:
cytoflowgui.workflow.operations.operation_base.WorkflowOperation
,cytoflow.operations.kmeans.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 clusterssubset (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
namedname
, of typecategory
. The new category has valuesname_1
,name_2
, etc to indicate which k-means cluster an event is a member of.The new
Experiment
also has one new statistic calledcenters
, which is a list of tuples encoding the centroids of each k-means cluster.- Return type
- class cytoflowgui.workflow.operations.kmeans.KMeansWorkflowView[source]¶
Bases:
cytoflowgui.workflow.views.view_base.WorkflowByView
- id = 'edu.mit.synbio.cytoflowgui.op_plugins.kmeans'¶
- friendly_id = 'KMeans'¶
- plot(experiment, **kwargs)[source]¶
A default
plot
that passescurrent_plot
as the plot name.