Spaces:
Build error
Build error
Download eda.py from grcvlrn/Price_Prediction_Deployment: direct link, hf CLI and curl.
- Browser
- Download file 5.45 kB
-
https://huggingface.co/spaces/grcvlrn/Price_Prediction_Deployment/resolve/main/eda.py
- Command line
-
hf download hf://spaces/grcvlrn/Price_Prediction_Deployment/eda.py
-
curl -L -o eda.py https://huggingface.co/spaces/grcvlrn/Price_Prediction_Deployment/resolve/main/eda.py
5.45 kB
| import streamlit as st | |
| import pandas as pd | |
| from PIL import Image | |
| def load_data(): | |
| return pd.read_csv('kc_house_data.csv') | |
| # # Show first 5 rows of the dataset | |
| # st.table(df.head(5)) | |
| def run(): | |
| # Title caption | |
| st.title('Welcome to Exploratory Data Analysis') | |
| # Correlation Plot | |
| st.title('Correlation Plot') | |
| image = Image.open('eda1.png') | |
| st.image(image, caption='Correlation Plot') | |
| # Show Insights | |
| with st.expander('Insights:'): | |
| st.caption('The plot shows the relationship between columns. Based on what we see, some of the columns like sqft_above, sqft_living15, sqft_basement, and sqft_living seems to be somewhat related linearly. The other columns also looks correlated, but not clear in what way. We will see the correlation coefficient to see which columns we are going to use for the model at a later time.') | |
| # Year of Houses Built | |
| st.title('Year of Houses Built') | |
| image = Image.open('eda2.png') | |
| st.image(image, caption='Year of Houses Built') | |
| # Show Insights | |
| with st.expander('Insights:'): | |
| st.caption('Based on the graph, we see that the houses that are sold are built from 1900s to 2010s. The graph peaked at the year 2000s and 2010s. This means that most people prefer recently built houses compare to older buildings. Business could acquire land to develop it and sell it within short range of time. This recently built building will be leveraged for an optimalized income. Buyers would be more interested in newly developed houses and business team could take advantage of this information to allocate funds for marketing this.') | |
| # Living Room Land | |
| st.title('Living Room Area') | |
| image = Image.open('eda3.png') | |
| st.image(image, caption='Living Room Area') | |
| # Show Insights | |
| with st.expander('Insights:'): | |
| st.caption('Based on the data that we see, the majority of houses fall within the 1,000 to 3,000 square feet range of living room, with the peak frequency around 2,000 square feet. This shows that most of the houses that are in demand are houses within 2000 square feet in living room. Businesses could focus in selling medium-sized homes. Since what we see that the graph is more skewed to the left, we can say that there are more opportunies in selling the small-sized homes compared to large-sized homes. ') | |
| # Houses View | |
| st.title('Houses View') | |
| image = Image.open('eda4.png') | |
| st.image(image, caption='Houses View') | |
| # Show Insights | |
| with st.expander('Insights:'): | |
| st.caption("Based on the chart that we see, 90% of the houses sales, which are the majority have no views. This greatly shows that most people doesn't seem to care if the house have a great view or not, but rather in the functionality of the house. Business should focus in marketing houses by funtionality rather than aesthetics. Yes, aesthetically pleasing and strategic location can be plus point in sales, but we need to cater sles to customers preference rather than our own.") | |
| # Bathrooms in Houses | |
| st.title('Bathrooms in Houses') | |
| image = Image.open('eda5.png') | |
| st.image(image, caption='Bathrooms in Houses') | |
| # Show Insights | |
| with st.expander('Insights:'): | |
| st.caption("Based on the chart shown, the majority of the sales which is 25% of the houses have 2.5 bathrooms. There are 18% of the houses with 1 bathroom, 14% of the sales houses with 1.75 bathrooms, and 9% of sales of houses with 2 bathrooms. This states that people often bought houses with 1 to 2.5 bathrooms. Which means, business can take another step in marketing houses with less than 3 bathrooms. The won't have to hesitate allocating resources to pursue specific marketing strategy. Though, business could also improve niche in selling houses with more than 2 bathroom, but with limited stock.") | |
| # Floors in Houses | |
| st.title('Floors in Houses') | |
| image = Image.open('eda6.png') | |
| st.image(image, caption='Floors in Houses') | |
| # Show Insights | |
| with st.expander('Insights:'): | |
| st.caption('Based on the chart that we see, 49% of the houses have 1 floor only, 38% of the houses that are sold have 2 floors, 9% of the houses have 1 and a half floor. Based on this data, we know that most people chooses houses with 1 - 2 floors. Therefore, businesses can allocate resources more effectively by focusing on single and two-floor homes, where the demand is highest. Also, potentialize niche for houses with 1.5 floor and limit market on houses with more than 2 floors.') | |
| # Bedrooms in Houses | |
| st.title('Bedrooms in Houses') | |
| image = Image.open('eda7.png') | |
| st.image(image, caption='Bedrooms in Houses') | |
| # Show Insights | |
| with st.expander('Insights:'): | |
| st.caption('Based on the chart that is shown, 45% of the house sales are 3 bedroom houses, 32% of the house sales are 4 bedroom houses, 13% of the house sales are 2 bedroom houses, and 7% of the houses are 5 bedroom houses. This shows that most people are in need and/or likes 3-4 bedroom houses. With this information, business can focus their marketing, development, and sales strategies on these types of homes to cater to the majority of the market while also creating strategies to target buyers interested in larger homes. Other than that, business could manage their iventory by limiting the less in demand houses for a more optimalized business venture.') | |
| if __name__ == '__main__': | |
| run() |