File size: 1,073 Bytes
b2e8445
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
tags:
- sklearn
- regression
- automotive
- mpg
---

# Auto MPG Predictor

This model predicts a vehicle's fuel efficiency (miles per gallon) based on its characteristics.

## Model Details

- Model type: Linear Regression
- Input features: cylinders, displacement, horsepower, weight, acceleration, model_year, origin_Japan, origin_USA
- Target: mpg (miles per gallon)

## How to Use

```python
from huggingface_hub import hf_hub_download
import joblib

# Download model and scaler
model_path = hf_hub_download(repo_id="your-username/auto-mpg-regressor", filename="auto_mpg_regressor.joblib")
scaler_path = hf_hub_download(repo_id="your-username/auto-mpg-regressor", filename="scaler.joblib")

model = joblib.load(model_path)
scaler = joblib.load(scaler_path)

# Prepare input data (same order as features in config)
import numpy as np
sample_input = np.array([[6, 225, 100, 3233, 15.4, 76, 0, 1]])  # Example input

# Preprocess
scaled_input = scaler.transform(sample_input)

# Predict
prediction = model.predict(scaled_input)
print(f"Predicted MPG: {prediction[0]}")