MCPcopy
hub / github.com/ContextLab/hypertools / _transform

Function _transform

hypertools/tools/text2mat.py:149–158  ·  view source on GitHub ↗
(vmodel, tmodel, x)

Source from the content-addressed store, hash-verified

147
148
149def _transform(vmodel, tmodel, x):
150 split = np.cumsum([len(xi) for xi in x])[:-1]
151 if vmodel is not None:
152 x = np.vsplit(vmodel.transform(np.vstack(x).ravel()).toarray(), split)
153 if tmodel is not None:
154 if isinstance(tmodel, Pipeline):
155 x = np.vsplit(tmodel.transform(np.vstack(x).ravel()), split)
156 else:
157 x = np.vsplit(tmodel.transform(np.vstack(x)), split)
158 return [xi for xi in x]
159
160
161def _fit_models(vmodel, tmodel, x, model_is_fit):

Callers 1

text2matFunction · 0.85

Calls 1

transformMethod · 0.45

Tested by

no test coverage detected