This repository contains a comprehensive implementation of Logistic Regression for the classification of fraudulent credit card transactions. The project demonstrates three distinct levels of implementation using Apache Spark to showcase scalability and distributed computing paradigms.
The objective is to assign labels (Fraud vs. Genuine) to transaction instances. We focus on building a scalable classifier that can process large-scale data in parallel while ensuring robust performance.
- Language: Python (PySpark) or Scala.
- Framework: Apache Spark (Structured API & Core RDD).
- Core Concepts: Catalyst Optimizer, Tungsten Execution Engine, and RDD Lineage.
- Name: Credit Card Fraud Detection Dataset.
- Source: Kaggle - Credit Card Fraud.
- Task: Binary Classification using Logistic Regression.
- Module:
spark.ml. - Methodology: Utilizing
VectorAssemblerfor feature engineering and theLogisticRegressionestimator. - Metrics: Evaluated based on Accuracy, AUC, Precision, and Recall.
- Module:
spark.mllib. - Methodology: Data is converted into an RDD of
LabeledPointobjects. Models are trained using built-in functions likeLogisticRegressionWithSGDorLogisticRegressionWithLBFGS. - Optimization: Fine-tuning via iteration counts and step-sizes (learning rates).
- Module: Spark Core (Fundamental RDD Transformations).
- Methodology: Manual decomposition of the Logistic Regression algorithm into scalable operations.
- Key Components: * Custom Dot Product calculation.
- Sigmoid Function implementation.
- Gradient Descent update mechanism using
mapandreduce.
The implementation adheres to the following course requirements:
- High-level Structured API: 1.25 points.
- MLlib RDD-based: 2.0 points.
- Low-level Operations: 2.0 points.
- Note: Bonus points awarded for Scala-based implementations.
<RepresentativeID>/
├── docs/
│ ├── Report.pdf # Approach, detailed explanations, and screenshots
│ └── drive_link.txt # Link to predicted CSV results
├── src/
│ └── Classification/
│ ├── Structured_API/ # Folder code for Structured API Implementation
│ ├── MLlib_RDD_Based/# Folder code for MLlib RDD-Based Implementation
│ └── Low_Level/ # Folder code for Low-Level Operations Implementation
└── README.md # Execution instructions