Spaces:
Sleeping
Sleeping
Update Script.py
Browse files
Script.py
CHANGED
|
@@ -1,30 +1,30 @@
|
|
| 1 |
-
import pandas as pd
|
| 2 |
-
import numpy as np
|
| 3 |
-
#from matplotlib import pyplot as plt
|
| 4 |
-
#import seaborn as sns
|
| 5 |
-
import sklearn
|
| 6 |
-
from sklearn.preprocessing import RobustScaler, StandardScaler, OneHotEncoder, OrdinalEncoder, PowerTransformer
|
| 7 |
-
from sklearn.compose import ColumnTransformer
|
| 8 |
-
from sklearn.pipeline import Pipeline
|
| 9 |
-
from sklearn.model_selection import train_test_split
|
| 10 |
-
from sklearn.linear_model import LinearRegression
|
| 11 |
-
import pickle
|
| 12 |
-
import streamlit as st
|
| 13 |
-
|
| 14 |
-
st.image("https://www.innomatics.in/wp-content/uploads/2023/01/Innomatics-Logo1.png")
|
| 15 |
-
st.title("Diamond Price Prediction")
|
| 16 |
-
|
| 17 |
-
carat = st.number_input("Enter the carat value")
|
| 18 |
-
cut = st.text_input("Enter the cut of the diamond")
|
| 19 |
-
color = st.text_input("Enter the color code of the diamond")
|
| 20 |
-
clarity = st.text_input("Enter the clarity code")
|
| 21 |
-
depth = st.number_input("Enter the depth of the diamond")
|
| 22 |
-
table = st.number_input("Enter the table value")
|
| 23 |
-
x = st.number_input("Enter the length of diamond")
|
| 24 |
-
y = st.number_input("Enter the width of the diamond")
|
| 25 |
-
z = st.number_input("Enter the z of the diamond")
|
| 26 |
-
|
| 27 |
-
model_1 = pickle.load(open(r"
|
| 28 |
-
if st.button("Submit"):
|
| 29 |
-
result = model_1.predict([[carat,cut,color,clarity,depth,table,x,y,z]])
|
| 30 |
st.write(f"The predicted price of the diamond is {result}")
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import numpy as np
|
| 3 |
+
#from matplotlib import pyplot as plt
|
| 4 |
+
#import seaborn as sns
|
| 5 |
+
import sklearn
|
| 6 |
+
from sklearn.preprocessing import RobustScaler, StandardScaler, OneHotEncoder, OrdinalEncoder, PowerTransformer
|
| 7 |
+
from sklearn.compose import ColumnTransformer
|
| 8 |
+
from sklearn.pipeline import Pipeline
|
| 9 |
+
from sklearn.model_selection import train_test_split
|
| 10 |
+
from sklearn.linear_model import LinearRegression
|
| 11 |
+
import pickle
|
| 12 |
+
import streamlit as st
|
| 13 |
+
|
| 14 |
+
st.image("https://www.innomatics.in/wp-content/uploads/2023/01/Innomatics-Logo1.png")
|
| 15 |
+
st.title("Diamond Price Prediction")
|
| 16 |
+
|
| 17 |
+
carat = st.number_input("Enter the carat value")
|
| 18 |
+
cut = st.text_input("Enter the cut of the diamond")
|
| 19 |
+
color = st.text_input("Enter the color code of the diamond")
|
| 20 |
+
clarity = st.text_input("Enter the clarity code")
|
| 21 |
+
depth = st.number_input("Enter the depth of the diamond")
|
| 22 |
+
table = st.number_input("Enter the table value")
|
| 23 |
+
x = st.number_input("Enter the length of diamond")
|
| 24 |
+
y = st.number_input("Enter the width of the diamond")
|
| 25 |
+
z = st.number_input("Enter the z of the diamond")
|
| 26 |
+
|
| 27 |
+
model_1 = pickle.load(open(r"estimator1.pkl","rb")) #pickle file path
|
| 28 |
+
if st.button("Submit"):
|
| 29 |
+
result = model_1.predict([[carat,cut,color,clarity,depth,table,x,y,z]])
|
| 30 |
st.write(f"The predicted price of the diamond is {result}")
|