Spaces:
Runtime error
Runtime error
Commit
·
eadb45e
1
Parent(s):
a21e10b
fixed onehotencoder issue
Browse files
app.py
CHANGED
|
@@ -26,6 +26,9 @@ def main():
|
|
| 26 |
<div style="background-color:pink;"><p style="color:white;font-size:75px;padding:10px">Room Occupancy Predictor 💡</p></div>
|
| 27 |
"""
|
| 28 |
st.markdown(html_temp,unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
| 29 |
def file_selector(folder_path='./dataset'):
|
| 30 |
filenames = os.listdir(folder_path)
|
| 31 |
selected_filename = st.selectbox("Select A file",filenames)
|
|
@@ -163,8 +166,7 @@ def main():
|
|
| 163 |
df.loc[:,x] = le.fit_transform(df[x])
|
| 164 |
onehotencoder = OneHotEncoder()
|
| 165 |
df.loc[:,~cats].join(pd.DataFrame(data=onehotencoder.
|
| 166 |
-
fit_transform (df.loc[:,cats]).toarray(), columns=
|
| 167 |
-
onehotencoder.get_feature_names()))
|
| 168 |
|
| 169 |
chosen_target = st.sidebar.selectbox("Please choose target column", (df.columns))
|
| 170 |
|
|
|
|
| 26 |
<div style="background-color:pink;"><p style="color:white;font-size:75px;padding:10px">Room Occupancy Predictor 💡</p></div>
|
| 27 |
"""
|
| 28 |
st.markdown(html_temp,unsafe_allow_html=True)
|
| 29 |
+
if st.button("Thanks"):
|
| 30 |
+
st.balloons()
|
| 31 |
+
|
| 32 |
def file_selector(folder_path='./dataset'):
|
| 33 |
filenames = os.listdir(folder_path)
|
| 34 |
selected_filename = st.selectbox("Select A file",filenames)
|
|
|
|
| 166 |
df.loc[:,x] = le.fit_transform(df[x])
|
| 167 |
onehotencoder = OneHotEncoder()
|
| 168 |
df.loc[:,~cats].join(pd.DataFrame(data=onehotencoder.
|
| 169 |
+
fit_transform (df.loc[:,cats]).toarray(), columns=onehotencoder.get_feature_names()))
|
|
|
|
| 170 |
|
| 171 |
chosen_target = st.sidebar.selectbox("Please choose target column", (df.columns))
|
| 172 |
|