Spaces:
Sleeping
Sleeping
File size: 475 Bytes
4da9055 ae74a54 4da9055 ae74a54 4da9055 ae74a54 4da9055 ae74a54 4da9055 ae74a54 4da9055 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import gradio as gr
from gradio.components import File
import pandas as pd
from sklearn.linear_model import LogisticRegression
def classify(data):
df = pd.read_csv(data)
X = df.drop('y', axis=1)
y = df['y']
model = LogisticRegression()
model.fit(X, y)
return model.predict(X)
demo = gr.Interface(fn=classify,
inputs=File(),
outputs="label")
if __name__ == "__main__":
demo.launch() |