{ "info": { "author": "Christian Bock", "author_email": "christian.bock@bsse.ethz.ch", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3" ], "description": "# Wasserstein Time Series Kernel\n\n### Installation\nThe easiest way is to install WTK from the Python Package Index (PyPI) via\n\n```\n$ pip install wtk\n```\n\n### Usage\nThe package provides functions to transform a set of `n` training time series and `o` test time series into an `n x n` distance matrix for training and an `o x n` distance matrix for testing.\nAdditionally, we provide a way to run a grid search for a krein space SVM. `krein_svm_grid_search` runs a `5`-fold\ncross-validation on the training set to determine the best hyperparameters. Then, its classification accuracy is\ncomputed on the test set.\n\n```\nfrom wtk import transform_to_dist_matrix\nfrom wtk.utilities import get_ucr_dataset, krein_svm_grid_search\n\n# Read UCR data\nX_train, y_train, X_test, y_test = get_ucr_dataset('../data/UCR/raw_data/', 'DistalPhalanxTW')\n\n# Compute wasserstein distance matrices with subsequent length k=10\nD_train, D_test = transform_to_dist_matrix(X_train, X_test, 10)\n\n# Run the grid search\nsvm_clf = krein_svm_grid_search(D_train, D_test, y_train, y_test)\n```\n\nAlternatively, you can get the kernel matrices computed from the distance matrices and train your own classifier.\n```\nfrom sklearn.svm import SVC\nfrom wtk import get_kernel_matrix\nfrom sklearn.metrics import accuracy_score\n\n# Get the kernel matrices\nK_train = get_kernel_matrix(D_train, psd=True, gamma=0.2)\nK_test = get_kernel_matrix(D_test, psd=False, gamma=0.2)\n\n# Train your classifier\nclf = SVC(C=5, kernel='precomputed')\nclf.fit(K_train, y_train)\n\ny_pred = clf.predict(K_test)\nprint(accuracy_score(y_test, y_pred))\n```\n\n# Help\n\nIf you have questions concerning WTK or you encounter problems when\ntrying to build the tool under your own system, please open an issue in\n[the issue tracker](https://github.com/BorgwardtLab/WTK/issues). Try to\ndescribe the issue in sufficient detail in order to make it possible for\nus to help you.\n\n# Contributors\n\nWTK is developed and maintained by members of the [Machine Learning and\nComputational Biology Lab](https://www.bsse.ethz.ch/mlcb) of [Prof. Dr.\nKarsten Borgwardt](https://www.bsse.ethz.ch/mlcb/karsten.html):\n\n- Christian Bock ([GitHub](https://github.com/chrisby))\n- Matteo Togninalli ([GitHub](https://github.com/mtog))\n- Bastian Rieck ([GitHub](https://github.com/Submanifold))\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/BorgwardtLab/WTK", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "wtk", "package_url": "https://pypi.org/project/wtk/", "platform": "", "project_url": "https://pypi.org/project/wtk/", "project_urls": { "Homepage": "https://github.com/BorgwardtLab/WTK", "Issues": "https://github.com/BorgwardtLab/WTK/issues" }, "release_url": "https://pypi.org/project/wtk/0.2.1.3/", "requires_dist": [ "Cython", "POT", "numpy", "scikit-learn" ], "requires_python": ">=3.6", "summary": "A Wasserstein Subsequence Kernel for Time Series", "version": "0.2.1.3" }, "last_serial": 5943653, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "63910fcd04042770fb8c63f906a7ed8f", "sha256": "94a0ed725f94fa2b3c06b26a58f66ca3f1c59eda886648118a42216fa7b5bf5b" }, "downloads": -1, "filename": "wtk-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "63910fcd04042770fb8c63f906a7ed8f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 20514, "upload_time": "2019-09-15T13:44:33", "url": "https://files.pythonhosted.org/packages/e2/18/ea9d2305c88c4dbbb80e9ed3fa27cbc5adbbb0c4bd518ad06aa86ffc6693/wtk-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7e8feb639f1b1b331e60254fc00085f9", "sha256": "0e3af739244fbc9f03cef40e48a6d746c9a37e99e64f59da52213bf977aae7a5" }, "downloads": -1, "filename": "wtk-0.2.tar.gz", "has_sig": false, "md5_digest": "7e8feb639f1b1b331e60254fc00085f9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6648, "upload_time": "2019-09-15T13:44:40", "url": "https://files.pythonhosted.org/packages/38/43/6a33af82aadb3ff7f6f79cf05abdfcf793a29fd2dd0febf6a40a8cc20790/wtk-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "cb78f7a90c9ca12a7d4761b752a9fa24", "sha256": "dc39bf1b262bc59bb238b71423b14d95248a930420008ba10bbe4fa0b7e59dfc" }, "downloads": -1, "filename": "wtk-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "cb78f7a90c9ca12a7d4761b752a9fa24", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 20287, "upload_time": "2019-10-08T06:58:06", "url": "https://files.pythonhosted.org/packages/bc/8d/f40ee25c9b6a36023312de79fba0e8cfd42f68e1a28badebe84336fb558a/wtk-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9f9dc05bdfc18d9208e773e08b5b897", "sha256": "55726ad0750780ef5eec30a9f19be874fbf3e6c9c408c809ed212182db654ff8" }, "downloads": -1, "filename": "wtk-0.2.1.tar.gz", "has_sig": false, "md5_digest": "d9f9dc05bdfc18d9208e773e08b5b897", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6779, "upload_time": "2019-10-08T06:58:15", "url": "https://files.pythonhosted.org/packages/fe/c4/df0606f3992de872cad5a6ad4c3d60a329263ecc8a35ab24d4d608c5e9c5/wtk-0.2.1.tar.gz" } ], "0.2.1.1": [ { "comment_text": "", "digests": { "md5": "6e8528dbaa9fe59f345bf8b931ee2b95", "sha256": "139d571745f8310c723e038939bea2ed7f89c88989aa1ffbb221c1627d54e070" }, "downloads": -1, "filename": "wtk-0.2.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6e8528dbaa9fe59f345bf8b931ee2b95", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 20301, "upload_time": "2019-10-08T07:53:09", "url": "https://files.pythonhosted.org/packages/37/73/a1fa0a01504213bd8b8928cfa20d1dedaedb06256362b4ca8396bfd63227/wtk-0.2.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "15124e4c0935583eea62a8b511bf07f8", "sha256": "bafc1c84589a35dc5a62ea4da8f13fe6bb3fd94d14441e89d09e040c83944235" }, "downloads": -1, "filename": "wtk-0.2.1.1.tar.gz", "has_sig": false, "md5_digest": "15124e4c0935583eea62a8b511bf07f8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6784, "upload_time": "2019-10-08T07:53:14", "url": "https://files.pythonhosted.org/packages/94/6e/3d1e67c3748988af49eda528bc74e539d06fd36990df697a556479d3b8a6/wtk-0.2.1.1.tar.gz" } ], "0.2.1.2": [ { "comment_text": "", "digests": { "md5": "d3829b78a25f2f4c34a76d992490f53d", "sha256": "b5044f08e3fc1d32d48a16f944aa02b2fc352a8f4eb4a18b3de396002a014d6a" }, "downloads": -1, "filename": "wtk-0.2.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "d3829b78a25f2f4c34a76d992490f53d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18276, "upload_time": "2019-10-08T08:38:33", "url": "https://files.pythonhosted.org/packages/05/37/85da914ff84ba02cc7d7a655587a876349bd87e6fd9e3d275b0201c8e21c/wtk-0.2.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "70ce96153f564cca0630b5fb9f1b762e", "sha256": "258872671bc7555c66ecc12c37dede8d0b8f859c561bf32b7d72efdfd2e6d5e4" }, "downloads": -1, "filename": "wtk-0.2.1.2.tar.gz", "has_sig": false, "md5_digest": "70ce96153f564cca0630b5fb9f1b762e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6473, "upload_time": "2019-10-08T08:38:39", "url": "https://files.pythonhosted.org/packages/92/8c/439c70345b95f3474a8cddcf9d7885086c383ece8c695d751aeff137b5a4/wtk-0.2.1.2.tar.gz" } ], "0.2.1.3": [ { "comment_text": "", "digests": { "md5": "a42ddbb82395729e7940d61d3fe5c878", "sha256": "8b73ea9154f3be39734518b766642fdae3e0b273a86eb0298e2eee0f28d1d72f" }, "downloads": -1, "filename": "wtk-0.2.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "a42ddbb82395729e7940d61d3fe5c878", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18275, "upload_time": "2019-10-08T08:43:18", "url": "https://files.pythonhosted.org/packages/28/85/7043dde5f14f8c9080767839d6f4a521907f24b6f05e5d01d2e1320fa231/wtk-0.2.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5079bf12e0cb6c91f0298a370497a5c1", "sha256": "f5314ed315fd97d1de2ac05f995364971a73e65b878faec5deaabe8484d2ebb6" }, "downloads": -1, "filename": "wtk-0.2.1.3.tar.gz", "has_sig": false, "md5_digest": "5079bf12e0cb6c91f0298a370497a5c1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6483, "upload_time": "2019-10-08T08:43:23", "url": "https://files.pythonhosted.org/packages/54/b9/3f7c48e8a621a2ce79125e070fdfd30cd8de42882fe4b230356a9346e190/wtk-0.2.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a42ddbb82395729e7940d61d3fe5c878", "sha256": "8b73ea9154f3be39734518b766642fdae3e0b273a86eb0298e2eee0f28d1d72f" }, "downloads": -1, "filename": "wtk-0.2.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "a42ddbb82395729e7940d61d3fe5c878", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 18275, "upload_time": "2019-10-08T08:43:18", "url": "https://files.pythonhosted.org/packages/28/85/7043dde5f14f8c9080767839d6f4a521907f24b6f05e5d01d2e1320fa231/wtk-0.2.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5079bf12e0cb6c91f0298a370497a5c1", "sha256": "f5314ed315fd97d1de2ac05f995364971a73e65b878faec5deaabe8484d2ebb6" }, "downloads": -1, "filename": "wtk-0.2.1.3.tar.gz", "has_sig": false, "md5_digest": "5079bf12e0cb6c91f0298a370497a5c1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6483, "upload_time": "2019-10-08T08:43:23", "url": "https://files.pythonhosted.org/packages/54/b9/3f7c48e8a621a2ce79125e070fdfd30cd8de42882fe4b230356a9346e190/wtk-0.2.1.3.tar.gz" } ] }