Coder Social home page Coder Social logo

strativ's Introduction

Backend Developer with AI-Focus Assignment @strativ

The weather in Dhaka is too hot to handle. Let's travel somewhere to cool off. We have the latitude and longitude of all the districts of Bangladesh here: https://raw.githubusercontent.com/strativ-dev/technical-screening-test/main/bd-districts.json, Using the API from open-meteo.com, we can get the temperature forecasts of each district for up to 7 days: https://open-meteo.com/en/docs. Note: The weather forecasts are updated periodically, according to the documentation.

  • Task 1: Let's make an API for the coolest 10 districts based on the average temperature at 2pm for the next 7 days. Constraint: No API responses for a user of the system should exceed 500 ms.
  • Task 2: Train a simple model that forecasts the weather conditions in a given future date. To simplify things, restrict predictions to the Dhaka district. After training the model, the model should be query-able via a simple API. For example, your API should be able to predict the temperature at any future date (beyond the 7 days provided by OpenMeteo). Note: If you feel that you do not have enough time and want to simplify further, provide a written solution plan for this section instead of a coded solution.

Deployment Instructions

  • Clone this repositories in your machine

  • Create a virtual environment with PIP, activate that and install all packages $ python3 -m venv ~/venvs/strativ $ source ~/venvs/strativ/bin/activate $ pip install --upgrade pip setuptools wheel black --no-cache-dir $ pip install -r requirements.txt --no-cache-dir

  • For Task 1: Run the below commands. Note: It will take around 2 minutes, because it has to fetch weather data from the OpenMeteo API for all the 64 districts and do some computations to create a Hashmap, so that we can lookup the 10 coolest districts in O(1) constant time. $ python3 task_1/app.py After that, using Postman or any other similar software, make a GET request with the below endpoint - http://127.0.0.1:5000/coolest_10

  • For Task 2: Run the below commands - $ jupyter notebook Then open the analysis.ipynb in the browser and run all the cells in order to generate the forcast.csv, which is the future weather prediction dataset from January 2023 to April 2050. Implemented NeuralProphet deep learning package for the time-series dataset named dhaka_2020-2022.csv, which includes historical temperature data from the year 2020 to 2022 for Dhaka district. After that, run the below python script in order to create an API endpoint. $ python3 task_2/app.py After that, using Postman or any other similar software, make a GET request with the below endpoint - http://127.0.0.1:5000/get_temperature?date=2024-11-30 Note: Above endpoint return the model predicted temperature on 2024-11-30. You just need to put the desired date in YYYY-MM-DD format between January 2023 to April 2050.

Version

  • v1.0 on November 24, 2023

Contributor

strativ's People

Contributors

kaiser-hamid-rabbi avatar

Stargazers

Rasik Kayastha avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.