%global _empty_manifest_terminate_build 0 Name: python-cde Version: 0.6.1 Release: 1 Summary: Framework for conditional density estimation License: MIT URL: https://jonasrothfuss.github.io/Nonparametric_Density_Estimation Source0: https://mirrors.aliyun.com/pypi/web/packages/9c/8c/fc3be557e738b91bc203e73d4068186dc94a32c6ad10770d9af957793cd5/cde-0.6.1.tar.gz BuildArch: noarch %description [![Build Status](https://travis-ci.org/freelunchtheorem/Conditional_Density_Estimation.svg?branch=master)](https://travis-ci.org/freelunchtheorem/Conditional_Density_Estimation) [![Downloads](https://pepy.tech/badge/cde)](https://pepy.tech/project/cde) # Conditional Density Estimation (CDE) ## Description Implementations of various methods for conditional density estimation * **Parametric neural network based methods** * Mixture Density Network (MDN) * Kernel Mixture Network (KMN) * Normalizing Flows (NF) * **Nonparametric methods** * Conditional Kernel Density Estimation (CKDE) * Neighborhood Kernel Density Estimation (NKDE) * **Semiparametric methods** * Least Squares Conditional Density Estimation (LSKDE) Beyond estimating conditional probability densities, the package features extensive functionality for computing: * **Centered moments:** mean, covariance, skewness and kurtosis * **Statistical divergences:** KL-divergence, JS-divergence, Hellinger distance * **Percentiles and expected shortfall** ## Installation To use the library, you can directly use the python package index: ```bash pip install cde ``` or clone the GitHub repository and run ```bash pip install . ``` Note that the package only supports tensorflow versions between 1.4 and 1.7. ## Documentation and paper See the documentation [here](https://freelunchtheorem.github.io/Conditional_Density_Estimation). A paper on best practices and benchmarks on conditional density estimation with neural networks that makes extensive use of this library can be found [here](https://arxiv.org/abs/1903.00954). ## Usage The following code snipped holds an easy example that demonstrates how to use the cde package. ```python from cde.density_simulation import SkewNormal from cde.density_estimator import KernelMixtureNetwork import numpy as np """ simulate some data """ density_simulator = SkewNormal(random_seed=22) X, Y = density_simulator.simulate(n_samples=3000) """ fit density model """ model = KernelMixtureNetwork("KDE_demo", ndim_x=1, ndim_y=1, n_centers=50, x_noise_std=0.2, y_noise_std=0.1, random_seed=22) model.fit(X, Y) """ query the conditional pdf and cdf """ x_cond = np.zeros((1, 1)) y_query = np.ones((1, 1)) * 0.1 prob = model.pdf(x_cond, y_query) cum_prob = model.cdf(x_cond, y_query) """ compute conditional moments & VaR """ mean = model.mean_(x_cond)[0][0] std = model.std_(x_cond)[0][0] skewness = model.skewness(x_cond)[0] ``` ## Citing If you use CDE in your research, you can cite it as follows: ``` @article{rothfuss2019conditional, title={Conditional Density Estimation with Neural Networks: Best Practices and Benchmarks}, author={Rothfuss, Jonas and Ferreira, Fabio and Walther, Simon and Ulrich, Maxim}, journal={arXiv:1903.00954}, year={2019} } ``` ## Todo - creating a branch just for our conditional estimators + python package %package -n python3-cde Summary: Framework for conditional density estimation Provides: python-cde BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-cde [![Build Status](https://travis-ci.org/freelunchtheorem/Conditional_Density_Estimation.svg?branch=master)](https://travis-ci.org/freelunchtheorem/Conditional_Density_Estimation) [![Downloads](https://pepy.tech/badge/cde)](https://pepy.tech/project/cde) # Conditional Density Estimation (CDE) ## Description Implementations of various methods for conditional density estimation * **Parametric neural network based methods** * Mixture Density Network (MDN) * Kernel Mixture Network (KMN) * Normalizing Flows (NF) * **Nonparametric methods** * Conditional Kernel Density Estimation (CKDE) * Neighborhood Kernel Density Estimation (NKDE) * **Semiparametric methods** * Least Squares Conditional Density Estimation (LSKDE) Beyond estimating conditional probability densities, the package features extensive functionality for computing: * **Centered moments:** mean, covariance, skewness and kurtosis * **Statistical divergences:** KL-divergence, JS-divergence, Hellinger distance * **Percentiles and expected shortfall** ## Installation To use the library, you can directly use the python package index: ```bash pip install cde ``` or clone the GitHub repository and run ```bash pip install . ``` Note that the package only supports tensorflow versions between 1.4 and 1.7. ## Documentation and paper See the documentation [here](https://freelunchtheorem.github.io/Conditional_Density_Estimation). A paper on best practices and benchmarks on conditional density estimation with neural networks that makes extensive use of this library can be found [here](https://arxiv.org/abs/1903.00954). ## Usage The following code snipped holds an easy example that demonstrates how to use the cde package. ```python from cde.density_simulation import SkewNormal from cde.density_estimator import KernelMixtureNetwork import numpy as np """ simulate some data """ density_simulator = SkewNormal(random_seed=22) X, Y = density_simulator.simulate(n_samples=3000) """ fit density model """ model = KernelMixtureNetwork("KDE_demo", ndim_x=1, ndim_y=1, n_centers=50, x_noise_std=0.2, y_noise_std=0.1, random_seed=22) model.fit(X, Y) """ query the conditional pdf and cdf """ x_cond = np.zeros((1, 1)) y_query = np.ones((1, 1)) * 0.1 prob = model.pdf(x_cond, y_query) cum_prob = model.cdf(x_cond, y_query) """ compute conditional moments & VaR """ mean = model.mean_(x_cond)[0][0] std = model.std_(x_cond)[0][0] skewness = model.skewness(x_cond)[0] ``` ## Citing If you use CDE in your research, you can cite it as follows: ``` @article{rothfuss2019conditional, title={Conditional Density Estimation with Neural Networks: Best Practices and Benchmarks}, author={Rothfuss, Jonas and Ferreira, Fabio and Walther, Simon and Ulrich, Maxim}, journal={arXiv:1903.00954}, year={2019} } ``` ## Todo - creating a branch just for our conditional estimators + python package %package help Summary: Development documents and examples for cde Provides: python3-cde-doc %description help [![Build Status](https://travis-ci.org/freelunchtheorem/Conditional_Density_Estimation.svg?branch=master)](https://travis-ci.org/freelunchtheorem/Conditional_Density_Estimation) [![Downloads](https://pepy.tech/badge/cde)](https://pepy.tech/project/cde) # Conditional Density Estimation (CDE) ## Description Implementations of various methods for conditional density estimation * **Parametric neural network based methods** * Mixture Density Network (MDN) * Kernel Mixture Network (KMN) * Normalizing Flows (NF) * **Nonparametric methods** * Conditional Kernel Density Estimation (CKDE) * Neighborhood Kernel Density Estimation (NKDE) * **Semiparametric methods** * Least Squares Conditional Density Estimation (LSKDE) Beyond estimating conditional probability densities, the package features extensive functionality for computing: * **Centered moments:** mean, covariance, skewness and kurtosis * **Statistical divergences:** KL-divergence, JS-divergence, Hellinger distance * **Percentiles and expected shortfall** ## Installation To use the library, you can directly use the python package index: ```bash pip install cde ``` or clone the GitHub repository and run ```bash pip install . ``` Note that the package only supports tensorflow versions between 1.4 and 1.7. ## Documentation and paper See the documentation [here](https://freelunchtheorem.github.io/Conditional_Density_Estimation). A paper on best practices and benchmarks on conditional density estimation with neural networks that makes extensive use of this library can be found [here](https://arxiv.org/abs/1903.00954). ## Usage The following code snipped holds an easy example that demonstrates how to use the cde package. ```python from cde.density_simulation import SkewNormal from cde.density_estimator import KernelMixtureNetwork import numpy as np """ simulate some data """ density_simulator = SkewNormal(random_seed=22) X, Y = density_simulator.simulate(n_samples=3000) """ fit density model """ model = KernelMixtureNetwork("KDE_demo", ndim_x=1, ndim_y=1, n_centers=50, x_noise_std=0.2, y_noise_std=0.1, random_seed=22) model.fit(X, Y) """ query the conditional pdf and cdf """ x_cond = np.zeros((1, 1)) y_query = np.ones((1, 1)) * 0.1 prob = model.pdf(x_cond, y_query) cum_prob = model.cdf(x_cond, y_query) """ compute conditional moments & VaR """ mean = model.mean_(x_cond)[0][0] std = model.std_(x_cond)[0][0] skewness = model.skewness(x_cond)[0] ``` ## Citing If you use CDE in your research, you can cite it as follows: ``` @article{rothfuss2019conditional, title={Conditional Density Estimation with Neural Networks: Best Practices and Benchmarks}, author={Rothfuss, Jonas and Ferreira, Fabio and Walther, Simon and Ulrich, Maxim}, journal={arXiv:1903.00954}, year={2019} } ``` ## Todo - creating a branch just for our conditional estimators + python package %prep %autosetup -n cde-0.6.1 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-cde -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue Jun 20 2023 Python_Bot - 0.6.1-1 - Package Spec generated