Update pages/2_Data_CLeaning_and_Preprocessing.py
Browse files
pages/2_Data_CLeaning_and_Preprocessing.py
CHANGED
|
@@ -31,6 +31,30 @@ if df is not None:
|
|
| 31 |
st.subheader("Shape of the Dataset:")
|
| 32 |
st.write(df.shape)
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
# Visualize Numeric Data (Histograms and Boxplots in subplots)
|
| 35 |
numeric_columns = df.select_dtypes(include=['float64', 'int64']).columns
|
| 36 |
if len(numeric_columns) > 0:
|
|
|
|
| 31 |
st.subheader("Shape of the Dataset:")
|
| 32 |
st.write(df.shape)
|
| 33 |
|
| 34 |
+
st.markdown("### Import Necessary Libraries:")
|
| 35 |
+
st.code("""
|
| 36 |
+
import numpy as np
|
| 37 |
+
import pandas as pd
|
| 38 |
+
import matplotlib.pyplot as plt
|
| 39 |
+
import seaborn as sns
|
| 40 |
+
import plotly.express as px
|
| 41 |
+
import warnings
|
| 42 |
+
warnings.filterwarnings('ignore')
|
| 43 |
+
|
| 44 |
+
from sklearn.linear_model import LogisticRegression
|
| 45 |
+
from sklearn.neighbors import KNeighborsClassifier
|
| 46 |
+
from sklearn.model_selection import train_test_split, cross_val_score
|
| 47 |
+
from sklearn.preprocessing import StandardScaler, LabelEncoder
|
| 48 |
+
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix, log_loss
|
| 49 |
+
|
| 50 |
+
import optuna
|
| 51 |
+
import imblearn
|
| 52 |
+
from imblearn.under_sampling import RandomUnderSampler
|
| 53 |
+
from imblearn.over_sampling import RandomOverSampler, SMOTE
|
| 54 |
+
|
| 55 |
+
import pickle
|
| 56 |
+
""", language="python")
|
| 57 |
+
|
| 58 |
# Visualize Numeric Data (Histograms and Boxplots in subplots)
|
| 59 |
numeric_columns = df.select_dtypes(include=['float64', 'int64']).columns
|
| 60 |
if len(numeric_columns) > 0:
|