# vikranth3140/movie-revenue-prediction architecture

> Architecture diagram of the GitHub repository vikranth3140/movie-revenue-prediction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vikranth3140/movie-revenue-prediction
- Repository: https://github.com/vikranth3140/movie-revenue-prediction

## Overview

##### Project type and purpose
- This is a full-stack Machine Learning application for predicting movie revenues.
- Purpose: Ingest movie datasets, perform preprocessing & feature engineering, train multiple regression models, and expose predictions via (a) a CLI tool (main.py) and (b) a Streamlit web interface (streamlit_app.py).

##### File structure
- Top-level scripts:
- main.py – command-line interface for real-time predictions
- streamlit_app.py – web front-end using Streamlit
- “models” directory: each file implements one scikit-learn or XGBoost model plus a feature_scaling.py for preprocessing
- “Helper files”: standalone data-analysis & visualization utilities (null_values_check, pie_chart, etc.)
- “old datasets” & “revised datasets”: raw & processed CSV files
- fig: static images used in README/Reports
- Reports/Misc: documentation, presentations, academic papers
- Config files: requirements.txt, .pre-commit-config.yaml, .gitignore

##### README for additional insights
- ML stack: Python 3.6+, scikit-learn 1.3.2, XGBoost, GridSearchCV
- Preprocessing steps: missing-value imputation, encoding, scaling, log transforms (feature_scaling.py)
- Feature engineering: ratio-based & binary features
- Model types: Linear Regression, Decision Tree (+ bagging), Random Forest, Gradient Boost, XGBoost
- Deployment: local CLI and Streamlit web app

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Layer"
        RawInitial["initial_dataset.csv"]:::dataStore
        RawIntermediate["intermediate_dataset.csv"]:::dataStore
        RawKaggle["movie_metadata.csv"]:::dataStore
        RawFinal["final_dataset.csv"]:::dataStore
        RevisedMovies["movies.csv"]:::dataStore
        RevisedOutput["output.csv"]:::dataStore
    end

    %% Preprocessing & Feature Engineering Layer
    subgraph "Preprocessing & Feature Engineering"
        DataBuilder["Data Builder Service"]:::compute
        FeatureScaling["feature_scaling.py"]:::compute
        FeatureScores["feature_scores.py"]:::compute
        SignificantFeatures["significant_features.py"]:::compute
    end

    %% Model Training & Evaluation Layer
    subgraph "Model Training & Evaluation"
        LinearReg["linear_regression.py"]:::compute
        LinearPCA["linear_regression_pca.py"]:::compute
        DecisionTree["decision_tree.py"]:::compute
        DecisionTreeBagging["decision_tree_bagging.py"]:::compute
        RandomForest["random_forest.py"]:::compute
        GradientBoost["gradient_boost.py"]:::compute
        XGBoost["XGBoost.py"]:::compute
        TrackingXGB["tracking_XGBoost.py"]:::compute
        Accuracies["accuracies.txt"]:::compute
    end

    %% Serving Layer
    subgraph "Serving Layer"
        CLI["main.py"]:::ui
        WebUI["streamlit_app.py"]:::ui
    end

    %% Reporting & Visualization Layer
    subgraph "Reporting & Visualization"
        DataVis["data_visualization.py"]:::compute
        Histogram["gross_histogram.py"]:::compute
        PieChart["pie_chart.py"]:::compute
        NullCheck["null_values_check.py"]:::compute
        BudgetGross["budgetxgross.py"]:::compute
        ReportsDoc["Reports"]:::report
        Figures["fig"]:::report
        MiscPres["Project-Presentation.pdf"]:::report
    end

    %% Data Flows
    RawInitial -->|Raw CSV| DataBuilder
    RawIntermediate -->|Raw CSV| DataBuilder
    RawKaggle -->|Raw CSV| DataBuilder
    DataBuilder -->|final_dataset.csv| RawFinal

    RawFinal -->|"final_dataset.csv"| FeatureScaling
    FeatureScaling -->|"processed_data"| LinearReg
    FeatureScaling -->|"processed_data"| LinearPCA
    FeatureScaling -->|"processed_data"| DecisionTree
    FeatureScaling -->|"processed_data"| DecisionTreeBagging
    FeatureScaling -->|"processed_data"| RandomForest
    FeatureScaling -->|"processed_data"| GradientBoost
    FeatureScaling -->|"processed_data"| XGBoost
    FeatureScaling -->|"processed_data"| TrackingXGB

    LinearReg -->|"model.pkl"| CLI
    LinearReg -->|"model.pkl"| WebUI
    LinearPCA -->|"model.pkl"| CLI
    LinearPCA -->|"model.pkl"| WebUI
    DecisionTree -->|"model.pkl"| CLI
    DecisionTree -->|"model.pkl"| WebUI
    DecisionTreeBagging -->|"model.pkl"| CLI
    DecisionTreeBagging -->|"model.pkl"| WebUI
    RandomForest -->|"model.pkl"| CLI
    RandomForest -->|"model.pkl"| WebUI
    GradientBoost -->|"model.pkl"| CLI
    GradientBoost -->|"model.pkl"| WebUI
    XGBoost -->|"model.pkl"| CLI
    XGBoost -->|"model.pkl"| WebUI
    TrackingXGB -->|"model.pkl"| CLI
    TrackingXGB -->|"model.pkl"| WebUI

    LinearReg -->|metrics| Accuracies
    LinearPCA -->|metrics| Accuracies
    DecisionTree -->|metrics| Accuracies
    DecisionTreeBagging -->|metrics| Accuracies
    RandomForest -->|metrics| Accuracies
    GradientBoost -->|metrics| Accuracies
    XGBoost -->|metrics| Accuracies
    TrackingXGB -->|metrics| Accuracies

    CLI -->|"user input & preprocessing"| FeatureScaling
    WebUI -->|"user input & preprocessing"| FeatureScaling
    CLI -->|"prediction"| CLI
    WebUI -->|"prediction"| WebUI

    Accuracies -->|read metrics| ReportsDoc
    DataVis -->|charts| ReportsDoc
    Histogram -->|charts| ReportsDoc
    PieChart -->|charts| ReportsDoc
    NullCheck -->|reports| ReportsDoc
    BudgetGross -->|charts| ReportsDoc
    Figures -->|images| ReportsDoc
    MiscPres -->|presentation| ReportsDoc

    %% Click Events
    click RawInitial "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/old datasets/Initial/initial_dataset.csv"
    click RawIntermediate "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/old datasets/Intermediate/intermediate_dataset.csv"
    click RawKaggle "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/old datasets/Kaggle/movie_metadata.csv"
    click RawFinal "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/old datasets/final_dataset.csv"
    click RevisedMovies "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/revised datasets/movies.csv"
    click RevisedOutput "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/revised datasets/output.csv"
    click DataBuilder "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/old datasets/data_builder_check.py"
    click FeatureScaling "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/models/feature_scaling.py"
    click FeatureScores "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/Helper files/Best Festures/feature_scores.py"
    click SignificantFeatures "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/Helper files/Best Festures/significant_features.py"
    click LinearReg "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/models/linear_regression.py"
    click LinearPCA "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/models/linear_regression_pca.py"
    click DecisionTree "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/models/decision_tree.py"
    click DecisionTreeBagging "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/models/decision_tree_bagging.py"
    click RandomForest "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/models/random_forest.py"
    click GradientBoost "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/models/gradient_boost.py"
    click XGBoost "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/models/XGBoost.py"
    click TrackingXGB "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/models/tracking_XGBoost.py"
    click Accuracies "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/models/accuracies.txt"
    click CLI "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/main.py"
    click WebUI "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/streamlit_app.py"
    click DataVis "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/Helper files/data_visualization.py"
    click Histogram "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/Helper files/gross_histogram.py"
    click PieChart "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/Helper files/pie_chart.py"
    click NullCheck "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/Helper files/null_values_check.py"
    click BudgetGross "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/Helper files/budgetxgross.py"
    click ReportsDoc "https://github.com/vikranth3140/movie-revenue-prediction/tree/main/Reports/"
    click Figures "https://github.com/vikranth3140/movie-revenue-prediction/tree/main/fig/"
    click MiscPres "https://github.com/vikranth3140/movie-revenue-prediction/blob/main/Misc/Project-Presentation.pdf"

    %% Styles
    classDef dataStore fill:#cce5ff,stroke:#66b2ff,stroke-width:1px
    classDef compute fill:#d4edda,stroke:#28a745,stroke-width:1px
    classDef ui fill:#ffe5b4,stroke:#ff9933,stroke-width:1px
    classDef report fill:#f2f2f2,stroke:#a6a6a6,stroke-width:1px
```
