MCPcopy
hub / github.com/ddbourgin/numpy-ml / __call__

Method __call__

numpy_ml/utils/kernels.py:254–264  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

252 self.param = param
253
254 def __call__(self):
255 param = self.param
256 if param is None:
257 kernel = LinearKernel()
258 elif isinstance(param, KernelBase):
259 kernel = param
260 elif isinstance(param, str):
261 kernel = self.init_from_str()
262 elif isinstance(param, dict):
263 kernel = self.init_from_dict()
264 return kernel
265
266 def init_from_str(self):
267 r = r"([a-zA-Z0-9]*)=([^,)]*)"

Callers

nothing calls this directly

Calls 3

init_from_strMethod · 0.95
init_from_dictMethod · 0.95
LinearKernelClass · 0.85

Tested by

no test coverage detected