{ "info": { "author": "Tam\u00e1s Majszlinger", "author_email": "tomcsojn@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3.7" ], "description": "# smoothassert\n\nThis Package contains custom Assertion methods to compare Pandas.Series objects.\n1. AssertSimilarSeries\n2. Assert_Cos_Sim_Series\n\n\n## Install\n\nGrab the package using `pip` (this could take a few minutes)\nTry using one of the following:\n\n pip install pip install -i https://test.pypi.org/simple/ smoothassert\n\n## Getting Started\n\nImport the module\n\n import smoothassert.smoothassert\n\nOr\nImport the method what you want to use directly\n```python\nfrom smoothassert.smoothassert import AssertSimilarSeries\n```\n\n## Features\n\n### 1. AssertSimilarSeries\nThe use of this method is to check that left and right Series are Equal, or similar with the given error rate.\nThe main usage of this method is to use it where you don't want or not able to make a code what works with 0% error rate i.e.: Machine learning models. Because the basic assertions in given in the common packages only have the AssertEqual methods what looks for 100% equality. If you have a Machine learning model what you want to have 80% precision then you can call this method to test it and its not going to raise Assertion error unless there is more error in the output stream.\n\n#### Example\nIf we have 2 series what is almost equal in this example it have 1/5 so 20% difference.\n```python\nimport pandas as pd\nfrom smoothassert.smoothassert import AssertSimilarSeries\n\nA = pd.Series(['a','b','c','d','e'])\nB = pd.Series(['b','b','c','d','e'])\n\nAssertSimilarSeries(A,B)\n\nOutput:\nAssertionError: Series are diferent in 20.0% while the allowable limit is 0%\n```\nBut if we raise the error limitation:\n```python\nimport pandas as pd\nfrom smoothassert.smoothassert import AssertSimilarSeries\n\nA = pd.Series(['a','b','c','d','e'])\nB = pd.Series(['b','b','c','d','e'])\n\nAssertSimilarSeries(A,B,percent=0.2)\n\nOutput:\nOK, error rate:20.0\n```\nProbably you going to use a unittest framework to test your code, what is perfectly fine and its going to work with it as well.\n### 2. Assert_Cos_Sim_Series\nCheck that the left and right values are similar to each other witht the given rate(default 1 token similarity needed).\nIts Good to Assert Categorical data, or strings.For example if you have a multi-class prediction and you have a couple of classes what you want as output but if the modell not finds all the classes but finds some , it can pass the test.\n\n#### Example\nif each value from the left series contain at least one categori/token from the right series then the test will pass.\n```python\nimport pandas as pd\nfrom smoothassert.smoothassert import Assert_Cos_Sim_Series\n\nout = pd.Series(['red','car','ford','red'])\nexpected = pd.Series(['red,car,sport','car','ford,blue,1999','car,red'])\n\nAssert_Cos_Sim_Series(out,expected)\nOutput:\nOK\n```\nYou can set the similarity limit as well default its 0 so if there is any similarity it will pass.\nYou can set this as:\n```python\nAssert_Cos_Sim_Series(out,expected,min_sim = 0.2)\n```\n## Documantation\n1. AssertSimilarSeries\nCheck that left and right Series are Equal, or similar with the given error rate. \n+ s1 Series\n+ s2 Series\n+ percent: float between 0 and 1 default 0\nthe allowable limit of the errors between the series given in percentage/100\n+ check_series_type : bool, default True\nWhether to check the Series class is identical.\n+ check_names : bool, default True\nWhether to check the Series and Index names attribute.\n+ check_dtype : bool, default True\n Whether to check the Series dtype is identical.\n2. Assert_Cos_Sim_Series\n+ Check that the cosine similarity between the elements of the two Series is bigger than the min_sim\n+ s1 Series\n+ s2 Series\n+ min_sim: float between 0 and 1 default 0(what means if there is at least one token has to be similar in each row)\n+ mute: bool default True\nmutes the writen feedbacks\n## In development\n+ Add check methods\n+ Add a changeable text pre processor to Assert_Cos_Sim_Series, Lemmatization,stemm,remove stopwords etc.\n\n## License\nSee [LICENSE](LICENSE) for license information.\n\n## Contribute / Contact Information\nIf you have found errors or some instructions are not working anymore, then please open an GitHub issue or, better, create a pull request with your desired changes.\n\nYou can also contact me at tomcsojn@gmail.com\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Majszlinger/smoothassert", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "smoothassert", "package_url": "https://pypi.org/project/smoothassert/", "platform": "", "project_url": "https://pypi.org/project/smoothassert/", "project_urls": { "Homepage": "https://github.com/Majszlinger/smoothassert" }, "release_url": "https://pypi.org/project/smoothassert/0.1.3/", "requires_dist": [ "pandas (>=0.24)", "numpy (>=1.17)", "scikit-learn (>=0.21)" ], "requires_python": "", "summary": "Custom Assertions for unittest with Pandas.Series and DataFrames. Similarity tests, based on pandas.testing", "version": "0.1.3" }, "last_serial": 5840266, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "b974446f50fb372e2400ef8cd90d3ef9", "sha256": "4971a4973fa286b904dc7d9fdb962e23f249e8be34aa837e23c0b25e715bfe7a" }, "downloads": -1, "filename": "smoothassert-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "b974446f50fb372e2400ef8cd90d3ef9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17744, "upload_time": "2019-09-17T08:34:44", "url": "https://files.pythonhosted.org/packages/13/d4/d1aa987274e993f6c3271ea991433f80dbbecff70c193463169a01f2c432/smoothassert-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "92edd3e461790218224a4a8cfdde0971", "sha256": "56d7981a88f935833533a3f88ba83c1ce836ba204f291dbe2129567ae0fba13b" }, "downloads": -1, "filename": "smoothassert-0.1.3.tar.gz", "has_sig": false, "md5_digest": "92edd3e461790218224a4a8cfdde0971", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4832, "upload_time": "2019-09-17T08:34:48", "url": "https://files.pythonhosted.org/packages/4c/c6/830a0cd9668964ebd7ef7891f3e8e5dff07e134fb6621c9de5b87a26a1dd/smoothassert-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b974446f50fb372e2400ef8cd90d3ef9", "sha256": "4971a4973fa286b904dc7d9fdb962e23f249e8be34aa837e23c0b25e715bfe7a" }, "downloads": -1, "filename": "smoothassert-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "b974446f50fb372e2400ef8cd90d3ef9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17744, "upload_time": "2019-09-17T08:34:44", "url": "https://files.pythonhosted.org/packages/13/d4/d1aa987274e993f6c3271ea991433f80dbbecff70c193463169a01f2c432/smoothassert-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "92edd3e461790218224a4a8cfdde0971", "sha256": "56d7981a88f935833533a3f88ba83c1ce836ba204f291dbe2129567ae0fba13b" }, "downloads": -1, "filename": "smoothassert-0.1.3.tar.gz", "has_sig": false, "md5_digest": "92edd3e461790218224a4a8cfdde0971", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4832, "upload_time": "2019-09-17T08:34:48", "url": "https://files.pythonhosted.org/packages/4c/c6/830a0cd9668964ebd7ef7891f3e8e5dff07e134fb6621c9de5b87a26a1dd/smoothassert-0.1.3.tar.gz" } ] }