Update pages/1_Data_Card_and_Data_collection.py
Browse files
pages/1_Data_Card_and_Data_collection.py
CHANGED
|
@@ -51,23 +51,44 @@ if df is not None:
|
|
| 51 |
st.subheader("Dataset Shape (Rows, Columns):")
|
| 52 |
st.write(df.shape)
|
| 53 |
|
| 54 |
-
st.markdown('''
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
else:
|
| 73 |
st.info("No dataset found. Please upload a CSV file.")
|
|
|
|
| 51 |
st.subheader("Dataset Shape (Rows, Columns):")
|
| 52 |
st.write(df.shape)
|
| 53 |
|
| 54 |
+
st.markdown('''**Dataset :**
|
| 55 |
+
|
| 56 |
+
| **Feature** | **Description** | **Example** |
|
| 57 |
+
|-------------------------|--------------------------------------------------------------------|------------------------------|
|
| 58 |
+
| **ProductID** | Unique identifier for each product. | 12345 |
|
| 59 |
+
| **ProductCategory** | Category of the consumer electronics product. | Smartphones, Laptops |
|
| 60 |
+
| **ProductBrand** | Brand of the product. | Apple, Samsung |
|
| 61 |
+
| **ProductPrice** | Price of the product (in dollars). | 999.99 |
|
| 62 |
+
| **CustomerAge** | Age of the customer. | 35 |
|
| 63 |
+
| **CustomerGender** | Gender of the customer (0 - Male, 1 - Female). | 1 |
|
| 64 |
+
| **PurchaseFrequency** | Average number of purchases per year. | 3 |
|
| 65 |
+
| **CustomerSatisfaction** | Customer satisfaction rating (1 - 5). | 4 |
|
| 66 |
+
| **PurchaseIntent** | Target variable: Intent to purchase (classification target). | 0 (No), 1 (Yes) |
|
| 67 |
+
''')
|
| 68 |
+
|
| 69 |
+
st.markdown("### Import Necessary Libraries:")
|
| 70 |
+
st.code("""
|
| 71 |
+
import numpy as np
|
| 72 |
+
import pandas as pd
|
| 73 |
+
import matplotlib.pyplot as plt
|
| 74 |
+
import seaborn as sns
|
| 75 |
+
import plotly.express as px
|
| 76 |
+
import warnings
|
| 77 |
+
warnings.filterwarnings('ignore')
|
| 78 |
+
|
| 79 |
+
from sklearn.linear_model import LogisticRegression
|
| 80 |
+
from sklearn.neighbors import KNeighborsClassifier
|
| 81 |
+
from sklearn.model_selection import train_test_split, cross_val_score
|
| 82 |
+
from sklearn.preprocessing import StandardScaler, LabelEncoder
|
| 83 |
+
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix, log_loss
|
| 84 |
+
|
| 85 |
+
import optuna
|
| 86 |
+
import imblearn
|
| 87 |
+
from imblearn.under_sampling import RandomUnderSampler
|
| 88 |
+
from imblearn.over_sampling import RandomOverSampler, SMOTE
|
| 89 |
+
|
| 90 |
+
import pickle
|
| 91 |
+
""", language="python")
|
| 92 |
|
| 93 |
else:
|
| 94 |
st.info("No dataset found. Please upload a CSV file.")
|