Skip to content

Commit 97589e8

Browse files
authored
Change httpx to httpx2 and update docstring
Updated import from httpx to httpx2 and modified docstring for dataset return type.
1 parent 44da857 commit 97589e8

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

machine_learning/linear_regression_vectorized.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
import httpx
2-
import numpy as np
3-
41
"""
52
Vectorized Linear Regression using Gradient Descent
63
74
Author: Somrita Banerjee (mailto:somritabanerjee126@gmail.com)
85
9-
Requirements:
10-
- Python >= 3.13
11-
- numpy
12-
- httpx
13-
146
Dataset used: CSGO dataset (ADR vs Rating)
157
168
References:
@@ -20,24 +12,27 @@
2012
# /// script
2113
# requires-python = ">=3.13"
2214
# dependencies = [
23-
# "httpx",
15+
# "httpx2",
2416
# "numpy",
2517
# ]
2618
# ///
2719

20+
import httpx2
21+
import numpy as np
22+
2823

2924
def collect_dataset() -> np.ndarray:
3025
"""Collect dataset of CSGO (ADR vs Rating).
3126
32-
:return: dataset as numpy array
27+
:return: dataset as a NumPy array
3328
3429
>>> ds = collect_dataset()
3530
>>> isinstance(ds, np.ndarray)
3631
True
3732
>>> ds.shape[1] >= 2
3833
True
3934
"""
40-
response = httpx.get(
35+
response = httpx2.get(
4136
"https://raw.githubusercontent.com/yashLadha/The_Math_of_Intelligence/"
4237
"master/Week1/ADRvsRating.csv",
4338
timeout=10,
@@ -98,10 +93,6 @@ def mean_absolute_error(predicted_y: np.ndarray, original_y: np.ndarray) -> floa
9893

9994

10095
def main() -> None:
101-
"""Driver function.
102-
103-
>>> main() # doctest: +SKIP
104-
"""
10596
dataset = collect_dataset()
10697

10798
m = dataset.shape[0]

0 commit comments

Comments
 (0)