{"id":13689115,"url":"https://github.com/jaswinder9051998/zoofs","last_synced_at":"2025-10-21T20:06:25.978Z","repository":{"id":41178676,"uuid":"278821412","full_name":"jaswinder9051998/zoofs","owner":"jaswinder9051998","description":"zoofs is a python library for performing feature selection using a variety of nature-inspired wrapper algorithms. The algorithms range from swarm-intelligence to physics-based to Evolutionary. It's easy to use , flexible and powerful tool to reduce your feature size.","archived":false,"fork":false,"pushed_at":"2025-06-20T05:31:23.000Z","size":7080,"stargazers_count":248,"open_issues_count":21,"forks_count":47,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-25T17:42:45.756Z","etag":null,"topics":["evolutionary-algorithms","feature-selection","genetic-algorithm","grey-wolf","grey-wolf-optimizer","machine-learning","machine-learning-algorithms","machinelearning","optimization","optimization-algorithms","optimization-methods","optimization-tools","particle-swarm","particle-swarm-optimization","python","subset-selection","supervised-learning"],"latest_commit_sha":null,"homepage":"https://jaswinder9051998.github.io/zoofs/","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/jaswinder9051998.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2020-07-11T08:33:37.000Z","updated_at":"2025-07-28T04:17:56.000Z","dependencies_parsed_at":"2023-11-09T12:29:25.325Z","dependency_job_id":"209560a4-ee7a-4e78-bc3d-831812e22766","html_url":"https://github.com/jaswinder9051998/zoofs","commit_stats":{"total_commits":239,"total_committers":6,"mean_commits":"39.833333333333336","dds":0.03765690376569042,"last_synced_commit":"7c502b88818dcdf82387d617d6dcf8b9447c2dc5"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jaswinder9051998/zoofs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaswinder9051998%2Fzoofs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaswinder9051998%2Fzoofs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaswinder9051998%2Fzoofs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaswinder9051998%2Fzoofs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaswinder9051998","download_url":"https://codeload.github.com/jaswinder9051998/zoofs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaswinder9051998%2Fzoofs/sbom","scorecard":{"id":507807,"data":{"date":"2025-08-11","repo":{"name":"github.com/jaswinder9051998/zoofs","commit":"7c502b88818dcdf82387d617d6dcf8b9447c2dc5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 2/20 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/workflow.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/jaswinder9051998/zoofs/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/jaswinder9051998/zoofs/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/workflow.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/jaswinder9051998/zoofs/workflow.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/workflow.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/jaswinder9051998/zoofs/workflow.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/workflow.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/jaswinder9051998/zoofs/workflow.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:16","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:17","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:18","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:19","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:20","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:27","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:17","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:18","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:19","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:20","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:27","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/workflow.yml:31","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of  27 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T23:41:55.974Z","repository_id":41178676,"created_at":"2025-08-19T23:41:55.974Z","updated_at":"2025-08-19T23:41:55.974Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280325300,"owners_count":26311419,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["evolutionary-algorithms","feature-selection","genetic-algorithm","grey-wolf","grey-wolf-optimizer","machine-learning","machine-learning-algorithms","machinelearning","optimization","optimization-algorithms","optimization-methods","optimization-tools","particle-swarm","particle-swarm-optimization","python","subset-selection","supervised-learning"],"created_at":"2024-08-02T15:01:34.137Z","updated_at":"2025-10-21T20:06:25.959Z","avatar_url":"https://github.com/jaswinder9051998.png","language":"Python","funding_links":[],"categories":["Feature Engineering","Python"],"sub_categories":["Feature Selection"],"readme":"![zoofs Logo Header](https://github.com/jaswinder9051998/zoofs/blob/master/asserts/zoofsedited.png)\n\n\u003cdiv align=\"center\"\u003e\n \n\u003ch1\u003e 🐾 zoofs ( Zoo Feature Selection ) \u003c/h1\u003e\n\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=jaswinder9051998_zoofs\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=jaswinder9051998_zoofs) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=jaswinder9051998_zoofs\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=jaswinder9051998_zoofs) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=jaswinder9051998_zoofs\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=jaswinder9051998_zoofs) [![\u003cSonarcloud quality gate\u003e](https://sonarcloud.io/api/project_badges/measure?project=jaswinder9051998_zoofs\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=jaswinder9051998_zoofs) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5638846.svg)](https://doi.org/10.5281/zenodo.5638846) [![PyPI version](https://badge.fury.io/py/zoofs.svg)](https://badge.fury.io/py/zoofs) [![Downloads](https://pepy.tech/badge/zoofs)](https://pepy.tech/project/zoofs) [![codecov](https://codecov.io/gh/jaswinder9051998/zoofs/branch/master/graph/badge.svg?token=TMFNF6Y7A2)](https://codecov.io/gh/jaswinder9051998/zoofs) [![Open In Colab](https://camo.githubusercontent.com/52feade06f2fecbf006889a904d221e6a730c194/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667)](https://colab.research.google.com/drive/12LYc67hIuy7PKSa8J_75bQUZ62EBJz4J?usp=sharing)  [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jaswinder9051998/zoofs/HEAD) [![Gitter](https://img.shields.io/gitter/room/DAVFoundation/DAV-Contributors.svg?style=flat-square)](https://gitter.im/zooFeatureSelection/community)\n \n \u003c/div\u003e\n \n``zoofs`` is a Python library for performing feature selection using a variety of nature inspired wrapper algorithms. The algorithms range from swarm-intelligence to physics based to Evolutionary.\nIt's an easy to use, flexible and powerful tool to reduce your feature size.  \n \n🌟 Like this Project? Give us a star !\n \n## 📘 Documentation \nhttps://jaswinder9051998.github.io/zoofs/\n\n \n## 🔗 Whats new in V0.1.24\n- pass kwargs through objective function\n- improved logger for results \n- added harris hawk algorithm\n- now you can pass ``timeout`` as a parameter to stop operation after the given number of second(s). An amazing alternative to passing number of iterations\n- Feature score hashing of visited feature sets to increase the overall performance\n \n## 🛠 Installation\n\n### Using pip\n\nUse the package manager to install zoofs.\n\n```bash\npip install zoofs\n```\n\n## 📜 Available Algorithms\n| Algorithm Name | Class Name | Description | References doi |\n|----------|-------------|-------------|-------------|\n| Particle Swarm Algorithm  | ParticleSwarmOptimization | Utilizes swarm behaviour | [https://doi.org/10.1007/978-3-319-13563-2_51](https://doi.org/10.1007/978-3-319-13563-2_51) |\n| Grey Wolf Algorithm | GreyWolfOptimization | Utilizes wolf hunting behaviour |  [https://doi.org/10.1016/j.neucom.2015.06.083](https://doi.org/10.1016/j.neucom.2015.06.083) |\n| Dragon Fly Algorithm | DragonFlyOptimization | Utilizes dragonfly swarm behaviour | [https://doi.org/10.1016/j.knosys.2020.106131](https://doi.org/10.1016/j.knosys.2020.106131) |\n| Harris Hawk Algorithm | HarrisHawkOptimization | Utilizes hawk hunting behaviour | [https://link.springer.com/chapter/10.1007/978-981-32-9990-0_12](https://link.springer.com/chapter/10.1007/978-981-32-9990-0_12) |\n| Genetic Algorithm Algorithm | GeneticOptimization | Utilizes genetic mutation behaviour | [https://doi.org/10.1109/ICDAR.2001.953980](https://doi.org/10.1109/ICDAR.2001.953980) |\n| Gravitational Algorithm | GravitationalOptimization | Utilizes newtons gravitational behaviour | [https://doi.org/10.1109/ICASSP.2011.5946916](https://doi.org/10.1109/ICASSP.2011.5946916) |\n\nMore algos soon, stay tuned !\n* [Try It Now?] [![Open In Colab](https://camo.githubusercontent.com/52feade06f2fecbf006889a904d221e6a730c194/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667)](https://colab.research.google.com/drive/12LYc67hIuy7PKSa8J_75bQUZ62EBJz4J?usp=sharing)\n\n## ⚡️ Usage\n \n\nDefine your own objective function for optimization !\n \n### Classification Example\n \n```python\nfrom sklearn.metrics import log_loss\n# define your own objective function, make sure the function receives four parameters,\n#  fit your model and return the objective value !\ndef objective_function_topass(model,X_train, y_train, X_valid, y_valid):      \n    model.fit(X_train,y_train)  \n    P=log_loss(y_valid,model.predict_proba(X_valid))\n    return P\n\n# import an algorithm !  \nfrom zoofs import ParticleSwarmOptimization\n# create object of algorithm\nalgo_object=ParticleSwarmOptimization(objective_function_topass,n_iteration=20,\n                                       population_size=20,minimize=True)\nimport lightgbm as lgb\nlgb_model = lgb.LGBMClassifier()                                       \n# fit the algorithm\nalgo_object.fit(lgb_model,X_train, y_train, X_valid, y_valid,verbose=True)\n#plot your results\nalgo_object.plot_history()\n\n```\n \n### Regression Example\n \n```python\nfrom sklearn.metrics import mean_squared_error\n# define your own objective function, make sure the function receives four parameters,\n#  fit your model and return the objective value !\ndef objective_function_topass(model,X_train, y_train, X_valid, y_valid):      \n    model.fit(X_train,y_train)  \n    P=mean_squared_error(y_valid,model.predict(X_valid))\n    return P\n\n# import an algorithm !  \nfrom zoofs import ParticleSwarmOptimization\n# create object of algorithm\nalgo_object=ParticleSwarmOptimization(objective_function_topass,n_iteration=20,\n                                       population_size=20,minimize=True)\nimport lightgbm as lgb\nlgb_model = lgb.LGBMRegressor()                                       \n# fit the algorithm\nalgo_object.fit(lgb_model,X_train, y_train, X_valid, y_valid,verbose=True)\n#plot your results\nalgo_object.plot_history()\n\n```\n \n### Suggestions for Usage\n- As available algorithms are wrapper algos, it is better to use ml models that build quicker, e.g lightgbm, catboost.\n- Take sufficient amount for 'population_size' , as this will determine the extent of exploration and exploitation of the algo.\n- Ensure that your ml model has its hyperparamters optimized before passing it to zoofs algos.\n\n\n### objective score plot\n![objective score Header](https://github.com/jaswinder9051998/zoofs/blob/master/asserts/p2.PNG)\n\n \u003cbr/\u003e\n \u003cbr/\u003e\n\n## Algorithms\n\n\u003cdetails\u003e\n\u003csummary markdown=\"span\"\u003e Particle Swarm Algorithm \u003c/summary\u003e\n \n![Particle Swarm](https://media.giphy.com/media/tBRQNyh6fKBpSy2oif/giphy.gif)\n\nIn computational science, particle swarm optimization (PSO) is a computational method that optimizes a problem by iteratively trying to improve a candidate solution with regard to a given measure of quality. It solves a problem by having a population of candidate solutions, here dubbed particles, and moving these particles around in the search-space according to simple mathematical formula over the particle's position and velocity. Each particle's movement is influenced by its local best known position, but is also guided toward the best known positions in the search-space, which are updated as better positions are found by other particles. This is expected to move the swarm toward the best solutions.\n \n------------------------------------------\n#### class zoofs.ParticleSwarmOptimization(objective_function,n_iteration=50,population_size=50,minimize=True,c1=2,c2=2,w=0.9)\n------------------------------------------\n\n|  |  |\n|----------|-------------|\n|  Parameters  | ``objective_function`` :  user made function of the signature 'func(model,X_train,y_train,X_test,y_test)'. \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The function must return a value, that needs to be minimized/maximized. \u003c/dd\u003e \u003c/dl\u003e ``n_iteration ``: int, default=1000 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Number of time the algorithm will run  \u003c/dd\u003e \u003c/dl\u003e ``timeout``: int = None \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Stop operation after the given number of second(s). If this argument is set to None, the operation is executed without time limitation and n_iteration is followed \u003c/dd\u003e \u003c/dl\u003e ``population_size`` : int, default=50 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Total size of the population  \u003c/dd\u003e \u003c/dl\u003e ``minimize ``: bool, default=True \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Defines if the objective value is to be maximized or minimized \u003c/dd\u003e \u003c/dl\u003e ``c1`` : float, default=2.0 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e first acceleration coefficient of particle swarm  \u003c/dd\u003e \u003c/dl\u003e    ``c2`` : float, default=2.0 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e second acceleration coefficient of particle swarm  \u003c/dd\u003e \u003c/dl\u003e `w` : float, default=0.9 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e weight parameter  \u003c/dd\u003e \u003c/dl\u003e|\n| Attributes | ``best_feature_list`` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### Methods\n\n| Methods | Class Name |\n|----------|-------------|\n|  fit  | Run the algorithm  |\n| plot_history | Plot results achieved across iteration |\n\n#### fit(model,X_train, y_train, X_test, y_test,verbose=True)\n\n|  |  |\n|----------|-------------|\n|   Parameters | ``model`` : \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e machine learning model's object \u003c/dd\u003e \u003c/dl\u003e ``X_train`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e\u003cdl\u003e \u003cdd\u003e Training input samples to be used for machine learning model \u003c/dd\u003e \u003c/dl\u003e ``y_train`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples) \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The target values (class labels in classification, real numbers in regression). \u003c/dd\u003e \u003c/dl\u003e ``X_valid`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Validation input samples \u003c/dd\u003e \u003c/dl\u003e ``y_valid`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The Validation target values . \u003c/dd\u003e \u003c/dl\u003e ``verbose`` : bool,default=True  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Print results for iterations \u003c/dd\u003e \u003c/dl\u003e|\n| Returns  | ``best_feature_list `` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### plot_history()\nPlot results across iterations\n\n#### Example\n```python\nfrom sklearn.metrics import log_loss\n# define your own objective function, make sure the function receives four parameters,\n#  fit your model and return the objective value !\ndef objective_function_topass(model,X_train, y_train, X_valid, y_valid):      \n    model.fit(X_train,y_train)  \n    P=log_loss(y_valid,model.predict_proba(X_valid))\n    return P\n\n# import an algorithm !  \nfrom zoofs import ParticleSwarmOptimization\n# create object of algorithm\nalgo_object=ParticleSwarmOptimization(objective_function_topass,n_iteration=20,\n                                       population_size=20,minimize=True,c1=2,c2=2,w=0.9)\nimport lightgbm as lgb\nlgb_model = lgb.LGBMClassifier()                      \n# fit the algorithm\nalgo_object.fit(lgb_model,X_train, y_train, X_valid, y_valid,verbose=True)\n#plot your results\nalgo_object.plot_history()\n```  \n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003c/details\u003e\n \n\u003cdetails\u003e\n\u003csummary markdown=\"span\"\u003e Grey Wolf Algorithm \u003c/summary\u003e\n \n![Grey Wolf](https://media.giphy.com/media/CvgezXSuQTMTC/giphy.gif)\n\nThe Grey Wolf Optimizer (GWO) mimics the leadership hierarchy and hunting mechanism of grey wolves in nature. Four types of grey wolves such as alpha, beta, delta, and omega are employed for simulating the leadership hierarchy. In addition, three main steps of hunting, searching for prey, encircling prey, and attacking prey, are implemented to perform optimization.\n \n------------------------------------------\n#### class zoofs.GreyWolfOptimization(objective_function,n_iteration=50,population_size=50,minimize=True)\n------------------------------------------\n|  |  |\n|----------|-------------|\n|  Parameters  | ``objective_function`` :  user made function of the signature 'func(model,X_train,y_train,X_test,y_test)'. \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The function must return a value, that needs to be minimized/maximized. \u003c/dd\u003e \u003c/dl\u003e ``n_iteration ``: int, default=50 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Number of time the algorithm will run  \u003c/dd\u003e \u003c/dl\u003e ``timeout``: int = None \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Stop operation after the given number of second(s). If this argument is set to None, the operation is executed without time limitation and n_iteration is followed \u003c/dd\u003e \u003c/dl\u003e ``population_size`` : int, default=50 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Total size of the population  \u003c/dd\u003e \u003c/dl\u003e ``method`` : {1, 2}, default=1 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Choose the between the two methods of grey wolf optimization \u003c/dd\u003e \u003c/dl\u003e ``minimize ``: bool, default=True \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Defines if the objective value is to be maximized or minimized \u003c/dd\u003e \u003c/dl\u003e|\n| Attributes | ``best_feature_list`` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### Methods\n\n| Methods | Class Name |\n|----------|-------------|\n|  fit  | Run the algorithm  |\n| plot_history | Plot results achieved across iteration |\n\n#### fit(model,X_train,y_train,X_valid,y_valid,method=1,verbose=True)\n\n|  |  |\n|----------|-------------|\n|   Parameters | ``model`` : \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e machine learning model's object \u003c/dd\u003e \u003c/dl\u003e ``X_train`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e\u003cdl\u003e \u003cdd\u003e Training input samples to be used for machine learning model \u003c/dd\u003e \u003c/dl\u003e ``y_train`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples) \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The target values (class labels in classification, real numbers in regression). \u003c/dd\u003e \u003c/dl\u003e ``X_valid`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Validation input samples \u003c/dd\u003e \u003c/dl\u003e ``y_valid`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The Validation target values . \u003c/dd\u003e \u003c/dl\u003e ``verbose`` : bool,default=True  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Print results for iterations \u003c/dd\u003e \u003c/dl\u003e|\n| Returns  | ``best_feature_list `` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### plot_history()\nPlot results across iterations\n\n#### Example\n```python\nfrom sklearn.metrics import log_loss\n# define your own objective function, make sure the function receives four parameters,\n#  fit your model and return the objective value !\ndef objective_function_topass(model,X_train, y_train, X_valid, y_valid):      \n    model.fit(X_train,y_train)  \n    P=log_loss(y_valid,model.predict_proba(X_valid))\n    return P\n\n# import an algorithm !  \nfrom zoofs import GreyWolfOptimization\n# create object of algorithm\nalgo_object=GreyWolfOptimization(objective_function_topass,n_iteration=20,method=1,\n                                    population_size=20,minimize=True)\nimport lightgbm as lgb\nlgb_model = lgb.LGBMClassifier()                                       \n# fit the algorithm\nalgo_object.fit(lgb_model,X_train, y_train, X_valid, y_valid,verbose=True)\n#plot your results\nalgo_object.plot_history()\n```  \n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003c/details\u003e\n \n\u003cdetails\u003e\n\u003csummary markdown=\"span\"\u003e Dragon Fly Algorithm \u003c/summary\u003e\n \n![Dragon Fly](https://media.giphy.com/media/xTiTnozh5piv13iFBC/giphy.gif)\n\nThe main inspiration of the Dragonfly Algorithm (DA) algorithm originates from static and dynamic swarming behaviours. These two swarming behaviours are very similar to the two main phases of optimization using meta-heuristics: exploration and exploitation. Dragonflies create sub swarms and fly over different areas in a static swarm, which is the main objective of the exploration phase. In the static swarm, however, dragonflies fly in bigger swarms and along one direction, which is favourable in the exploitation phase.\n \n------------------------------------------\n#### class zoofs.DragonFlyOptimization(objective_function,n_iteration=50,population_size=50,minimize=True)\n------------------------------------------\n|  |  |\n|----------|-------------|\n|  Parameters  | ``objective_function`` :  user made function of the signature 'func(model,X_train,y_train,X_test,y_test)'. \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The function must return a value, that needs to be minimized/maximized. \u003c/dd\u003e \u003c/dl\u003e ``n_iteration ``: int, default=50 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Number of time the algorithm will run  \u003c/dd\u003e \u003c/dl\u003e ``timeout``: int = None \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Stop operation after the given number of second(s). If this argument is set to None, the operation is executed without time limitation and n_iteration is followed \u003c/dd\u003e \u003c/dl\u003e ``population_size`` : int, default=50 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Total size of the population  \u003c/dd\u003e \u003c/dl\u003e ``method`` : {'linear','random','quadraic','sinusoidal'}, default='sinusoidal' \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Choose the between the three methods of Dragon Fly optimization \u003c/dd\u003e \u003c/dl\u003e ``minimize ``: bool, default=True \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Defines if the objective value is to be maximized or minimized \u003c/dd\u003e \u003c/dl\u003e|\n| Attributes | ``best_feature_list`` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### Methods\n\n| Methods | Class Name |\n|----------|-------------|\n|  fit  | Run the algorithm  |\n| plot_history | Plot results achieved across iteration |\n\n#### fit(model,X_train,y_train,X_valid,y_valid,method='sinusoidal',verbose=True)\n\n|  |  |\n|----------|-------------|\n|   Parameters | ``model`` : \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e machine learning model's object \u003c/dd\u003e \u003c/dl\u003e ``X_train`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e\u003cdl\u003e \u003cdd\u003e Training input samples to be used for machine learning model \u003c/dd\u003e \u003c/dl\u003e ``y_train`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples) \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The target values (class labels in classification, real numbers in regression). \u003c/dd\u003e \u003c/dl\u003e ``X_valid`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Validation input samples \u003c/dd\u003e \u003c/dl\u003e ``y_valid`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The Validation target values . \u003c/dd\u003e \u003c/dl\u003e ``verbose`` : bool,default=True  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Print results for iterations \u003c/dd\u003e \u003c/dl\u003e|\n| Returns  | ``best_feature_list `` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### plot_history()\nPlot results across iterations\n\n#### Example\n```python\nfrom sklearn.metrics import log_loss\n# define your own objective function, make sure the function receives four parameters,\n#  fit your model and return the objective value !\ndef objective_function_topass(model,X_train, y_train, X_valid, y_valid):      \n    model.fit(X_train,y_train)  \n    P=log_loss(y_valid,model.predict_proba(X_valid))\n    return P\n\n# import an algorithm !  \nfrom zoofs import DragonFlyOptimization\n# create object of algorithm\nalgo_object=DragonFlyOptimization(objective_function_topass,n_iteration=20,method='sinusoidal',\n                                    population_size=20,minimize=True)\nimport lightgbm as lgb\nlgb_model = lgb.LGBMClassifier()                                     \n# fit the algorithm\nalgo_object.fit(lgb_model,X_train, y_train, X_valid, y_valid,  verbose=True)\n#plot your results\nalgo_object.plot_history()\n```  \n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003c/details\u003e\n \n\u003cdetails\u003e\n\u003csummary markdown=\"span\"\u003e Harris Hawk Optimization \u003c/summary\u003e\n \n![Harris Hawk](https://media.giphy.com/media/lq2hmYpAAomgT3dyh3/giphy.gif)\n\nHHO is a popular swarm-based, gradient-free optimization algorithm with several active and time-varying phases of exploration and exploitation. This algorithm initially published by the prestigious Journal of Future Generation Computer Systems (FGCS) in 2019, and from the first day, it has gained increasing attention among researchers due to its flexible structure, high performance, and high-quality results. The main logic of the HHO method is designed based on the cooperative behaviour and chasing styles of Harris' hawks in nature called \"surprise pounce\". Currently, there are many suggestions about how to enhance the functionality of HHO, and there are also several enhanced variants of the HHO in the leading Elsevier and IEEE transaction journals.\n \n------------------------------------------\n#### class zoofs.HarrisHawkOptimization(objective_function,n_iteration=50,population_size=50,minimize=True,beta=0.5)\n------------------------------------------\n\n|  |  |\n|----------|-------------|\n|  Parameters  | ``objective_function`` :  user made function of the signature 'func(model,X_train,y_train,X_test,y_test)'. \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The function must return a value, that needs to be minimized/maximized. \u003c/dd\u003e \u003c/dl\u003e ``n_iteration ``: int, default=1000 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Number of time the algorithm will run  \u003c/dd\u003e \u003c/dl\u003e ``timeout``: int = None \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Stop operation after the given number of second(s). If this argument is set to None, the operation is executed without time limitation and n_iteration is followed \u003c/dd\u003e \u003c/dl\u003e ``population_size`` : int, default=50 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Total size of the population  \u003c/dd\u003e \u003c/dl\u003e ``minimize ``: bool, default=True \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Defines if the objective value is to be maximized or minimized \u003c/dd\u003e \u003c/dl\u003e ``beta`` : float, default=0.5 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e value for levy random walk  \u003c/dd\u003e \u003c/dl\u003e |\n| Attributes | ``best_feature_list`` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### Methods\n\n| Methods | Class Name |\n|----------|-------------|\n|  fit  | Run the algorithm  |\n| plot_history | Plot results achieved across iteration |\n\n#### fit(model,X_train, y_train, X_test, y_test,verbose=True)\n\n|  |  |\n|----------|-------------|\n|   Parameters | ``model`` : \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e machine learning model's object \u003c/dd\u003e \u003c/dl\u003e ``X_train`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e\u003cdl\u003e \u003cdd\u003e Training input samples to be used for machine learning model \u003c/dd\u003e \u003c/dl\u003e ``y_train`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples) \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The target values (class labels in classification, real numbers in regression). \u003c/dd\u003e \u003c/dl\u003e ``X_valid`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Validation input samples \u003c/dd\u003e \u003c/dl\u003e ``y_valid`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The Validation target values . \u003c/dd\u003e \u003c/dl\u003e ``verbose`` : bool,default=True  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Print results for iterations \u003c/dd\u003e \u003c/dl\u003e|\n| Returns  | ``best_feature_list `` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### plot_history()\nPlot results across iterations\n\n#### Example\n```python\nfrom sklearn.metrics import log_loss\n# define your own objective function, make sure the function receives four parameters,\n#  fit your model and return the objective value !\ndef objective_function_topass(model,X_train, y_train, X_valid, y_valid):      \n    model.fit(X_train,y_train)  \n    P=log_loss(y_valid,model.predict_proba(X_valid))\n    return P\n\n# import an algorithm !  \nfrom zoofs import HarrisHawkOptimization\n# create object of algorithm\nalgo_object=HarrisHawkOptimization(objective_function_topass,n_iteration=20,\n                                       population_size=20,minimize=True)\nimport lightgbm as lgb\nlgb_model = lgb.LGBMClassifier()                      \n# fit the algorithm\nalgo_object.fit(lgb_model,X_train, y_train, X_valid, y_valid,verbose=True)\n#plot your results\nalgo_object.plot_history()\n```  \n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003c/details\u003e\n \n\u003cdetails\u003e\n\u003csummary markdown=\"span\"\u003e Genetic Algorithm \u003c/summary\u003e\n \n![Dragon Fly](https://media.giphy.com/media/3o85xGrC7nPVbA2y3K/giphy.gif)\n\nIn computer science and operations research, a genetic algorithm (GA) is a metaheuristic inspired by the process of natural selection that belongs to the larger class of evolutionary algorithms (EA). Genetic algorithms are commonly used to generate high-quality solutions to optimization and search problems by relying on biologically inspired operators such as mutation, crossover and selection. Some examples of GA applications include optimizing decision trees for better performance, automatically solve sudoku puzzles, hyperparameter optimization, etc.\n \n------------------------------------------\n#### class zoofs.GeneticOptimization(objective_function,n_iteration=20,population_size=20,selective_pressure=2,elitism=2,mutation_rate=0.05,minimize=True)\n------------------------------------------\n|  |  |\n|----------|-------------|\n|  Parameters  | ``objective_function`` :  user made function of the signature 'func(model,X_train,y_train,X_test,y_test)'. \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The function must return a value, that needs to be minimized/maximized. \u003c/dd\u003e \u003c/dl\u003e ``n_iteration``: int, default=50 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Number of time the algorithm will run  \u003c/dd\u003e \u003c/dl\u003e ``timeout``: int = None \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Stop operation after the given number of second(s). If this argument is set to None, the operation is executed without time limitation and n_iteration is followed \u003c/dd\u003e \u003c/dl\u003e ``population_size`` : int, default=50 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Total size of the population  \u003c/dd\u003e \u003c/dl\u003e ``selective_pressure``: int, default=2 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003emeasure of reproductive opportunities for each organism in the population \u003c/dd\u003e \u003c/dl\u003e ``elitism``: int, default=2 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e number of top individuals to be considered as elites \u003c/dd\u003e \u003c/dl\u003e ``mutation_rate``: float, default=0.05 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e rate of mutation in the population's gene \u003c/dd\u003e \u003c/dl\u003e ``minimize``: bool, default=True \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Defines if the objective value is to be maximized or minimized \u003c/dd\u003e \u003c/dl\u003e|\n| Attributes | ``best_feature_list`` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### Methods\n\n| Methods | Class Name |\n|----------|-------------|\n|  fit  | Run the algorithm  |\n| plot_history | Plot results achieved across iteration |\n\n#### fit(model,X_train,y_train,X_valid,y_valid,verbose=True)\n\n|  |  |\n|----------|-------------|\n|   Parameters | ``model`` : \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e machine learning model's object \u003c/dd\u003e \u003c/dl\u003e ``X_train`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e\u003cdl\u003e \u003cdd\u003e Training input samples to be used for machine learning model \u003c/dd\u003e \u003c/dl\u003e ``y_train`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples) \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The target values (class labels in classification, real numbers in regression). \u003c/dd\u003e \u003c/dl\u003e ``X_valid`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Validation input samples \u003c/dd\u003e \u003c/dl\u003e ``y_valid`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The Validation target values . \u003c/dd\u003e \u003c/dl\u003e ``verbose`` : bool,default=True  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Print results for iterations \u003c/dd\u003e \u003c/dl\u003e|\n| Returns  | ``best_feature_list `` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### plot_history()\nPlot results across iterations\n\n#### Example\n```python\nfrom sklearn.metrics import log_loss\n# define your own objective function, make sure the function receives four parameters,\n#  fit your model and return the objective value !\ndef objective_function_topass(model,X_train, y_train, X_valid, y_valid):      \n    model.fit(X_train,y_train)  \n    P=log_loss(y_valid,model.predict_proba(X_valid))\n    return P\n\n# import an algorithm !  \nfrom zoofs import GeneticOptimization\n# create object of algorithm\nalgo_object=GeneticOptimization(objective_function_topass,n_iteration=20,\n                            population_size=20,selective_pressure=2,elitism=2,\n                            mutation_rate=0.05,minimize=True)\nimport lightgbm as lgb\nlgb_model = lgb.LGBMClassifier()                            \n# fit the algorithm\nalgo_object.fit(lgb_model,X_train, y_train,X_valid, y_valid, verbose=True)\n#plot your results\nalgo_object.plot_history()\n```  \n\u003c/details\u003e\n \n\u003cdetails\u003e\n\u003csummary markdown=\"span\"\u003e Gravitational Algorithm \u003c/summary\u003e\n \n![Gravitational Algorithm](https://media.giphy.com/media/d1zp7XeNrzpWo/giphy.gif)\n\n Gravitational Algorithm is based on the law of gravity and mass interactions is introduced. In the algorithm, the searcher agents are a collection of masses which interact with each other based on the Newtonian gravity and the laws of motion.\n \n------------------------------------------\n#### class zoofs.GravitationalOptimization(self,objective_function,n_iteration=50,population_size=50,g0=100,eps=0.5,minimize=True)\n------------------------------------------\n|  |  |\n|----------|-------------|\n|  Parameters  | ``objective_function`` :  user made function of the signature 'func(model,X_train,y_train,X_test,y_test)'. \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The function must return a value, that needs to be minimized/maximized. \u003c/dd\u003e \u003c/dl\u003e ``n_iteration``: int, default=50 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Number of time the algorithm will run  \u003c/dd\u003e \u003c/dl\u003e ``timeout``: int = None \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Stop operation after the given number of second(s). If this argument is set to None, the operation is executed without time limitation and n_iteration is followed \u003c/dd\u003e \u003c/dl\u003e ``population_size`` : int, default=50 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Total size of the population  \u003c/dd\u003e \u003c/dl\u003e ``g0``: float, default=100 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e gravitational strength constant \u003c/dd\u003e \u003c/dl\u003e ``eps``: float, default=0.5 \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e distance constant \u003c/dd\u003e \u003c/dl\u003e``minimize``: bool, default=True \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Defines if the objective value is to be maximized or minimized \u003c/dd\u003e \u003c/dl\u003e|\n| Attributes | ``best_feature_list`` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### Methods\n\n| Methods | Class Name |\n|----------|-------------|\n|  fit  | Run the algorithm  |\n| plot_history | Plot results achieved across iteration |\n\n#### fit(model,X_train,y_train,X_valid,y_valid,verbose=True)\n\n|  |  |\n|----------|-------------|\n|   Parameters | ``model`` : \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e machine learning model's object \u003c/dd\u003e \u003c/dl\u003e ``X_train`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e\u003cdl\u003e \u003cdd\u003e Training input samples to be used for machine learning model \u003c/dd\u003e \u003c/dl\u003e ``y_train`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples) \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The target values (class labels in classification, real numbers in regression). \u003c/dd\u003e \u003c/dl\u003e ``X_valid`` : pandas.core.frame.DataFrame of shape (n_samples, n_features)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Validation input samples \u003c/dd\u003e \u003c/dl\u003e ``y_valid`` : pandas.core.frame.DataFrame or pandas.core.series.Series of shape (n_samples)  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e The Validation target values . \u003c/dd\u003e \u003c/dl\u003e ``verbose`` : bool,default=True  \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Print results for iterations \u003c/dd\u003e \u003c/dl\u003e|\n| Returns  | ``best_feature_list `` :  array-like \u003cbr/\u003e \u003cdl\u003e \u003cdd\u003e Final best set of features  \u003c/dd\u003e \u003c/dl\u003e |\n\n#### plot_history()\nPlot results across iterations\n\n#### Example\n```python\nfrom sklearn.metrics import log_loss\n# define your own objective function, make sure the function receives four parameters,\n#  fit your model and return the objective value !\ndef objective_function_topass(model,X_train, y_train, X_valid, y_valid):      \n    model.fit(X_train,y_train)  \n    P=log_loss(y_valid,model.predict_proba(X_valid))\n    return P\n\n# import an algorithm !  \nfrom zoofs import GravitationalOptimization\n# create object of algorithm\nalgo_object=GravitationalOptimization(objective_function_topass,n_iteration=50,\n                                population_size=50,g0=100,eps=0.5,minimize=True)\nimport lightgbm as lgb\nlgb_model = lgb.LGBMClassifier()                                \n# fit the algorithm\nalgo_object.fit(lgb_model,X_train, y_train, X_valid, y_valid, verbose=True)\n#plot your results\nalgo_object.plot_history()\n```  \n \u003c/details\u003e\n\n## Support `zoofs`\n\nThe development of ``zoofs`` relies completely on contributions.\n\n#### Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## First roll out\n18,08,2021\n\n## License\n[apache-2.0](https://choosealicense.com/licenses/apache-2.0/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaswinder9051998%2Fzoofs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaswinder9051998%2Fzoofs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaswinder9051998%2Fzoofs/lists"}