{"id":25995161,"url":"https://github.com/pankajr141/ensembler","last_synced_at":"2025-07-19T19:06:48.066Z","repository":{"id":57426543,"uuid":"50485018","full_name":"pankajr141/ensembler","owner":"pankajr141","description":"Powerful stacking/blending ensemble implementation in python.","archived":false,"fork":false,"pushed_at":"2016-06-07T06:57:29.000Z","size":17,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T18:01:15.832Z","etag":null,"topics":["blending","ensemble","ensemble-learning","stacking"],"latest_commit_sha":null,"homepage":"","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/pankajr141.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}},"created_at":"2016-01-27T05:51:06.000Z","updated_at":"2022-09-29T09:16:07.000Z","dependencies_parsed_at":"2022-09-19T06:00:30.206Z","dependency_job_id":null,"html_url":"https://github.com/pankajr141/ensembler","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/pankajr141%2Fensembler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajr141%2Fensembler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajr141%2Fensembler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajr141%2Fensembler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pankajr141","download_url":"https://codeload.github.com/pankajr141/ensembler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242048555,"owners_count":20063404,"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":["blending","ensemble","ensemble-learning","stacking"],"created_at":"2025-03-05T15:19:02.979Z","updated_at":"2025-03-05T15:19:03.647Z","avatar_url":"https://github.com/pankajr141.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Usage\n--------\nBlending examples:\n\n#### Example 1 - Using default meta estimator (LogisticRegression)\n```shell\nfrom sklearn.ensemble import ExtraTreesClassifier\nfrom sklearn.ensemble import GradientBoostingClassifier\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.svm import SVC\nfrom ensembler import blend\n\nclfs = [\n          RandomForestClassifier(),\n          SVC(probability=True, degree=3, gamma=0.001, kernel='linear'),\n          ExtraTreesClassifier(max_depth=6, n_estimators=1000, max_features=None),\n]\n\n# Creating a blend/stack of 3 base level estimator with CV 3\nblendModel = blend.BlendModel(clfs, nFoldsBase=3)\nblendModel.fit(x, y)\npredictions = blendModel.predict(xHoldout)\nblendModel.score(xHoldout, yHoldOut)\n```\n\n\n#### Example 2 - Using custom meta estimator\n```shell\nfrom sklearn.ensemble import ExtraTreesClassifier\nfrom sklearn.ensemble import GradientBoostingClassifier\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.svm import SVC\nfrom ensembler import blend\n\nclfs = [\n          RandomForestClassifier(),\n          SVC(probability=True, degree=3, gamma=0.001, kernel='linear'),\n          ExtraTreesClassifier(max_depth=6, n_estimators=1000, max_features=None),\n]\n\n# Tuning parameters for meta estimator\nmetaTunedParamsRF = {\n                          'n_estimators': [2000, 1000, 500],\n                          'max_depth': [4, 6]\n                     }\nmetaEstimator = RandomForestClassifier()\nmetaTunedParams = metaTunedParamsRF\n\n# saveAndPickBaseDump is useful when we dont want to train base level estimator again, \n# it will initially train base estimatior and pickles them to disk. \n# This is handy while trying various metaEstimators\n# Creating a blend/stack of 3 base level estimator with CV 4 and custom metaEstimator\n blendModel = blend.BlendModel(clfs, nFoldsBase=4, \n                                saveAndPickBaseDump=True, saveAndPickBaseDumpLoc=r'pickle_dir',\n                                metaEstimator=metaEstimator, metaTunedParams=metaTunedParams\n                              )\nblendModel.fit(x, y)\npredictions = blendModel.predict(xHoldout)\nblendModel.score(xHoldout, yHoldOut)\n```\n\n\nInstallation\n------------\n\n#### Installing dependency\n\n```pip install git+https://github.com/fmfn/BayesianOptimization.git```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankajr141%2Fensembler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpankajr141%2Fensembler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankajr141%2Fensembler/lists"}