Skip to content

Commit 485b286

Browse files
committed
Fix code style issues via Ruff
1 parent 2610aa6 commit 485b286

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

machine_learning/decision_tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import numpy as np
2+
13
"""
24
Decision Tree Regression Implementation
35
@@ -45,8 +47,6 @@
4547
Output: The decision tree maps a real number input to a real number output.
4648
"""
4749

48-
import numpy as np
49-
5050

5151
class DecisionTree:
5252
def __init__(self, depth=5, min_leaf_size=5):

machine_learning/linear_regression.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import httpx
2+
import numpy as np
3+
14
"""
25
Linear Regression Algorithm - Predictive Analysis (Enhanced Documentation)
36
@@ -42,8 +45,7 @@
4245
# "numpy",
4346
# ]
4447
# ///
45-
import httpx
46-
import numpy as np
48+
4749

4850

4951
def collect_dataset():

machine_learning/logistic_regression.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
Notes:
2525
- This implementation is for educational purposes and demonstrates logistic regression
2626
without using high-level libraries.
27-
- The training is done with gradient descent; for large datasets, optimization techniques
28-
like stochastic gradient descent may be preferable.
29-
- Visualization is based on the Iris dataset, focusing only on two features for simplicity.
27+
- The training is done with gradient descent; for large datasets, optimization
28+
techniques like stochastic gradient descent may be preferable.
29+
- Visualization is based on the Iris dataset, focusing only on two features
30+
for simplicity.
3031
3132
Helpful resources:
3233
- Coursera Machine Learning course

0 commit comments

Comments
 (0)