image_output_1.png
from sklearn.linear_model import LassoCV, RidgeCV, LinearRegression

from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score

from sklearn.model_selection import train_test_split, RepeatedKFold

import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

df = pd.read_csv('/kaggle/input/boston-housing-dataset/HousingData.csv')

df.isnull().sum()

df.isnull().sum()

def model(model, x_train, y_train, x_test, y_test):
    mod = model
    mod_fit = mod.fit(x_train, y_train)
    y_pred = mod_fit.predict(x_test)
    df_model = pd.DataFrame({'Test': y_test, 'Predict': y_pred})

model(LassoCV(alphas=np.arange(0, 1, 0.01), cv=RepeatedKFold(n_splits=10, n_repeats=3, random_state=1), n_jobs=-1), X_train, y_train, X_test, y_test)