Spaces:
Runtime error
Runtime error
Create sample.csv
Browse files- sample.csv +33 -0
sample.csv
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import numpy as np
|
3 |
+
from sklearn.preprocessing import LabelEncoder, StandardScaler
|
4 |
+
from sklearn.model_selection import train_test_split
|
5 |
+
from sklearn.linear_model import LogisticRegression, LinearRegression
|
6 |
+
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
|
7 |
+
import gradio as gr
|
8 |
+
|
9 |
+
def auto_eda(file):
|
10 |
+
# Load dataset
|
11 |
+
df = pd.read_csv(file.name)
|
12 |
+
output = []
|
13 |
+
|
14 |
+
# Show head, shape, and dtypes
|
15 |
+
output.append("📌 **First 5 Rows:**")
|
16 |
+
output.append(df.head().to_markdown())
|
17 |
+
|
18 |
+
output.append(f"\n📊 **Shape of Dataset:** {df.shape}")
|
19 |
+
output.append("\n🧾 **Data Types:**")
|
20 |
+
output.append(df.dtypes.to_markdown())
|
21 |
+
|
22 |
+
return "\n\n".join(output)
|
23 |
+
|
24 |
+
# Gradio UI
|
25 |
+
demo = gr.Interface(
|
26 |
+
fn=auto_eda,
|
27 |
+
inputs=gr.File(label="Upload CSV File"),
|
28 |
+
outputs=gr.Markdown(label="Dataset Info"),
|
29 |
+
title="📈 AutoEDA Agent - Step 1",
|
30 |
+
description="Upload your dataset to begin automatic EDA."
|
31 |
+
)
|
32 |
+
|
33 |
+
demo.launch()
|