{"id":27372230,"url":"https://github.com/lasithaamarasinghe/data_crunch_045","last_synced_at":"2025-04-13T09:53:35.429Z","repository":{"id":285958996,"uuid":"959159577","full_name":"LasithaAmarasinghe/Data_Crunch_045","owner":"LasithaAmarasinghe","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-03T14:34:40.000Z","size":6570,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T15:37:39.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LasithaAmarasinghe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-02T11:10:46.000Z","updated_at":"2025-04-03T14:34:43.000Z","dependencies_parsed_at":"2025-04-03T15:48:49.208Z","dependency_job_id":null,"html_url":"https://github.com/LasithaAmarasinghe/Data_Crunch_045","commit_stats":null,"previous_names":["lasithaamarasinghe/data_crunch_045"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasithaAmarasinghe%2FData_Crunch_045","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasithaAmarasinghe%2FData_Crunch_045/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasithaAmarasinghe%2FData_Crunch_045/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasithaAmarasinghe%2FData_Crunch_045/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LasithaAmarasinghe","download_url":"https://codeload.github.com/LasithaAmarasinghe/Data_Crunch_045/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248695305,"owners_count":21146952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-13T09:53:34.888Z","updated_at":"2025-04-13T09:53:35.420Z","avatar_url":"https://github.com/LasithaAmarasinghe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Crunch - CSE, UoM\n\n# Harveston Climate Prediction 🌾🌦️\n\n## Overview\nHarveston's climate is shifting unpredictably, affecting agriculture and food security. This project aims to develop time series forecasting models to predict five critical environmental variables:\n- Average Temperature (°C)\n- Radiation (W/m²)\n- Rain Amount (mm)\n- Wind Speed (km/h)\n- Wind Direction (°)\n\n## Models Used\n### 1. RandomForestRegressor ([Code 1](code%201.py))\n- Uses **Random Forest**, an **ensemble learning model** that builds multiple decision trees and averages their predictions.\n- Handles feature engineering, categorical encoding, and missing data preprocessing.\n\n### 2. LightGBM ([Code 2](code%202.py))\n- Implements **LightGBM**, an optimized **ensemble gradient boosting model** that builds trees sequentially to improve predictions.\n- Uses boosting techniques for efficient learning and high performance.\n- Performs hyperparameter tuning and feature extraction.\n\n### 3. XGBoost ([Code 3](code%203.py))\n- Uses **XGBoost**, another powerful **ensemble gradient boosting model** known for efficiency and regularization.\n- Applies gradient boosting with optimized tree-building techniques.\n- Handles categorical encoding, missing values, and feature engineering.\n\n### 4. LSTM ([Code 4](code%204.py))\n- Uses an LSTM (Long Short-Term Memory) model, a type of **recurrent neural network** (RNN) designed for sequential data processing.\n- Employs memory cells to capture long-term dependencies and temporal patterns in data.\n- Trains the model with early stopping, batch processing, and validation to optimize performance.\n\n### 5. Gradient Boosting ([Code 5](code%205.py))\n- Uses Gradient Boosting, an **ensemble learning technique** that builds trees sequentially to minimize prediction errors.\n- Applies boosting by adjusting model weights iteratively to improve accuracy.\n- Optimizes tree depth, learning rate, and subsampling for enhanced performance and generalization.\n\n### 6. BaggingRegressor ([Code 6](code%206.py))\n- Implements Bagging, an ensemble learning method that trains multiple base regressors (Decision Trees) on random subsets of the data and averages their predictions.\n- Enhances model stability, reduces variance, and improves generalization by combining multiple weak learners.\n- Uses bootstrap sampling and feature selection to improve robustness and mitigate overfitting.\n\n### 7. Stack ([Code 7](code%207.py))\n- Implements a stacked ensemble model that combines multiple base regressors to enhance prediction accuracy.\n- Uses diverse base models, including Random Forest, Gradient Boosting, XGBoost, Ridge Regression, and Lasso Regression, to capture different aspects of the data.\n- Employs k-fold cross-validation to generate out-of-fold predictions for training a meta-model (XGBoost) that learns from the base models' outputs.\n\n## Dataset\n- The dataset contains historical environmental records from different kingdoms in Harveston.\n- The test dataset includes `ID`, `Year`, `Month`, `Day`, and `kingdom`, requiring predictions for the five target variables.\n\n## Evaluation Metric\nPredictions are evaluated using **Symmetric Mean Absolute Percentage Error (sMAPE)**:\n\n$$sMAPE = \\frac{100\\%}{n} \\sum_{i=1}^{n} \\frac{|y_{true,i} - y_{pred,i}|}{(|y_{true,i}| + |y_{pred,i}|)/2}$$\n\nThe final score is the average sMAPE across all target columns.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasithaamarasinghe%2Fdata_crunch_045","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flasithaamarasinghe%2Fdata_crunch_045","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasithaamarasinghe%2Fdata_crunch_045/lists"}