MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / sparse_dot

Function sparse_dot

experiments/baselines/scholar_inbox/runner.py:253–258  ·  view source on GitHub ↗
(weights: Dict[str, float], vector: Dict[str, float])

Source from the content-addressed store, hash-verified

251
252
253def sparse_dot(weights: Dict[str, float], vector: Dict[str, float]) -> float:
254 if not weights or not vector:
255 return 0.0
256 if len(weights) > len(vector):
257 return sum(value * weights.get(key, 0.0) for key, value in vector.items())
258 return sum(value * vector.get(key, 0.0) for key, value in weights.items())
259
260
261def balanced_logistic_samples(

Callers 2

predict_logisticMethod · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected