How emielstoelinga/ccmlwi works
Project Type and Purpose
• This is a research-oriented stock-market prediction tool that ingests news-headline datasets, runs two modeling approaches (sentiment-analysis + SVM and LSTM networks), evaluates results, and optionally exposes a simple web UI for demonstration.
Main Architectural Components
a. Data Ingestion & Storage
• Combine_Data.py & the various Jupyter notebooks (Bag_of_words.ipynb, Combine_Data*.ipynb) collect and merge CSV/Kaggle news-headline and stock-value datasets.
• Raw data files (CSV/JSON) live in the project root or subfolders like “baseline”, “predictionBySentiment”, “sentimentPerHeadline”.
b. Preprocessing & Feature Extraction
• Scripts under RNN/data.py and LSTM/tf_data.py clean text, build vocabulary (top 2k words), compute embeddings or bag-of-words, and calculate sentiment scores (using NLTK’s VADER in sentimentPerHeadline.py).
• The baseline module (baseline/baseline.py) implements a trivial classifier for comparison.
c. Modeling Pipelines
• Sentiment-analysis pipeline:
• predictionBySentiment/*.py filter company-specific headlines, compute sentiment features, invoke scikit-learn SVMs to train/test.
• sentimentPerHeadline/sentimentPerHeadline.py computes per-headline sentiment.
• LSTM pipeline:
• LSTM/tf_train.py defines the CNN+LSTM architecture;
• LSTM/tf_test.py runs evaluation on held-out data;
• LSTM/tf_data.py feeds tokenized, padded sequences into tf_train.
• RNN pipeline (alternative to LSTM):
• RNN/model.py, RNN/train.py orchestrate a vanilla RNN classifier.
d. Evaluation & Reporting
• Data+Exploration.py and notebooks plot accuracies, generate tables (Tables 1 & 2).
e. Web Interface (optional)
• Web/main.py implements a Flask app that invokes selected models and renders results via Web/templates/index.html.
Component Interactions
• From Combine_Data → Preprocessing modules (tokenization, sentiment scoring)
• From Preprocessing → Model Trainers (SVM, RNN, LSTM)
• From Trainers → Evaluation & Results (plots, tables)
• From Results → Web UI (if deployed)
• External dependencies (NLTK, scikit-learn, TensorFlow/Keras) callouts on each relevant module.
Architectural Patterns & Principles
• Modular pipeline: separate data, preprocess, train, test, and serve phases.
• Reusability: sentiment and tokenization code used by both SVM and neural nets.
• MVC in the Web folder (Flask controller, template view, model invocation).
• Batch processing (no streaming or real-time inference).
Technologies & Libraries
• Python 3.x, Jupyter notebooks
• scikit-learn (SVM classifiers)
• NLTK (VADER sentiment)
• TensorFlow/Keras (CNN+LSTM, RNN)
• Flask (Web interface)