How mstabc/forlaps works
Based on our analysis of both the file structure and the README, the project can be seen as a dual-purpose machine learning framework that encompasses two major components:
1. Reinforcement Learning (RL) Pipeline – found in the "OfflineRL and FORLAPS" folder and associated files:
• This component handles three main operations:
• Offline RL (training without data augmentation)
• Augmented RL (enhanced training with synthetic data through data augmentation)
• Evaluation of RL models using test datasets (involving Parquet files and CSV evaluations)
• Key files include:
• main.py – orchestrates the RL pipeline including data handling and RL training/evaluation
• config.py – holds configuration parameters such as RL hyperparameters and data paths
• offline_rl.py – contains the core offline RL implementation
• data_augmentation_processor.py – processes synthetic data creation for augmented RL
• rl_evaluation.py – manages model evaluation using test inputs
• Additional utility scripts (agent_plots_save.py and utils.py) that help with ancillary tasks, logging, or plotting
LSTM and KNN Models Component – encapsulated within the "lstm_KNN" directory
• This section focuses on training a Multi-Task LSTM model for sequence prediction and a KNN model for identifying similar process traces.
• It involves:
• Data preprocessing (data_preprocessing.py)
• Training modules (lstm_model.py and knn_model.py)
• Evaluation logic (lstm_evaluation.py)
• A main.py that orchestrates these sequences similar to the RL workflow
• Utility scripts to support these tasks (utils.py)
• The README also points out that parameters like epochs, learning rate, batch size, and hidden dimension are configurable via command line args.
Additionally, there is a top-level dataset_processor.py and an evaluation_dataset directory that appear to support both workflows by preparing and evaluating data.
A. Main Components to Include:
1. Reinforcement Learning Module:
• Configuration Manager (config.py)
• Data Ingestion & Processing (data handling scripts, e.g., part of main.py and dataset_processor.py)
• Offline RL Engine (offline_rl.py)
• Data Augmentation Processor (data_augmentation_processor.py)
• Evaluation Engine (rl_evaluation.py)
• Utility Tools (agent_plots_save.py, utils.py)
2. LSTM & KNN Model Training Module:
• Data Preprocessing (data_preprocessing.py)
• LSTM Model (lstm_model.py)
• KNN Model (knn_model.py)
• Evaluation Process (lstm_evaluation.py)
• Main Orchestration (main.py for this directory)
• Helper Libraries (utils.py)
3. Shared or External Elements:
• Dataset sources and evaluation datasets (evaluation_dataset folder, dataset_processor.py)
• Command-line interface which acts as an entry point for both pipelines (instructions in README on running the script with arguments)
B. Relationships and Interactions:
• From “User/CLI Input” to “Main Orchestrator” (for either RL or LSTM/KNN pipelines)
• Within RL module, data flows from input files → data augmentation processor (if applicable) → offline RL engine → evaluation engine → file outputs (CSV/Parquet)
• Within LSTM/KNN module, data flows from preprocessing → respective model training steps → evaluation → outputs
C. Architectural Patterns and Principles:
• Separation of concerns: distinct modules for data processing, model training, and evaluation.
• Parameterization and modularity – many parameters are configurable via command-line arguments.
D. Relevant Technologies and Frameworks:
• Python is the primary language.
• The design hints at using typical ML libraries (such as those for RL, LSTM, or KNN) even though the precise libraries might not be explicitly mentioned.
• Data persistence and evaluation formats (CSV and Parquet) should be noted.
• The design should also indicate that the system is intended to be run via CLI with various configurable options.
1. For the RL pipeline:
• Clearly separate different operation modes (offline, augmented, and evaluation)
• A node for the CLI that routes arguments to main.py which then directs the process accordingly.
2. For the LSTM/KNN pipeline:
• Data preprocessing, model training (both LSTM and KNN), and evaluation sequence.
• Use of training parameters (epochs, learning rate, batch size, hidden dim) as configurable option nodes influencing the training process.
• Optionally, include a “Shared Resources” block pointing out data directories (evaluation_dataset) and common utility scripts.