Spaces:
Sleeping
Sleeping
added images
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import numpy as np
|
|
| 3 |
import pandas as pd
|
| 4 |
from sklearn.model_selection import train_test_split
|
| 5 |
from sklearn.neighbors import KNeighborsClassifier
|
|
|
|
| 6 |
def train_iris_model():
|
| 7 |
df = pd.read_csv("Iris.csv")
|
| 8 |
df['Species'] = df['Species'].map({'Iris-setosa': 0, 'Iris-virginica': 1, 'Iris-versicolor': 2})
|
|
@@ -50,5 +51,13 @@ def main():
|
|
| 50 |
st.subheader("Prediction:")
|
| 51 |
st.success(f"Predicted Species: {predicted_species}")
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
if __name__ == "__main__":
|
| 54 |
main()
|
|
|
|
| 3 |
import pandas as pd
|
| 4 |
from sklearn.model_selection import train_test_split
|
| 5 |
from sklearn.neighbors import KNeighborsClassifier
|
| 6 |
+
|
| 7 |
def train_iris_model():
|
| 8 |
df = pd.read_csv("Iris.csv")
|
| 9 |
df['Species'] = df['Species'].map({'Iris-setosa': 0, 'Iris-virginica': 1, 'Iris-versicolor': 2})
|
|
|
|
| 51 |
st.subheader("Prediction:")
|
| 52 |
st.success(f"Predicted Species: {predicted_species}")
|
| 53 |
|
| 54 |
+
# Display relevant images based on prediction
|
| 55 |
+
if predicted_species == 'Iris-setosa':
|
| 56 |
+
st.image('setosa_image.jpg', caption='Iris-setosa', use_column_width=True)
|
| 57 |
+
elif predicted_species == 'Iris-virginica':
|
| 58 |
+
st.image('virginica_image.jpg', caption='Iris-virginica', use_column_width=True)
|
| 59 |
+
elif predicted_species == 'Iris-versicolor':
|
| 60 |
+
st.image('versicolor_image.jpg', caption='Iris-versicolor', use_column_width=True)
|
| 61 |
+
|
| 62 |
if __name__ == "__main__":
|
| 63 |
main()
|