A comprehensive enterprise fraud detection system built on Palantir Foundry, featuring real-time transaction processing, machine learning-based fraud prediction, and an interactive web dashboard.
Kafka Stream → Transaction Processing → Feature Engineering → ML Inference → Ontology → Dashboard
| Component | Directory | Description |
|---|---|---|
| Data Pipeline | python-transforms/ |
Streaming transaction ingestion, Avro-to-Parquet conversion, and ML inference transforms |
| ML Model | model-training/ |
XGBoost + Random Forest ensemble model with threshold optimization |
| Training Data | training-data-generation/ |
Synthetic customer and transaction data generator with fraud labeling |
| Web Dashboard | efd-website/ |
React OSDK application for fraud monitoring and investigation |
The data pipeline handles real-time transaction ingestion and fraud scoring:
transform.py— Streaming transaction processor that ingests from Kafka, deduplicates, and enriches transactionsfraud_predictions.py— Applies the trained ML model to score transactions in real-timeavro_to_parquet.py— Converts raw Avro-encoded Kafka messages to structured Parquet format
- Incremental processing (only new transactions since last build)
- Automatic schema evolution handling
- Configurable fraud threshold scoring
The fraud detection model uses an ensemble approach combining XGBoost and Random Forest classifiers.
feature_engineering.py— Feature extraction and transformation (transaction velocity, amount statistics, time-based features)model_training.py— Model training with hyperparameter tuning and threshold optimization for precision/recall trade-offgenerated_adapter.py—FraudDetectionModelAdapterfor Foundry model deploymentrun_inference.py— Batch inference pipelineadapters.py— Model adapter interfaces
- Optimized decision threshold balancing false positives vs. missed fraud
- Feature importance tracking for model interpretability
- Version-controlled model artifacts with full lineage
examples.py— Generates synthetic customer profiles and transaction histories with realistic fraud patterns- Normal spending behavior simulation
- Fraud injection with configurable fraud rate
- Customer demographic generation
- Temporal patterns (time-of-day, day-of-week effects)
A React application built with the Palantir Ontology SDK (OSDK) providing:
- Real-time fraud alerts — Live monitoring of flagged transactions
- Investigation workflows — Drill-down into suspicious activity patterns
- Customer profiles — 360° view of customer behavior and risk scores
- Analytics dashboards — Aggregate fraud metrics and trends
- React + TypeScript
- Vite build system
- Palantir OSDK for Ontology integration
- Responsive design for desktop and mobile
This project is built and run on Palantir Foundry. The source code is exported here for reference and version control.
- Palantir Foundry enrollment with:
- Data Connection (Kafka connector)
- Transforms (Python)
- Model Training
- OSDK application hosting
enterprise-fraud-detection-model/
├── README.md
├── python-transforms/ # Data pipeline transforms
│ ├── pipeline.py
│ ├── datasets/
│ │ ├── transform.py
│ │ ├── fraud_predictions.py
│ │ └── avro_to_parquet.py
│ └── ...
├── model-training/ # ML model code
│ ├── model_training.py
│ ├── feature_engineering.py
│ ├── generated_adapter.py
│ ├── run_inference.py
│ └── ...
├── training-data-generation/ # Synthetic data generation
│ └── examples.py
└── efd-website/ # React OSDK dashboard
├── package.json
├── src/
│ ├── main.tsx
│ ├── client.ts
│ └── ...
└── ...
Proprietary. All rights reserved.
This repository is automatically synced from Palantir Foundry using a custom export pipeline. Changes should be made in Foundry and re-exported.
Last export method: Foundry → GitHub Contents API (automated pipeline)