SHiP.partitioning

This submodule contains all available partitioning methods. There are different ways how to select and use a partitioning method.

Usage Examples:

  1. Import a specific partitioning method directly from the submodule:

from SHiP import SHiP
from SHiP.partitioning import <PartitioningMethod>

ship = SHiP(data=my_data)
labels = ship.fit_predict(partitioningMethod=<PartitioningMethod>)
  1. Alternatively, use the PartitioningMethod enum to list and access all available partitioning methods:

from SHiP import SHiP
from SHiP.partitioning import PartitioningMethod

for partitioning_method in PartitioningMethod:
    print(partitioning_method)

ship = SHiP(data=my_data)
labels = ship.fit_predict(partitioningMethod=PartitioningMethod.<PartitioningMethod>)
  1. You can also specify the partitioning method as a string (ensure it matches an available method):

from SHiP import SHiP

ship = SHiP(data=my_data)
labels = ship.fit_predict(partitioningMethod="<PartitioningMethod>")
class SHiP.partitioning.PartitioningMethod

Enum of available partitioning methods.

Can be used to iterate over or to select a partitioning method for SHiP.

Example:

from SHiP.partitioning import PartitioningMethod

for method in PartitioningMethod:
    print(method)

ship = SHiP(data=my_data)
labels = ship.fit_predict(partitioningMethod=PartitioningMethod.<Method>)

Members:

K

Elbow

Threshold

ThresholdElbow

QCoverage

QCoverageElbow

QStem

QStemElbow

LcaNoiseElbow

LcaNoiseElbowNoTriangle

MedianOfElbows

MeanOfElbows

Stability

NormalizedStability

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: SHiP.partitioning.PartitioningMethod, value: int) -> None

  2. __init__(self: SHiP.partitioning.PartitioningMethod, arg0: str) -> None

Elbow = <PartitioningMethod.Elbow: 1>
K = <PartitioningMethod.K: 0>
LcaNoiseElbow = <PartitioningMethod.LcaNoiseElbow: 8>
LcaNoiseElbowNoTriangle = <PartitioningMethod.LcaNoiseElbowNoTriangle: 9>
MeanOfElbows = <PartitioningMethod.MeanOfElbows: 11>
MedianOfElbows = <PartitioningMethod.MedianOfElbows: 10>
NormalizedStability = <PartitioningMethod.NormalizedStability: 13>
QCoverage = <PartitioningMethod.QCoverage: 4>
QCoverageElbow = <PartitioningMethod.QCoverageElbow: 5>
QStem = <PartitioningMethod.QStem: 6>
QStemElbow = <PartitioningMethod.QStemElbow: 7>
Stability = <PartitioningMethod.Stability: 12>
Threshold = <PartitioningMethod.Threshold: 2>
ThresholdElbow = <PartitioningMethod.ThresholdElbow: 3>
PartitioningMethod.name -> str
property value
SHiP.partitioning.partitioningMethodToString(arg0: SHiP.partitioning.PartitioningMethod) str

Convert a PartitioningMethod enum to a string.

SHiP.partitioning.stringToPartitioningMethod(arg0: str) SHiP.partitioning.PartitioningMethod

Convert a string to a PartitioningMethod enum.