Spaces:
Sleeping
Sleeping
| 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() |