{"id":30548485,"url":"https://github.com/jespb/python-rbdgp","last_synced_at":"2025-08-28T03:08:05.889Z","repository":{"id":197020914,"uuid":"697830140","full_name":"jespb/Python-rbdGP","owner":"jespb","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-28T15:10:02.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-09-28T17:31:34.767Z","etag":null,"topics":[],"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/jespb.png","metadata":{"files":{"readme":"README.txt","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}},"created_at":"2023-09-28T15:02:48.000Z","updated_at":"2023-09-28T17:31:40.235Z","dependencies_parsed_at":null,"dependency_job_id":"a8e76cec-caf9-42f5-89ab-e8fee1011ad2","html_url":"https://github.com/jespb/Python-rbdGP","commit_stats":null,"previous_names":["jespb/python-rbdgp"],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/jespb/Python-rbdGP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jespb%2FPython-rbdGP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jespb%2FPython-rbdGP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jespb%2FPython-rbdGP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jespb%2FPython-rbdGP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jespb","download_url":"https://codeload.github.com/jespb/Python-rbdGP/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jespb%2FPython-rbdGP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272426365,"owners_count":24933024,"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-08-28T02:00:10.768Z","response_time":74,"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":[],"created_at":"2025-08-28T03:08:05.274Z","updated_at":"2025-08-28T03:08:05.882Z","avatar_url":"https://github.com/jespb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a, easy-to-use, scikit-learn inspired version of the Random Binary Decomposition Genetic Programming (rbdGP) algorithm.\n\n\nBy using this file, you are agreeing to this product's EULA\nThis product can be obtained in https://github.com/jespb/Python-rbdGP\nCopyright ©2023-2023 J. E. Batista\n\n\nThis file contains information about the command and flags used in the stand-alone version of this implementation and an explanation on how to import, use and edit this implementation.\n\n\nThis implementation of rbdGP can be used in a stand-alone fashion using the following command and flags:\n\n$ python Main_RbdGP_standalone.py\n\t\n\t[-d datasets] \n\t\t- This flag expects a set of csv dataset names separated by \";\" (e.g., a.csv;b.csv)\n\t\t- By default, the heart.csv dataset is used\t\t\n\n\t[-dsdir dir] \n\t\t- States the dataset directory. \n\t\t- By default \"datasets/\" is used \n\t\t- Use \"-dsdir ./\" for the root directory\t\n\n\t[-es elite_size]\n\t\t- This flag expects an integer with the elite size;\n\t\t- By default, the elite has size 1.\n\n\t[-md max_depth]\n\t\t- This flag expects an integer with the maximum initial depth for the trees;\n\t\t- By default, this value is set to 6.\t\t\n\n\t[-mg max_generation]\n\t\t- This flag expects an integer with the maximum number of generations;\n\t\t- By default, this value is set to 100.\n\n\t[-odir dir] \n\t\t- States the output directory. \n\t\t- By default \"results/\" is used \n\t\t- Use \"-odir ./\" for the root directory\n\t\n\t[-op operators]\n\t\t- This flag excepts a set of operators separated by \";\"\n\t\t- Allowed operators: +;-;*;/\n\t\t- By default, the used operators are the sum, subtraction, multiplication and protected division.\t\t\n\n\t[-ps population_size]\n\t\t- This flag expects an integer with the size of the population;\n\t\t- By default, this value is set to 500.\n\n\t[-runs number_of_runs] \n\t\t- This flag expects an integer with the number of runs to be made;\n\t\t- By default, this values is set to 30\n\t\n\t[-tf train_fraction]\n\t\t- This flag expects a float [0;1] with the fraction of the dataset to be used in training;\n\t\t- By default, this value is set to 0.70\n\t\n\t[-ts tournament_size]\n\t\t- This flag expects an integer with the tournament size;\n\t\t- By default, this value is set to 10.\n\n\t[-t number_of_threads]\n\t\t- This flag expects an integer with the number of threads to use while evaluating the population;\n\t\t- If the value is set to 1, the multiprocessing library will not be used \n\t\t- By default, this value is set to 1.\n\n\n\n\n\t\n\n\nHow to import this implementation to your project:\n\t- Download this repository;\n\t- Copy the \"rbdgp/\" directory to your project directory;\n\t- import the RbdGP class using \"from rbdgp.RbdGP import RbdGP\".\n\nHow to use this implementation:\n\t$ from rbdgp.RbdGP import RbdGP\n\t$ model = RbdGP()\n\t$ model.fit( training_x, training_y)\n\nArguments for RbdGP():\n\toperators\t\t\t-\u003e Operators used by the individual and the number of arguments (default: [(\"+\",2),(\"-\",2),(\"*\",2),(\"/\",2)] )\n\tmax_depth\t\t\t-\u003e Max initial depths of the individuals (default: 6)\n\tpopulation_size\t\t-\u003e Population size (default: 500)\n\tmax_generation\t\t-\u003e Maximum number of generations (default: 100)\n\ttournament_size\t\t-\u003e Tournament size (default: 5)\n\telitism_size\t\t-\u003e Elitism selection size (default: 1)\n\tlimit_depth\t\t\t-\u003e Maximum individual depth (default: 17)\n\tthreads \t\t\t-\u003e Number of CPU threads to be used (default: 1)\n\nArguments for model.fit():\n\tTr_X \t\t\t\t-\u003e Training samples\n\tTr_Y \t\t\t\t-\u003e Training labels\n\tTe_X \t\t\t\t-\u003e Test samples, used in the standalone version (default: None)\n\tTe_Y \t\t\t\t-\u003e Test labels, used in the standalone version (default: None)\n\n\nUseful methods:\n\t$ model = RbdGP()\t\t\t-\u003e starts the model;\n\t$ model.fit(X, Y)\t\t\t-\u003e fits the model to the dataset;\n\t$ model.predict(dataset)    -\u003e Returns a list with the prediction of the given dataset.\n\n\n\n\nHow to edit this implementation:\n\tFitness Function ( rbdgp.Individual ):\n\t\t- Change the getFitness() method to use your own fitness function;\n\t\t- This implementation assumes that a higher fitness is always better. To change this, edit the __gt__ method in this class;\n\t\t- You may use the getTrainingPredictions() and getTrainingSet() to obtain the models prediction and the training set;\n\t\t- You can also explore the behind the standard fitness function;\n\t\t- Warning: RbdGP evaluates every model in every run, as such, I do not recomend complex fitness functions. You should invest in fast evaluation methods to train a population.\n\n\tClassification method ( rbdgp.Individual ):\n\t\t- Change the trainModel() method to use your own classifier;\n\t\t- Assuming it is a scykit-learn implementation, you may only need to change the first few lines of this method;\n\t\t- Warning: RbdGP evaluates every model in every run, as such, I do not recomend complex classification model. You should invest in fast classification methods to train a population and the use a more complex method (if you wish) on the final model.\n\n\nReference:\n\tLiao, L., Pindur, A.K., Iba, H.: Genetic Programming with Random Binary Decomposition for Multi-Class Classification Problems. IEEE-CEC (2021)\n\tDOI: 10.1109/CEC45853.2021.9504967","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjespb%2Fpython-rbdgp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjespb%2Fpython-rbdgp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjespb%2Fpython-rbdgp/lists"}