Spaces:
Runtime error
Runtime error
Download app.py from AITECHPRODUCTS/deeplearning-demo: direct link, hf CLI and curl.
- Browser
- Download file 475 Bytes
-
https://huggingface.co/spaces/AITECHPRODUCTS/deeplearning-demo/resolve/main/app.py
- Command line
-
hf download hf://spaces/AITECHPRODUCTS/deeplearning-demo/app.py
-
curl -L -o app.py https://huggingface.co/spaces/AITECHPRODUCTS/deeplearning-demo/resolve/main/app.py
475 Bytes
| 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() |