<jupyter_start><jupyter_text>Dataset includes: - sample size: 20- targets: Weight, Waist, Pulse- Exercises: Chins, Situps, Jumps<jupyter_code>X, y = datasets.load_linnerud(return_X_y=True)
print(X.shape)
print(X[0])
print(y[0])<jupyter_output>(20, 3)
[  5. 162.  60.]
[191.  36.  50.]<jupyter_text>Select just one feature and one target<jupyter_code>X = X[:, np.newaxis, 1] # choosing situps
y = y[:, np.newaxis, 1] # choosing waistline as label<jupyter_output><empty_output><jupyter_text>Split training and test data<jupyter_code>X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, test_size=0.50)<jupyter_output><empty_output><jupyter_text>Select model and fit it with the training data<jupyter_code>model = linear_model.LinearRegression()
model.fit(X_train, y_train)<jupyter_output><empty_output><jupyter_text>Use test data to predict a line<jupyter_code>y_pred = model.predict(X_test)
plt.scatter(X_test, y_test, color="red")
plt.plot(X_test, y_pred, color="green", linewidth=3)
plt.xlabel("Situps")
plt.ylabel("Waistline measurements")
plt.title("A Graph Plot Showing Relationship between the waistline and accomplished situp exercises.")
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13018242122719734, 'fraction_numerical': 0.02155887230514096, 'mean_word_length': 8.007462686567164, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '233365', 'license': 'MIT', 'n_tokens_mistral': 482, 'n_tokens_neox': 457, 'n_words': 95, 'path': '2-Regression/1-Tools/notebook.ipynb', 'repo_name': 'Linhatran/Microsoft-machine-learning', 'size': '1206'}