> For the complete documentation index, see [llms.txt](https://docs.satoshiterminal.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.satoshiterminal.io/resources/copy-of-defi-analytics/risk-management-and-security-analytics/machine-learning-driven-wallet-clustering.md).

# Machine-Learning-Driven Wallet Clustering

**Implementation Details**

**Class Names**

| Model Name       | Parameters Class            | Data Class           |
| ---------------- | --------------------------- | -------------------- |
| WalletClustering | WalletClusteringQueryParams | WalletClusteringData |

**Import Statement**

```python
pythonCopyEditfrom satoshi_terminal.models.wallet_clustering import (
    WalletClustering,
    WalletClusteringQueryParams,
    WalletClusteringData,
)
```

***

**Parameters**

| Name               | Type                       | Description                                               | Default | Optional |
| ------------------ | -------------------------- | --------------------------------------------------------- | ------- | -------- |
| wallet\_address    | Union\[str, List\[str]]    | Wallet address(es) to include in clustering analysis.     | None    | True     |
| clustering\_method | str                        | Method for clustering (e.g., "Behavioral", "Geographic"). | None    | True     |
| time\_range        | Tuple\[datetime, datetime] | Date range for activity clustering.                       | None    | True     |

***

**Data**

| Name              | Type       | Description                                                |
| ----------------- | ---------- | ---------------------------------------------------------- |
| cluster\_id       | str        | Identifier for the wallet cluster.                         |
| wallet\_addresses | List\[str] | List of wallets in the cluster.                            |
| common\_behaviors | List\[str] | Frequently observed patterns among wallets in the cluster. |
| anomaly\_score    | float      | Anomaly score for unusual activity within the cluster.     |
| timestamp         | datetime   | Timestamp of the clustering operation.                     |
