human
Give me a the Python program you requested given the following:
I am working on the file "Lab 7 - Implementazione di regressioni.ipynb".
The first task is:
Esercizio 1: Regressione Lineare
Si usino le slide usate a lezione. 
Confrontare i coefficienti $w$ trovati dalla vostra soluzione con quelli che trova la classe LinearRegression della libreria Scikit Learn.
Can you write Python program for it?
assistant
#Here is the Python program you requested.

class RegressioneLineare(object):
    def fit(self, x, y):
        # Build the matrix with vector (1, x) as rows
        X = np.matrix(list(map(lambda row: np.append([1], row), x)))
        # Solve the normal equation (what if X is not invertible?)
        self.w = matmul(matmul(inv(matmul(transpose(X), X)), transpose(X)), y)
                
    def predict(self, x):
        # Build the matrix with vector (1, x) as rows
        X = np.matrix(list(map(lambda row: np.append([1], row), x)))
        # Predict values        
        return matmul(transpose(X), self.w)

from sklearn.linear_model import LinearRegression    

lr = LinearRegression(normalize=False)
lr.fit(X, Y)
print('Scikit LinearRegression, pesi trovati:', lr.intercept_, lr.coef_)

my = RegressioneLineare()
my.fit(X,Y)
print('My Regressione lineare, pesi trovati:', my.w)