Downloads · 30 days
0
shayanmalik09/auto-mpg-regression-model
auto-mpg-regression-model is a machine learning model from shayanmalik09. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for sklearn.
This model predicts a vehicle's fuel efficiency (miles per gallon) based on its characteristics.
Downloads · 30 days
0
Access
Public
Updated Apr 13, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 53%
From the Hugging Face model README
This model predicts a vehicle's fuel efficiency (miles per gallon) based on its characteristics.
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]}")