Initial changes to the features dataframe
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import joblib
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
import xgboost
|
| 5 |
# from sklearn.ensemble import GradientBoostingClassifier
|
|
@@ -90,6 +91,18 @@ if uploaded_file is not None:
|
|
| 90 |
features = feature_extraction.scale(features_list)
|
| 91 |
|
| 92 |
# st.write(features)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
# Reshape the features to match the expected shape for prediction
|
| 94 |
reshaped_features = features.reshape(1, -1)
|
| 95 |
if model_name == "XGB - (Multi Label)":
|
|
@@ -135,5 +148,4 @@ if uploaded_file is not None:
|
|
| 135 |
st.write("No genre predicted above the threshold.")
|
| 136 |
else:
|
| 137 |
predicted_label = model.predict(features)[0]
|
| 138 |
-
st.write(f"Predicted Genre: {predicted_label}")
|
| 139 |
st.metric("Predicted Genre:",str(predicted_label))
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import joblib
|
| 3 |
+
import pandas as pd
|
| 4 |
import numpy as np
|
| 5 |
import xgboost
|
| 6 |
# from sklearn.ensemble import GradientBoostingClassifier
|
|
|
|
| 91 |
features = feature_extraction.scale(features_list)
|
| 92 |
|
| 93 |
# st.write(features)
|
| 94 |
+
# Features Dataframe
|
| 95 |
+
df = pd.DataFrame({
|
| 96 |
+
"fname": ["Feature -1", "Feature - 2"]
|
| 97 |
+
})
|
| 98 |
+
st.dataframe(
|
| 99 |
+
df,
|
| 100 |
+
column_config={
|
| 101 |
+
"name": "Features"
|
| 102 |
+
}
|
| 103 |
+
)
|
| 104 |
+
|
| 105 |
+
|
| 106 |
# Reshape the features to match the expected shape for prediction
|
| 107 |
reshaped_features = features.reshape(1, -1)
|
| 108 |
if model_name == "XGB - (Multi Label)":
|
|
|
|
| 148 |
st.write("No genre predicted above the threshold.")
|
| 149 |
else:
|
| 150 |
predicted_label = model.predict(features)[0]
|
|
|
|
| 151 |
st.metric("Predicted Genre:",str(predicted_label))
|