How dattarajrao/contextualbandits works
Project type and purpose
• This is a research‐oriented Python library/tool for evaluating and demonstrating a novel contextual bandit algorithm (array of action‐based SGD learners) on two datasets (simulated articles and MovieLens).
• It is not a full‐stack web app or microservice architecture; instead, it’s a data‐processing and algorithm‐evaluation toolkit with driver scripts, a core algorithm module, and plotting helpers.
File structure
• Top‐level scripts:
• ContextualLearner.py – implements the core “array of bandit learners” algorithm.
• PlotHelper.py – contains plotting utilities for accuracy/reward curves.
• MovieLens_Example.py & NewsRecommendation_Example.py – driver scripts that orchestrate data loading, algorithm training/testing, and call PlotHelper.
• Data files:
• MovieLens_100k_Normalized.csv – normalized MovieLens data.
• SimulatedArticleData.csv – synthetic article‐recommendation dataset.
• No external build/deploy configs; the entire system runs locally under Python, using standard data libraries (e.g., numpy, pandas, matplotlib).
README for additional insights
• Confirms the core contribution is the ContextualLearner class implementing the array‐of‐learners approach.
• Two workflows: one on simulated data, one on real MovieLens data.
• Emphasis on generating reward‐accuracy plots.
Elements
• From scripts → ContextualLearner (“train/test calls”)
• From ContextualLearner → scripts (“rewards & metrics”)
• Blue for data layer
• Green for algorithm module
• Orange for orchestration (scripts)
• Purple for visualization