{"id":27424358,"url":"https://github.com/xhan97/isokernel","last_synced_at":"2025-04-14T11:49:21.124Z","repository":{"id":128250114,"uuid":"505875436","full_name":"xhan97/IsoKernel","owner":"xhan97","description":"A scikit-learn-compatible module for Isolation Kernel with aNNE implemention.","archived":false,"fork":false,"pushed_at":"2024-11-23T23:38:25.000Z","size":92,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-24T00:17:27.730Z","etag":null,"topics":["distribution-similarity","isolation-kernel","kernel-methods","similarity-measures","sklearn-compatible"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xhan97.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-21T14:21:28.000Z","updated_at":"2024-11-23T23:38:28.000Z","dependencies_parsed_at":"2024-04-24T04:23:34.669Z","dependency_job_id":"1129b9e8-2aa9-430f-a885-cec4e5746032","html_url":"https://github.com/xhan97/IsoKernel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xhan97%2FIsoKernel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xhan97%2FIsoKernel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xhan97%2FIsoKernel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xhan97%2FIsoKernel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xhan97","download_url":"https://codeload.github.com/xhan97/IsoKernel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877512,"owners_count":21176235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distribution-similarity","isolation-kernel","kernel-methods","similarity-measures","sklearn-compatible"],"created_at":"2025-04-14T11:49:20.512Z","updated_at":"2025-04-14T11:49:21.045Z","avatar_url":"https://github.com/xhan97.png","language":"Python","readme":"\n.. -*- mode: rst -*-\n\nIsoKernel\n======================================================================\n\nIsoKernel - IsoKernel is a python library for Isolation Kernel. It includes several kernel methods using isolation mechanism.\n\n\nSupported Kernel methods\n-----------------------------\n\n* Isolation Kernel (IsoKernel)\n* Isolation Distribution Kernel (IsoDisKernel)\n\n\nInstalling\n----------\n\nPyPI install, presuming you have an up to date pip.\n\n.. .. code:: bash\n\n..    pip install IsoKernel\n\nFor a manual install of the latest code directly from GitHub:\n\n.. code:: bash\n\n    pip install git+https://github.com/xhan97/IsoKernel.git\n\n\nAlternatively download the package, install requirements, and manually run the installer:\n\n.. code:: bash\n\n    wget https://codeload.github.com/xhan97/IsoKernel/zip/refs/heads/master\n    unzip IsoKernel-master.zip\n    rm IsoKernel-master.zip\n    cd IsoKernel-master\n\n    pip install -r requirements.txt\n\n    python setup.py install\n\n\n\nHow to use IsoKernel\n-------------------------\n\nThe IsoKernel package inherits from sklearn classes, and thus drops in neatly\nnext to other sklearn  with an identical calling API. Similarly it\nsupports input in a variety of formats: an array (or pandas dataframe) of shape ``(num_samples x num_features)``.\n\n.. code:: python\n\n    from IsoKernel import IsoKernel\n    from sklearn.datasets import make_blobs\n\n    data, _ = make_blobs(1000)\n\n    ik = IsoKernel(n_estimators=200, max_samples=16, method=\"anne\") # method can be \"anne\" or \"inne\"\n    ik = ik.fit(data)\n    # get Isolation Kernel feature for all points in data.\n    ik.transform(data)\n    # get pairwise Isolation Kernel similarity for all points in data.\n    ik.similarity(data)\n\n\nHow to use IsoDisKernel\n-------------------------------\n\nIsolation Distributional Kernel is a new way to measure the similarity between two distributions.\nIt addresses two key issues of kernel mean embedding, where the kernel employed has:\n    (i) a feature map with intractable dimensionality which leads to high computational cost;\n    (ii) data independency which leads to poor accuracy.\n\n.. code:: python\n\n    from IsoKernel import IsoDisKernel\n    from sklearn.datasets import make_blobs\n\n    data, _ = make_blobs(1000)\n\n    idk = IsoDisKernel(n_estimators=200, max_samples=16, method=\"anne\") # method can be \"anne\" or \"inne\"\n    idk = idk.fit(data)\n    D_i = data[:10]\n    D_j = data[-10:]\n    # Directly get the similarity between two distributions \n    # is_normalize: whether return the normalized similarity matrix ranged of [0,1]. Default: True\n    sim = idk.similarity(D_i, D_j, is_normalize=True)\n\n    # get ik feature of two distributions\n    ikm_D_i, ikm_D_j = idk.transform(D_i, D_j)\n    # get kernel mean embedding \n    kme_D_i = idk.kernel_mean_embedding(ikm_D_i)\n    kme_D_j = idk.kernel_mean_embedding(ikm_D_j)\n    # get similarity between two distributions.\n    sim = idk.kme_similarity(kme_D_i, kme_D_j, is_normalize=True)\n\n\nRunning the Tests\n---------------------------\n\nThe package tests can be run after installation using the command:\n\n.. code:: bash\n\n    pip install pytest\n\nor, if ``pytest`` is installed:\n\n.. code:: bash\n\n    pytest  IsoKernel/tests\n\nIf one or more of the tests fail, please report a bug at https://github.com/xhan97/IsoKernel/issues\n\n\nPython Version\n------------------------\n\nPython 3  is recommend  the better option if it is available to you.\n\n\nCiting\n------------------------\n\nIf you have used this codebase in a scientific publication and wish to\ncite it, please use the following publication (Bibtex format):\n\n.. code:: bibtex\n\n   @inproceedings{10.1145/3219819.3219990,\n        author = {Ting, Kai Ming and Zhu, Yue and Zhou, Zhi-Hua},\n        title = {Isolation Kernel and Its Effect on SVM},\n        year = {2018},\n        publisher = {Association for Computing Machinery},\n        address = {New York, NY, USA},\n        booktitle = {Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery \u0026 Data Mining},\n        pages = {2329–2337},\n        numpages = {9},\n        location = {London, United Kingdom},\n        series = {KDD '18}\n        }\n\n.. code:: bibtex\n\n    @inproceedings{ting2020Isolation,\n        author = {Ting, Kai Ming and Xu, Bi-Cun and Washio, Takashi and Zhou, Zhi-Hua},\n        title = {Isolation Distributional Kernel: A New Tool for Kernel Based Anomaly Detection},\n        year = {2020},\n        publisher = {Association for Computing Machinery},\n        address = {New York, NY, USA},\n        doi = {10.1145/3394486.3403062},\n        pages = {198-206},\n        numpages = {9},\n        series = {KDD '20}\n    }\n\n.. code:: bibtex\n\n    @inproceedings{HZTZL22Streaming,\n     author = {Han, Xin and Zhu, Ye and Ting, Kai Ming and Zhan, De-Chuan and Li, Gang},\n     title = {Streaming Hierarchical Clustering Based on Point-Set Kernel},\n     year = {2022},\n     isbn = {9781450393850},\n     publisher = {Association for Computing Machinery},\n     address = {New York, NY, USA},\n     url = {https://doi.org/10.1145/3534678.3539323},\n     doi = {10.1145/3534678.3539323},\n     pages = {525–533},\n     numpages = {9},\n     keywords = {streaming data, hierarchical clustering, isolation kernel},\n     location = {Washington DC, USA},\n     series = {KDD '22}\n}\n\nLicense\n-------\n\nApache license\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxhan97%2Fisokernel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxhan97%2Fisokernel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxhan97%2Fisokernel/lists"}