You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
avg_latency_seconds_30d - Groups by settlement speed
repeat_counterparty_rate_30d - Separates one-time vs recurring
Expected Value Ranges (Normal Wallets)
Feature
Min
P25
Median
P75
Max
tx_count_30d
1
8
20
35
80
avg_payment_usd_30d
$5
$15
$40
$120
$500
unique_counterparties_30d
1
3
8
15
30
avg_latency_seconds_30d
10s
30s
45s
65s
150s
hourly_burst_ratio_24h
1.0
1.2
1.5
2.2
4.0
Quick Commands
# Generate test data
python scripts/generate_test_features.py --n-wallets 1000
# Train model
python scripts/train_anomaly_model.py --input data/test_wallet_features.parquet
# Detect anomalies
python scripts/predict_anomalies.py \
--input data/test_wallet_features.parquet \
--output data/results.parquet
# View top anomalies
duckdb -c " SELECT wallet_address, anomaly_score, contributing_features FROM read_parquet('data/results.parquet') WHERE is_anomaly = true ORDER BY anomaly_score LIMIT 10"# Feature statistics
duckdb -c " SUMMARIZE SELECT * FROM read_parquet('data/wallet_features.parquet')"
TypeScript Integration
import{WalletFeatureVector,AnomalyDetectionModel,validateFeatureVector}from'./server/models';// Extract features (simplified)constfeatures: Partial<WalletFeatureVector>={wallet_address: '0x123...',tx_count_7d: 42,avg_payment_usd_7d: 125.50,// ... other features from DuckDBcomputed_at: newDate().toISOString(),observation_window_days: 30};// Validate completenessif(validateFeatureVector(features)){// Run ML model (requires Python backend)constmodel=newAnomalytectionModel();// model.predict([features]); // Throws - needs Python}