{"id":19849545,"url":"https://github.com/filipspl/bayesian-svm-knime-scikit","last_synced_at":"2025-10-26T08:15:19.553Z","repository":{"id":92209077,"uuid":"216764693","full_name":"filipsPL/bayesian-svm-knime-scikit","owner":"filipsPL","description":"Bayesian Optimization of SVM parameters with scikit-learn to be used in KNIME in Python-learner node","archived":false,"fork":false,"pushed_at":"2019-10-22T13:57:57.000Z","size":1105,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T12:49:18.047Z","etag":null,"topics":["bayesian-optimization","knime","machine-learning","python","svm"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/filipsPL.png","metadata":{"files":{"readme":"README.md","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":"2019-10-22T08:40:28.000Z","updated_at":"2019-10-23T09:12:28.000Z","dependencies_parsed_at":"2023-06-08T00:06:32.852Z","dependency_job_id":null,"html_url":"https://github.com/filipsPL/bayesian-svm-knime-scikit","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/filipsPL%2Fbayesian-svm-knime-scikit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipsPL%2Fbayesian-svm-knime-scikit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipsPL%2Fbayesian-svm-knime-scikit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipsPL%2Fbayesian-svm-knime-scikit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filipsPL","download_url":"https://codeload.github.com/filipsPL/bayesian-svm-knime-scikit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241229515,"owners_count":19930811,"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":["bayesian-optimization","knime","machine-learning","python","svm"],"created_at":"2024-11-12T13:21:32.228Z","updated_at":"2025-10-26T08:15:14.505Z","avatar_url":"https://github.com/filipsPL.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bayesian-svm-knime-scikit\n\nBayesian Optimization of SVM parameters C and gamma, with scikit-learn, to be used in KNIME in Python learner node. Based on the [optimization functions by thuijskens](https://github.com/thuijskens/bayesian-optimization).\n\nWhy?\n\n1. Parameter Optimization Loop Node(s) doesn't work as expected for some data. Including Bayesian optimization.\n2. You may want to use scikit-learn instead of KNIME or Weka implementation.\n3. You can tune this workflow to optimize other parameters for many different scikit algorithms.\n\n## Setup\n\n- In python node please select python2.\n- copy\u0026paste the python code into the code window of Python Learner (`python-learner.py`) and Python Predictor (`python-predictor.py`)\n- sample workflow:\n\n![](obrazki/README-7c3d86f7.png)\n\n\n- fine tuning - edit variables at the top of the `python-learner.py`:\n\n```python\n# values of log10 gamma and C\n# from https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4534515/\n# - log10(C) in [ - 2, 5]\n# - log10(gamma) in [ - 10, 3]\n\nbounds = np.array([[-2, 5], [-10, 3]])\n\n# number of optimizations for bayesian optimizer\nn_iters = 50\n\n# number of initial samples to calculate\nn_pre_samples=10\n```\n\n- please note: scripts (after slight modifications) can be run from the command line\n- sample data file provided (`nr-ahr-lite.csv ` from my [tox21 dataset](https://github.com/filipsPL/tox21_dataset))\n\n## Sample output\n\n- standard output from the Python Learner gives you C, gamma and CV AUROC values:\n\n```\nbest C 82404.4422051\nbest gamma 1.01295459839e-10\nbest AUROC 0.793847566575\n```\n\n- output ROC (from the ROC Curve node):\n\n![](obrazki/README-51e001c2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipspl%2Fbayesian-svm-knime-scikit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilipspl%2Fbayesian-svm-knime-scikit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipspl%2Fbayesian-svm-knime-scikit/lists"}