Spaces:
Sleeping
Sleeping
Syauqi Nabil Tasri commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,38 +2,13 @@ import streamlit as st
|
|
| 2 |
import pandas as pd
|
| 3 |
import pickle
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
| 7 |
-
# # Use your Hugging Face token
|
| 8 |
-
# login(token="hf_XmkhAdKiaTYaQbgMoGTYRqBFDFVAjvbTI")
|
| 9 |
-
|
| 10 |
-
|
| 11 |
model = pickle.load(open('model (9).pkl', 'rb'))
|
| 12 |
|
| 13 |
-
# from huggingface_hub import create_repo
|
| 14 |
-
|
| 15 |
-
# # Replace 'your_model_name' with the name you want for your model
|
| 16 |
-
# repo_url = create_repo(name='Almond Classification', private=False)
|
| 17 |
-
|
| 18 |
st.title('Almond Classification')
|
| 19 |
st.write('This web app classifies almonds based on your input features.')
|
| 20 |
|
| 21 |
-
|
| 22 |
-
# # Input untuk setiap fitur
|
| 23 |
-
# length_major_axis = st.number_input('Length (major axis)', min_value=269.356903, max_value=279.879883)
|
| 24 |
-
# width_minor_axis = st.number_input('Width (minor axis)', min_value=176.023636, max_value=227.940628)
|
| 25 |
-
# thickness_depth = st.number_input('Thickness (depth)', min_value=0.0, max_value=279.879883)
|
| 26 |
-
# area = st.number_input('Area', min_value=0.0, max_value=279.879883)
|
| 27 |
-
# perimeter = st.number_input('Perimeter', min_value=0.0, max_value=279.879883)
|
| 28 |
-
# roundness = st.slider('Roundness', min_value=0.0, max_value=1.0, step=0.01)
|
| 29 |
-
# solidity = st.slider('Solidity', min_value=0.0, max_value=1.0, step=0.01)
|
| 30 |
-
# compactness = st.slider('Compactness', min_value=0.0, max_value=1.0, step=0.01)
|
| 31 |
-
# aspect_ratio = st.slider('Aspect Ratio', min_value=0.0, max_value=5.0, step=0.01)
|
| 32 |
-
# eccentricity = st.slider('Eccentricity', min_value=0.0, max_value=1.0, step=0.01)
|
| 33 |
-
# extent = st.slider('Extent', min_value=0.0, max_value=1.0, step=0.01)
|
| 34 |
-
# convex_area = st.number_input('Convex hull (convex area)', min_value=0.0, step=0.01)
|
| 35 |
-
|
| 36 |
-
|
| 37 |
length_major_axis = st.number_input('Length (major axis)', min_value=269.356903, max_value=279.879883)
|
| 38 |
width_minor_axis = st.number_input('Width (minor axis)', min_value=176.023636, max_value=227.940628)
|
| 39 |
thickness_depth = st.number_input('Thickness (depth)', min_value=107.253448, max_value=127.795132)
|
|
@@ -47,7 +22,6 @@ eccentricity = st.slider('Eccentricity', min_value=0.75693, max_value=0.81012, s
|
|
| 47 |
extent = st.slider('Extent', min_value=0.656535, max_value=0.725739, step=0.01)
|
| 48 |
convex_area = st.number_input('Convex hull (convex area)', min_value=18068.0, max_value=36683.0, step=0.01)
|
| 49 |
|
| 50 |
-
|
| 51 |
# Tombol untuk memprediksi
|
| 52 |
if st.button('Predict'):
|
| 53 |
input_features = [[length_major_axis, width_minor_axis, thickness_depth, area,
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import pickle
|
| 4 |
|
| 5 |
+
# Load the fitted model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
model = pickle.load(open('model (9).pkl', 'rb'))
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
st.title('Almond Classification')
|
| 9 |
st.write('This web app classifies almonds based on your input features.')
|
| 10 |
|
| 11 |
+
# Input untuk setiap fitur
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
length_major_axis = st.number_input('Length (major axis)', min_value=269.356903, max_value=279.879883)
|
| 13 |
width_minor_axis = st.number_input('Width (minor axis)', min_value=176.023636, max_value=227.940628)
|
| 14 |
thickness_depth = st.number_input('Thickness (depth)', min_value=107.253448, max_value=127.795132)
|
|
|
|
| 22 |
extent = st.slider('Extent', min_value=0.656535, max_value=0.725739, step=0.01)
|
| 23 |
convex_area = st.number_input('Convex hull (convex area)', min_value=18068.0, max_value=36683.0, step=0.01)
|
| 24 |
|
|
|
|
| 25 |
# Tombol untuk memprediksi
|
| 26 |
if st.button('Predict'):
|
| 27 |
input_features = [[length_major_axis, width_minor_axis, thickness_depth, area,
|