MCPcopy Create free account
hub / github.com/derrynknife/SurPyval / validate_float_array

Function validate_float_array

surpyval/utils/__init__.py:69–78  ·  view source on GitHub ↗

Convert input to float array with better error handling.

(arr, name)

Source from the content-addressed store, hash-verified

67 Ensures that all unique combinations of x and c are grouped. This should
68 reduce the chance of having arrays that are too long for the MLE fit.
69 """
70
71 # TODO: Change to numpy index
72 grouped = defaultdict(lambda: defaultdict(int))
73 if x.ndim == 2:
74 for vx, vc, vn in zip(x, c, n):
75 grouped[tuple(vx)][vc] += vn
76 else:
77 for vx, vc, vn in zip(x, c, n):
78 grouped[vx][vc] += vn
79
80 x_out = []
81 c_out = []

Callers 1

fsli_handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected