ngboost 0.5.2.dev0__tar.gz → 0.5.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/PKG-INFO +1 -1
  2. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/ngboost.py +11 -4
  3. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/pyproject.toml +1 -1
  4. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/setup.py +1 -1
  5. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/LICENSE +0 -0
  6. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/README.md +0 -0
  7. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/__init__.py +0 -0
  8. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/api.py +0 -0
  9. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/__init__.py +0 -0
  10. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/categorical.py +0 -0
  11. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/cauchy.py +0 -0
  12. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/distn.py +0 -0
  13. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/exponential.py +0 -0
  14. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/gamma.py +0 -0
  15. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/laplace.py +0 -0
  16. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/lognormal.py +0 -0
  17. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/multivariate_normal.py +0 -0
  18. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/normal.py +0 -0
  19. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/poisson.py +0 -0
  20. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/t.py +0 -0
  21. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/distns/utils.py +0 -0
  22. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/evaluation.py +0 -0
  23. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/helpers.py +0 -0
  24. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/learners.py +0 -0
  25. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/manifold.py +0 -0
  26. {ngboost-0.5.2.dev0 → ngboost-0.5.3}/ngboost/scores.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ngboost
3
- Version: 0.5.2.dev0
3
+ Version: 0.5.3
4
4
  Summary: Library for probabilistic predictions via gradient boosting.
5
5
  Home-page: https://github.com/stanfordmlgroup/ngboost
6
6
  License: Apache-2.0
@@ -1,4 +1,5 @@
1
1
  """The NGBoost library"""
2
+
2
3
  # pylint: disable=line-too-long,too-many-instance-attributes,too-many-arguments
3
4
  # pylint: disable=unused-argument,too-many-locals,too-many-branches,too-many-statements
4
5
  # pylint: disable=unused-variable,invalid-unary-operand-type,attribute-defined-outside-init
@@ -342,7 +343,12 @@ class NGBoost:
342
343
  raise ValueError("y cannot be None")
343
344
 
344
345
  X, Y = check_X_y(
345
- X, Y, accept_sparse=True, y_numeric=True, multi_output=self.multi_output
346
+ X,
347
+ Y,
348
+ accept_sparse=True,
349
+ force_all_finite="allow-nan",
350
+ multi_output=self.multi_output,
351
+ y_numeric=True,
346
352
  )
347
353
 
348
354
  self.n_features = X.shape[1]
@@ -357,8 +363,9 @@ class NGBoost:
357
363
  X_val,
358
364
  Y_val,
359
365
  accept_sparse=True,
360
- y_numeric=True,
366
+ force_all_finite="allow-nan",
361
367
  multi_output=self.multi_output,
368
+ y_numeric=True,
362
369
  )
363
370
  val_params = self.pred_param(X_val)
364
371
  val_loss_list = []
@@ -490,7 +497,7 @@ class NGBoost:
490
497
  A NGBoost distribution object
491
498
  """
492
499
 
493
- X = check_array(X, accept_sparse=True)
500
+ X = check_array(X, accept_sparse=True, force_all_finite="allow-nan")
494
501
 
495
502
  params = np.asarray(self.pred_param(X, max_iter))
496
503
  dist = self.Dist(params.T)
@@ -537,7 +544,7 @@ class NGBoost:
537
544
  Numpy array of the estimates of Y
538
545
  """
539
546
 
540
- X = check_array(X, accept_sparse=True)
547
+ X = check_array(X, accept_sparse=True, force_all_finite="allow-nan")
541
548
 
542
549
  return self.pred_dist(X, max_iter=max_iter).predict()
543
550
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ngboost"
3
- version = "0.5.2dev"
3
+ version = "0.5.3"
4
4
  description = "Library for probabilistic predictions via gradient boosting."
5
5
  authors = ["Stanford ML Group <avati@cs.stanford.edu>"]
6
6
  readme = "README.md"
@@ -16,7 +16,7 @@ install_requires = \
16
16
 
17
17
  setup_kwargs = {
18
18
  'name': 'ngboost',
19
- 'version': '0.5.2.dev0',
19
+ 'version': '0.5.3',
20
20
  'description': 'Library for probabilistic predictions via gradient boosting.',
21
21
  'long_description': '# NGBoost: Natural Gradient Boosting for Probabilistic Prediction\n\n<h4 align="center">\n\n![Python package](https://github.com/stanfordmlgroup/ngboost/workflows/Python%20package/badge.svg)\n[![GitHub Repo Size](https://img.shields.io/github/repo-size/stanfordmlgroup/ngboost?label=Repo+Size)](https://github.com/stanfordmlgroup/ngboost/graphs/contributors)\n[![Github License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![PyPI](https://img.shields.io/pypi/v/ngboost?logo=pypi&logoColor=white)](https://pypi.org/project/ngboost)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/ngboost?logo=icloud&logoColor=white)](https://pypistats.org/packages/ngboost)\n\n</h4>\n\nngboost is a Python library that implements Natural Gradient Boosting, as described in ["NGBoost: Natural Gradient Boosting for Probabilistic Prediction"](https://stanfordmlgroup.github.io/projects/ngboost/). It is built on top of [Scikit-Learn](https://scikit-learn.org/stable/), and is designed to be scalable and modular with respect to choice of proper scoring rule, distribution, and base learner. A didactic introduction to the methodology underlying NGBoost is available in this [slide deck](https://docs.google.com/presentation/d/1Tn23Su0ygR6z11jy3xVNiLGv0ggiUQue/edit?usp=share_link&ouid=102290675300480810195&rtpof=true&sd=true).\n\n## Installation\n\n```sh\nvia pip\n\npip install --upgrade ngboost\n\nvia conda-forge\n\nconda install -c conda-forge ngboost\n```\n\n## Usage\n\nProbabilistic regression example on the Boston housing dataset:\n\n```python\nfrom ngboost import NGBRegressor\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import mean_squared_error\n\n#Load Boston housing dataset\ndata_url = "http://lib.stat.cmu.edu/datasets/boston"\nraw_df = pd.read_csv(data_url, sep="\\s+", skiprows=22, header=None)\nX = np.hstack([raw_df.values[::2, :], raw_df.values[1::2, :2]])\nY = raw_df.values[1::2, 2]\n\nX_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.2)\n\nngb = NGBRegressor().fit(X_train, Y_train)\nY_preds = ngb.predict(X_test)\nY_dists = ngb.pred_dist(X_test)\n\n# test Mean Squared Error\ntest_MSE = mean_squared_error(Y_preds, Y_test)\nprint(\'Test MSE\', test_MSE)\n\n# test Negative Log Likelihood\ntest_NLL = -Y_dists.logpdf(Y_test).mean()\nprint(\'Test NLL\', test_NLL)\n```\n\nDetails on available distributions, scoring rules, learners, tuning, and model interpretation are available in our [user guide](https://stanfordmlgroup.github.io/ngboost/intro.html), which also includes numerous usage examples and information on how to add new distributions or scores to NGBoost.\n\n## License\n\n[Apache License 2.0](https://github.com/stanfordmlgroup/ngboost/blob/master/LICENSE).\n\n## Reference\n\nTony Duan, Anand Avati, Daisy Yi Ding, Khanh K. Thai, Sanjay Basu, Andrew Y. Ng, Alejandro Schuler. 2019.\nNGBoost: Natural Gradient Boosting for Probabilistic Prediction.\n[arXiv](https://arxiv.org/abs/1910.03225)\n',
22
22
  'author': 'Stanford ML Group',
File without changes
File without changes
File without changes
File without changes
File without changes