forked from TheAlgorithms/Python
-
Notifications
You must be signed in to change notification settings - Fork 0
adding jaccard similarity (TheAlgorithms#1270) #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Update DFS.py * Update DFS.py
* Atbash.py: Both raw_input() and unichr() were removed in Python 3 @sateslayer and @AnupKumarPanwar your reviews please. * Remove any leading / trailing whitespace from user input
* Move prim.py from Graphs to graphs * Removed prim.py from Graphs * Update prim.py
* -Added a single-threaded implementation of odd-even transposition sort. This is a modified bubble sort meant to work with multiple processors. Since this is running on a single thread, it has the same running time as bubble sort. * -Added a parallel implementation of Odd-Even Transposition sort This implementation uses multiprocessing to perform the swaps at each step of the algorithm simultaneously.
* iterative and formula fibonacci methods Added two ways to calculate the fibonacci sequence: (1) iterative (2) formula. I've also added a timer decorator so someone can see the difference in computation time between these two methods. Added two unittests using the slash framework. * Update test_fibonacci.py * remove inline comments per Contributing Guidelines * Update sol5.py * Create placeholder.py * Update and rename maths/test_fibonacci.py to maths/tests/test_fibonacci.py * Delete placeholder.py * Create __init__.py * Update test_fibonacci.py * Rename Maths/lucasSeries.py to maths/lucasSeries.py * Update and rename Project Euler/Problem 01/sol5.py to project_euler/problem_01/sol6.py
* Add compression_analysis removing analysis/compression_analysis to just compression_analysis * Delete PSNR-example-base.png * Delete PSNR-example-comp-10.jpg * Delete compressed_image.png * Delete example_image.jpg * Delete example_wikipedia_image.jpg * Delete original_image.png * Delete psnr.py
* Problem 234 project Euler * Update project_euler/problem_234 Co-Authored-By: Emmanuel Arias <[email protected]> * Update project_euler/problem_234 Co-Authored-By: Emmanuel Arias <[email protected]> * Update project_euler/problem_234 Co-Authored-By: Emmanuel Arias <[email protected]> * Update project_euler/problem_234 Co-Authored-By: Emmanuel Arias <[email protected]> * Update project_euler/problem_234 Co-Authored-By: Emmanuel Arias <[email protected]> * Update project_euler/problem_234 Co-Authored-By: Emmanuel Arias <[email protected]> * Update and rename problem_234 to problem_234.py * Made suggested changes else was not required temp declared afterwards suggested changes are correct.Thank u! * Rename project_euler/problem_234.py to project_euler/problem_234/sol1.py
* Added script for automatically generating DIRECTORY.md * Sort and list files by alphabetical order * Rename script.py to ~script.py
File looks more elegant now ;-)
I've added comments to make understanding this method a little easier for those that are not familiar. This should close out #727 . Other changes: 1. added if __name__ == '__main__' rather than the "# MAIN" comment 2. put in return for distances and vertices. Previously everything was just printed out, but someone may find it useful to have the algorithm return something. 3. Other PEP8 changes 4. Added example input and expected output as a check to make sure any future changes will give the same output.
Reduced lines of code and extra processing on the line: n += 1
* Corrected wrong DFS implementation * changed list into hash set for dijkstra priority queue implementation.
* Create spiralPrint.py * Update spiralPrint.py
Use the last element as the first pivot, for it's easy to pop, this saves one element space. Iterating with the original list saves half the space, instead of generate a new shallow copy list by slice method.
Since `j` is redefined before it is used, it makes more sense to declare it with the value `None` instead of `1`. This fixes a [warning from lgtm](https://lgtm.com/projects/g/TheAlgorithms/Python/snapshot/66c4afbd0f28f9989f35ddbeb5c9263390c5d192/files/other/primelib.py?sort=name&dir=ASC&mode=heatmap)
* Added Whitespace and Docstring I modified the file to make Pylint happier and make the code more readable. * Beautified Code and Added Docstring I modified the file to make Pylint happier and make the code more readable. * Added DOCSTRINGS, Uncyclopedia link, and whitespace I added DOCSTRINGS and whitespace to make the code more readable and understandable. * Improved Formatting * Wrapped comments * Fixed spelling error for `movement` variable * Added DOCSTRINGs * Improved Formatting * Corrected whitespace to improve readability. * Added docstrings. * Made comments fit inside an 80 column layout.
* Improved Formatting of basic_maths.py - Added docstrings. - Improved whitespace formatting. - Renamed functions to match snake_case. * Improved Formatting of factorial_python.py - Added docstrings. - Improved whitespace formatting. - Renamed constants to match UPPER_CASE. * Improved Formatting of factorial_recursive.py - Improved whitespace formatting to meet PyLint standards. * Improved Code to Conform to PyLint - Renamed `max` to `max_num` to avoid redefining built-in 'max' [pylint] - Removed unnecessary parens after 'while' keyword [pylint] * Improved Formatting of factorial_recursive.py - Added docstrings. - Improved whitespace formatting.
* add ons in string directory - Bayer_Moore_Search * created divide_and_conquer folder and added max_sub_array_sum.py under it (issue #817)
* Travis CI: Simplify the testing * flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics * python: 3.7 * dist: xenial for python: 3.7 * Delete .lgtm.yml These changes were created to get around the fact that Travis CI was not enabled on this repo. Now that Travis is enabled, we can remove these modifications. The problems are that: 1. [LGTM does not want us running flake8 on their infrstructure](https://discuss.lgtm.com/t/can-i-get-lgtm-to-run-flake8-tests/1445/6) and 2. when we do, it [does not work as expected](https://discuss.lgtm.com/t/tests-are-not-automatically-run-when-lgtm-yml-is-modified/1446/4).
* created divide_and_conquer folder and added max_sub_array_sum.py under it (issue #817) * additional file in divide_and_conqure (closest pair of points)
* Added print function into matrix_multiplication_addition.py and removed blank space in data_structures/binary tree directory * Removed .vs/ folder per #893 * Rename matrix_multiplication_addition.py to matrix_operation.py * Added '~script.py' to ignore files and updated DIRECTORY.md
* Added OOP aproach to matrices * created methods for minors, cofactors, and determinants and added corresponding doctests * Added methods for adjugate, inverse, and identity (along with corresponding doctests) to matrix_class.py A small bug persists that causes the doctest to fail. After a couple Matrix objects are printed, the next one is printed in a different format. * formatted matrix_class.py with python/black * implemented negation and exponentiation as well as corresponding doctests in matrix_class.py. Also implemented eq and ne comparison operations * changed __str__ method in matrix_class.py to align with numpy standard and fixed bug in cofactors method * removed property decorators from several methods in matrix_class.py
* Add Kth lexicographic permutation Function that computes the kth lexicographic permtation of 0,1,2,...,n-1 in O(n^2) time * Update kth_lexicographic_permutation.py Addressed requested changes
* add version of smaller image * swap image in tests * edits for image src
* Add Flake8 F4 Tests to .travis.yml F4 tests check for import errors. Implements issue #973 * Remove wildcard imports
* Add delete to trie.py + tests * Minor fixes + tests * Remove noqa comments + modify tests for Travis CI to detect * Minor improvement
* Implementation of sequential minimal optimization algorithm * Update smo.py * Add demonstration of svm partition boundary 1:Use matplotlib show svm's partition boundary 2:Automatically download test dataset * Update smo.py * Update smo.py * Rename smo.py to sequential_minimum_optimization.py * Update doc and simplify the code. Fix filename typo error in doc. Use ternary conditional operator in predict() * Update doc.
* fix: Syntax Error lgtm display in matrix/matrix_operation.py. * Testing for None should use the 'is' operator. * fix: Too many arguments for string format. * fix: supress lgtm alert as false positive. * style: Unnecessary 'pass' statement. * Revert "fix: Syntax Error lgtm display in matrix/matrix_operation.py." This reverts commit 4c629b4.
SVM stands for support vector machines. Intuitively, a support vector is the vector right near the decision boundary.
* Add disjoint set * disjoint set: add doctest, make code more Pythonic * disjoint set: replace x.p with x.parent * disjoint set: add test and refercence
* Added the matrix_exponentiation.py file in maths directory * Implemented the requested changes * Update matrix_exponentiation.py
* Min head with decrease key functionality * doctest added * __str__ changed as per Python convention * edits in doctest * get_value by key added * __getitem__ added
* Adding stooge sort * Updated doctest * Just added underscore in the name
* Added dbscan in two formats. A jupyter notebook file for the storytelling and a .py file for people that just want to look at the code. The code in both is essentially the same. With a few things different in the .py file for plotting the clusters. * fixed LGTM problems * Some requested changes implemented. Still need to do docstring * implememted all changes as requested
* maths-polynomial_evalutation * added doctest and removed redundancy
* Update CONTRIBUTING.md * Update CONTRIBUTING.md * Add Python type hints and mypy
* doctests and intro docstring added * doctests, docstrings and check for empty collection added * Intro docstring added * python versions reversed
* added bogobogosort * fix indentation error
* adding softmax function * wraped lines as asked
* adding jaccard similarity * renaming files. zeebus! what an headache
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.