Temesvári Csanád commited on
Commit
ba2ab2f
1 Parent(s): a6e15b1

updated app and removed unused functions

Browse files
Files changed (3) hide show
  1. app.py +3 -2
  2. functions.py +0 -8
  3. requirements.txt +2 -1
app.py CHANGED
@@ -4,15 +4,16 @@ import joblib
4
  import pandas as pd
5
  from datetime import timedelta, datetime
6
  from functions import get_weather_data_weekly, data_encoder, get_aplevel
 
7
 
8
 
9
  def fancy_header(text, font_size=24):
10
  res = f'<p style="color:#ff5f27; font-size: {font_size}px;text-align:center">{text}</p>'
11
  st.markdown(res, unsafe_allow_html=True)
12
 
13
- # TODO: set the screen to widehardo
14
  st.title('Air Quality Prediction Project 🌩')
15
- st.image("bienna.jpg", use_column_width='auto')
16
  st.write(36 * "-")
17
 
18
  st.markdown("# This is a final project in the course ID2223 Scalable Machine Learning and Deep Learning :computer:")
 
4
  import pandas as pd
5
  from datetime import timedelta, datetime
6
  from functions import get_weather_data_weekly, data_encoder, get_aplevel
7
+ from PIL import Image
8
 
9
 
10
  def fancy_header(text, font_size=24):
11
  res = f'<p style="color:#ff5f27; font-size: {font_size}px;text-align:center">{text}</p>'
12
  st.markdown(res, unsafe_allow_html=True)
13
 
14
+ vienna_image = Image.open('vienna.jpg')
15
  st.title('Air Quality Prediction Project 🌩')
16
+ st.image(vienna_image, use_column_width='auto')
17
  st.write(36 * "-")
18
 
19
  st.markdown("# This is a final project in the course ID2223 Scalable Machine Learning and Deep Learning :computer:")
functions.py CHANGED
@@ -163,14 +163,6 @@ def data_encoder(X):
163
  X['conditions'] = OrdinalEncoder().fit_transform(X[['conditions']])
164
  return X
165
 
166
- def transform(df):
167
- df.loc[df["windgust"].isna(),'windgust'] = df['windspeed']
168
- df['snow'].fillna(0,inplace=True)
169
- df['snowdepth'].fillna(0, inplace=True)
170
- df['pressure'].fillna(df['pressure'].mean(), inplace=True)
171
- return df
172
-
173
-
174
  def get_aplevel(temps:np.ndarray) -> list:
175
  boundary_list = np.array([0, 50, 100, 150, 200, 300]) # assert temps.shape == [x, 1]
176
  redf = np.logical_not(temps<=boundary_list) # temps.shape[0] x boundary_list.shape[0] ndarray
 
163
  X['conditions'] = OrdinalEncoder().fit_transform(X[['conditions']])
164
  return X
165
 
 
 
 
 
 
 
 
 
166
  def get_aplevel(temps:np.ndarray) -> list:
167
  boundary_list = np.array([0, 50, 100, 150, 200, 300]) # assert temps.shape == [x, 1]
168
  redf = np.logical_not(temps<=boundary_list) # temps.shape[0] x boundary_list.shape[0] ndarray
requirements.txt CHANGED
@@ -4,4 +4,5 @@ numpy
4
  joblib
5
  python-dotenv
6
  xgboost
7
- optuna
 
 
4
  joblib
5
  python-dotenv
6
  xgboost
7
+ optuna
8
+ Pillow