assets/ is a support layer
The assets package is not where recommendation models live. It contains reusable reporting/dashboard helpers and bundled presentation resources.
src/cooprecsys/assets/
├── icon/
├── dashboard_utils.py
├── statsrender.py
├── vizdata.py
├── vendors_css.zip
└── vendors_js.zip
dashboard_utils.py
Provides small transformations for human-readable labels, numeric formatting, gauge detection, scorecards, and chart normalization.
These helpers are useful when a model/report produces metrics such as NDCG, MAP, coverage, latency, fallback rate, or score distributions and the dashboard needs a stable JSON-friendly representation.
statsrender.py
Gen_MiniStats() converts tabular statistics into compact dashboard/report data. It belongs after model evaluation, not inside the training algorithm itself.
vizdata.py
This module contains data-level visualization helpers such as score distributions, 2-D embedding projections, similarity heatmaps, top-K similar-item calculations for diagnostics, and conversion of scores into prediction frames.
The similarity helper here is a visualization/analysis utility. It should not be confused with the Ary2Tower residual recommendation fallback, which deliberately uses a global Bayesian/recency prior rather than item-item similarity.
Packaged frontend resources
vendors_css.zip and vendors_js.zip are packaged frontend assets used by the broader dashboard/report environment. Keep them versioned with the code that expects their structure.
Example: prepare scorecard data
from cooprecsys.assets.dashboard_utils import generate_scorecards
cards = generate_scorecards({
'ndcg@10': 0.61,
'coverage': 0.84,
'fallback_rate': 0.07,
})
The output can then be handed to the dashboard/report layer without coupling the UI to the internals of a model trainer.