{"id":24431849,"url":"https://github.com/flashxio/knorpy","last_synced_at":"2025-06-30T21:32:01.607Z","repository":{"id":80273039,"uuid":"94258276","full_name":"flashxio/knorPy","owner":"flashxio","description":"Python bindings for knor","archived":false,"fork":false,"pushed_at":"2019-06-08T16:29:24.000Z","size":208,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T19:45:05.043Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flashxio.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-06-13T21:10:34.000Z","updated_at":"2022-04-06T14:25:42.000Z","dependencies_parsed_at":"2023-04-07T04:54:46.027Z","dependency_job_id":null,"html_url":"https://github.com/flashxio/knorPy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/flashxio/knorPy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashxio%2FknorPy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashxio%2FknorPy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashxio%2FknorPy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashxio%2FknorPy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flashxio","download_url":"https://codeload.github.com/flashxio/knorPy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashxio%2FknorPy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262853234,"owners_count":23374922,"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":[],"created_at":"2025-01-20T15:22:07.701Z","updated_at":"2025-06-30T21:32:01.579Z","avatar_url":"https://github.com/flashxio.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# knor for Python\n\n[![Build\nStatus](https://travis-ci.org/flashxio/knorPy.svg?branch=master)](https://travis-ci.org/flashxio/knorPy)\n\nThese are Python 2.7+ and Python 3 bindings for the standalone\nmachine in-memory portion of the clustering NUMA Optimized Routines. See the\nfull C++ library for details: https://github.com/flashxio/knor\n\n## Supported OSes\n\nThe `knor` python package has been tested on the following OSes:\n- Mac OSX Sierra, Mojave\n- Ubuntu LTS 14.04, 16.04, 18.04\n- Debian Linux\n\n## Python Dependencies\n\n- Numpy: `pip install -U numpy`\n- Setuptools: `pip install -U setuptools`\n- pybind11: `pip install -U pybind11`\n\n## Mac Installation\n\n```\npip install knor\n```\n\n## Linux installation\n\n### Best Performance configuration\n\nFor the best performance make sure the `numa` system package is installed via\n\n```\napt-get install -y libnuma-dbg libnuma-dev libnuma1\n```\n\nThen simply install the package via pip:\n\n```\npip install knor\n```\n\n## Installation Errors\n\n1.\n\n```\n  File “/Library/Python/2.7/site-packages/pip/utils/__init__.py”, line X, in\n  call_subprocess\n      % (command_desc, proc.returncode, cwd))\n      InstallationError: Command “python setup.py egg_info” failed with error\n      code 1 in /private/tmp/pip-build-vaASFl/knor/\n```\n\n### Solution\n\nUpdate your `python` version to at least `2.7.10`\n\n2.\n\n```\n    In file included from knor/cknor/libkcommon/clusters.cpp:23:\n    knor/cknor/libkcommon/util.hpp:29:10: fatal error: ‘random’ file not found\n    #include \u003crandom\u003e\n             ^\n    1 error generated.\n    error: command ‘/usr/bin/clang’ failed with exit status 1\n```\n### Solution\nThis usually occurs on Mac when your Xcode and Xcode command line tools are out of\ndate. Update then to at least Version 8\n\n3.\n\n```\nunable to execute 'x86_64-linux-gnu-gcc': No such file or directory\n  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n```\n\n### Solution\nInstall the `gcc` compiler via `apt-get install build-essential`\n\n4.\n\n```\n fatal error: Python.h: No such file or directory compilation terminated.\n```\n\n### Solution\nInstall the development headers for the version on Python you intend to install knor e.g\n\n```\napt-get install python-dev  # for python2.x installs\napt-get install python3-dev  # for python3.x installs\n```\n\n5.\n```\nfatal error: 'pybind11/pybind11.h' file not found\n#include \u003cpybind11/pybind11.h\u003e\n         ^~~~~~~~~~~~~~~~~~~~~\nImportError: No module named pybind11\n```\n\n### Solution\n\nThis occurs on Mac and is best solved by utilizing virtual environments as\nfollows:\n\n```\nsudo pip install virtualenv\nvirtualenv -p \u003cpython-version\u003e \u003cdesired-path\u003e\nsource \u003cdesired-path\u003e/bin/activate\n```\n\nWhere `python-version` is either `python2.7` or `python3`.\n\nThen install `pybind11` by `pip install pybind11` then attempt to install `knor`\n\n6.\nImportError: No module named 'setuptools'\n```\n\n### Solution\n\nUse a recent version of `setuptools` from `pip`\n\n```\nsudo apt remove python-setuptools python3-setuptool\npip install -U setuptools\npip3 install -U setuptools\n```\n\n\n## Documentation\n\n```\nfrom knor import *\nhelp(Kmeans)\nhelp(SKmeans)\nhelp(KmeansPP)\nhelp(FuzzyCMeans)\nhelp(Kmedoids)\nhelp(Xmeans)\nhelp(Hmeans)\nhelp(Gmeans)\n```\n\n## Example\n\n```\nimport knor\nimport numpy as np\ndata = np.random.random((100, 10))\nkm = knor.Kmeans(k=5)\nret = km.fit(data)\nprint(ret)\n```\n\n## The `cluster_t` return object\n\nThe `cluster_t` return object has the following attributes:\n\n- `k`: The number of clusters requested\n- `nrow`: The number of rows/samples in the dataset\n- `ncol`: Then number of columns/features in the dataset\n- `sizes`: The number of samples in each cluster/centroid\n- `iters`: The number of iterations performed\n- `centroids`: A `list` where each row is a cluster center\n- `clusters`: A `list` index for which cluster each sample falls into\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashxio%2Fknorpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashxio%2Fknorpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashxio%2Fknorpy/lists"}