The following labeled data is given: x={10.9, 12.4, 13.5, 14.6, 14.8, 16.5, 19.4} and y={24.8, 30.0, 31.0, 29.3, 35.9, 39.6, 40.7}.

perform linear and ridge regression.

I used the following code:

using DataFrames, CSV

using PyPlot

using Plots

using GLM

x = [10.9, 12.4, 13.5, 14.6, 14.8, 16.5, 19.4] #x-values

y = [24.8, 30.0, 31.0, 29.3, 35.9, 39.6, 40.7] #Y-values

num_tr_ex = length(y); #96

data = DataFrame(X=x, Y=y)

linearRegressor = lm(@formula(Y ~ X), data)

println(linearRegressor)

linearFit = predict(linearRegressor)

(plot!(x, linearFit,))

display(scatter!(x, y))

I have no idea how to get started with Ridge Regression.