Spaces:
Runtime error
Runtime error
Upload 7 files
Browse filesFiles changed (7)
- DockerfileAdded+7
- ProcfileAdded+1
- Readme.mdAdded+53
- app.pyAdded+67
- best_model.pklAdded+3
- requirements.txtAdded+4
- setup.shAdded+11
1234567FROM python:3.9WORKDIR /codeCOPY . .RUN pip install --upgrade pipRUN pip install -r requirements.txtEXPOSE $PORTCMD streamlit run app.py --server.port $PORT --server.address 0.0.0.01web: streamlit run app.py --server.port $PORT --server.headless true1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253# Streamlit_EDA
Problem Statement : It is very tedious process to check each dataset for missing values and perform an initial exploratory data analysis, and generate a baseline model.
Solution : Created an AUTOML website, that is a one place solution.
How it works :
1. Upload the csv file that you have to work with which contains the Independent variables and dependent variable. 2. In the next section we can visualize the data, and drop columns if needed. And then once perform EDA is clicked it provides the results from pandas_profiling 1. Overview: - Number of variables - Number of observations - Total missing cells - Missing cells per variable - Duplicate rows - Duplicate rows per variable 2. Variables: - Variable type (categorical, numerical, date, etc.) - Distinct count - Missing values - Count of unique values - Most frequent values - Frequency of the most frequent value - Histogram for numerical variables - Common values for categorical variables 3. Quantiles, Deciles, and Percentiles: - Summary statistics including mean, median, and standard deviation 4. Correlations: - Correlation matrix for numerical variables - Heatmap of the correlation matrix 5. Sample: - A sample of rows from the dataset 6. Missing Values: - Matrix of missing values 7. Text Analysis: - Word cloud for text columns - Character and word distribution for text columns 8. Interactions: - Scatterplot matrix for numerical variables - Correlation plot 9. File and Data Information: - File information (size, creation date) - Data information (number of variables, observations, memory usage) 10. Warnings: - A section for warnings, such as high cardinality, constant variables, etc. 3. In Modelling page the columns are show that do not have missing values, from these you can choose target variable. 4. The best model can be downloade.
site : https://eda-data-9d79aa8caa61.herokuapp.com/12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667from operator import indeximport streamlit as st#import plotly.express as pxfrom pycaret.classification import setup, compare_models, pull, save_model, load_modelfrom ydata_profiling import ProfileReport
import pandas as pdfrom streamlit_pandas_profiling import st_profile_reportimport os
with st.sidebar: st.image('img/side.jpeg') st.title('AutoStreamML') choice = st.radio("Navigation", ["Upload", "Profiling", "Modelling", "Download"]) st.info("This application allows you to build an automted ML pipeline using streamlit, pandas profiling and PyCaret.")
if os.path.exists("sourcedata.csv") and choice == "Upload": st.session_state.df = pd.read_csv("sourcedata.csv", index_col=None)
if choice == "Upload": st.title("Upload your data for modelling") file = st.file_uploader("Upload your dataset") if file: st.session_state.df = pd.read_csv(file, index_col=None) st.dataframe(st.session_state.df) if st.button("Save"): st.session_state.df.to_csv("sourcedata.csv", index=None)
if choice == "Profiling": st.title("Automated Exploratory Data Analysis") selected_columns = st.multiselect("Select columns to drop", st.session_state.df.columns) st.dataframe(st.session_state.df) # Add a button to drop selected columns if st.button("Drop Columns"): if selected_columns: st.session_state.df.drop(columns=selected_columns, inplace=True) st.dataframe(st.session_state.df) if st.button("Save"): st.session_state.df.to_csv("sourcedata.csv", index=None) if st.button("Perform EDA"): # Add code to remove timestamps and then do the profile report profile_df = ProfileReport(st.session_state.df, title="EDA") st_profile_report(profile_df)
if choice == "Modelling": columns_without_missing_values = [col for col in st.session_state.df.columns if st.session_state.df[col].count() == len(st.session_state.df)]
target = st.selectbox("Select Your Target", columns_without_missing_values) if st.button('Run Modelling'): # Mention to user if the missing value is present instead of throwing error setup(st.session_state.df, target=target) setup_df = pull() st.info("This is the ML Experiment Settings") st.dataframe(setup_df) best_model = compare_models() compare_df = pull() st.dataframe(compare_df) save_model(best_model, 'best_model')
if choice == "Download": with open("best_model.pkl", "rb") as f: st.download_button("Download the file", f, "best_model.pkl")123version https://git-lfs.github.com/spec/v1oid sha256:933b3183cfbbe0ce115337a6dcd6d0913b72f0aa1d268313bfb3935f55392265size 2375491234streamlit_pandas_profilingydata_profilingstreamlitpycaret1234567891011mkdir -p ~/.streamlit/echo "\[general]\n\email = \"your-email@domain.com\"\n\" > ~/.streamlit/credentials.tomlecho "\[server]\n\headless = true\n\enableCORS=false\n\port = $PORT\n\" > ~/.streamlit/config.tomlDockerfileAdded+7
ProcfileAdded+1
Readme.mdAdded+53
app.pyAdded+67
best_model.pklAdded+3
requirements.txtAdded+4
setup.shAdded+11