RoboticsClubIITJ / ML-DL-implementation

An implementation of ML and DL algorithms from scratch in python using nothing but NumPy and Matplotlib.
BSD 3-Clause "New" or "Revised" License
48 stars 69 forks source link

[Bug report] Test error #103

Closed agrawalshubham01 closed 3 years ago

agrawalshubham01 commented 3 years ago

Describe the bug Import error to other files after updating the function of activations.py

----------- coverage: platform linux, python 3.6.9-final-0 -----------
Coverage HTML written to dir htmlcov

=========================== short test summary info ============================
ERROR Examples/gaussian_naive_bayes_example.py - ImportError: cannot import n...
ERROR Examples/k_means_clustering_example.py - ImportError: cannot import nam...
ERROR Examples/knn_example.py - ImportError: cannot import name 'sigmoid'
ERROR Examples/linear_example.py - ImportError: cannot import name 'sigmoid'
ERROR Examples/logistic_example.py - ImportError: cannot import name 'sigmoid'
ERROR Examples/naive_bayes_example.py - ImportError: cannot import name 'sigm...
ERROR MLlib/loss_func.py - ImportError: cannot import name 'sigmoid'
ERROR MLlib/models.py - ImportError: cannot import name 'sigmoid'
ERROR MLlib/optimizers.py - ImportError: cannot import name 'sigmoid'
!!!!!!!!!!!!!!!!!!! Interrupted: 9 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 9 errors in 0.56s ===============================

To Reproduce Steps to reproduce the behavior: 1.python3 -m pytest --doctest-modules --cov=./ --cov-report=html

parva-jain commented 3 years ago

I would like to fix it.

parva-jain commented 3 years ago

The error is occurring as the earlier sigmoid method is changed into a Class. So for fixing it, all its import instances need to be changed according to that of a Class.

agrawalshubham01 commented 3 years ago

@parva-jain i guess like previously sigmoid was a function and now it is class so instead of importing function we would need to import class

parva-jain commented 3 years ago

The error is occurring as the earlier sigmoid method is changed into a Class. So for fixing it, all its import instances need to be changed according to that of a Class.

That's what I meant by this.