* Added missing_number algorithm using bit manipulation
* Update bit_manipulation/missing_number.py
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fix DeprecationWarning in local_weighted_learning.py
Fix DeprecationWarning that occurs during build due to converting an
np.ndarray to a scalar implicitly
* DeprecationWarning fix attempt 2
* added smith waterman algorithm
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* descriptive names for the parameters a and b
* doctesting lowercase upcase empty string cases
* updated block quot,fixed traceback and doctests
* shorter block quote
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* global vars to func params,more doctests
* updated doctests
* user access to SW params
* formating
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Update knuth_morris_pratt.py - changed Boolean to Index
* Update knuth_morris_pratt.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update knuth_morris_pratt.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update knuth_morris_pratt.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update back_propagation_neural_network.py
* Update back_propagation_neural_network.py
* Update strings/knuth_morris_pratt.py
* Update knuth_morris_pratt.py
* Update knuth_morris_pratt.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add type hints to k_nearest_neighbours.py
* Refactor k_nearest_neighbours.py into class
* Add documentation to k_nearest_neighbours.py
* Use heap-based priority queue for k_nearest_neighbours.py
* Delete knn_sklearn.py
* updating DIRECTORY.md
* Use optional args in k_nearest_neighbours.py for demo purposes
* Fix wrong function arg in k_nearest_neighbours.py
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* updating DIRECTORY.md
* Fix mypy errors in erosion_operation.py
* Rename functions to use snake case
* updating DIRECTORY.md
* updating DIRECTORY.md
* Replace raw file string with pathlib Path
* Fix function name in erosion_operation.py doctest
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* feat(maths): add function to perform calculation
- Add single function to calculate sum of two positive numbers
using bitwise operator
* docs: add wikipedia url as explanation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update sum_of_two_positive_numbers_bitwise.py
* Update sum_of_two_positive_numbers_bitwise.py
* Update sum_of_two_positive_numbers_bitwise.py
---------
Co-authored-by: Okza Pradhana <okzapradhana@azko-macbook.local>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Create coulomb_law.py
* Update coulomb_law.py
* Update coulomb_law.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update and rename coulomb_law.py to coulombs_law.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update coulombs_law.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update coulombs_law.py
* Update coulombs_law.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update coulombs_law.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update coulombs_law.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Update xgboost_regressor.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Replaced loops in jacobi_iteration_method function with vector operations. That gives a reduction in the time for calculating the algorithm.
* Replaced loops in jacobi_iteration_method function with vector operations. That gives a reduction in the time for calculating the algorithm.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Delete main.py
* Update jacobi_iteration_method.py
Changed a line that was too long.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update jacobi_iteration_method.py
Changed the type of the returned list as required.
* Update jacobi_iteration_method.py
Replaced init_val with new_val.
* Update jacobi_iteration_method.py
Fixed bug: init_val: list[int] to list[float].
Since the numbers are fractional: init_val = [0.5, -0.5, -0.5].
* Update jacobi_iteration_method.py
Changed comments, made variable names more understandable.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update jacobi_iteration_method.py
left the old algorithm commented out, as it clearly shows what is being done.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update jacobi_iteration_method.py
Edits upon request.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* added addAtPosition to simple linked list
* added addAtPosition to simple linked list
* modified the add function to take an optional position command
* fixed type safety errors:
* fixed type safety errors:
* fixed type safety errors:
* fixed type safety errors:
* fixed size error
* fixed size error
* added doctest and updates the else after checking if posiiton argument less than 0 or not
* added doctest and updates the else after checking if posiiton argument less than 0 or not
* fixed the contributing.md mistake
* added doctest for out of bounds position value, both negative and positive
* Added Scaled Exponential Linear Unit Activation Function
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update scaled_exponential_linear_unit.py
* Update scaled_exponential_linear_unit.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update scaled_exponential_linear_unit.py
* Update scaled_exponential_linear_unit.py
* Update scaled_exponential_linear_unit.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update scaled_exponential_linear_unit.py
* Update scaled_exponential_linear_unit.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Create haralick_descriptors
* Working on creating Unit Testing for Haralick Descriptors module
* Type hinting for Haralick descriptors
* Fixed docstrings, unit testing and formatting choices
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixed line size formatting
* Added final doctests
* Changed main callable
* Updated requirements.txt
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update computer_vision/haralick_descriptors.py
No! What if the Kernel is empty?
Example:
>>> kernel = np.zeros((1))
>>> kernel or np.ones((3, 3))
array([[1., 1., 1.],
[1., 1., 1.],
[1., 1., 1.]])
Co-authored-by: Christian Clauss <cclauss@me.com>
* Undone wrong commit
* Update haralick_descriptors.py
* Apply suggestions from code review
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix ruff errors in haralick_descriptors.py
* Add type hint to haralick_descriptors.py to fix ruff error
* Update haralick_descriptors.py
* Update haralick_descriptors.py
* Update haralick_descriptors.py
* Update haralick_descriptors.py
* Try to fix mypy errors in haralick_descriptors.py
* Update haralick_descriptors.py
* Fix type hint in haralick_descriptors.py
---------
Co-authored-by: Rafael Zimmer <rzimmerdev@monmo.localdomain>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Style sigmoid function in harmony with pep guideness
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Updated postfix_evaluation.py to support Unary operators and floating point numbers Fixes#8754 and #8724
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py
Signed-off-by: Arijit De <arijitde2050@gmail.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated postfix_evaluation.py to support Unary operators and floating point numbers. Fixes#8754 and formatted code to pass ruff and black test.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes#8724 and made sure it passes doctest
Signed-off-by: Arijit De <arijitde2050@gmail.com>
* Fixed return type hinting required by pre commit for evaluate function
Signed-off-by: Arijit De <arijitde2050@gmail.com>
* Changed line 186 to return only top of stack instead of calling the get_number function as it was converting float values to int, resulting in data loss. Fixes#8754 and #8724
Signed-off-by: Arijit De <arijitde2050@gmail.com>
* Made the requested changes
Also changed the code to make the evaluate function first convert all the numbers and then process the valid expression.
* Fixes#8754, #8724 Updated postfix_evaluation.py
postfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes#8724. Added a doctest example with unary operator.
* Fixes#8754, #8724 Updated postfix_evaluation.py
postfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes#8724. Added a doctest example with unary operator.
* Fixes#8754, #8724 Updated the parse_token function of postfix_evaluation.py
ostfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes#8724. Added a doctest example with unary operator and invalid expression.
* Fixes#8754, #8724 Updated postfix_evaluation.py
postfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes#8724. Added a doctest example with unary operator and invalid expression.
* Update postfix_evaluation.py
* Update postfix_evaluation.py
* Update postfix_evaluation.py
* Update postfix_evaluation.py
* Update postfix_evaluation.py
---------
Signed-off-by: Arijit De <arijitde2050@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* use np.dot
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* further improvements using array slicing
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Update arc_length.py
Wrote the output of testcase
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update arc_length.py
Added the requested changes
* Update arc_length.py
followed the change request
* Update arc_length.py
followed suggestions
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Octal to Binary Convert
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* mention return type
* code scratch
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* mentioned return type
* remove comment
* added documention and some test cases
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add another test case
* fixes documention
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Documention and test cases added
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* documention problem solved
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* error in exit 1
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
---------
Co-authored-by: BamaCharanChhandogi <b.c.chhandogi@gmailcom>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Move and reimplement convert_number_to_words.py
- Move convert_number_to_words.py from web_programming/ to conversions/
- Reimplement the algorithm from scratch because the logic was very
opaque and too heavily nested
- Add support for the Western numbering system (both short and long)
because the original implementation only supported the Indian
numbering system
- Add extensive doctests and error handling
* updating DIRECTORY.md
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>