# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import numpy as np
import matplotlib.pyplot as plt

# ### generate dataset

dataset_X = np.arange(0, 10, 1)
dataset_Y = 0.5 * dataset_X + 5

dataset_Y

plt.scatter(dataset_X, dataset_Y)

w = 0
b = 0

w = (dataset_X.transpose() * dataset_Y) / (dataset_X.transpose() * dataset_X)

w

plt.plot(dataset_X, w)

predict_Y = w.transpose() * dataset_X

# +
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 3))

ax1.scatter(dataset_X, predict_Y)

ax2.scatter(dataset_X, dataset_Y)
plt.show()
# -



StarcoderdataJupyterScriptsDedupFiltered