Posts

Showing posts with the label machine learning

Causal Modeling

Image
                                                               generated by meta ai Yes. In fact, causal  modelling  is one of the most advanced topics in quantitative finance and is becoming increasingly important because traditional ML models (LSTM, XGBoost, Transformers) often learn  correlations , whereas causal models aim  to discover why prices move. Since I am  pursuing an  MSc in Financial Engineering  at  WQU , I'll teach it at that level, covering  theory, mathematics, and Python implementations. Learning Roadmap We'll build from scratch. Correlation vs Causation Structural Causal Models (SCM) Directed Acyclic Graphs (DAGs) Causal Discovery Algorithms Do-Calculus (Pearl) Counterfactual Prediction Causal Forecasting Applying causal models to stock prediction Building an end-t...

Python code examples for implementing an ML ensemble using Redis

  Important Setup Note: RedisAI and RedisML are no longer actively maintained as of 2025/2026. Therefore, Pattern B has evolved into standard deployment patterns using lightweight modern tools (like ONNX Runtime or FastAPI workers coupled directly with Redis), ensuring your pipeline remains production-grade. Pattern A: Asynchronous Parallel Processing (Redis Streams) Best for: Heavy models (Deep Learning, large Random Forests) that need separate workers or hardware (GPUs) to compute in parallel without locking your main API. Architecture Flow [Client Request] │ ▼ ┌───────────┐ XADD ┌───────────────┐ │ FastAPI │ ────────────────>│ Redis Stream │──┐ (Model 1 Worker) │ Gateway │ │(ml:requests) │──┼─> [Model 2 Worker] └───────────┘ └───────────────┘──┘ (Model 3 Worker) │ │ │ (Polls responses via │ XADD │ ...

Building a Lightweight Debugging Agent

Image
                                                               image generated by meta ai Building a Lightweight Debugging Agent: Python, Perl, and Awk In modern development, especially when managing massive log files from platforms like GitLab, sending raw data directly to an LLM is inefficient . This post explores how to build a terminal-level tool that pre-processes logs and searches codebases using a combination of classic Unix concepts and Python . 1. The Quick & Dirty: Unix Tools For simple recursive string searches, Unix tools remain the fastest starting point . Using Grep + Awk You can use grep for the search and awk for filtering or formatting the output . Bash grep -rn "your_string" /path/to/project | awk -F: '{print "File: "$1", Line: "$2", Match: "$3}' -r : Recursive search -n : Show line numbers Usi...