Spaces:
Sleeping
Sleeping
Commit
·
e5b3900
1
Parent(s):
4548114
test
Browse files
app.py
CHANGED
@@ -6,8 +6,8 @@ import matplotlib.pyplot as plt
|
|
6 |
import io
|
7 |
|
8 |
def linear_regression(input_csv, x_column, y_column):
|
9 |
-
# Load dataset
|
10 |
-
df = pd.read_csv(input_csv)
|
11 |
|
12 |
# Prepare data for regression
|
13 |
X = df[[x_column]].values
|
@@ -42,7 +42,7 @@ def linear_regression(input_csv, x_column, y_column):
|
|
42 |
iface = gr.Interface(
|
43 |
fn=linear_regression,
|
44 |
inputs=[
|
45 |
-
gr.components.File(type="
|
46 |
gr.components.Textbox(label="X Column Name"),
|
47 |
gr.components.Textbox(label="Y Column Name"),
|
48 |
],
|
|
|
6 |
import io
|
7 |
|
8 |
def linear_regression(input_csv, x_column, y_column):
|
9 |
+
# Load dataset from binary
|
10 |
+
df = pd.read_csv(io.BytesIO(input_csv))
|
11 |
|
12 |
# Prepare data for regression
|
13 |
X = df[[x_column]].values
|
|
|
42 |
iface = gr.Interface(
|
43 |
fn=linear_regression,
|
44 |
inputs=[
|
45 |
+
gr.components.File(type="binary"),
|
46 |
gr.components.Textbox(label="X Column Name"),
|
47 |
gr.components.Textbox(label="Y Column Name"),
|
48 |
],
|