Skip to content

fix: add missing numpy import to logistic_regr.py#15

Closed
Mukller wants to merge 1 commit into
ankonzoid:masterfrom
Mukller:fix/missing-numpy-import-logistic-regr
Closed

fix: add missing numpy import to logistic_regr.py#15
Mukller wants to merge 1 commit into
ankonzoid:masterfrom
Mukller:fix/missing-numpy-import-logistic-regr

Conversation

@Mukller

@Mukller Mukller commented Jul 7, 2026

Copy link
Copy Markdown

Problem

logistic_regr.predict() calls np.ones() when all training labels are identical (self.flag is True), but numpy was never imported at the top of the file. This causes a NameError at runtime:

NameError: name 'np' is not defined

Fix

Added import numpy as np at the top of the file alongside the existing import.

Fixes #13

logistic_regr.predict() calls np.ones() when all training labels are
identical (self.flag is True), but numpy was never imported. This causes
a NameError at runtime:

  NameError: name 'np' is not defined

Added 'import numpy as np' at the top of the file.

Fixes #13
@Mukller Mukller closed this by deleting the head repository Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NameError: name 'np' is not defined in logistic_regr.py

1 participant