‘Weather Forecast using Logistic Regression Classifier’ is intended to predict the precipitation type of the weather, whether it would be rain or snow. The model processed and analyzed weather history data to determine the precipitation type. As the evaluation, the model achieves 99.8% accuracy using Logistic Regression Classifier to classify the weather into two classes, Rain or Snow. This project was the final project of Google Developer Student Clubs Bina Nusantara University and was accomplished with a score of 94 out of 100. The source code of this project could be accessed on my GitHub.
GitHub - nadyatyandra/Final-Project-GDSC
The first step is loading the ‘weatherHistory.csv’ dataset using Pandas library.
import pandas as pd
dataset = pd.read_csv('weatherHistory.csv')
dataset
We use boxplot and bar chart to visualize the data and make it easier to analyze regarding the distribution of each feature.
import matplotlib.pyplot as plt
dataset.plot(kind = 'box', subplots = True, layout = (2, 4), sharex = False, sharey = False, figsize = (8, 8))
plt.tight_layout()
plt.show()
import seaborn as sns
sns.countplot(x = 'Precip Type', data = dataset)
plt.show()
sns.boxplot(x = 'Precip Type', y = 'Temperature (C)', data = dataset)
plt.show()
sns.boxplot(x = 'Precip Type', y = 'Apparent Temperature (C)', data = dataset)
plt.show()
sns.boxplot(x = 'Precip Type', y = 'Humidity', data = dataset)
plt.show()