```
import numpy as np
import matplotlib as plt
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error
diabetes = datasets.load_diabetes()
# print(diabetes.keys())
# ['data', 'target', 'frame', 'DESCR', 'feature_names', 'data_filename', 'target_filename', 'data_module']
diabetes_X = diabetes.data[:, np.newaxis, 2]

diabetes_X_test = diabetes_X[:-30]
diabetes_X_train = diabetes_X[0:30]
diabetes_Y_train = diabetes.target[:-30]
diabetes_Y_test = diabetes.target[0:30]

model = linear_model.LinearRegression()

model.fit(diabetes_X_train, diabetes_X_train)

diabetes_Y_predicted = model.predict(diabetes_X_test)

print(mean_squared_error(diabetes_Y_test, diabetes_Y_predicted))

```

The error looks something like this:

```
 File "f:\ML\Projects\test.py", line 21, in <module>
    print(mean_squared_error(diabetes_Y_test, diabetes_Y_predicted))
  File "C:\Python\lib\site-packages\sklearn\metrics\_regression.py", line 438, in mean_squared_error
    y_type, y_true, y_pred, multioutput = _check_reg_targets(
  File "C:\Python\lib\site-packages\sklearn\metrics\_regression.py", line 94, in _check_reg_targets
    check_consistent_length(y_true, y_pred)
  File "C:\Python\lib\site-packages\sklearn\utils\validation.py", line 332, in check_consistent_length
    raise ValueError(
ValueError: Found input variables with inconsistent numbers of samples: [30, 412]

```