def _fit_compute_node(self, node, Xs, ys, cache, **fit_params): # TODO: same as _compute_node TODO? if ys: output_data = node.fit_compute_func( unlistify(Xs), unlistify(ys), **fit_params ) else: output_data = node.fit_compute_func(unlistify(Xs), **fit_params) output_data = listify(output_data) self._update_cache(cache, output_data, node)
def _compute_node(self, node, Xs, cache): # TODO: Raise warning if computed output is already in cache. # This happens when recomputing a step that had a subset of its outputs already passed in the inputs. # TODO: Some regressors have extra options in their predict method, and they return a tuple of arrays. # https://scikit-learn.org/stable/glossary.html#term-predict output_data = node.compute_func(unlistify(Xs)) output_data = listify(output_data) self._update_cache(cache, output_data, node)
def _fit_node(self, node, Xs, ys, **fit_params): if ys: node.fit_func(unlistify(Xs), unlistify(ys), **fit_params) else: node.fit_func(unlistify(Xs), **fit_params)
def test_unlistify(x, expected, raises): with raises: assert unlistify(x) == expected