Spaces:
Sleeping
Sleeping
Download backend/test_sklearn.py from Afnaan04/Car_vs_Bike_Classification: direct link, hf CLI and curl.
- Browser
- Download file 400 Bytes
-
https://huggingface.co/spaces/Afnaan04/Car_vs_Bike_Classification/resolve/main/backend/test_sklearn.py
- Command line
-
hf download hf://spaces/Afnaan04/Car_vs_Bike_Classification/backend/test_sklearn.py
-
curl -L -o test_sklearn.py https://huggingface.co/spaces/Afnaan04/Car_vs_Bike_Classification/resolve/main/backend/test_sklearn.py
400 Bytes
| try: | |
| from sklearn.ensemble import RandomForestClassifier | |
| import joblib | |
| import numpy as np | |
| X = np.array([[0, 0], [1, 1]]) | |
| y = np.array([0, 1]) | |
| clf = RandomForestClassifier(n_estimators=10) | |
| clf.fit(X, y) | |
| print("Scikit-learn runs successfully!") | |
| except ImportError as e: | |
| print(f"Import failed: {e}") | |
| except Exception as e: | |
| print(f"Error: {e}") | |