Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -84,20 +84,13 @@ class IrisPredictor:
|
|
| 84 |
labels={'x': 'Features', 'y': 'Importance'})
|
| 85 |
return fig
|
| 86 |
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
# Make prediction
|
| 96 |
-
prediction = model.predict(scaled_features)
|
| 97 |
-
probabilities = model.predict_proba(scaled_features)
|
| 98 |
-
|
| 99 |
-
return prediction[0], probabilities[0]
|
| 100 |
-
|
| 101 |
|
| 102 |
def main():
|
| 103 |
st.title("🌸 Iris Flower Prediction App")
|
|
|
|
| 84 |
labels={'x': 'Features', 'y': 'Importance'})
|
| 85 |
return fig
|
| 86 |
|
| 87 |
+
def predict_single_sample(self, model, features):
|
| 88 |
+
# Scale features
|
| 89 |
+
scaled_features = self.scaler.transform([features])
|
| 90 |
+
# Make prediction
|
| 91 |
+
prediction = model.predict(scaled_features)
|
| 92 |
+
probabilities = model.predict_proba(scaled_features)
|
| 93 |
+
return prediction[0], probabilities[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
def main():
|
| 96 |
st.title("🌸 Iris Flower Prediction App")
|