MCPcopy Create free account
hub / github.com/PythonOT/POT / split_classes

Function split_classes

ot/dr.py:76–79  ·  view source on GitHub ↗

r"""split samples in :math:`\mathbf{X}` by classes in :math:`\mathbf{y}`

(X, y)

Source from the content-addressed store, hash-verified

74
75
76def split_classes(X, y):
77 r"""split samples in :math:`\mathbf{X}` by classes in :math:`\mathbf{y}`"""
78 lstsclass = np.unique(y)
79 return [X[y == i, :].astype(np.float32) for i in lstsclass]
80
81
82def fda(X, y, p=2, reg=1e-16):

Callers 2

fdaFunction · 0.85
wdaFunction · 0.85

Calls 1

uniqueMethod · 0.45

Tested by

no test coverage detected