# Import necessary libraries
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
# Generate some sample data
X = np.random.rand(100, 5)
y = 2*X[:,0] + 3*X[:,1] - 4*X[:,2] + np.random.randn(100)*0.5
# Create a pipeline with scaling and linear regression
pipeline = Pipeline([
    ('scaler', StandardScaler()),
    ('regressor', LinearRegression())])
# Fit the pipeline to the data
pipeline.fit(X, y) 

import joblib
# Save the model to a file
joblib.dump(pipeline, 'model.joblib')
# Load the model from the file
pipeline = joblib.load('model.joblib')
X_testpred = np.random.rand(5)
y_testpred = pipeline.predict([X_testpred])
print("Predicted value:",y_testpred)