-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
30 lines (22 loc) · 870 Bytes
/
app.py
File metadata and controls
30 lines (22 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
############################
## Lefki Meidi ##
## First HuggingFace Agent##
############################
import pandas as pd
from agent_logic import create_agent
url : str = "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv"
df = pd.read_csv(url)
print(f"Dataset successfully loaded ! {df.shape}")
agent = create_agent()
print("Agent ready !")
message = f"""
You are a data science assistant.
Here is a small preview of the dataset (first 10 rows):
{df.head(10).to_string()}
Your tasks:
1. Inspect and describe the dataset (shape, types, missing values, distributions).
2. Clean it (impute missing data, encode categorical features, normalize if needed).
3. Train a predictive model to classify the 'Survived' column.
4. Display training results and performance metrics.
"""
agent.run(message)