Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- sklearn
|
| 4 |
+
- regression
|
| 5 |
+
- automotive
|
| 6 |
+
- mpg
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# Auto MPG Predictor
|
| 10 |
+
|
| 11 |
+
This model predicts a vehicle's fuel efficiency (miles per gallon) based on its characteristics.
|
| 12 |
+
|
| 13 |
+
## Model Details
|
| 14 |
+
|
| 15 |
+
- Model type: Linear Regression
|
| 16 |
+
- Input features: cylinders, displacement, horsepower, weight, acceleration, model_year, origin_Japan, origin_USA
|
| 17 |
+
- Target: mpg (miles per gallon)
|
| 18 |
+
|
| 19 |
+
## How to Use
|
| 20 |
+
|
| 21 |
+
```python
|
| 22 |
+
from huggingface_hub import hf_hub_download
|
| 23 |
+
import joblib
|
| 24 |
+
|
| 25 |
+
# Download model and scaler
|
| 26 |
+
model_path = hf_hub_download(repo_id="your-username/auto-mpg-regressor", filename="auto_mpg_regressor.joblib")
|
| 27 |
+
scaler_path = hf_hub_download(repo_id="your-username/auto-mpg-regressor", filename="scaler.joblib")
|
| 28 |
+
|
| 29 |
+
model = joblib.load(model_path)
|
| 30 |
+
scaler = joblib.load(scaler_path)
|
| 31 |
+
|
| 32 |
+
# Prepare input data (same order as features in config)
|
| 33 |
+
import numpy as np
|
| 34 |
+
sample_input = np.array([[6, 225, 100, 3233, 15.4, 76, 0, 1]]) # Example input
|
| 35 |
+
|
| 36 |
+
# Preprocess
|
| 37 |
+
scaled_input = scaler.transform(sample_input)
|
| 38 |
+
|
| 39 |
+
# Predict
|
| 40 |
+
prediction = model.predict(scaled_input)
|
| 41 |
+
print(f"Predicted MPG: {prediction[0]}")
|