# zihan-hei/nyc_housing_aanlysis architecture

> Architecture diagram of the GitHub repository zihan-hei/nyc_housing_aanlysis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zihan-hei/nyc_housing_aanlysis
- Repository: https://github.com/zihan-hei/nyc_housing_aanlysis

## Overview

##### Project type and purpose
- This is a data‐analysis/ML project implemented as a single Jupyter notebook (`NYC_Housing_Analysis.ipynb`) with a supporting README.
- Purpose: analyze rental housing data (price, size, amenities, location, pet policy) to answer specific questions via regression, classification, aggregation, and mapping.

##### File structure
- Top‐level files:
- `NYC_Housing_Analysis.ipynb` – contains all code for data loading, cleaning, modeling, and visualization
- `README.md` – describes dataset source, attributes, and analytical questions
- No separate “frontend” or “backend” directories – it’s a linear analysis pipeline in one notebook.
- No deployment or service orchestration files.

##### README for additional insights
- Data source: UCI repository CSV from scraped listings
- Analytical objectives:
a. Linear regression (price vs. square footage)
b. Classification (affordable vs. unaffordable at \$1,100 threshold)
c. Count plots (# of 2-bed/1-bath < \$1,500)
d. Geospatial mapping of affordability
e. Logistic regression on pet ownership effect
- Tech stack (implied): Python, Pandas, scikit-learn, Matplotlib/Seaborn, Folium/GeoPandas.

##### Elements
– Clear component labels (Data Source, Ingestion, Preprocessing, etc.)
- Rectangles for processing modules (preprocessing, modeling)
- Parallelograms for input/output (plots, maps)
– Annotations on edges to show data formats (CSV → DataFrame → model input)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Components
    DS["Data Source\nCSV (UCI)"]:::data
    ING["Data Ingestion & Storage\n(read_csv, DataFrame)"]:::processing
    PRE["Data Preprocessing\n(cleaning, feature engineering)"]:::processing
    MT["Model Training\n(linear & logistic regression)"]:::model
    AE["Aggregation & Exploration\n(counts, stats)"]:::processing
    VIZ["Visualization\n(Plots, Maps)"]:::viz
    OUT["Output & Reporting\n(markdown, figures)"]:::report

    %% Flow
    DS -->|"CSV"| ING
    ING -->|"DataFrame"| PRE
    PRE --> MT
    PRE --> AE
    MT -->|"Model results"| VIZ
    AE -->|"Aggregated data"| VIZ
    VIZ -->|"Charts & Maps"| OUT

    %% Click Events
    click DS "https://github.com/zihan-hei/nyc_housing_aanlysis/blob/main/NYC_Housing_Analysis.ipynb"
    click ING "https://github.com/zihan-hei/nyc_housing_aanlysis/blob/main/NYC_Housing_Analysis.ipynb"
    click PRE "https://github.com/zihan-hei/nyc_housing_aanlysis/blob/main/NYC_Housing_Analysis.ipynb"
    click MT "https://github.com/zihan-hei/nyc_housing_aanlysis/blob/main/NYC_Housing_Analysis.ipynb"
    click AE "https://github.com/zihan-hei/nyc_housing_aanlysis/blob/main/NYC_Housing_Analysis.ipynb"
    click VIZ "https://github.com/zihan-hei/nyc_housing_aanlysis/blob/main/NYC_Housing_Analysis.ipynb"
    click OUT "https://github.com/zihan-hei/nyc_housing_aanlysis/blob/main/README.md"

    %% Styles
    classDef data fill:#ffdead,stroke:#333,stroke-width:1px;
    classDef processing fill:#add8e6,stroke:#333,stroke-width:1px;
    classDef model fill:#90ee90,stroke:#333,stroke-width:1px;
    classDef viz fill:#ffb6c1,stroke:#333,stroke-width:1px;
    classDef report fill:#ffe4b5,stroke:#333,stroke-width:1px;
```
