<jupyter_start><jupyter_text>Diabetes dataset<jupyter_code>import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model, model_selection
X, y = datasets.load_diabetes(return_X_y=True)
print(X.shape)
print(X[0])
X = X[:, np.newaxis, 2]
print(X.shape)
print(X[0])
X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, test_size=0.33)
model = linear_model.LinearRegression()
model.fit(X_train, y_train)
y_pred = model.predict(X_test)
plt.scatter(X_test, y_test, color='k')
plt.plot(X_test, y_pred, color='b', lw=3)
plt.show()<jupyter_output><empty_output><jupyter_text>Linnerud dataset<jupyter_code>X, y = datasets.load_linnerud(return_X_y=True)
X = X[:, np.newaxis, 1]
y = y[:, np.newaxis, 1]
X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, test_size=0.3)
model = linear_model.LinearRegression()
model.fit(X_train, y_train)
y_pred = model.predict(X_test)
plt.scatter(X_test, y_test, color='k')
plt.plot(X_test, y_pred, color='b', lw=3)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14814814814814814, 'fraction_numerical': 0.011396011396011397, 'mean_word_length': 8.24561403508772, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '589400', 'license': 'MIT', 'n_tokens_mistral': 456, 'n_tokens_neox': 447, 'n_words': 79, 'path': '2-Regression/1-Tools/notebook.ipynb', 'repo_name': 'kszonsteg/ML-For-Beginners', 'size': '1053'}