# 🔧 Project: Predict Titanic Survivors using Microsoft Fabric

### 🚀 Project Overview

In this beginner-friendly machine learning project, we're using **Microsoft Fabric** to analyze the Titanic passenger dataset and build a predictive model that determines whether a passenger survived the disaster.

We’ll go step-by-step using **Lakehouse**, **Notebooks**, and **PySpark (Python)** — all inside Microsoft Fabric’s unified data platform.

### ✅ **Lakehouse**

A **Lakehouse in Azure Fabric** gives you a **single platform** to store, process, and analyze **both raw and structured data**, making it ideal for **modern data science and analytics projects**.

### ✅ Traditional Approach (Before Lakehouse)

| 🔹 Data Lake | 🔹 Data Warehouse |
| --- | --- |
| Stores raw, unstructured data | Stores cleaned, structured data |
| Cheap, flexible, scalable | Optimized for fast queries (BI) |
| Used by data scientists/engineers | Used by analysts and BI teams |
| Examples: Azure Data Lake Gen2 | Examples: Azure Synapse SQL pool |

➡️ **Problem**: These were separate systems. You had to **move data** from the lake to the warehouse for reporting, which caused duplication, delay, and complexity.

### ✅ Unified Storage in Microsoft Fabric (Lakehouse)

Now with **OneLake** in Microsoft Fabric:

* **You store all your data in one place** — no need to move between lake and warehouse.
    
* The **same data** can be:
    
    * Accessed as files (`CSV`, `Parquet`) → for ML/AI
        
    * Queried as structured **tables** → for Power BI/SQL
        

### 🧠 Example:

Imagine you upload `titanic.csv` to the **Lakehouse**:

* In **Files**: It exists as a raw file **(data lake style)**
    
* When you **Load to Table**: It becomes a structured table **(warehouse style)**
    
* Power BI, SQL, and notebooks **all use the same storage location** **(OneLake)**
    

### **Files**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1753199349660/2f463967-219b-4812-8567-9f95749a12cd.png align="center")

### Tables

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1753199474823/750b96bb-e202-41e7-9aae-c750b990085b.png align="center")

### 🔄 Summary:

> “Unified storage” means you don’t need separate systems for storage (lake) and analytics (warehouse). With **OneLake**, your data serves both **data science** and **business intelligence** directly — faster, simpler, and cheaper.

1. ### **Create a new Lakehouse**
    

* Go to **My Workspace**
    
* Click **\+ New item → Lakehouse**
    
* Name it `Titanic_Lakehouse`
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1753200388606/7d3bcab1-d811-478c-8a09-61d50d678b76.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1753200533208/4a1c293b-70fa-4581-a099-c4907494e0d1.png align="center")

2. ### **Upload the dataset**
    

* Download `titanic.csv` from GitHub link  
    [https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv](https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv)
    
* In your Lakehouse, go to the **Files** tab
    
* Click **Upload** and select `titanic.csv`
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1753200957925/4e5bb110-6747-46fd-afce-40d55cd3b0ba.png align="center")

3. ### **Convert the file into a structured table**
    

* After the file uploads, right-click on `titanic.csv`
    
* Choose **Load to Tables → New table**
    
* Name the new table `titanic` and click **Load**
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1753199870942/d24d3185-f077-4acd-a781-232100b6b047.png align="center")

4. ### **Open a Notebook**
    

* At the top menu, click **Open notebook → New notebook**
    
* Make sure the notebook is attached to `Titanic_Lakehouse`
    
* **Read the dataset using PySpark**
    
    * Run this code:
        
        ```plaintext
        df = spark.read.table('titanic')
        display(df.limit(5))
        ```
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1753202239086/678ac0dc-8cd3-4be2-9b10-3581c0378248.png align="center")
        
* **Print Schema**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1753202435685/793d1caa-8ab7-43c7-b4b5-96f57e6c16dc.png align="center")
    
      
    EndFragment
