# sijianf/bvsimc architecture

> Architecture diagram of the GitHub repository sijianf/bvsimc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sijianf/bvsimc
- Repository: https://github.com/sijianf/bvsimc
- Video tour (about a minute): https://gitdiagram.com/sijianf/bvsimc/video

## Overview

BVSIMC is a compact Python implementation of Bayesian variable-selection-guided inductive matrix completion. Users provide a binary target matrix and side-channel feature matrices, construct the model, and run optimization to obtain latent coefficients and likelihood history; probabilities can then be recovered from the documented latent-product formula. The runtime is concentrated in one model class, so optimization, spike-and-slab selection, and scoring are internal responsibilities rather than separate services. The notebooks document simulation and evaluation capabilities, but their internal calls were not sampled.

Main entry points: [`bvsimc/model.py`](https://github.com/sijianf/bvsimc/blob/main/bvsimc/model.py) (Model and optimization), [`bvsimc/__init__.py`](https://github.com/sijianf/bvsimc/blob/main/bvsimc/__init__.py) (BVSIMC export), [`examples`](https://github.com/sijianf/bvsimc/tree/main/examples) (Simulation and evaluation demos)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Package API"]
  node_api["BVSIMC export<br/>[__init__.py]"]
end

subgraph group_algorithm["Model algorithm"]
  node_model["Model and optimization<br/>[model.py]"]
end

node_user(("Analyst"))
node_input["Target and features"]
node_coeff["Fitted coefficients"]
node_prob["Predicted probabilities"]
node_demo["Simulation and evaluation demos"]

node_user -->|"imports"| node_api
node_api -->|"exports"| node_model
node_user -->|"constructs and optimizes"| node_model
node_input -->|"provides inputs"| node_model
node_model -->|"returns coefficients"| node_coeff
node_coeff -->|"recovers probabilities"| node_prob
node_demo -.->|"demonstrates workflow"| node_user

click node_api "https://github.com/sijianf/bvsimc/blob/main/bvsimc/__init__.py"
click node_model "https://github.com/sijianf/bvsimc/blob/main/bvsimc/model.py"
click node_demo "https://github.com/sijianf/bvsimc/tree/main/examples"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api toneBlue
class node_model toneAmber
class node_user,node_input,node_coeff,node_prob toneIndigo
class node_demo toneTeal
```

## Components

### Package API

- [BVSIMC export](https://github.com/sijianf/bvsimc/blob/main/bvsimc/__init__.py): `bvsimc/__init__.py`

### Model algorithm

- [Model and optimization](https://github.com/sijianf/bvsimc/blob/main/bvsimc/model.py): `bvsimc/model.py`

### Other components

- **Analyst**
- **Target and features**
- **Fitted coefficients**
- **Predicted probabilities**
- [Simulation and evaluation demos](https://github.com/sijianf/bvsimc/tree/main/examples): `examples`

## Connections

- Analyst → BVSIMC export: imports (evidence: `bvsimc/__init__.py`)
- BVSIMC export → Model and optimization: exports (evidence: `bvsimc/__init__.py`)
- Analyst → Model and optimization: constructs and optimizes (evidence: `README.md`)
- Target and features → Model and optimization: provides inputs (evidence: `README.md`)
- Model and optimization → Fitted coefficients: returns coefficients (evidence: `README.md`)
- Fitted coefficients → Predicted probabilities: recovers probabilities (evidence: `README.md`)
- Simulation and evaluation demos → Analyst: demonstrates workflow (evidence: `README.md`)
