Spaces:
Build error
Build error
Download app.py from KeynesYouDigIt/xgboostHairExperimentsOne: direct link, hf CLI and curl.
- Browser
- Download file 547 Bytes
-
https://huggingface.co/spaces/KeynesYouDigIt/xgboostHairExperimentsOne/resolve/main/app.py
- Command line
-
hf download hf://spaces/KeynesYouDigIt/xgboostHairExperimentsOne/app.py
-
curl -L -o app.py https://huggingface.co/spaces/KeynesYouDigIt/xgboostHairExperimentsOne/resolve/main/app.py
547 Bytes
| import streamlit as st | |
| import pandas as pd | |
| # from __future__ import division | |
| import numpy as np | |
| import xgboost as xgb | |
| x = st.slider("Select a value") | |
| st.write(x, "squared is", x * x) | |
| data = pd.read_csv("hf://datasets/Ammok/hair_health/predict_hair_fall.csv") | |
| # Calculate split point (70%) | |
| split_point = int(len(data) * 0.7) | |
| # Split into train and test | |
| train = data.iloc[:split_point] | |
| test = data.iloc[split_point:] | |
| # If you need numpy arrays instead of dataframes | |
| train_np = train.to_numpy() | |
| test_np = test.to_numpy() | |
| st.dataframe(data) | |