{"id":18407472,"url":"https://github.com/akai01/ngboost","last_synced_at":"2025-07-17T02:34:14.871Z","repository":{"id":130004489,"uuid":"404450462","full_name":"Akai01/ngboost","owner":"Akai01","description":" An R interface to the NGBoost.","archived":false,"fork":false,"pushed_at":"2022-11-08T20:05:10.000Z","size":215,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T15:51:43.343Z","etag":null,"topics":["ngboost","pyhon","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Akai01.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-09-08T18:14:35.000Z","updated_at":"2024-10-04T19:32:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"59b8098a-16bd-4da9-931e-39d99e3a5a98","html_url":"https://github.com/Akai01/ngboost","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/Akai01%2Fngboost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Akai01%2Fngboost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Akai01%2Fngboost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Akai01%2Fngboost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Akai01","download_url":"https://codeload.github.com/Akai01/ngboost/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247620622,"owners_count":20968247,"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":["ngboost","pyhon","r"],"created_at":"2024-11-06T03:14:07.209Z","updated_at":"2025-04-07T08:32:38.386Z","avatar_url":"https://github.com/Akai01.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# ngboost\n\n\u003c!-- badges: start --\u003e\n\n\u003c!-- badges: end --\u003e\n\nThe goal of ngboost is to provide an R interface for the Python package [NGBoost](https://stanfordmlgroup.github.io/ngboost/intro.html). \n\n## What is Natural Gradient Boosting?\n\n\"NGBoost is a method for probabilistic prediction with competitive state-of-the-art performance on a variety of datasets. NGBoost combines a multiparameter boosting algorithm with the natural gradient to efficiently estimate how parameters of the presumed outcome distribution vary with the observed features. NGBoost performs as well as existing methods for probabilistic regression but retains major advantages: NGBoost is flexible, scalable, and easy-to-use.\" (From the paper, Duan, et at., 2019, [see here](https://arxiv.org/pdf/1910.03225.pdf))\n\n\n## Installation\n\nThe development version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\n\ndevtools::install_github(\"Akai01/ngboost\")\n```\n## Example\n\nA probabilistic regression example on the Boston housing dataset: \n\n```{r example_regression}\nlibrary(ngboost)\n\ndata(Boston, package = \"MASS\")\n\ndta \u003c- rsample::initial_split(Boston)\n\ntrain \u003c- rsample::training(dta)\n\ntest \u003c- rsample::testing(dta)\n\n\nx_train = train[,1:13]\ny_train = train[,14]\n\nx_test = test[,1:13]\ny_test = test[,14]\n\n\nmodel \u003c- NGBRegression$new(Dist = Dist(\"Exponential\"),\n                           Base = sklearner(),\n                           Score = Scores(\"MLE\"),\n                           natural_gradient =TRUE,\n                           n_estimators = 600,\n                           learning_rate = 0.002,\n                           minibatch_frac = 0.8,\n                           col_sample = 0.9,\n                           verbose = TRUE,\n                           verbose_eval = 100,\n                           tol = 1e-5)\n\nmodel$fit(X = x_train, Y = y_train, X_val = x_test, Y_val = y_test)\n\nmodel$feature_importances()\n\nmodel$plot_feature_importance()\n\nmodel$predict(x_test)%\u003e%head()\n\ndistt \u003c- model$pred_dist(x_test) # it returns a NGBDist\n\nclass(distt)\n\n?NGBDist # see the available methods\n\ndistt$interval(confidence = .9)\n\n```\n\nClassification example:\n\n```{r example_class, echo=TRUE, warning = FALSE, message = FALSE}\ndata(BreastCancer, package = \"mlbench\")\n\ndta \u003c- na.omit(BreastCancer)\n\ndta \u003c- rsample::initial_split(dta)\n\ntrain \u003c- rsample::training(dta)\n\ntest \u003c- rsample::testing(dta)\n\nx_train = train[,2:10]\ny_train = as.integer(train[,11])\n\nx_test = test[,2:10]\ny_test = as.integer(test[,11])\n\n\nmodel \u003c- NGBClassifier$new(Dist = Dist(\"k_categorical\", k = 3),\n                           Base = sklearner(),\n                           Score = Scores(\"LogScore\"),\n                           natural_gradient = TRUE,\n                           n_estimators = 100,\n                           tol = 1e-5,\n                           random_state = NULL)\n\nmodel$fit(x_train, y_train, X_val = x_test, Y_val = y_test)\n\nmodel$feature_importances()\n\nmodel$plot_feature_importance()\n\nmodel$predict(x_test)\n\nmodel$predict_proba(x_test)%\u003e%head()\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakai01%2Fngboost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakai01%2Fngboost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakai01%2Fngboost/lists"}