WeatherApp.v1 / README.md
egecandrsn's picture
Update README.md
a29a3f3
---
title: WeatherApp.v1
emoji: 🌍
colorFrom: purple
colorTo: red
sdk: gradio
sdk_version: 3.27.0
app_file: app.py
pinned: false
license: unknown
---
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
# Weather Prediction Model Based on User Preferences
This is a machine learning model that predicts the suitability of the weather based on user preferences. The model takes into account various weather features and scores each day based on how well it matches the user's ideal weather conditions.
## Features
- Trains a machine learning model based on the user's ideal weather conditions
- Predicts the suitability of the weather on a given day and location
- Provides hourly scores for the day's weather
## Requirements
- pandas
- numpy
- scikit-learn
- pickle
- datetime
- tensorflow
- json
- requests
- gradio
To install the requirements, run:
```bash
pip install pandas numpy scikit-learn tensorflow json requests gradio
```
## Usage
1. Train the model by providing your ideal max temperature, min temperature, and humidity level.
2. Predict the weather for a given location and day (yesterday, today, or tomorrow) using the trained model.
3. Receive a daily score and hourly scores for the selected day based on your preferences.
## Data
The historical weather data is stored in `weatherdatafinal.csv`. The program uses the Visual Crossing Weather API to fetch real-time weather data for the specified location and day.
## Functions
- `add_daytime_column()`: Adds a daytime column to the dataset by calculating the duration between sunrise and sunset.
- `train_model()`: Trains the model based on user preferences for ideal max temperature, ideal min temperature, and ideal humidity.
- `predict_weather()`: Predicts the daily score for the specified location and day based on the trained model.
- `main()`: Defines the Gradio interface and launches the application.
## Author
@egecandrsn