diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6929c54f..6a0f981a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,24 +40,24 @@ jobs: - name: Run Pylint run: find . -type f -name "*.py" | xargs pylint --disable=import-error,missing-module-docstring,invalid-name,not-callable,duplicate-code --load-plugins=pylint.extensions.docparams - # tests: - # runs-on: ubuntu-22.04 - # container: - # image: ghcr.io/bastien-mva/docker_image:latest - # steps: - # - uses: actions/checkout@v4 - # - name: Install package locally and run tests - # run: | - # pip install '.[tests]' - # pip install -e . - # jupyter nbconvert Getting_started.ipynb --to python --output tests/untestable_getting_started - # cd tests - # python _create_readme_getting_started_and_docstrings_tests.py - # pytest --cov --cov-branch --cov-report=xml . - # - name: Upload coverage reports to Codecov - # uses: codecov/codecov-action@v5 - # with: - # token: ${{ secrets.CODECOV_TOKEN }} + tests: + runs-on: ubuntu-22.04 + container: + image: ghcr.io/bastien-mva/docker_image:latest + steps: + - uses: actions/checkout@v4 + - name: Install package locally and run tests + run: | + pip install '.[tests]' + pip install -e . + jupyter nbconvert Getting_started.ipynb --to python --output tests/untestable_getting_started + cd tests + python _create_readme_getting_started_and_docstrings_tests.py + pytest --cov --cov-branch --cov-report=xml . + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} build_package: @@ -80,30 +80,30 @@ jobs: name: dist path: dist/ - # publish_package: - # runs-on: ubuntu-22.04 - # needs: - # - build_package - # - tests - # if: github.event_name == 'release' - # steps: - # - uses: actions/checkout@v4 - # - name: Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: '3.9' - # - name: Install Twine - # run: pip install twine - # - name: download artifacts and publish - # uses: actions/download-artifact@v4 - # with: - # name: dist - # path: dist/ - # - name: Publish package - # env: - # TWINE_USERNAME: __token__ - # TWINE_PASSWORD: ${{ secrets.PYPLN_TOKEN }} - # run: python -m twine upload dist/* + publish_package: + runs-on: ubuntu-22.04 + needs: + - build_package + - tests + if: github.event_name == 'release' + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: Install Twine + run: pip install twine + - name: download artifacts and publish + uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + - name: Publish package + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPLN_TOKEN }} + run: python -m twine upload dist/* pages: runs-on: ubuntu-22.04 @@ -122,7 +122,10 @@ jobs: wget https://github.com/jgm/pandoc/releases/download/1.15.1/pandoc-1.15.1-1-amd64.deb sudo dpkg -i pandoc-1.15.1-1-amd64.deb - name: Convert README - run: pandoc README.md --from markdown --to rst -s -o docs/source/readme.rst + run: | + pandoc README.md --from markdown --to rst -s -o docs/source/readme.rst + echo "HEEEEEERE" + cat docs/source/readme.rst - name: Build docs run: | pip install . @@ -136,3 +139,4 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs/build/html + force: true diff --git a/README.md b/README.md index 5034eab8..b547c1f9 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,9 @@ that an `R` version of the package is available [here](https://pln-team.github.i ```sh pip install pyPLNmodels ``` +The package depends on resource-intensive libraries like `torch`, so it may +require significant storage space. + ## Statistical description diff --git a/docs/source/tutorials/_quarto.yml b/docs/source/tutorials/_quarto.yml index add0269e..c079143b 100644 --- a/docs/source/tutorials/_quarto.yml +++ b/docs/source/tutorials/_quarto.yml @@ -46,3 +46,4 @@ format: css: custom_css_yml.css theme: cosme code-copy: true + # page-navigation: true diff --git a/docs/source/tutorials/autoreg.html b/docs/source/tutorials/autoreg.html index 97bb7b0a..3cc6626b 100644 --- a/docs/source/tutorials/autoreg.html +++ b/docs/source/tutorials/autoreg.html @@ -2,13 +2,13 @@ - + -pyPLNmodels - Time-series count data ⏱️ +Time-series count data ⏱️ – pyPLNmodels - + - - + - + + + - +
+

1 Introduction

The Poisson lognormal (PLN) model can be extended to capture temporal (or similarly, 1D spatial dependencies) by structuring the latent space. This leads to the PlnAR (PLN autoregressive, documentation) model, where an autocorrelation matrix \(\Phi\) encodes how latent variables evolve across time (or space).

@@ -4817,7 +4309,7 @@

2 Data

We illustrate the package using the crossover dataset (Petit et al. (2017)), which contains recombination patterns in sheep over the genome. This dataset captures male meiotic recombination maps for the Lacaune breed, combining historical data from Lacaune and Soay sheep.

-
+
from pyPLNmodels import load_crossover
 data = load_crossover(chromosome_numbers=[1, 5, 8])
 print('Data: ', data.keys())
@@ -4828,7 +4320,7 @@

2 Data

2.1 Endogenous variables

-
+
print(data["endog"].head())
                   nco_Lacaune_M  nco_Lacaune_F  nco_Soay_F  nco_Soay_M
@@ -4841,7 +4333,7 @@ 

The dataset also includes chromosome identifiers:

-
+
print(data["chrom"].unique())
['1' '5' '8']
@@ -4852,19 +4344,24 @@

3 Model Initialization and Fitting

We start by fitting a model with a diagonal autoregressive structure:

-
+
from pyPLNmodels import PlnAR
 ar_diag = PlnAR.from_formula("endog ~ 1", data=data, ar_type="diagonal").fit()
Taking the offsets from the data given.
 Fitting a PlnAR model with autoregressive type diagonal.
 Intializing parameters ...
-Initialization finished.
-Maximum number of iterations (400)  reached in 6.4 seconds.
+Initialization finished.
+
+
+
Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  18%|█▊        | 72/400 [00:00<00:00, 718.35it/s]Upper bound on the fitting time:  37%|███▋      | 149/400 [00:00<00:00, 743.45it/s]Upper bound on the fitting time:  56%|█████▌    | 224/400 [00:00<00:00, 744.79it/s]Upper bound on the fitting time:  75%|███████▍  | 299/400 [00:00<00:00, 739.19it/s]Upper bound on the fitting time:  94%|█████████▎| 374/400 [00:00<00:00, 742.32it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 740.01it/s]
+
+
+
Maximum number of iterations (400)  reached in 1.4 seconds.
 Last  criterion = 5.34e-06 . Required tolerance = 1e-06
-
Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▎         | 10/400 [00:00<00:03, 99.97it/s]Upper bound on the fitting time:   5%|▌         | 21/400 [00:00<00:03, 101.49it/s]Upper bound on the fitting time:   8%|▊         | 33/400 [00:00<00:03, 105.63it/s]Upper bound on the fitting time:  11%|█         | 44/400 [00:00<00:03, 97.38it/s] Upper bound on the fitting time:  14%|█▎        | 54/400 [00:00<00:04, 82.69it/s]Upper bound on the fitting time:  16%|█▌        | 63/400 [00:00<00:04, 77.74it/s]Upper bound on the fitting time:  18%|█▊        | 71/400 [00:00<00:04, 74.41it/s]Upper bound on the fitting time:  20%|██        | 80/400 [00:00<00:04, 76.46it/s]Upper bound on the fitting time:  22%|██▏       | 89/400 [00:01<00:03, 78.56it/s]Upper bound on the fitting time:  24%|██▍       | 98/400 [00:01<00:03, 79.15it/s]Upper bound on the fitting time:  26%|██▋       | 106/400 [00:01<00:03, 76.30it/s]Upper bound on the fitting time:  29%|██▉       | 116/400 [00:01<00:03, 81.55it/s]Upper bound on the fitting time:  32%|███▏      | 127/400 [00:01<00:03, 88.07it/s]Upper bound on the fitting time:  34%|███▍      | 138/400 [00:01<00:02, 93.51it/s]Upper bound on the fitting time:  37%|███▋      | 149/400 [00:01<00:02, 98.02it/s]Upper bound on the fitting time:  40%|████      | 161/400 [00:01<00:02, 102.05it/s]Upper bound on the fitting time:  43%|████▎     | 172/400 [00:01<00:02, 104.19it/s]Upper bound on the fitting time:  46%|████▌     | 183/400 [00:02<00:02, 104.74it/s]Upper bound on the fitting time:  48%|████▊     | 194/400 [00:02<00:02, 100.59it/s]Upper bound on the fitting time:  51%|█████▏    | 205/400 [00:02<00:01, 102.95it/s]Upper bound on the fitting time:  54%|█████▍    | 216/400 [00:02<00:01, 104.87it/s]Upper bound on the fitting time:  57%|█████▋    | 227/400 [00:02<00:01, 105.23it/s]Upper bound on the fitting time:  60%|█████▉    | 238/400 [00:02<00:01, 105.95it/s]Upper bound on the fitting time:  62%|██████▏   | 249/400 [00:02<00:01, 105.31it/s]Upper bound on the fitting time:  65%|██████▌   | 260/400 [00:02<00:01, 106.07it/s]Upper bound on the fitting time:  68%|██████▊   | 271/400 [00:02<00:01, 107.13it/s]Upper bound on the fitting time:  70%|███████   | 282/400 [00:02<00:01, 107.97it/s]Upper bound on the fitting time:  73%|███████▎  | 293/400 [00:03<00:00, 108.04it/s]Upper bound on the fitting time:  76%|███████▌  | 304/400 [00:03<00:00, 108.30it/s]Upper bound on the fitting time:  79%|███████▉  | 315/400 [00:03<00:00, 106.89it/s]Upper bound on the fitting time:  82%|████████▏ | 326/400 [00:03<00:00, 107.19it/s]Upper bound on the fitting time:  84%|████████▍ | 337/400 [00:03<00:00, 107.65it/s]Upper bound on the fitting time:  87%|████████▋ | 349/400 [00:03<00:00, 108.91it/s]Upper bound on the fitting time:  90%|█████████ | 360/400 [00:03<00:00, 108.89it/s]Upper bound on the fitting time:  93%|█████████▎| 371/400 [00:03<00:00, 108.59it/s]Upper bound on the fitting time:  96%|█████████▌| 382/400 [00:03<00:00, 108.37it/s]Upper bound on the fitting time:  98%|█████████▊| 393/400 [00:03<00:00, 107.16it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:04<00:00, 98.65it/s] 
+

For more information on how to include covariates and offsets, see the dedicated tutorial.

@@ -4872,10 +4369,14 @@

3 Model Initializ

4 Temporal structure

-
-
ar_diag.show()
+
+
ar_diag.show()
-

+
+
+

+
+

The output indicates, for instance, that the variable nco_Soay_F depends approximately 80% on its past values (see the graph on the bottom left).

@@ -4883,17 +4384,21 @@

4 Temporal struct

5 Latent variables and visualization

To explore latent dynamics, extract the latent variables \(Z\):

-
-
z = ar_diag.latent_variables
+
+
z = ar_diag.latent_variables

Visualize the temporal structure via the viz_dims method:

-
-
ar_diag.viz_dims(
-    column_names=["nco_Lacaune_M", "nco_Lacaune_F", "nco_Soay_F", "nco_Soay_M"],
-    colors=data["chrom"]
-)
+
+
ar_diag.viz_dims(
+    column_names=["nco_Lacaune_M", "nco_Lacaune_F", "nco_Soay_F", "nco_Soay_M"],
+    colors=data["chrom"]
+)
-

+
+
+

+
+

Column names of the endogenous variables can be accessed via the column_names_endog attribute.

@@ -4904,44 +4409,56 @@

6 Full and Spheri

6.1 Full autoregression

Each variable depends on all others (default behavior):

-
-
ar_full = PlnAR.from_formula("endog ~ 1", data=data, ar_type="full").fit()
-ar_full.show()
+
+
ar_full = PlnAR.from_formula("endog ~ 1", data=data, ar_type="full").fit()
+ar_full.show()
Taking the offsets from the data given.
 Fitting a PlnAR model with autoregressive type full.
 Intializing parameters ...
-Initialization finished.
-Maximum number of iterations (400)  reached in 5.2 seconds.
-Last  criterion = 5.34e-06 . Required tolerance = 1e-06
+Initialization finished.
-
Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 9/400 [00:00<00:04, 81.34it/s]Upper bound on the fitting time:   4%|▍         | 18/400 [00:00<00:04, 81.24it/s]Upper bound on the fitting time:   7%|▋         | 27/400 [00:00<00:04, 81.79it/s]Upper bound on the fitting time:   9%|▉         | 36/400 [00:00<00:04, 82.34it/s]Upper bound on the fitting time:  11%|█▏        | 45/400 [00:00<00:04, 82.43it/s]Upper bound on the fitting time:  14%|█▎        | 54/400 [00:00<00:04, 82.34it/s]Upper bound on the fitting time:  16%|█▌        | 63/400 [00:00<00:04, 82.60it/s]Upper bound on the fitting time:  18%|█▊        | 72/400 [00:00<00:03, 82.11it/s]Upper bound on the fitting time:  20%|██        | 81/400 [00:00<00:03, 82.37it/s]Upper bound on the fitting time:  22%|██▎       | 90/400 [00:01<00:03, 82.70it/s]Upper bound on the fitting time:  25%|██▍       | 99/400 [00:01<00:03, 82.46it/s]Upper bound on the fitting time:  27%|██▋       | 108/400 [00:01<00:03, 82.78it/s]Upper bound on the fitting time:  29%|██▉       | 117/400 [00:01<00:03, 83.17it/s]Upper bound on the fitting time:  32%|███▏      | 126/400 [00:01<00:03, 82.32it/s]Upper bound on the fitting time:  34%|███▍      | 135/400 [00:01<00:03, 82.34it/s]Upper bound on the fitting time:  36%|███▌      | 144/400 [00:01<00:03, 82.13it/s]Upper bound on the fitting time:  38%|███▊      | 153/400 [00:01<00:02, 82.85it/s]Upper bound on the fitting time:  40%|████      | 162/400 [00:02<00:03, 74.17it/s]Upper bound on the fitting time:  42%|████▎     | 170/400 [00:02<00:03, 71.75it/s]Upper bound on the fitting time:  44%|████▍     | 178/400 [00:02<00:03, 70.51it/s]Upper bound on the fitting time:  46%|████▋     | 186/400 [00:02<00:03, 70.23it/s]Upper bound on the fitting time:  48%|████▊     | 194/400 [00:02<00:02, 69.68it/s]Upper bound on the fitting time:  50%|█████     | 202/400 [00:02<00:02, 69.62it/s]Upper bound on the fitting time:  52%|█████▏    | 209/400 [00:02<00:02, 69.04it/s]Upper bound on the fitting time:  55%|█████▍    | 218/400 [00:02<00:02, 73.26it/s]Upper bound on the fitting time:  57%|█████▋    | 227/400 [00:02<00:02, 76.65it/s]Upper bound on the fitting time:  59%|█████▉    | 236/400 [00:03<00:02, 78.28it/s]Upper bound on the fitting time:  61%|██████▏   | 245/400 [00:03<00:01, 79.66it/s]Upper bound on the fitting time:  63%|██████▎   | 253/400 [00:03<00:01, 79.06it/s]Upper bound on the fitting time:  65%|██████▌   | 261/400 [00:03<00:01, 78.85it/s]Upper bound on the fitting time:  68%|██████▊   | 270/400 [00:03<00:01, 80.49it/s]Upper bound on the fitting time:  70%|██████▉   | 279/400 [00:03<00:01, 81.41it/s]Upper bound on the fitting time:  72%|███████▏  | 288/400 [00:03<00:01, 82.43it/s]Upper bound on the fitting time:  74%|███████▍  | 297/400 [00:03<00:01, 82.60it/s]Upper bound on the fitting time:  76%|███████▋  | 306/400 [00:03<00:01, 82.21it/s]Upper bound on the fitting time:  79%|███████▉  | 315/400 [00:03<00:01, 82.45it/s]Upper bound on the fitting time:  81%|████████  | 324/400 [00:04<00:00, 83.07it/s]Upper bound on the fitting time:  83%|████████▎ | 333/400 [00:04<00:00, 82.42it/s]Upper bound on the fitting time:  86%|████████▌ | 342/400 [00:04<00:00, 76.84it/s]Upper bound on the fitting time:  88%|████████▊ | 350/400 [00:04<00:00, 77.63it/s]Upper bound on the fitting time:  90%|████████▉ | 358/400 [00:04<00:00, 77.51it/s]Upper bound on the fitting time:  92%|█████████▏| 367/400 [00:04<00:00, 79.09it/s]Upper bound on the fitting time:  94%|█████████▍| 376/400 [00:04<00:00, 79.82it/s]Upper bound on the fitting time:  96%|█████████▋| 385/400 [00:04<00:00, 80.52it/s]Upper bound on the fitting time:  98%|█████████▊| 394/400 [00:04<00:00, 80.77it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:05<00:00, 79.13it/s]
+
Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  12%|█▏        | 49/400 [00:00<00:00, 487.55it/s]Upper bound on the fitting time:  24%|██▍       | 98/400 [00:00<00:00, 481.37it/s]Upper bound on the fitting time:  37%|███▋      | 147/400 [00:00<00:00, 475.81it/s]Upper bound on the fitting time:  49%|████▉     | 195/400 [00:00<00:00, 473.89it/s]Upper bound on the fitting time:  61%|██████    | 243/400 [00:00<00:00, 469.13it/s]Upper bound on the fitting time:  72%|███████▎  | 290/400 [00:00<00:00, 463.60it/s]Upper bound on the fitting time:  84%|████████▍ | 337/400 [00:00<00:00, 462.21it/s]Upper bound on the fitting time:  96%|█████████▋| 386/400 [00:00<00:00, 469.28it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 469.89it/s]
+
+
+
Maximum number of iterations (400)  reached in 0.9 seconds.
+Last  criterion = 5.34e-06 . Required tolerance = 1e-06
-

+
+
+

+
+

6.2 Spherical autoregression

All variables share a common temporal trend:

-
-
ar_spher = PlnAR.from_formula("endog ~ 1", data=data, ar_type="spherical").fit()
-ar_spher.show()
+
+
ar_spher = PlnAR.from_formula("endog ~ 1", data=data, ar_type="spherical").fit()
+ar_spher.show()
Taking the offsets from the data given.
 Fitting a PlnAR model with autoregressive type spherical.
 Intializing parameters ...
-Initialization finished.
-Maximum number of iterations (400)  reached in 4.5 seconds.
-Last  criterion = 5.34e-06 . Required tolerance = 1e-06
+Initialization finished.
-
Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▎         | 10/400 [00:00<00:04, 92.67it/s]Upper bound on the fitting time:   5%|▌         | 20/400 [00:00<00:04, 91.26it/s]Upper bound on the fitting time:   8%|▊         | 30/400 [00:00<00:04, 90.85it/s]Upper bound on the fitting time:  10%|█         | 40/400 [00:00<00:03, 90.67it/s]Upper bound on the fitting time:  12%|█▎        | 50/400 [00:00<00:03, 92.08it/s]Upper bound on the fitting time:  15%|█▌        | 60/400 [00:00<00:03, 92.79it/s]Upper bound on the fitting time:  18%|█▊        | 70/400 [00:00<00:03, 94.15it/s]Upper bound on the fitting time:  20%|██        | 80/400 [00:00<00:03, 92.96it/s]Upper bound on the fitting time:  22%|██▎       | 90/400 [00:00<00:03, 92.52it/s]Upper bound on the fitting time:  25%|██▌       | 100/400 [00:01<00:03, 91.47it/s]Upper bound on the fitting time:  28%|██▊       | 110/400 [00:01<00:03, 92.12it/s]Upper bound on the fitting time:  30%|███       | 120/400 [00:01<00:03, 92.59it/s]Upper bound on the fitting time:  32%|███▎      | 130/400 [00:01<00:02, 93.17it/s]Upper bound on the fitting time:  35%|███▌      | 140/400 [00:01<00:02, 91.92it/s]Upper bound on the fitting time:  38%|███▊      | 150/400 [00:01<00:02, 92.79it/s]Upper bound on the fitting time:  40%|████      | 160/400 [00:01<00:02, 93.33it/s]Upper bound on the fitting time:  42%|████▎     | 170/400 [00:01<00:02, 86.26it/s]Upper bound on the fitting time:  45%|████▍     | 179/400 [00:01<00:02, 86.18it/s]Upper bound on the fitting time:  47%|████▋     | 188/400 [00:02<00:02, 87.18it/s]Upper bound on the fitting time:  50%|████▉     | 198/400 [00:02<00:02, 88.24it/s]Upper bound on the fitting time:  52%|█████▏    | 208/400 [00:02<00:02, 89.15it/s]Upper bound on the fitting time:  55%|█████▍    | 218/400 [00:02<00:02, 90.88it/s]Upper bound on the fitting time:  57%|█████▋    | 228/400 [00:02<00:01, 92.46it/s]Upper bound on the fitting time:  60%|█████▉    | 238/400 [00:02<00:01, 93.85it/s]Upper bound on the fitting time:  62%|██████▏   | 248/400 [00:02<00:01, 93.18it/s]Upper bound on the fitting time:  64%|██████▍   | 258/400 [00:02<00:01, 92.51it/s]Upper bound on the fitting time:  67%|██████▋   | 268/400 [00:02<00:01, 91.99it/s]Upper bound on the fitting time:  70%|██████▉   | 278/400 [00:03<00:01, 93.19it/s]Upper bound on the fitting time:  72%|███████▏  | 288/400 [00:03<00:01, 94.57it/s]Upper bound on the fitting time:  74%|███████▍  | 298/400 [00:03<00:01, 95.09it/s]Upper bound on the fitting time:  77%|███████▋  | 308/400 [00:03<00:00, 93.75it/s]Upper bound on the fitting time:  80%|███████▉  | 318/400 [00:03<00:00, 94.42it/s]Upper bound on the fitting time:  82%|████████▏ | 328/400 [00:03<00:00, 94.66it/s]Upper bound on the fitting time:  84%|████████▍ | 338/400 [00:03<00:00, 95.52it/s]Upper bound on the fitting time:  87%|████████▋ | 348/400 [00:03<00:00, 96.16it/s]Upper bound on the fitting time:  90%|████████▉ | 358/400 [00:03<00:00, 95.93it/s]Upper bound on the fitting time:  92%|█████████▏| 368/400 [00:03<00:00, 94.36it/s]Upper bound on the fitting time:  94%|█████████▍| 378/400 [00:04<00:00, 93.85it/s]Upper bound on the fitting time:  97%|█████████▋| 388/400 [00:04<00:00, 91.97it/s]Upper bound on the fitting time: 100%|█████████▉| 398/400 [00:04<00:00, 93.35it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:04<00:00, 92.34it/s]
+
Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  14%|█▎        | 54/400 [00:00<00:00, 534.81it/s]Upper bound on the fitting time:  27%|██▋       | 108/400 [00:00<00:00, 513.65it/s]Upper bound on the fitting time:  40%|████      | 160/400 [00:00<00:00, 506.06it/s]Upper bound on the fitting time:  53%|█████▎    | 213/400 [00:00<00:00, 515.20it/s]Upper bound on the fitting time:  67%|██████▋   | 269/400 [00:00<00:00, 529.22it/s]Upper bound on the fitting time:  81%|████████▏ | 325/400 [00:00<00:00, 538.58it/s]Upper bound on the fitting time:  95%|█████████▌| 380/400 [00:00<00:00, 541.21it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 531.33it/s]
+
+
+
Maximum number of iterations (400)  reached in 0.8 seconds.
+Last  criterion = 5.34e-06 . Required tolerance = 1e-06
-

+
+
+

+
+

One can check that the spherical, diagonal and autoregressive models gives similar outcomes.

@@ -4950,10 +4467,10 @@

7 Autoregression Coefficients

Access the estimated autoregression parameters:

-
-
print("Spherical autoregressive parameter:", ar_spher.ar_coef.shape)
-print("Diagonal autoregressive parameter:", ar_diag.ar_coef.shape)
-print("Full autoregressive parameter:", ar_full.ar_coef.shape)
+
+
print("Spherical autoregressive parameter:", ar_spher.ar_coef.shape)
+print("Diagonal autoregressive parameter:", ar_diag.ar_coef.shape)
+print("Full autoregressive parameter:", ar_full.ar_coef.shape)
Spherical autoregressive parameter: torch.Size([1])
 Diagonal autoregressive parameter: torch.Size([4])
@@ -4965,9 +4482,10 @@ 

7 Autoregression +

-

References

+

References

Batardière, Bastien, Joon Kwon, and Julien Chiquet. 2024. “pyPLNmodels: A Python Package to Analyze Multivariate High-Dimensional Count Data.” Journal of Open Source Software.
@@ -4976,240 +4494,407 @@

7 Autoregression

+ }); +

+ diff --git a/docs/source/tutorials/basic_analysis.html b/docs/source/tutorials/basic_analysis.html index 88f7a11e..f4209818 100644 --- a/docs/source/tutorials/basic_analysis.html +++ b/docs/source/tutorials/basic_analysis.html @@ -2,13 +2,13 @@ - + -pyPLNmodels - Basic analysis 🍼 +Basic analysis 🍼 – pyPLNmodels - + - - + - + + + - +
+

This guide introduces the basics of multivariate count data analysis using the pyPLNmodels package. For complex datasets, traditional models like Poisson regression and Zero-Inflated Poisson Regression (ZIP) may fail to capture important insights, such as correlations between counts (i.e. variables). The pyPLNmodels package provides two key models to address these challenges:

  • Pln model (documentation)
  • @@ -4815,7 +4307,7 @@

    1 Statistical Ove
  • \(\Sigma\) (covariance): the covariance matrix of the latent variables \(Z_i\)

These models aim to capture the structure of the data through the latent variables \(Z\).

-

The Pln model assumes \(\Sigma\) has full rank, while the PlnPCA model assumes \(\Sigma\) has a low rank, which must be specified by the user. A lower A lower rank introduces a trade-off, reducing computational complexity but potentially compromising parameter estimation accuracy.

+

The Pln model assumes \(\Sigma\) has full rank, while the PlnPCA model assumes \(\Sigma\) has a low rank, which must be specified by the user. A lower rank introduces a trade-off, reducing computational complexity but potentially compromising parameter estimation accuracy.

1.1 Purpose

The pyPLNmodels package is designed to:

@@ -4824,18 +4316,18 @@

\(Z\) (which typically contains more information than \(Y\))
  • Visualize the latent variables and their relationships
  • -

    This is achieved using the input count matrix \(Y\), along with optional covariate matrix \(X\) (defaulting to a vector of 1’s) and offsets \(O\) (defaulting to a matrix of 0’s).

    +

    This is achieved using the input count matrix \(Y\), along with optional covariate matrix \(X\) (defaulting to a vector of 1s) and offsets \(O\) (defaulting to a matrix of 0s).

    2 Importing Data

    -

    In this example, we analyze single-cell RNA-seq data provided by the load_scrna function in the package. Each column in the dataset represents a gene, while each row corresponds to a cell (i.e., an individual). Covariates for cell types (labels) are also included. For simplicity, we limit the analysis to 20 variables (dimensions).

    -
    +

    In this example, we analyze single-cell RNA-seq data provided by the load_scrna function in the package. Each column in the dataset represents a gene, while each row corresponds to a cell (i.e., an individual). Covariates for cell types (labels) are also included. For simplicity, we limit the analysis to \(10\) variables (dimensions).

    +
    from pyPLNmodels import load_scrna
    -rna = load_scrna(dim=20)
    +rna = load_scrna(dim=10)
     print('Data: ', rna.keys())
    -
    Returning scRNA dataset of size (400, 20)
    +
    Returning scRNA dataset of size (400, 10)
     Data:  dict_keys(['endog', 'labels', 'labels_1hot'])
    @@ -4843,36 +4335,22 @@

    2 Importing Data<

    2.1 Data Structure

    2.1.1 Count Matrix (endog)

    -
    +
    endog = rna["endog"]
     print(endog.head())
    -
         FTL  MALAT1   FTH1  TMSB4X   CD74  SPP1   APOE    B2M   ACTB  HLA-DRA  \
    +
         FTL  MALAT1   FTH1  TMSB4X   CD74  SPP1   APOE    B2M   ACTB  HLA-DRA
     0    5.0    39.0   14.0    39.0   11.0   0.0    0.0   88.0   49.0      0.0
     1    8.0    52.0   38.0   186.0   17.0   0.0    0.0  152.0  167.0      3.0
     2   76.0    29.0   38.0    71.0   37.0   3.0    2.0   21.0    7.0     12.0
     3  354.0   151.0  236.0   184.0  287.0   0.0  238.0  255.0   27.0    243.0
    -4    0.0    55.0   10.0    37.0    8.0   1.0    0.0   23.0   49.0      1.0
    -
    -   APOC1  MT-CO1  TMSB10  EEF1A1  HLA-DRB1  HLA-DPA1  HLA-DPB1  MT-CO2  LYZ  \
    -0    0.0    29.0    22.0    34.0       0.0       0.0       1.0    21.0  0.0
    -1    0.0   109.0    65.0   128.0       2.0       4.0       1.0   172.0  1.0
    -2    3.0    46.0     7.0    11.0       0.0       7.0      17.0    16.0  0.0
    -3  196.0   118.0    45.0    98.0      66.0     115.0     160.0    27.0  6.0
    -4    0.0    11.0    25.0    10.0       1.0       2.0       2.0     6.0  0.0
    -
    -   RPLP1
    -0   14.0
    -1  124.0
    -2   20.0
    -3   40.0
    -4   18.0  
    +4 0.0 55.0 10.0 37.0 8.0 1.0 0.0 23.0 49.0 1.0

    2.1.2 Cell Type

    -
    +
    cell_type = rna["labels"]
     print('Possible cell types: ', cell_type.unique())
     print(cell_type.head())
    @@ -4892,32 +4370,37 @@

    3 Model Initialization and Fitting

    To analyze the mean values for each cell type, we use cell type as a covariate, with Macrophages as the reference category:

    -
    +
    from pyPLNmodels import Pln
     pln = Pln.from_formula('endog ~ 1 + labels', data=rna).fit()
    Setting the offsets to zero.
     Fitting a Pln model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (400)  reached in 7.2 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  21%|██        | 83/400 [00:00<00:00, 826.25it/s]Upper bound on the fitting time:  42%|████▏     | 168/400 [00:00<00:00, 837.12it/s]Upper bound on the fitting time:  65%|██████▍   | 259/400 [00:00<00:00, 869.92it/s]Upper bound on the fitting time:  90%|█████████ | 360/400 [00:00<00:00, 922.16it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 903.95it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 1.3 seconds.
     Last  criterion = 5.4e-06 . Required tolerance = 1e-06
    -
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   3%|▎         | 12/400 [00:00<00:03, 117.57it/s]Upper bound on the fitting time:   6%|▌         | 24/400 [00:00<00:03, 100.29it/s]Upper bound on the fitting time:   9%|▉         | 35/400 [00:00<00:03, 95.36it/s] Upper bound on the fitting time:  12%|█▏        | 47/400 [00:00<00:03, 102.52it/s]Upper bound on the fitting time:  14%|█▍        | 58/400 [00:00<00:03, 104.47it/s]Upper bound on the fitting time:  17%|█▋        | 69/400 [00:00<00:03, 106.13it/s]Upper bound on the fitting time:  20%|██        | 81/400 [00:00<00:02, 108.36it/s]Upper bound on the fitting time:  23%|██▎       | 93/400 [00:00<00:02, 109.86it/s]Upper bound on the fitting time:  26%|██▋       | 105/400 [00:00<00:02, 111.39it/s]Upper bound on the fitting time:  29%|██▉       | 117/400 [00:01<00:02, 112.57it/s]Upper bound on the fitting time:  32%|███▏      | 129/400 [00:01<00:02, 113.45it/s]Upper bound on the fitting time:  35%|███▌      | 141/400 [00:01<00:02, 115.26it/s]Upper bound on the fitting time:  38%|███▊      | 153/400 [00:01<00:02, 115.53it/s]Upper bound on the fitting time:  41%|████▏     | 165/400 [00:01<00:02, 114.84it/s]Upper bound on the fitting time:  44%|████▍     | 177/400 [00:01<00:01, 116.13it/s]Upper bound on the fitting time:  48%|████▊     | 190/400 [00:01<00:01, 118.75it/s]Upper bound on the fitting time:  51%|█████     | 203/400 [00:01<00:01, 120.74it/s]Upper bound on the fitting time:  54%|█████▍    | 216/400 [00:01<00:01, 122.81it/s]Upper bound on the fitting time:  57%|█████▋    | 229/400 [00:02<00:01, 123.70it/s]Upper bound on the fitting time:  60%|██████    | 242/400 [00:02<00:01, 122.67it/s]Upper bound on the fitting time:  64%|██████▍   | 255/400 [00:02<00:01, 119.18it/s]Upper bound on the fitting time:  67%|██████▋   | 267/400 [00:02<00:01, 114.22it/s]Upper bound on the fitting time:  70%|██████▉   | 279/400 [00:02<00:01, 114.61it/s]Upper bound on the fitting time:  73%|███████▎  | 291/400 [00:02<00:01, 106.51it/s]Upper bound on the fitting time:  76%|███████▌  | 302/400 [00:02<00:00, 102.25it/s]Upper bound on the fitting time:  78%|███████▊  | 314/400 [00:02<00:00, 106.28it/s]Upper bound on the fitting time:  82%|████████▏ | 326/400 [00:02<00:00, 109.12it/s]Upper bound on the fitting time:  85%|████████▍ | 339/400 [00:03<00:00, 112.56it/s]Upper bound on the fitting time:  88%|████████▊ | 351/400 [00:03<00:00, 114.24it/s]Upper bound on the fitting time:  91%|█████████ | 364/400 [00:03<00:00, 116.26it/s]Upper bound on the fitting time:  94%|█████████▍| 376/400 [00:03<00:00, 114.83it/s]Upper bound on the fitting time:  97%|█████████▋| 388/400 [00:03<00:00, 115.82it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:03<00:00, 116.32it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:03<00:00, 112.91it/s]
    +

    For more details on formula syntax and model initialization, including handling offsets, refer to the dedicated tutorial.

    3.1 Model Summary and Insights

    After fitting the model, you can print its configuration and key details:

    -
    -
    print(pln)
    +
    +
    print(pln)
    A multivariate Pln with full covariance.
     ======================================================================
          Loglike   Dimension    Nb param         BIC         AIC         ICL
    -   -22468.19          20         270  23277.0352  22738.1875    10228.37
    +   -12790.12          10          85  13044.7622   12875.125      6261.7
     
     ======================================================================
     * Useful attributes
    @@ -4931,53 +4414,88 @@ 

    -
    pln.show()
    +
    +
    pln.show()
    +
    +
    +
    +

    +
    +
    +
    +
    +

    Monitoring the norm of each parameter is essential to assess model convergence. If the model has not converged, consider refitting it with additional iterations and a reduced tolerance (tol). To adjust the number of iterations, use the maxiter parameter:

    +
    +
    pln.fit(maxiter=1000, tol = 0).show()
    +
    +
    Fitting a Pln model with full covariance.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time:  11%|█         | 107/1000 [00:00<00:00, 1061.61it/s]Upper bound on the fitting time:  21%|██▏       | 214/1000 [00:00<00:00, 1056.11it/s]Upper bound on the fitting time:  32%|███▏      | 323/1000 [00:00<00:00, 1069.60it/s]Upper bound on the fitting time:  43%|████▎     | 431/1000 [00:00<00:00, 1073.67it/s]Upper bound on the fitting time:  54%|█████▍    | 539/1000 [00:00<00:00, 1075.09it/s]Upper bound on the fitting time:  65%|██████▍   | 647/1000 [00:00<00:00, 1055.11it/s]Upper bound on the fitting time:  75%|███████▌  | 753/1000 [00:00<00:00, 1041.14it/s]Upper bound on the fitting time:  86%|████████▌ | 858/1000 [00:00<00:00, 1022.65it/s]Upper bound on the fitting time:  96%|█████████▌| 961/1000 [00:00<00:00, 1024.86it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [00:00<00:00, 1044.85it/s]
    +
    +
    +
    Maximum number of iterations (1400)  reached in 2.2 seconds.
    +Last  criterion = 0.0 . Required tolerance = 0
    +
    -

    +
    +
    +

    +
    -

    Monitoring the norm of each parameters allows to know if the model has converged. If it has not converged, one can refit the model with a lower tolerance (tol) and a bigger number iterations than the default (maxiter=400):

    -
    -
    pln.fit(maxiter=1000, tol = 0)

    3.2 Exploring Latent Variables

    The latent variables \(Z\), which capture the underlying structure of the data, are accessible via the latent_variables attribute, or the .transform() method:

    -
    -
    Z = pln.latent_variables
    -Z = pln.transform()
    -print('Shape of Z:', Z.shape)
    +
    +
    Z = pln.latent_variables
    +Z = pln.transform()
    +print('Shape of Z:', Z.shape)
    -
    Shape of Z: torch.Size([400, 20])
    +
    Shape of Z: torch.Size([400, 10])
    -

    The effect of covariates on the latent variables can be removed by using the remove_exog_effect keyword:

    -
    -
    Z_moins_XB = pln.transform(remove_exog_effect=True)
    -

    You can visualize these latent variables using the .viz() method:

    -
    -
    pln.viz(colors=cell_type)
    +
    +
    pln.viz(colors=cell_type)
    -

    +
    +
    +

    +
    +
    -

    To visualize the latent positions without the effect of covariates (i.e., (Z - XB)), set the remove_exog_effect parameter to True:

    -
    -
    pln.viz(colors=cell_type, remove_exog_effect=True)
    +

    By default the effect of covariates on the latent variables is included in the visualization. This means that the latent variables are represented as \(Z + +XB\). The effect of covariates on the latent variables can be removed by using the remove_exog_effect keyword:

    +
    +
    Z_moins_XB = pln.transform(remove_exog_effect=True)
    +
    +

    To visualize the latent positions without the effect of covariates (i.e., (Z - XB)), set the remove_exog_effect parameter to True in the .viz() method:

    +
    +
    pln.viz(colors=cell_type, remove_exog_effect=True)
    -

    +
    +
    +

    +
    +

    Additionally, you can generate a pair plot of the first Principal Components (PCs) of the latent variables:

    -
    -
    pln.pca_pairplot(n_components=4, colors=cell_type)
    +
    +
    pln.pca_pairplot(n_components=4, colors=cell_type)
    -

    +
    +
    +

    +
    +
    +

    The remove_exog_effect parameter is also available in the pca_pairplot method.

    @@ -4986,137 +4504,82 @@

    4 Analyzing Covar

    4.1 Confidence Intervals and Statistical Significance

    To summarize the model, including confidence intervals and p-values, use the summary method:

    -
    -
    pln.summary()
    +
    +
    pln.summary()
    Coefficients and p-values per dimension:
     
     Dimension: FTL
     Exog Name                Coefficient         P-value
    -Intercept                   4.405430           1e-16
    -labels[T.T_cells_CD4+]       -3.238307         3.4e-14
    -labels[T.T_cells_CD8+]       -3.691690           1e-16
    +Intercept                   4.408599           1e-16
    +labels[T.T_cells_CD4+]       -3.255301           1e-16
    +labels[T.T_cells_CD8+]       -3.704965           1e-16
     
     Dimension: MALAT1
     Exog Name                Coefficient         P-value
    -Intercept                   4.494294           1e-16
    -labels[T.T_cells_CD4+]        0.047518            0.67
    -labels[T.T_cells_CD8+]       -0.599757         0.00068
    +Intercept                   4.496646           1e-16
    +labels[T.T_cells_CD4+]        0.044992            0.75
    +labels[T.T_cells_CD8+]       -0.602403         7.8e-08
     
     Dimension: FTH1
     Exog Name                Coefficient         P-value
    -Intercept                   3.977555           1e-16
    -labels[T.T_cells_CD4+]       -2.103544           1e-16
    -labels[T.T_cells_CD8+]       -3.101902           1e-16
    +Intercept                   3.989528           1e-16
    +labels[T.T_cells_CD4+]       -2.125104           1e-16
    +labels[T.T_cells_CD8+]       -3.118913           1e-16
     
     Dimension: TMSB4X
     Exog Name                Coefficient         P-value
    -Intercept                   4.323444           1e-16
    -labels[T.T_cells_CD4+]       -0.844740         3.6e-10
    -labels[T.T_cells_CD8+]       -1.232170         4.2e-07
    +Intercept                   4.338097           1e-16
    +labels[T.T_cells_CD4+]       -0.861660         6.8e-05
    +labels[T.T_cells_CD8+]       -1.246957           1e-16
     
     Dimension: CD74
     Exog Name                Coefficient         P-value
    -Intercept                   3.900579           1e-16
    -labels[T.T_cells_CD4+]       -3.254608           1e-16
    -labels[T.T_cells_CD8+]       -3.284683           1e-16
    +Intercept                   3.903079           1e-16
    +labels[T.T_cells_CD4+]       -3.282655           1e-16
    +labels[T.T_cells_CD8+]       -3.335481           1e-16
     
     Dimension: SPP1
     Exog Name                Coefficient         P-value
    -Intercept                   0.200535            0.21
    -labels[T.T_cells_CD4+]       -4.434213           1e-16
    -labels[T.T_cells_CD8+]       -5.076484           1e-16
    +Intercept                   0.209591            0.19
    +labels[T.T_cells_CD4+]       -4.515602           1e-16
    +labels[T.T_cells_CD8+]       -5.166453           1e-16
     
     Dimension: APOE
     Exog Name                Coefficient         P-value
    -Intercept                   0.917977         8.2e-11
    -labels[T.T_cells_CD4+]       -4.270944           1e-16
    -labels[T.T_cells_CD8+]       -4.561553           1e-16
    +Intercept                   0.926648           2e-11
    +labels[T.T_cells_CD4+]       -4.293190         2.2e-16
    +labels[T.T_cells_CD8+]       -4.383797           1e-16
     
     Dimension: B2M
     Exog Name                Coefficient         P-value
    -Intercept                   3.903286           1e-16
    -labels[T.T_cells_CD4+]       -0.207227            0.19
    -labels[T.T_cells_CD8+]       -0.571121           0.011
    +Intercept                   3.912995           1e-16
    +labels[T.T_cells_CD4+]       -0.220007            0.67
    +labels[T.T_cells_CD8+]       -0.583185         0.00023
     
     Dimension: ACTB
     Exog Name                Coefficient         P-value
    -Intercept                   3.477508           1e-16
    -labels[T.T_cells_CD4+]       -1.058260         1.3e-05
    -labels[T.T_cells_CD8+]       -1.433466           1e-16
    +Intercept                   3.496265           1e-16
    +labels[T.T_cells_CD4+]       -1.082953         0.00027
    +labels[T.T_cells_CD8+]       -1.466583         3.5e-09
     
     Dimension: HLA-DRA
     Exog Name                Coefficient         P-value
    -Intercept                   3.569291           1e-16
    -labels[T.T_cells_CD4+]       -4.681176           1e-16
    -labels[T.T_cells_CD8+]       -4.322145           1e-16
    -
    -Dimension: APOC1
    -Exog Name                Coefficient         P-value
    -Intercept                   0.537658         0.00021
    -labels[T.T_cells_CD4+]       -4.180346           1e-16
    -labels[T.T_cells_CD8+]       -4.951382           1e-16
    -
    -Dimension: MT-CO1
    -Exog Name                Coefficient         P-value
    -Intercept                   3.719430           1e-16
    -labels[T.T_cells_CD4+]       -0.864605           0.046
    -labels[T.T_cells_CD8+]       -1.318557           1e-16
    -
    -Dimension: TMSB10
    -Exog Name                Coefficient         P-value
    -Intercept                   3.296484           1e-16
    -labels[T.T_cells_CD4+]       -1.006131           0.033
    -labels[T.T_cells_CD8+]       -1.902974           1e-16
    -
    -Dimension: EEF1A1
    -Exog Name                Coefficient         P-value
    -Intercept                   2.992825           1e-16
    -labels[T.T_cells_CD4+]        0.042000            0.71
    -labels[T.T_cells_CD8+]       -1.093768         2.4e-15
    -
    -Dimension: HLA-DRB1
    -Exog Name                Coefficient         P-value
    -Intercept                   2.854607           1e-16
    -labels[T.T_cells_CD4+]       -4.098247           1e-16
    -labels[T.T_cells_CD8+]       -3.645638           1e-16
    -
    -Dimension: HLA-DPA1
    -Exog Name                Coefficient         P-value
    -Intercept                   2.543715         4.4e-16
    -labels[T.T_cells_CD4+]       -3.681852           1e-16
    -labels[T.T_cells_CD8+]       -3.447149           1e-16
    -
    -Dimension: HLA-DPB1
    -Exog Name                Coefficient         P-value
    -Intercept                   2.700437         4.9e-08
    -labels[T.T_cells_CD4+]       -3.689348           1e-16
    -labels[T.T_cells_CD8+]       -3.355143           1e-16
    -
    -Dimension: MT-CO2
    -Exog Name                Coefficient         P-value
    -Intercept                   2.992518         8.1e-09
    -labels[T.T_cells_CD4+]       -0.491286          0.0016
    -labels[T.T_cells_CD8+]       -0.978666         2.2e-16
    -
    -Dimension: LYZ
    -Exog Name                Coefficient         P-value
    -Intercept                   2.074273           9e-12
    -labels[T.T_cells_CD4+]       -4.863344           1e-16
    -labels[T.T_cells_CD8+]       -5.335721           1e-16
    -
    -Dimension: RPLP1
    -Exog Name                Coefficient         P-value
    -Intercept                   3.192550         4.3e-14
    -labels[T.T_cells_CD4+]       -0.150987            0.28
    -labels[T.T_cells_CD8+]       -0.957494         2.3e-11
    +Intercept 3.575849 1e-16 +labels[T.T_cells_CD4+] -4.725000 1e-16 +labels[T.T_cells_CD8+] -4.348214 1e-16
    +

    The p-value corresponds to the coding used in one-hot encoding, with Macrophages set as the reference category.

    You can also visualize confidence intervals for regression coefficients using the plot_regression_forest method:

    -
    -
    pln.plot_regression_forest()
    +
    +
    pln.plot_regression_forest()
    -

    +
    +
    +

    +
    +

    @@ -5128,10 +4591,14 @@

    5 Covariance and

    5.1 Correlation Circle

    Use the plot_correlation_circle() method to visualize the relationships between variables:

    -
    -
    pln.plot_correlation_circle(column_names=["FTL", "MALAT1", "FTH1"])
    +
    +
    pln.plot_correlation_circle(column_names=["FTL", "MALAT1", "FTH1"])
    -

    +
    +
    +

    +
    +

    You can access the column names using the column_names_endog attribute of the model.

    @@ -5139,10 +4606,14 @@

    5.2 Biplot

    The biplot() method allows simultaneous visualization of variables and latent variables ((Z)):

    -
    -
    pln.biplot(column_names=["FTL", "MALAT1", "FTH1"], colors=cell_type)
    +
    +
    pln.biplot(column_names=["FTL", "MALAT1", "FTH1"], colors=cell_type)
    -

    +
    +
    +

    +
    +

    @@ -5151,31 +4622,36 @@

    6 High-dimension: PlnPCA Model

    The PlnPCA model (Chiquet, Mariadassou, and Robin 2018) extends the functionality of the Pln model for high-dimensional data. It uses the same syntax as Pln:

    -
    -
    from pyPLNmodels import PlnPCA
    -high_d_rna = load_scrna(dim=500)
    -pca = PlnPCA.from_formula('endog ~ 1 + labels', data=high_d_rna, rank=5).fit()
    +
    +
    from pyPLNmodels import PlnPCA
    +high_d_rna = load_scrna(dim=500)
    +pca = PlnPCA.from_formula('endog ~ 1 + labels', data=high_d_rna, rank=5).fit()
    Returning scRNA dataset of size (400, 500)
     Setting the offsets to zero.
     Fitting a PlnPCA model with 5 principal components.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (400)  reached in 5.7 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  12%|█▎        | 50/400 [00:00<00:00, 497.67it/s]Upper bound on the fitting time:  25%|██▌       | 100/400 [00:00<00:00, 480.72it/s]Upper bound on the fitting time:  37%|███▋      | 149/400 [00:00<00:00, 465.31it/s]Upper bound on the fitting time:  50%|████▉     | 198/400 [00:00<00:00, 472.47it/s]Upper bound on the fitting time:  62%|██████▎   | 250/400 [00:00<00:00, 487.23it/s]Upper bound on the fitting time:  76%|███████▌  | 302/400 [00:00<00:00, 497.51it/s]Upper bound on the fitting time:  89%|████████▉ | 355/400 [00:00<00:00, 505.50it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 495.90it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 1.0 seconds.
     Last  criterion = 5.4e-06 . Required tolerance = 1e-06
    -
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 9/400 [00:00<00:04, 86.34it/s]Upper bound on the fitting time:   4%|▍         | 18/400 [00:00<00:04, 85.55it/s]Upper bound on the fitting time:   7%|▋         | 27/400 [00:00<00:04, 84.76it/s]Upper bound on the fitting time:   9%|▉         | 36/400 [00:00<00:04, 83.75it/s]Upper bound on the fitting time:  11%|█▏        | 45/400 [00:00<00:04, 84.96it/s]Upper bound on the fitting time:  14%|█▎        | 54/400 [00:00<00:04, 85.13it/s]Upper bound on the fitting time:  16%|█▌        | 63/400 [00:00<00:03, 84.55it/s]Upper bound on the fitting time:  18%|█▊        | 72/400 [00:00<00:03, 82.06it/s]Upper bound on the fitting time:  20%|██        | 81/400 [00:00<00:03, 82.59it/s]Upper bound on the fitting time:  22%|██▎       | 90/400 [00:01<00:03, 83.36it/s]Upper bound on the fitting time:  25%|██▍       | 99/400 [00:01<00:03, 84.16it/s]Upper bound on the fitting time:  27%|██▋       | 108/400 [00:01<00:03, 84.67it/s]Upper bound on the fitting time:  29%|██▉       | 117/400 [00:01<00:03, 85.28it/s]Upper bound on the fitting time:  32%|███▏      | 126/400 [00:01<00:03, 85.38it/s]Upper bound on the fitting time:  34%|███▍      | 135/400 [00:01<00:03, 83.57it/s]Upper bound on the fitting time:  36%|███▌      | 144/400 [00:01<00:03, 84.95it/s]Upper bound on the fitting time:  38%|███▊      | 153/400 [00:01<00:02, 85.99it/s]Upper bound on the fitting time:  40%|████      | 162/400 [00:01<00:02, 83.71it/s]Upper bound on the fitting time:  43%|████▎     | 172/400 [00:02<00:02, 86.44it/s]Upper bound on the fitting time:  45%|████▌     | 181/400 [00:02<00:02, 87.04it/s]Upper bound on the fitting time:  48%|████▊     | 190/400 [00:02<00:02, 86.93it/s]Upper bound on the fitting time:  50%|████▉     | 199/400 [00:02<00:02, 86.94it/s]Upper bound on the fitting time:  52%|█████▏    | 208/400 [00:02<00:02, 86.71it/s]Upper bound on the fitting time:  54%|█████▍    | 217/400 [00:02<00:02, 83.97it/s]Upper bound on the fitting time:  56%|█████▋    | 226/400 [00:02<00:02, 82.02it/s]Upper bound on the fitting time:  59%|█████▉    | 235/400 [00:02<00:02, 82.16it/s]Upper bound on the fitting time:  61%|██████    | 244/400 [00:02<00:01, 83.27it/s]Upper bound on the fitting time:  63%|██████▎   | 253/400 [00:02<00:01, 83.95it/s]Upper bound on the fitting time:  66%|██████▌   | 262/400 [00:03<00:01, 83.94it/s]Upper bound on the fitting time:  68%|██████▊   | 271/400 [00:03<00:01, 84.76it/s]Upper bound on the fitting time:  70%|███████   | 280/400 [00:03<00:01, 85.49it/s]Upper bound on the fitting time:  72%|███████▏  | 289/400 [00:03<00:01, 83.42it/s]Upper bound on the fitting time:  74%|███████▍  | 298/400 [00:03<00:01, 83.77it/s]Upper bound on the fitting time:  77%|███████▋  | 307/400 [00:03<00:01, 84.53it/s]Upper bound on the fitting time:  79%|███████▉  | 316/400 [00:03<00:00, 84.79it/s]Upper bound on the fitting time:  81%|████████▏ | 325/400 [00:03<00:00, 85.24it/s]Upper bound on the fitting time:  84%|████████▎ | 334/400 [00:03<00:00, 85.23it/s]Upper bound on the fitting time:  86%|████████▌ | 343/400 [00:04<00:00, 84.46it/s]Upper bound on the fitting time:  88%|████████▊ | 352/400 [00:04<00:00, 85.21it/s]Upper bound on the fitting time:  90%|█████████ | 361/400 [00:04<00:00, 85.94it/s]Upper bound on the fitting time:  92%|█████████▎| 370/400 [00:04<00:00, 86.14it/s]Upper bound on the fitting time:  95%|█████████▍| 379/400 [00:04<00:00, 85.91it/s]Upper bound on the fitting time:  97%|█████████▋| 388/400 [00:04<00:00, 86.03it/s]Upper bound on the fitting time:  99%|█████████▉| 397/400 [00:04<00:00, 83.08it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:04<00:00, 84.52it/s]
    +

    ⚠️ Note: P-values are not available in the PlnPCA model.

    -
    -
    print(pca)
    +
    +
    print(pca)
    A multivariate PlnPCA with 5 principal components.
     ======================================================================
          Loglike   Dimension    Nb param         BIC         AIC         ICL
    -  -330671.62         500        3990 342624.5968  334661.625   339771.13
    +  -330657.75         500        3990 342610.7218   334647.75   339757.06
     
     ======================================================================
     * Useful attributes
    @@ -5188,36 +4664,64 @@ 

    6 High-dimension: None

    -

    This model is particularly efficient for high-dimensional datasets, offering significantly reduced computation time compared to Pln:

    +

    A low-dimensional of dimension rank of the latent variables can be obtained using the project keyword of the .transform() method:

    +
    +
    Z_low_dim = pca.transform(project=True)
    +print('Shape of Z_low_dim:', Z_low_dim.shape)
    +
    +
    Shape of Z_low_dim: torch.Size([400, 5])
    +
    +
    +

    This model is particularly efficient for high-dimensional datasets, offering significantly reduced computation time compared to Pln. See this paper for a computational comparison between Pln and PlnPCA

    6.1 Selecting the Rank

    The rank is a hyperparameter that can be specified by the user. Alternatively, a data-driven approach to rank selection can be performed using the PlnPCACollection class, which fits multiple models with different ranks:

    -
    -
    from pyPLNmodels import PlnPCACollection
    -pcas = PlnPCACollection.from_formula('endog ~ 1 + labels', data=high_d_rna, ranks=[3, 5, 10, 15]).fit()
    +
    +
    from pyPLNmodels import PlnPCACollection
    +pcas = PlnPCACollection.from_formula('endog ~ 1 + labels', data=high_d_rna, ranks=[3, 5, 10, 15]).fit()
    Setting the offsets to zero.
     Adjusting 4 PlnPCA models.
     
     Fitting a PlnPCA model with 3 principal components.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (400)  reached in 5.9 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  13%|█▎        | 51/400 [00:00<00:00, 505.80it/s]Upper bound on the fitting time:  26%|██▋       | 106/400 [00:00<00:00, 529.37it/s]Upper bound on the fitting time:  40%|████      | 161/400 [00:00<00:00, 537.43it/s]Upper bound on the fitting time:  54%|█████▍    | 216/400 [00:00<00:00, 541.60it/s]Upper bound on the fitting time:  68%|██████▊   | 272/400 [00:00<00:00, 547.74it/s]Upper bound on the fitting time:  82%|████████▏ | 328/400 [00:00<00:00, 550.41it/s]Upper bound on the fitting time:  96%|█████████▌| 384/400 [00:00<00:00, 549.51it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 543.79it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 0.9 seconds.
     Last  criterion = 5.4e-06 . Required tolerance = 1e-06
     Fitting a PlnPCA model with 5 principal components.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (400)  reached in 5.0 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  13%|█▎        | 52/400 [00:00<00:00, 517.32it/s]Upper bound on the fitting time:  26%|██▌       | 104/400 [00:00<00:00, 503.69it/s]Upper bound on the fitting time:  39%|███▉      | 155/400 [00:00<00:00, 493.49it/s]Upper bound on the fitting time:  51%|█████▏    | 205/400 [00:00<00:00, 467.65it/s]Upper bound on the fitting time:  63%|██████▎   | 252/400 [00:00<00:00, 462.31it/s]Upper bound on the fitting time:  75%|███████▍  | 299/400 [00:00<00:00, 463.64it/s]Upper bound on the fitting time:  87%|████████▋ | 348/400 [00:00<00:00, 471.12it/s]Upper bound on the fitting time: 100%|█████████▉| 399/400 [00:00<00:00, 483.13it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 478.59it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 0.8 seconds.
     Last  criterion = 5.4e-06 . Required tolerance = 1e-06
     Fitting a PlnPCA model with 10 principal components.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (400)  reached in 5.0 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  12%|█▏        | 48/400 [00:00<00:00, 478.78it/s]Upper bound on the fitting time:  24%|██▍       | 96/400 [00:00<00:00, 476.02it/s]Upper bound on the fitting time:  36%|███▌      | 144/400 [00:00<00:00, 472.61it/s]Upper bound on the fitting time:  48%|████▊     | 192/400 [00:00<00:00, 472.11it/s]Upper bound on the fitting time:  60%|██████    | 240/400 [00:00<00:00, 473.42it/s]Upper bound on the fitting time:  72%|███████▏  | 288/400 [00:00<00:00, 473.25it/s]Upper bound on the fitting time:  84%|████████▍ | 336/400 [00:00<00:00, 469.16it/s]Upper bound on the fitting time:  96%|█████████▌| 384/400 [00:00<00:00, 472.00it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 471.98it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 0.8 seconds.
     Last  criterion = 5.4e-06 . Required tolerance = 1e-06
     Fitting a PlnPCA model with 15 principal components.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (400)  reached in 5.4 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  12%|█▎        | 50/400 [00:00<00:00, 495.53it/s]Upper bound on the fitting time:  25%|██▌       | 100/400 [00:00<00:00, 493.94it/s]Upper bound on the fitting time:  38%|███▊      | 150/400 [00:00<00:00, 494.76it/s]Upper bound on the fitting time:  50%|█████     | 201/400 [00:00<00:00, 498.12it/s]Upper bound on the fitting time:  63%|██████▎   | 252/400 [00:00<00:00, 500.57it/s]Upper bound on the fitting time:  76%|███████▌  | 303/400 [00:00<00:00, 500.40it/s]Upper bound on the fitting time:  88%|████████▊ | 354/400 [00:00<00:00, 480.49it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 487.86it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 0.8 seconds.
     Last  criterion = 5.4e-06 . Required tolerance = 1e-06
     ======================================================================
     
    @@ -5229,29 +4733,30 @@ 

    -
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 8/400 [00:00<00:05, 74.82it/s]Upper bound on the fitting time:   4%|▍         | 16/400 [00:00<00:05, 73.40it/s]Upper bound on the fitting time:   6%|▌         | 24/400 [00:00<00:05, 73.27it/s]Upper bound on the fitting time:   8%|▊         | 32/400 [00:00<00:05, 72.31it/s]Upper bound on the fitting time:  10%|█         | 40/400 [00:00<00:04, 72.14it/s]Upper bound on the fitting time:  12%|█▏        | 48/400 [00:00<00:04, 71.64it/s]Upper bound on the fitting time:  14%|█▍        | 56/400 [00:00<00:04, 72.34it/s]Upper bound on the fitting time:  16%|█▌        | 64/400 [00:00<00:04, 72.15it/s]Upper bound on the fitting time:  18%|█▊        | 72/400 [00:01<00:04, 70.18it/s]Upper bound on the fitting time:  20%|██        | 80/400 [00:01<00:04, 71.48it/s]Upper bound on the fitting time:  22%|██▏       | 88/400 [00:01<00:04, 72.30it/s]Upper bound on the fitting time:  24%|██▍       | 96/400 [00:01<00:04, 71.14it/s]Upper bound on the fitting time:  26%|██▋       | 105/400 [00:01<00:03, 74.80it/s]Upper bound on the fitting time:  28%|██▊       | 114/400 [00:01<00:03, 78.72it/s]Upper bound on the fitting time:  31%|███       | 123/400 [00:01<00:03, 81.14it/s]Upper bound on the fitting time:  33%|███▎      | 132/400 [00:01<00:03, 82.18it/s]Upper bound on the fitting time:  35%|███▌      | 141/400 [00:01<00:03, 84.43it/s]Upper bound on the fitting time:  38%|███▊      | 150/400 [00:01<00:02, 85.95it/s]Upper bound on the fitting time:  40%|███▉      | 159/400 [00:02<00:02, 86.91it/s]Upper bound on the fitting time:  42%|████▏     | 168/400 [00:02<00:02, 87.37it/s]Upper bound on the fitting time:  44%|████▍     | 177/400 [00:02<00:02, 87.46it/s]Upper bound on the fitting time:  46%|████▋     | 186/400 [00:02<00:02, 87.50it/s]Upper bound on the fitting time:  49%|████▉     | 195/400 [00:02<00:02, 88.14it/s]Upper bound on the fitting time:  51%|█████     | 204/400 [00:02<00:02, 88.27it/s]Upper bound on the fitting time:  54%|█████▎    | 214/400 [00:02<00:02, 89.16it/s]Upper bound on the fitting time:  56%|█████▌    | 224/400 [00:02<00:01, 89.70it/s]Upper bound on the fitting time:  58%|█████▊    | 233/400 [00:02<00:01, 89.52it/s]Upper bound on the fitting time:  60%|██████    | 242/400 [00:02<00:01, 87.74it/s]Upper bound on the fitting time:  63%|██████▎   | 251/400 [00:03<00:01, 87.16it/s]Upper bound on the fitting time:  65%|██████▌   | 260/400 [00:03<00:01, 85.44it/s]Upper bound on the fitting time:  67%|██████▋   | 269/400 [00:03<00:01, 86.45it/s]Upper bound on the fitting time:  70%|██████▉   | 278/400 [00:03<00:01, 86.85it/s]Upper bound on the fitting time:  72%|███████▏  | 287/400 [00:03<00:01, 87.32it/s]Upper bound on the fitting time:  74%|███████▍  | 297/400 [00:03<00:01, 87.91it/s]Upper bound on the fitting time:  76%|███████▋  | 306/400 [00:03<00:01, 87.70it/s]Upper bound on the fitting time:  79%|███████▉  | 315/400 [00:03<00:00, 88.02it/s]Upper bound on the fitting time:  81%|████████  | 324/400 [00:03<00:00, 88.04it/s]Upper bound on the fitting time:  83%|████████▎ | 333/400 [00:04<00:00, 86.15it/s]Upper bound on the fitting time:  86%|████████▌ | 342/400 [00:04<00:00, 86.63it/s]Upper bound on the fitting time:  88%|████████▊ | 351/400 [00:04<00:00, 86.96it/s]Upper bound on the fitting time:  90%|█████████ | 360/400 [00:04<00:00, 87.49it/s]Upper bound on the fitting time:  92%|█████████▏| 369/400 [00:04<00:00, 87.31it/s]Upper bound on the fitting time:  94%|█████████▍| 378/400 [00:04<00:00, 87.53it/s]Upper bound on the fitting time:  97%|█████████▋| 387/400 [00:04<00:00, 79.52it/s]Upper bound on the fitting time:  99%|█████████▉| 396/400 [00:04<00:00, 77.05it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:04<00:00, 81.86it/s]
    -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 8/400 [00:00<00:05, 71.16it/s]Upper bound on the fitting time:   4%|▍         | 16/400 [00:00<00:05, 70.73it/s]Upper bound on the fitting time:   6%|▋         | 25/400 [00:00<00:04, 75.75it/s]Upper bound on the fitting time:   8%|▊         | 33/400 [00:00<00:04, 76.28it/s]Upper bound on the fitting time:  10%|█         | 42/400 [00:00<00:04, 77.95it/s]Upper bound on the fitting time:  12%|█▎        | 50/400 [00:00<00:04, 77.33it/s]Upper bound on the fitting time:  14%|█▍        | 58/400 [00:00<00:04, 76.23it/s]Upper bound on the fitting time:  16%|█▋        | 66/400 [00:00<00:04, 77.17it/s]Upper bound on the fitting time:  19%|█▉        | 75/400 [00:00<00:04, 78.85it/s]Upper bound on the fitting time:  21%|██        | 84/400 [00:01<00:03, 79.84it/s]Upper bound on the fitting time:  23%|██▎       | 93/400 [00:01<00:03, 81.05it/s]Upper bound on the fitting time:  26%|██▌       | 102/400 [00:01<00:03, 82.91it/s]Upper bound on the fitting time:  28%|██▊       | 111/400 [00:01<00:03, 84.08it/s]Upper bound on the fitting time:  30%|███       | 120/400 [00:01<00:03, 85.11it/s]Upper bound on the fitting time:  32%|███▏      | 129/400 [00:01<00:03, 85.78it/s]Upper bound on the fitting time:  34%|███▍      | 138/400 [00:01<00:03, 86.07it/s]Upper bound on the fitting time:  37%|███▋      | 147/400 [00:01<00:02, 86.42it/s]Upper bound on the fitting time:  39%|███▉      | 156/400 [00:01<00:02, 85.72it/s]Upper bound on the fitting time:  41%|████▏     | 165/400 [00:02<00:02, 85.36it/s]Upper bound on the fitting time:  44%|████▎     | 174/400 [00:02<00:02, 86.26it/s]Upper bound on the fitting time:  46%|████▌     | 183/400 [00:02<00:02, 86.30it/s]Upper bound on the fitting time:  48%|████▊     | 192/400 [00:02<00:02, 86.14it/s]Upper bound on the fitting time:  50%|█████     | 201/400 [00:02<00:02, 86.02it/s]Upper bound on the fitting time:  52%|█████▎    | 210/400 [00:02<00:02, 82.90it/s]Upper bound on the fitting time:  55%|█████▍    | 219/400 [00:02<00:02, 77.44it/s]Upper bound on the fitting time:  57%|█████▋    | 227/400 [00:02<00:02, 76.32it/s]Upper bound on the fitting time:  59%|█████▉    | 236/400 [00:02<00:02, 78.84it/s]Upper bound on the fitting time:  61%|██████▏   | 245/400 [00:03<00:01, 78.95it/s]Upper bound on the fitting time:  63%|██████▎   | 253/400 [00:03<00:01, 76.69it/s]Upper bound on the fitting time:  66%|██████▌   | 262/400 [00:03<00:01, 78.18it/s]Upper bound on the fitting time:  68%|██████▊   | 271/400 [00:03<00:01, 80.89it/s]Upper bound on the fitting time:  70%|███████   | 280/400 [00:03<00:01, 82.88it/s]Upper bound on the fitting time:  72%|███████▏  | 289/400 [00:03<00:01, 84.37it/s]Upper bound on the fitting time:  74%|███████▍  | 298/400 [00:03<00:01, 83.60it/s]Upper bound on the fitting time:  77%|███████▋  | 307/400 [00:03<00:01, 81.66it/s]Upper bound on the fitting time:  79%|███████▉  | 316/400 [00:03<00:01, 80.25it/s]Upper bound on the fitting time:  81%|████████▏ | 325/400 [00:04<00:00, 79.36it/s]Upper bound on the fitting time:  84%|████████▎ | 334/400 [00:04<00:00, 80.82it/s]Upper bound on the fitting time:  86%|████████▌ | 343/400 [00:04<00:00, 81.62it/s]Upper bound on the fitting time:  88%|████████▊ | 352/400 [00:04<00:00, 82.67it/s]Upper bound on the fitting time:  90%|█████████ | 361/400 [00:04<00:00, 82.77it/s]Upper bound on the fitting time:  92%|█████████▎| 370/400 [00:04<00:00, 79.56it/s]Upper bound on the fitting time:  94%|█████████▍| 378/400 [00:04<00:00, 74.05it/s]Upper bound on the fitting time:  96%|█████████▋| 386/400 [00:04<00:00, 72.85it/s]Upper bound on the fitting time:  98%|█████████▊| 394/400 [00:04<00:00, 72.82it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:04<00:00, 80.09it/s]
    -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 8/400 [00:00<00:04, 79.34it/s]Upper bound on the fitting time:   4%|▍         | 17/400 [00:00<00:04, 81.25it/s]Upper bound on the fitting time:   6%|▋         | 26/400 [00:00<00:04, 81.54it/s]Upper bound on the fitting time:   9%|▉         | 35/400 [00:00<00:04, 80.65it/s]Upper bound on the fitting time:  11%|█         | 44/400 [00:00<00:04, 77.33it/s]Upper bound on the fitting time:  13%|█▎        | 53/400 [00:00<00:04, 78.75it/s]Upper bound on the fitting time:  16%|█▌        | 62/400 [00:00<00:04, 79.83it/s]Upper bound on the fitting time:  18%|█▊        | 71/400 [00:00<00:04, 80.56it/s]Upper bound on the fitting time:  20%|██        | 80/400 [00:01<00:03, 80.32it/s]Upper bound on the fitting time:  22%|██▏       | 89/400 [00:01<00:03, 80.81it/s]Upper bound on the fitting time:  24%|██▍       | 98/400 [00:01<00:03, 81.50it/s]Upper bound on the fitting time:  27%|██▋       | 107/400 [00:01<00:03, 81.87it/s]Upper bound on the fitting time:  29%|██▉       | 116/400 [00:01<00:03, 82.01it/s]Upper bound on the fitting time:  31%|███▏      | 125/400 [00:01<00:03, 81.94it/s]Upper bound on the fitting time:  34%|███▎      | 134/400 [00:01<00:03, 82.12it/s]Upper bound on the fitting time:  36%|███▌      | 143/400 [00:01<00:03, 82.12it/s]Upper bound on the fitting time:  38%|███▊      | 152/400 [00:01<00:03, 81.78it/s]Upper bound on the fitting time:  40%|████      | 161/400 [00:01<00:02, 82.00it/s]Upper bound on the fitting time:  42%|████▎     | 170/400 [00:02<00:02, 82.31it/s]Upper bound on the fitting time:  45%|████▍     | 179/400 [00:02<00:02, 80.33it/s]Upper bound on the fitting time:  47%|████▋     | 188/400 [00:02<00:02, 81.15it/s]Upper bound on the fitting time:  49%|████▉     | 197/400 [00:02<00:02, 81.62it/s]Upper bound on the fitting time:  52%|█████▏    | 206/400 [00:02<00:02, 81.82it/s]Upper bound on the fitting time:  54%|█████▍    | 215/400 [00:02<00:02, 81.52it/s]Upper bound on the fitting time:  56%|█████▌    | 224/400 [00:02<00:02, 81.46it/s]Upper bound on the fitting time:  58%|█████▊    | 233/400 [00:02<00:02, 81.79it/s]Upper bound on the fitting time:  60%|██████    | 242/400 [00:02<00:01, 81.85it/s]Upper bound on the fitting time:  63%|██████▎   | 251/400 [00:03<00:01, 80.71it/s]Upper bound on the fitting time:  65%|██████▌   | 260/400 [00:03<00:01, 81.04it/s]Upper bound on the fitting time:  67%|██████▋   | 269/400 [00:03<00:01, 81.37it/s]Upper bound on the fitting time:  70%|██████▉   | 278/400 [00:03<00:01, 81.91it/s]Upper bound on the fitting time:  72%|███████▏  | 287/400 [00:03<00:01, 81.96it/s]Upper bound on the fitting time:  74%|███████▍  | 296/400 [00:03<00:01, 79.39it/s]Upper bound on the fitting time:  76%|███████▌  | 304/400 [00:03<00:01, 77.90it/s]Upper bound on the fitting time:  78%|███████▊  | 312/400 [00:03<00:01, 76.19it/s]Upper bound on the fitting time:  80%|████████  | 320/400 [00:03<00:01, 76.62it/s]Upper bound on the fitting time:  82%|████████▏ | 328/400 [00:04<00:00, 76.60it/s]Upper bound on the fitting time:  84%|████████▍ | 336/400 [00:04<00:00, 76.88it/s]Upper bound on the fitting time:  86%|████████▌ | 344/400 [00:04<00:00, 77.11it/s]Upper bound on the fitting time:  88%|████████▊ | 352/400 [00:04<00:00, 76.94it/s]Upper bound on the fitting time:  90%|█████████ | 360/400 [00:04<00:00, 76.79it/s]Upper bound on the fitting time:  92%|█████████▏| 368/400 [00:04<00:00, 76.71it/s]Upper bound on the fitting time:  94%|█████████▍| 376/400 [00:04<00:00, 77.29it/s]Upper bound on the fitting time:  96%|█████████▋| 385/400 [00:04<00:00, 78.52it/s]Upper bound on the fitting time:  98%|█████████▊| 394/400 [00:04<00:00, 79.40it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:05<00:00, 79.99it/s]
    -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 9/400 [00:00<00:04, 81.63it/s]Upper bound on the fitting time:   4%|▍         | 18/400 [00:00<00:04, 79.52it/s]Upper bound on the fitting time:   6%|▋         | 26/400 [00:00<00:04, 78.83it/s]Upper bound on the fitting time:   8%|▊         | 34/400 [00:00<00:05, 72.70it/s]Upper bound on the fitting time:  10%|█         | 42/400 [00:00<00:05, 69.90it/s]Upper bound on the fitting time:  12%|█▎        | 50/400 [00:00<00:04, 71.23it/s]Upper bound on the fitting time:  14%|█▍        | 58/400 [00:00<00:04, 71.51it/s]Upper bound on the fitting time:  16%|█▋        | 66/400 [00:00<00:04, 72.43it/s]Upper bound on the fitting time:  18%|█▊        | 74/400 [00:01<00:04, 73.86it/s]Upper bound on the fitting time:  20%|██        | 82/400 [00:01<00:04, 74.41it/s]Upper bound on the fitting time:  22%|██▎       | 90/400 [00:01<00:04, 75.36it/s]Upper bound on the fitting time:  24%|██▍       | 98/400 [00:01<00:03, 76.21it/s]Upper bound on the fitting time:  26%|██▋       | 106/400 [00:01<00:03, 76.38it/s]Upper bound on the fitting time:  28%|██▊       | 114/400 [00:01<00:03, 76.86it/s]Upper bound on the fitting time:  30%|███       | 122/400 [00:01<00:03, 76.88it/s]Upper bound on the fitting time:  32%|███▎      | 130/400 [00:01<00:03, 75.39it/s]Upper bound on the fitting time:  34%|███▍      | 138/400 [00:01<00:03, 73.14it/s]Upper bound on the fitting time:  36%|███▋      | 146/400 [00:01<00:03, 70.52it/s]Upper bound on the fitting time:  38%|███▊      | 154/400 [00:02<00:03, 67.96it/s]Upper bound on the fitting time:  40%|████      | 161/400 [00:02<00:03, 66.97it/s]Upper bound on the fitting time:  42%|████▏     | 168/400 [00:02<00:03, 66.04it/s]Upper bound on the fitting time:  44%|████▍     | 175/400 [00:02<00:03, 66.85it/s]Upper bound on the fitting time:  46%|████▌     | 183/400 [00:02<00:03, 69.65it/s]Upper bound on the fitting time:  48%|████▊     | 191/400 [00:02<00:02, 71.68it/s]Upper bound on the fitting time:  50%|████▉     | 199/400 [00:02<00:02, 71.98it/s]Upper bound on the fitting time:  52%|█████▏    | 207/400 [00:02<00:02, 72.25it/s]Upper bound on the fitting time:  54%|█████▍    | 215/400 [00:02<00:02, 74.01it/s]Upper bound on the fitting time:  56%|█████▌    | 223/400 [00:03<00:02, 75.47it/s]Upper bound on the fitting time:  58%|█████▊    | 231/400 [00:03<00:02, 75.91it/s]Upper bound on the fitting time:  60%|█████▉    | 239/400 [00:03<00:02, 76.49it/s]Upper bound on the fitting time:  62%|██████▏   | 247/400 [00:03<00:02, 74.96it/s]Upper bound on the fitting time:  64%|██████▍   | 255/400 [00:03<00:01, 75.45it/s]Upper bound on the fitting time:  66%|██████▌   | 263/400 [00:03<00:01, 75.09it/s]Upper bound on the fitting time:  68%|██████▊   | 271/400 [00:03<00:01, 76.09it/s]Upper bound on the fitting time:  70%|██████▉   | 279/400 [00:03<00:01, 76.57it/s]Upper bound on the fitting time:  72%|███████▏  | 287/400 [00:03<00:01, 76.99it/s]Upper bound on the fitting time:  74%|███████▍  | 295/400 [00:04<00:01, 76.65it/s]Upper bound on the fitting time:  76%|███████▌  | 303/400 [00:04<00:01, 77.37it/s]Upper bound on the fitting time:  78%|███████▊  | 311/400 [00:04<00:01, 77.58it/s]Upper bound on the fitting time:  80%|███████▉  | 319/400 [00:04<00:01, 78.00it/s]Upper bound on the fitting time:  82%|████████▏ | 327/400 [00:04<00:00, 77.55it/s]Upper bound on the fitting time:  84%|████████▍ | 335/400 [00:04<00:00, 74.65it/s]Upper bound on the fitting time:  86%|████████▌ | 343/400 [00:04<00:00, 72.87it/s]Upper bound on the fitting time:  88%|████████▊ | 351/400 [00:04<00:00, 73.54it/s]Upper bound on the fitting time:  90%|████████▉ | 359/400 [00:04<00:00, 75.01it/s]Upper bound on the fitting time:  92%|█████████▏| 367/400 [00:04<00:00, 75.91it/s]Upper bound on the fitting time:  94%|█████████▍| 375/400 [00:05<00:00, 76.71it/s]Upper bound on the fitting time:  96%|█████████▌| 383/400 [00:05<00:00, 76.74it/s]Upper bound on the fitting time:  98%|█████████▊| 391/400 [00:05<00:00, 76.93it/s]Upper bound on the fitting time: 100%|█████████▉| 399/400 [00:05<00:00, 77.29it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:05<00:00, 74.34it/s]
    +

    Use the .show() method to explore insights about the optimal rank:

    -
    -
    pcas.show()
    +
    +
    pcas.show()
    -

    +
    +
    +

    +
    +

    ⚠️ Note: The best model typically correspond to the largest rank, which may not always be desirable.

    The best model can be accessed using the .best_model() method. The selection criterion can be AIC, BIC, or ICL:

    -
    -
    best_model = pcas.best_model(criterion="BIC")
    -print(best_model)
    +
    +
    best_model = pcas.best_model(criterion="BIC")
    +print(best_model)
    A multivariate PlnPCA with 15 principal components.
     ======================================================================
          Loglike   Dimension    Nb param         BIC         AIC         ICL
    -   -281440.0         500        8895 308087.0386    290335.0   299427.15
    +   -281405.0         500        8895 308052.0386    290300.0   299389.87
     
     ======================================================================
     * Useful attributes
    @@ -5268,14 +4773,14 @@ 

    6.2 Accessing Individual Models

    All individual models in the collection can be accessed with the rank as the key:

    -
    -
    pca_5 = pcas[5]
    -print(pca_5)
    +
    +
    pca_5 = pcas[5]
    +print(pca_5)
    A multivariate PlnPCA with 5 principal components.
     ======================================================================
          Loglike   Dimension    Nb param         BIC         AIC         ICL
    -  -331103.12         500        3990 343056.0968  335093.125   340204.75
    +  -330615.38         500        3990 342568.3468  334605.375   339716.13
     
     ======================================================================
     * Useful attributes
    @@ -5289,14 +4794,14 @@ 

    -
    for pca in pcas.values():
    -    print(pca)
    +
    +
    for pca in pcas.values():
    +    print(pca)
    A multivariate PlnPCA with 3 principal components.
     ======================================================================
          Loglike   Dimension    Nb param         BIC         AIC         ICL
    -  -363021.88         500        2997 372000.0846  366018.875   370292.93
    +  -363016.88         500        2997 371995.0846  366013.875   370287.37
     
     ======================================================================
     * Useful attributes
    @@ -5310,7 +4815,7 @@ 

    < +

    -

    References

    +

    References

    Aitchison, John, and CH Ho. 1989. “The Multivariate Poisson-Log Normal Distribution.” Biometrika 76 (4): 643–53.
    @@ -5373,240 +4879,407 @@

    <

    + }); +

    + diff --git a/docs/source/tutorials/basic_analysis.qmd b/docs/source/tutorials/basic_analysis.qmd index 8800fbb8..e2e05a23 100644 --- a/docs/source/tutorials/basic_analysis.qmd +++ b/docs/source/tutorials/basic_analysis.qmd @@ -49,7 +49,7 @@ and the model parameters are: These models aim to capture the structure of the data through the latent variables $Z$. The `Pln` model assumes $\Sigma$ has full rank, while the `PlnPCA` model -assumes $\Sigma$ has a low rank, which must be specified by the user. A lower +assumes $\Sigma$ has a low rank, which must be specified by the user. A lower rank introduces a trade-off, reducing computational complexity but potentially compromising parameter estimation accuracy. @@ -61,16 +61,20 @@ The `pyPLNmodels` package is designed to: * Retrieve the latent variables $Z$ (which typically contains more information than $Y$) * Visualize the latent variables and their relationships -This is achieved using the input count matrix $Y$, along with optional covariate matrix $X$ (defaulting to a vector of 1's) and offsets $O$ (defaulting to a matrix of 0's). +This is achieved using the input count matrix $Y$, along with optional covariate matrix $X$ (defaulting to a vector of 1s) and offsets $O$ (defaulting to a matrix of 0s). # Importing Data -In this example, we analyze single-cell RNA-seq data provided by the `load_scrna` function in the package. Each column in the dataset represents a gene, while each row corresponds to a cell (i.e., an individual). Covariates for cell types (`labels`) are also included. For simplicity, we limit the analysis to 20 variables (dimensions). +In this example, we analyze single-cell RNA-seq data provided by the +`load_scrna` function in the package. Each column in the dataset represents a +gene, while each row corresponds to a cell (i.e., an individual). Covariates +for cell types (`labels`) are also included. For simplicity, we limit the +analysis to $10$ variables (dimensions). ```{python} from pyPLNmodels import load_scrna -rna = load_scrna(dim=20) +rna = load_scrna(dim=10) print('Data: ', rna.keys()) ``` @@ -118,17 +122,15 @@ To gain deeper insights into the model parameters and the optimization process, pln.show() ``` -Monitoring the norm of each parameters allows to know if the model has -converged. If it has not converged, one can refit the model with a lower -tolerance (`tol`) and a bigger number iterations than the default (`maxiter=400`): +Monitoring the norm of each parameter is essential to assess model convergence. +If the model has not converged, consider refitting it with additional iterations and +a reduced tolerance (`tol`). To adjust the number of iterations, use the +`maxiter` parameter: ```{python} -#|eval : false -pln.fit(maxiter=1000, tol = 0) +pln.fit(maxiter=1000, tol = 0).show() ``` - - ## Exploring Latent Variables The latent variables $Z$, which capture the underlying structure of the data, are accessible via the `latent_variables` attribute, or the `.transform()` method: @@ -139,20 +141,23 @@ Z = pln.transform() print('Shape of Z:', Z.shape) ``` -The effect of covariates on the latent variables can be removed by using the `remove_exog_effect` keyword: + +You can visualize these latent variables using the `.viz()` method: ```{python} -Z_moins_XB = pln.transform(remove_exog_effect=True) +pln.viz(colors=cell_type) ``` - -You can visualize these latent variables using the `.viz()` method: +By default the effect of covariates on the latent variables is included in the +visualization. This means that the latent variables are represented as $Z + +XB$. The effect of covariates on the latent variables can be removed by using +the `remove_exog_effect` keyword: ```{python} -pln.viz(colors=cell_type) +Z_moins_XB = pln.transform(remove_exog_effect=True) ``` -To visualize the latent positions without the effect of covariates (i.e., \(Z - XB\)), set the `remove_exog_effect` parameter to `True`: +To visualize the latent positions without the effect of covariates (i.e., \(Z - XB\)), set the `remove_exog_effect` parameter to `True` in the `.viz()` method: ```{python} pln.viz(colors=cell_type, remove_exog_effect=True) @@ -163,6 +168,7 @@ Additionally, you can generate a pair plot of the first Principal Components (PC ```{python} pln.pca_pairplot(n_components=4, colors=cell_type) ``` +The `remove_exog_effect` parameter is also available in the `pca_pairplot` method. # Analyzing Covariate Effects @@ -175,6 +181,8 @@ To summarize the model, including confidence intervals and p-values, use the `su ```{python} pln.summary() ``` +The p-value corresponds to the coding used in one-hot encoding, with +`Macrophages` set as the reference category. You can also visualize confidence intervals for regression coefficients using the `plot_regression_forest` method: @@ -220,12 +228,23 @@ pca = PlnPCA.from_formula('endog ~ 1 + labels', data=high_d_rna, rank=5).fit() **⚠️ Note:** P-values are not available in the `PlnPCA` model. - ```{python} print(pca) ``` -This model is particularly efficient for high-dimensional datasets, offering significantly reduced computation time compared to `Pln`: +A low-dimensional of dimension `rank` of the latent variables can be obtained using the `project` keyword of the `.transform()` method: + +```{python} +Z_low_dim = pca.transform(project=True) +print('Shape of Z_low_dim:', Z_low_dim.shape) +``` + + + +This model is particularly efficient for high-dimensional datasets, offering +significantly reduced computation time compared to `Pln`. See [this +paper](https://joss.theoj.org/papers/10.21105/joss.06969) for a computational +comparison between `Pln` and `PlnPCA` ## Selecting the Rank diff --git a/docs/source/tutorials/clustering.html b/docs/source/tutorials/clustering.html index 156b5a48..296a37b8 100644 --- a/docs/source/tutorials/clustering.html +++ b/docs/source/tutorials/clustering.html @@ -2,13 +2,13 @@ - + -pyPLNmodels - Clustering of count data 🔍 +Clustering of count data 🔍 – pyPLNmodels - + - - + - + + + - +
    +

    1 Introduction

    The Poisson lognormal (PLN) model can be extended to uncover clustering structures in count data. Two main approaches are available:

    @@ -4806,7 +4298,7 @@

    1 Introduction

    2 Data Loading and Structure

    -
    +
    from pyPLNmodels import load_scrna
     rna = load_scrna(dim=20)
     print("Data keys:", rna.keys())
    @@ -4817,7 +4309,7 @@

    2 Data Loading an

    2.1 Count Matrix (endog)

    -
    +
    endog = rna["endog"]
     print(endog.head())
    @@ -4846,7 +4338,7 @@

    2.2 Cell Types (labels)

    -
    +
    cell_type = rna["labels"]
     print("Cell types:", cell_type.unique())
     print(cell_type.head())
    @@ -4884,7 +4376,7 @@ 

    3.2 Train-Test Split

    We separate the data into training and test sets. The training set is used to fit the model, while the test set is used for evaluation.

    -
    +
    train_prop = 0.8
     n_train = int(endog.shape[0] * train_prop)
     endog_train, endog_test = endog[:n_train], endog[n_train:]
    @@ -4893,7 +4385,7 @@ 

    3.3 Fitting the PLN-LDA Model

    -
    +
    from pyPLNmodels import PlnLDA
     lda = PlnLDA(endog_train, clusters=cell_type_train).fit()
     print(lda)
    @@ -4901,8 +4393,13 @@

    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  26%|██▌       | 102/400 [00:00<00:00, 1017.58it/s]Upper bound on the fitting time:  51%|█████     | 204/400 [00:00<00:00, 999.29it/s] Upper bound on the fitting time:  76%|███████▋  | 306/400 [00:00<00:00, 1006.35it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 1009.37it/s]
    +

    +
    +
    Maximum number of iterations (400)  reached in 1.2 seconds.
     Last  criterion = 5.4e-06 . Required tolerance = 1e-06
     A multivariate PlnLDA with full covariance.
     ======================================================================
    @@ -4920,13 +4417,13 @@ 

    -
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   4%|▍         | 16/400 [00:00<00:02, 149.84it/s]Upper bound on the fitting time:   8%|▊         | 31/400 [00:00<00:02, 142.82it/s]Upper bound on the fitting time:  12%|█▏        | 46/400 [00:00<00:02, 140.25it/s]Upper bound on the fitting time:  15%|█▌        | 61/400 [00:00<00:02, 139.95it/s]Upper bound on the fitting time:  19%|█▉        | 75/400 [00:00<00:02, 139.81it/s]Upper bound on the fitting time:  22%|██▎       | 90/400 [00:00<00:02, 140.00it/s]Upper bound on the fitting time:  26%|██▋       | 105/400 [00:00<00:02, 140.47it/s]Upper bound on the fitting time:  30%|███       | 120/400 [00:00<00:01, 140.04it/s]Upper bound on the fitting time:  34%|███▍      | 135/400 [00:00<00:01, 140.12it/s]Upper bound on the fitting time:  38%|███▊      | 150/400 [00:01<00:01, 141.21it/s]Upper bound on the fitting time:  41%|████▏     | 165/400 [00:01<00:01, 141.50it/s]Upper bound on the fitting time:  45%|████▌     | 180/400 [00:01<00:01, 140.84it/s]Upper bound on the fitting time:  49%|████▉     | 195/400 [00:01<00:01, 141.95it/s]Upper bound on the fitting time:  52%|█████▎    | 210/400 [00:01<00:01, 141.48it/s]Upper bound on the fitting time:  56%|█████▋    | 225/400 [00:01<00:01, 142.38it/s]Upper bound on the fitting time:  60%|██████    | 240/400 [00:01<00:01, 141.77it/s]Upper bound on the fitting time:  64%|██████▍   | 255/400 [00:01<00:01, 139.89it/s]Upper bound on the fitting time:  68%|██████▊   | 270/400 [00:01<00:00, 141.59it/s]Upper bound on the fitting time:  71%|███████▏  | 285/400 [00:02<00:00, 142.26it/s]Upper bound on the fitting time:  75%|███████▌  | 300/400 [00:02<00:00, 143.03it/s]Upper bound on the fitting time:  79%|███████▉  | 315/400 [00:02<00:00, 142.51it/s]Upper bound on the fitting time:  82%|████████▎ | 330/400 [00:02<00:00, 141.17it/s]Upper bound on the fitting time:  86%|████████▋ | 345/400 [00:02<00:00, 142.74it/s]Upper bound on the fitting time:  90%|█████████ | 360/400 [00:02<00:00, 143.32it/s]Upper bound on the fitting time:  94%|█████████▍| 375/400 [00:02<00:00, 143.68it/s]Upper bound on the fitting time:  98%|█████████▊| 390/400 [00:02<00:00, 142.67it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:02<00:00, 141.64it/s]
    +

    You can also define the model using R-style formulas as follows:

    -
    -
    data_train = {"endog_train": endog_train, "clusters_train": cell_type_train}
    -_ = PlnLDA.from_formula("endog_train ~ 0 | clusters_train", data=data_train)
    +
    +
    data_train = {"endog_train": endog_train, "clusters_train": cell_type_train}
    +_ = PlnLDA.from_formula("endog_train ~ 0 | clusters_train", data=data_train)
    Setting the offsets to zero.
    @@ -4935,30 +4432,47 @@

    3.4 Predicting on Test Set

    -
    -
    pred_test = lda.predict_clusters(endog_test)
    +
    +
    pred_test = lda.predict_clusters(endog_test)
    Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1410.83it/s]
    +
    +
    +
    Done!
     Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1442.06it/s]
    +
    +
    +
    Done!
     Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.

    -
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  46%|████▌     | 23/50 [00:00<00:00, 227.00it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 252.06it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 246.48it/s]
    -Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  48%|████▊     | 24/50 [00:00<00:00, 239.33it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 253.10it/s]
    -Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  48%|████▊     | 24/50 [00:00<00:00, 239.00it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 254.24it/s]
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1452.76it/s]
    +
    +
    Done!
    -
    -
    from pyPLNmodels import plot_confusion_matrix
    -plot_confusion_matrix(pred_test, cell_type_test)
    +
    +
    +
    +
    +
    +
    from pyPLNmodels import plot_confusion_matrix
    +plot_confusion_matrix(pred_test, cell_type_test)
    -

    +
    +
    +

    +
    +

    You can enhance performance by incorporating additional variables or increasing the number of samples in your dataset.

    @@ -4966,82 +4480,149 @@

    <

    3.5 Visualizing the Latent Space

    The .transform_new() method transforms unseen endogenous data into the latent space via LDA.

    -
    -
    lda.viz_transformed(lda.transform_new(endog_test), colors=cell_type_test)
    +
    +
    lda.viz_transformed(lda.transform_new(endog_test), colors=cell_type_test)
    Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1217.64it/s]
    +
    +
    +
    Done!
     Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1304.64it/s]
    +
    +
    +
    Done!
     Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.

    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1414.64it/s]
    +
    +
    +
    Done!
    -
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  48%|████▊     | 24/50 [00:00<00:00, 236.82it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 251.32it/s]
    -Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  48%|████▊     | 24/50 [00:00<00:00, 239.10it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 251.14it/s]
    -Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  48%|████▊     | 24/50 [00:00<00:00, 239.81it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 254.93it/s]
    +
    -

    +
    +
    +

    +
    -
    -
    lda.viz_transformed(lda.transform_new(endog_train), colors=cell_type_train)
    +
    +
    +
    lda.viz_transformed(lda.transform_new(endog_train), colors=cell_type_train)
    Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1143.74it/s]
    +
    +
    +
    Done!
     Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1146.37it/s]
    +
    +
    +
    Done!
     Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1147.84it/s]
    +
    +
    +
    Done!
    -
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  36%|███▌      | 18/50 [00:00<00:00, 175.52it/s]Upper bound on the fitting time:  72%|███████▏  | 36/50 [00:00<00:00, 164.75it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 163.14it/s]
    -Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  34%|███▍      | 17/50 [00:00<00:00, 167.57it/s]Upper bound on the fitting time:  68%|██████▊   | 34/50 [00:00<00:00, 160.04it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 158.71it/s]
    -Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  32%|███▏      | 16/50 [00:00<00:00, 152.98it/s]Upper bound on the fitting time:  64%|██████▍   | 32/50 [00:00<00:00, 154.21it/s]Upper bound on the fitting time:  96%|█████████▌| 48/50 [00:00<00:00, 156.66it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 154.42it/s]
    +
    -

    +
    +
    +

    +
    +

    3.5.1 Optional: Exogenous Variables

    You can include exogenous variables in the model; however, they will not be used for making predictions. When predicting on new data, ensure that the corresponding covariates for the samples are provided.

    -
    -
    import torch
    -dumb_lda = PlnLDA(endog_train, exog=torch.randn(endog_train.shape[0], 2), clusters=cell_type_train).fit()
    -_ = dumb_lda.predict_clusters(endog_test, exog=torch.randn(endog_test.shape[0], 2))
    +
    +
    import torch
    +dumb_lda = PlnLDA(endog_train, exog=torch.randn(endog_train.shape[0], 2), clusters=cell_type_train).fit()
    +_ = dumb_lda.predict_clusters(endog_test, exog=torch.randn(endog_test.shape[0], 2))
    Setting the offsets to zero.
     Fitting a PlnLDA model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (400)  reached in 3.1 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  25%|██▍       | 99/400 [00:00<00:00, 982.59it/s]Upper bound on the fitting time:  50%|█████     | 200/400 [00:00<00:00, 995.39it/s]Upper bound on the fitting time:  75%|███████▌  | 301/400 [00:00<00:00, 998.88it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 995.52it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 0.4 seconds.
     Last  criterion = 5.4e-06 . Required tolerance = 1e-06
     Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1253.41it/s]
    +
    +
    +
    Done!
     Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1243.13it/s]
    +
    +
    +
    Done!
     Setting the offsets to zero.
    -Doing a VE step.
    -Done!
    +Doing a VE step.
    -
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   4%|▍         | 16/400 [00:00<00:02, 153.49it/s]Upper bound on the fitting time:   8%|▊         | 32/400 [00:00<00:02, 144.53it/s]Upper bound on the fitting time:  12%|█▏        | 47/400 [00:00<00:02, 142.45it/s]Upper bound on the fitting time:  16%|█▌        | 62/400 [00:00<00:02, 143.26it/s]Upper bound on the fitting time:  19%|█▉        | 77/400 [00:00<00:02, 144.01it/s]Upper bound on the fitting time:  23%|██▎       | 92/400 [00:00<00:02, 144.73it/s]Upper bound on the fitting time:  27%|██▋       | 107/400 [00:00<00:02, 142.55it/s]Upper bound on the fitting time:  30%|███       | 122/400 [00:00<00:01, 142.42it/s]Upper bound on the fitting time:  34%|███▍      | 137/400 [00:00<00:01, 142.61it/s]Upper bound on the fitting time:  38%|███▊      | 152/400 [00:01<00:01, 141.40it/s]Upper bound on the fitting time:  42%|████▏     | 167/400 [00:01<00:01, 139.42it/s]Upper bound on the fitting time:  45%|████▌     | 181/400 [00:01<00:01, 139.55it/s]Upper bound on the fitting time:  49%|████▉     | 196/400 [00:01<00:01, 140.32it/s]Upper bound on the fitting time:  53%|█████▎    | 211/400 [00:01<00:01, 117.56it/s]Upper bound on the fitting time:  56%|█████▌    | 224/400 [00:01<00:01, 114.71it/s]Upper bound on the fitting time:  59%|█████▉    | 236/400 [00:01<00:01, 111.61it/s]Upper bound on the fitting time:  62%|██████▏   | 249/400 [00:01<00:01, 116.36it/s]Upper bound on the fitting time:  66%|██████▌   | 262/400 [00:01<00:01, 118.59it/s]Upper bound on the fitting time:  69%|██████▉   | 275/400 [00:02<00:01, 120.66it/s]Upper bound on the fitting time:  72%|███████▏  | 288/400 [00:02<00:00, 119.41it/s]Upper bound on the fitting time:  75%|███████▌  | 301/400 [00:02<00:00, 121.88it/s]Upper bound on the fitting time:  79%|███████▉  | 315/400 [00:02<00:00, 125.03it/s]Upper bound on the fitting time:  82%|████████▏ | 328/400 [00:02<00:00, 125.42it/s]Upper bound on the fitting time:  86%|████████▌ | 342/400 [00:02<00:00, 127.08it/s]Upper bound on the fitting time:  89%|████████▉ | 356/400 [00:02<00:00, 128.32it/s]Upper bound on the fitting time:  92%|█████████▏| 369/400 [00:02<00:00, 127.73it/s]Upper bound on the fitting time:  96%|█████████▌| 382/400 [00:02<00:00, 120.51it/s]Upper bound on the fitting time:  99%|█████████▉| 395/400 [00:03<00:00, 120.38it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:03<00:00, 128.04it/s]
    -Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  34%|███▍      | 17/50 [00:00<00:00, 164.47it/s]Upper bound on the fitting time:  70%|███████   | 35/50 [00:00<00:00, 173.14it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 166.62it/s]
    -Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  34%|███▍      | 17/50 [00:00<00:00, 168.85it/s]Upper bound on the fitting time:  68%|██████▊   | 34/50 [00:00<00:00, 167.52it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 168.85it/s]
    -Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time:  36%|███▌      | 18/50 [00:00<00:00, 175.03it/s]Upper bound on the fitting time:  72%|███████▏  | 36/50 [00:00<00:00, 163.42it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 166.40it/s]
    +
    Upper bound on the fitting time:   0%|          | 0/50 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 50/50 [00:00<00:00, 1254.84it/s]
    +
    +
    +
    Done!
    +
    +
    +
    +
    +
    +

    ⚠️ Exogenous variables must be full rank, and an intercept will be added to account for the cluster bias.. Avoid one-hot encodings without intercept removal, like this:

    +
    +
    try:
    +    wrong_lda = PlnLDA.from_formula("endog ~ 1 | labels", data = rna)
    +except ValueError as e:
    +    print(str(e))
    +try:
    +    wrong_lda = PlnLDA.from_formula("endog ~ labels | labels", data = rna)
    +except ValueError as e:
    +    print(str(e))
    +
    +
    Setting the offsets to zero.
    +Input matrix (exog,clusters) does not result in (exog,clusters).T @(exog,clusters) being full rank (rank = 3, expected = 4). You may consider removing one or more variables or set add_const to False if that is not already the case. You can also set 0 + exog | clusters  in the formula to avoid adding an intercept.
    +Setting the offsets to zero.
    +Input matrix (exog,clusters) does not result in (exog,clusters).T @(exog,clusters) being full rank (rank = 3, expected = 6). You may consider removing one or more variables or set add_const to False if that is not already the case. You can also set 0 + exog | clusters  in the formula to avoid adding an intercept.
    -

    ⚠️ Exogenous variables must be full rank, and an intercept will be added to account for the cluster bias.. Avoid one-hot encodings without intercept removal.

    @@ -5061,26 +4642,41 @@

    4.2 Model Fitting

    -
    -
    from pyPLNmodels import PlnMixture
    -mixture = PlnMixture(endog, n_cluster=3).fit()
    -print(mixture)
    +
    +
    from pyPLNmodels import PlnMixture
    +mixture = PlnMixture(endog, n_cluster=3).fit()
    +print(mixture)
    Setting the offsets to zero.
     Fitting a PlnMixture model with diagonal covariances and 3 clusters.
     Intialization ...
     Fitting a PlnDiag model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (150)  reached in 1.1 seconds.
    -Last  criterion = 0.01074308 . Required tolerance = 1e-06
    -Finished!
    -Maximum number of iterations (400)  reached in 7.9 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  72%|███████▏  | 108/150 [00:00<00:00, 1072.36it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 1072.58it/s]
    +
    +
    +
    Maximum number of iterations (150)  reached in 0.1 seconds.
    +Last  criterion = 0.01074308 . Required tolerance = 1e-06
    +
    +
    +
    +
    +
    +
    Finished!
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  12%|█▏        | 49/400 [00:00<00:00, 481.98it/s]Upper bound on the fitting time:  24%|██▍       | 98/400 [00:00<00:00, 471.17it/s]Upper bound on the fitting time:  36%|███▋      | 146/400 [00:00<00:00, 468.95it/s]Upper bound on the fitting time:  48%|████▊     | 194/400 [00:00<00:00, 469.85it/s]Upper bound on the fitting time:  60%|██████    | 241/400 [00:00<00:00, 284.87it/s]Upper bound on the fitting time:  73%|███████▎  | 293/400 [00:00<00:00, 339.64it/s]Upper bound on the fitting time:  86%|████████▌ | 342/400 [00:00<00:00, 377.22it/s]Upper bound on the fitting time:  98%|█████████▊| 390/400 [00:00<00:00, 402.95it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:01<00:00, 390.06it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 1.2 seconds.
     Last  criterion = 5.37e-06 . Required tolerance = 1e-06
     A multivariate PlnMixture with diagonal covariances and 3 clusters.
     ======================================================================
          Loglike   Dimension    Nb param         BIC         AIC         ICL  Silhouette
    -   -24320.81          20         120   24680.294  24440.8062    11699.42  0.42445526
    +   -24320.87          20         120  24680.3536  24440.8657    11699.65  0.42457986
     
     ======================================================================
     * Useful attributes
    @@ -5093,26 +4689,51 @@ 

    -
    Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  10%|█         | 15/150 [00:00<00:00, 148.57it/s]Upper bound on the fitting time:  20%|██        | 30/150 [00:00<00:00, 143.86it/s]Upper bound on the fitting time:  30%|███       | 45/150 [00:00<00:00, 140.68it/s]Upper bound on the fitting time:  40%|████      | 60/150 [00:00<00:00, 137.21it/s]Upper bound on the fitting time:  49%|████▉     | 74/150 [00:00<00:00, 137.09it/s]Upper bound on the fitting time:  59%|█████▊    | 88/150 [00:00<00:00, 134.97it/s]Upper bound on the fitting time:  68%|██████▊   | 102/150 [00:00<00:00, 133.99it/s]Upper bound on the fitting time:  77%|███████▋  | 116/150 [00:00<00:00, 133.94it/s]Upper bound on the fitting time:  87%|████████▋ | 130/150 [00:00<00:00, 133.65it/s]Upper bound on the fitting time:  96%|█████████▌| 144/150 [00:01<00:00, 131.89it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:01<00:00, 134.88it/s]
    -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 7/400 [00:00<00:06, 63.03it/s]Upper bound on the fitting time:   4%|▎         | 14/400 [00:00<00:07, 54.87it/s]Upper bound on the fitting time:   5%|▌         | 21/400 [00:00<00:06, 57.55it/s]Upper bound on the fitting time:   7%|▋         | 27/400 [00:00<00:06, 53.73it/s]Upper bound on the fitting time:   8%|▊         | 34/400 [00:00<00:06, 56.73it/s]Upper bound on the fitting time:  10%|█         | 40/400 [00:00<00:06, 53.46it/s]Upper bound on the fitting time:  12%|█▏        | 46/400 [00:00<00:06, 55.24it/s]Upper bound on the fitting time:  13%|█▎        | 52/400 [00:00<00:06, 56.47it/s]Upper bound on the fitting time:  14%|█▍        | 58/400 [00:01<00:06, 54.06it/s]Upper bound on the fitting time:  16%|█▌        | 64/400 [00:01<00:06, 55.63it/s]Upper bound on the fitting time:  18%|█▊        | 70/400 [00:01<00:06, 53.45it/s]Upper bound on the fitting time:  19%|█▉        | 76/400 [00:01<00:06, 51.78it/s]Upper bound on the fitting time:  20%|██        | 82/400 [00:01<00:06, 50.88it/s]Upper bound on the fitting time:  22%|██▏       | 89/400 [00:01<00:05, 53.90it/s]Upper bound on the fitting time:  24%|██▍       | 95/400 [00:01<00:05, 51.75it/s]Upper bound on the fitting time:  25%|██▌       | 101/400 [00:01<00:05, 51.00it/s]Upper bound on the fitting time:  27%|██▋       | 107/400 [00:02<00:05, 50.88it/s]Upper bound on the fitting time:  28%|██▊       | 113/400 [00:02<00:05, 52.09it/s]Upper bound on the fitting time:  30%|███       | 120/400 [00:02<00:05, 55.61it/s]Upper bound on the fitting time:  32%|███▏      | 126/400 [00:02<00:04, 55.30it/s]Upper bound on the fitting time:  33%|███▎      | 133/400 [00:02<00:04, 56.93it/s]Upper bound on the fitting time:  35%|███▌      | 140/400 [00:02<00:04, 58.12it/s]Upper bound on the fitting time:  37%|███▋      | 147/400 [00:02<00:04, 59.19it/s]Upper bound on the fitting time:  38%|███▊      | 154/400 [00:02<00:04, 59.96it/s]Upper bound on the fitting time:  40%|████      | 161/400 [00:02<00:04, 56.11it/s]Upper bound on the fitting time:  42%|████▏     | 167/400 [00:03<00:04, 56.20it/s]Upper bound on the fitting time:  44%|████▎     | 174/400 [00:03<00:03, 57.99it/s]Upper bound on the fitting time:  45%|████▌     | 181/400 [00:03<00:03, 60.72it/s]Upper bound on the fitting time:  47%|████▋     | 188/400 [00:03<00:03, 62.82it/s]Upper bound on the fitting time:  49%|████▉     | 195/400 [00:03<00:03, 63.23it/s]Upper bound on the fitting time:  50%|█████     | 202/400 [00:03<00:03, 64.62it/s]Upper bound on the fitting time:  52%|█████▏    | 209/400 [00:03<00:02, 65.68it/s]Upper bound on the fitting time:  54%|█████▍    | 216/400 [00:03<00:02, 66.51it/s]Upper bound on the fitting time:  56%|█████▌    | 223/400 [00:03<00:02, 66.57it/s]Upper bound on the fitting time:  57%|█████▊    | 230/400 [00:03<00:02, 66.64it/s]Upper bound on the fitting time:  59%|█████▉    | 237/400 [00:04<00:02, 67.06it/s]Upper bound on the fitting time:  61%|██████    | 244/400 [00:04<00:02, 67.31it/s]Upper bound on the fitting time:  63%|██████▎   | 251/400 [00:04<00:02, 67.61it/s]Upper bound on the fitting time:  64%|██████▍   | 258/400 [00:04<00:02, 67.69it/s]Upper bound on the fitting time:  66%|██████▋   | 265/400 [00:04<00:01, 67.92it/s]Upper bound on the fitting time:  68%|██████▊   | 272/400 [00:04<00:01, 67.61it/s]Upper bound on the fitting time:  70%|██████▉   | 279/400 [00:04<00:01, 67.54it/s]Upper bound on the fitting time:  72%|███████▏  | 286/400 [00:04<00:01, 66.82it/s]Upper bound on the fitting time:  73%|███████▎  | 293/400 [00:04<00:01, 66.59it/s]Upper bound on the fitting time:  75%|███████▌  | 300/400 [00:05<00:01, 67.13it/s]Upper bound on the fitting time:  77%|███████▋  | 307/400 [00:05<00:01, 66.98it/s]Upper bound on the fitting time:  78%|███████▊  | 314/400 [00:05<00:01, 66.18it/s]Upper bound on the fitting time:  80%|████████  | 321/400 [00:05<00:01, 66.16it/s]Upper bound on the fitting time:  82%|████████▏ | 328/400 [00:05<00:01, 65.70it/s]Upper bound on the fitting time:  84%|████████▍ | 335/400 [00:05<00:00, 66.09it/s]Upper bound on the fitting time:  86%|████████▌ | 342/400 [00:05<00:00, 62.16it/s]Upper bound on the fitting time:  87%|████████▋ | 349/400 [00:05<00:00, 60.22it/s]Upper bound on the fitting time:  89%|████████▉ | 356/400 [00:05<00:00, 59.65it/s]Upper bound on the fitting time:  91%|█████████ | 363/400 [00:06<00:00, 60.44it/s]Upper bound on the fitting time:  92%|█████████▎| 370/400 [00:06<00:00, 59.52it/s]Upper bound on the fitting time:  94%|█████████▍| 376/400 [00:06<00:00, 58.72it/s]Upper bound on the fitting time:  96%|█████████▌| 383/400 [00:06<00:00, 59.67it/s]Upper bound on the fitting time:  98%|█████████▊| 390/400 [00:06<00:00, 60.25it/s]Upper bound on the fitting time:  99%|█████████▉| 397/400 [00:06<00:00, 62.28it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:06<00:00, 60.22it/s]
    +

    4.2.1 Optional: With Covariates

    -
    -
    _ = PlnMixture(endog, exog=torch.randn(endog.shape[0], 2), n_cluster=3)
    +
    +
    _ = PlnMixture(endog, exog=torch.randn(endog.shape[0], 2), n_cluster=3)
    Setting the offsets to zero.
    -

    ⚠️ exogenous variables must be full rank, and an intercept will be added to account for the cluster bias. Avoid one-hot encodings without intercept removal.

    +

    ⚠️ Exogenous variables must be full rank, and an intercept will be added to account for the cluster bias. Avoid one-hot encodings without intercept removal:

    +
    +
    try:
    +    wrong_mixt = PlnMixture.from_formula("endog ~ 1", data = rna, n_cluster = 3)
    +except ValueError as e:
    +    print(str(e))
    +try:
    +    wrong_mixt = PlnMixture.from_formula("endog ~ labels", data = rna, n_cluster = 3)
    +except ValueError as e:
    +    print(str(e))
    +try:
    +    wrong_mixt = PlnMixture(endog = rna["endog"], exog = rna["labels_1hot"], n_cluster = 3)
    +except ValueError as e:
    +    print(str(e))
    +right_mixt = PlnMixture.from_formula("endog ~ 0", data = rna, n_cluster = 3)
    +right_mixt = PlnMixture(endog = rna["endog"], exog = rna["labels_1hot"].iloc[:,1:], n_cluster = 3)
    +
    +
    Setting the offsets to zero.
    +Input matrix exog does not result in (exog,1).T @(exog,1) being full rank (rank = 1, expected = 2). This gives non identifiable cluster means. You may consider removing one or more variables in exog.
    +Setting the offsets to zero.
    +Input matrix exog does not result in (exog,1).T @(exog,1) being full rank (rank = 3, expected = 4). This gives non identifiable cluster means. You may consider removing one or more variables in exog.
    +Setting the offsets to zero.
    +Input matrix exog does not result in (exog,1).T @(exog,1) being full rank (rank = 3, expected = 4). This gives non identifiable cluster means. You may consider removing one or more variables in exog.
    +Setting the offsets to zero.
    +Setting the offsets to zero.
    +
    +

    4.2.2 Extracting Weights

    -
    -
    print(mixture.weights)
    +
    +
    print(mixture.weights)
    -
    tensor([0.5004, 0.2524, 0.2472], dtype=torch.float64)
    +
    tensor([0.5004, 0.2524, 0.2471], dtype=torch.float64)
    @@ -5120,59 +4741,84 @@

    4.3 Visualizing and Evaluating Clusters

    One can access the clusters of the samples using the .clusters attribute:

    -
    -
    clusters = mixture.clusters
    +
    +
    clusters = mixture.clusters

    Some useful visualization and information about clusters are displayed using the .show() method:

    -
    -
    mixture.show()
    +
    +
    mixture.show()
    -

    +
    +
    +

    +
    +

    One can visualize the latent variables using the .viz() method. By default, the latent variables are colored by the inferred clusters, but other colors can be specified using the colors argument.

    -
    -
    mixture.viz()
    +
    +
    mixture.viz()
    -

    +
    +
    +

    +
    +

    You can compare the inferred clusters with the actual cell types, although retrieving the exact cell types is not expected since the method is unsupervised.

    To visualize the clustering results, use the following:

    -
    -
    mixture.viz(colors=cell_type)
    +
    +
    mixture.viz(colors=cell_type)
    -

    +
    +
    +

    +
    +

    You can also assess the clustering performance with a confusion matrix:

    -
    -
    plot_confusion_matrix(clusters, cell_type)
    +
    +
    plot_confusion_matrix(clusters, cell_type)
    -

    +
    +
    +

    +
    +

    4.4 Predicting on New Data

    You can predict unseen data using the .predict_clusters() method.

    -
    -
    new_clusters = mixture.predict_clusters(endog)
    +
    +
    new_clusters = mixture.predict_clusters(endog)
    Setting the offsets to zero.
     Doing a VE step.
     Intialization ...
     Fitting a PlnDiag model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (150)  reached in 0.9 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  68%|██████▊   | 102/150 [00:00<00:00, 1012.41it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 1029.15it/s]
    +
    +
    +
    Maximum number of iterations (150)  reached in 0.1 seconds.
     Last  criterion = 0.01074308 . Required tolerance = 1e-06
    -Finished!
    -Done!
    +Finished!
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/30 [00:00<?, ?it/s]Upper bound on the fitting time: 100%|██████████| 30/30 [00:00<00:00, 616.05it/s]
    +
    +
    +
    Done!
    -
    Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  12%|█▏        | 18/150 [00:00<00:00, 173.63it/s]Upper bound on the fitting time:  24%|██▍       | 36/150 [00:00<00:00, 161.42it/s]Upper bound on the fitting time:  35%|███▌      | 53/150 [00:00<00:00, 158.89it/s]Upper bound on the fitting time:  46%|████▌     | 69/150 [00:00<00:00, 158.62it/s]Upper bound on the fitting time:  57%|█████▋    | 86/150 [00:00<00:00, 159.27it/s]Upper bound on the fitting time:  69%|██████▊   | 103/150 [00:00<00:00, 161.42it/s]Upper bound on the fitting time:  80%|████████  | 120/150 [00:00<00:00, 163.95it/s]Upper bound on the fitting time:  91%|█████████▏| 137/150 [00:00<00:00, 164.91it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 162.84it/s]
    -Upper bound on the fitting time:   0%|          | 0/30 [00:00<?, ?it/s]Upper bound on the fitting time:  33%|███▎      | 10/30 [00:00<00:00, 94.00it/s]Upper bound on the fitting time:  67%|██████▋   | 20/30 [00:00<00:00, 89.72it/s]Upper bound on the fitting time:  97%|█████████▋| 29/30 [00:00<00:00, 86.96it/s]Upper bound on the fitting time: 100%|██████████| 30/30 [00:00<00:00, 86.93it/s]
    +

    The number of clusters has been arbitrary set to \(3\). A more data-driven approach is given by the PlnMixtureCollection in the next section.

    @@ -5180,9 +4826,7 @@

    <

    4.5 Use PlnMixtureCollection for selecting the optimal number of clusters

    To explore multiple cluster solutions, use PlnMixtureCollection:

    -
    -
    from pyPLNmodels import PlnMixtureCollection
    -collection = PlnMixtureCollection(endog, n_clusters=range(2, 8)).fit()
    +
    Setting the offsets to zero.
     Adjusting 6 PlnMixture models.
    @@ -5191,61 +4835,121 @@ 

    +
    Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  69%|██████▊   | 103/150 [00:00<00:00, 1029.30it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 1031.99it/s]
    +

    +
    +
    Maximum number of iterations (150)  reached in 0.1 seconds.
     Last  criterion = 0.01074308 . Required tolerance = 1e-06
    -Finished!
    -Maximum number of iterations (400)  reached in 6.8 seconds.
    +Finished!
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  15%|█▍        | 59/400 [00:00<00:00, 585.59it/s]Upper bound on the fitting time:  30%|██▉       | 118/400 [00:00<00:00, 585.30it/s]Upper bound on the fitting time:  44%|████▍     | 177/400 [00:00<00:00, 585.99it/s]Upper bound on the fitting time:  59%|█████▉    | 236/400 [00:00<00:00, 584.68it/s]Upper bound on the fitting time:  74%|███████▍  | 295/400 [00:00<00:00, 583.16it/s]Upper bound on the fitting time:  88%|████████▊ | 354/400 [00:00<00:00, 584.29it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 583.97it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 0.8 seconds.
     Last  criterion = 5.36e-06 . Required tolerance = 1e-06
     Fitting a PlnMixture model with diagonal covariances and 3 clusters.
     Intialization ...
     Fitting a PlnDiag model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (150)  reached in 1.2 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  71%|███████   | 106/150 [00:00<00:00, 1051.31it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 1053.49it/s]
    +
    +
    +
    Maximum number of iterations (150)  reached in 0.1 seconds.
     Last  criterion = 0.01074308 . Required tolerance = 1e-06
    -Finished!
    -Maximum number of iterations (400)  reached in 7.7 seconds.
    +Finished!
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  13%|█▎        | 52/400 [00:00<00:00, 515.42it/s]Upper bound on the fitting time:  26%|██▌       | 104/400 [00:00<00:00, 503.27it/s]Upper bound on the fitting time:  39%|███▉      | 155/400 [00:00<00:00, 501.31it/s]Upper bound on the fitting time:  52%|█████▏    | 206/400 [00:00<00:00, 499.96it/s]Upper bound on the fitting time:  64%|██████▍   | 257/400 [00:00<00:00, 499.32it/s]Upper bound on the fitting time:  77%|███████▋  | 307/400 [00:00<00:00, 499.52it/s]Upper bound on the fitting time:  89%|████████▉ | 357/400 [00:00<00:00, 499.14it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 499.41it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 1.0 seconds.
     Last  criterion = 5.37e-06 . Required tolerance = 1e-06
     Fitting a PlnMixture model with diagonal covariances and 4 clusters.
     Intialization ...
     Fitting a PlnDiag model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (150)  reached in 1.0 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  69%|██████▉   | 104/150 [00:00<00:00, 1034.52it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 1039.50it/s]
    +
    +
    +
    Maximum number of iterations (150)  reached in 0.1 seconds.
     Last  criterion = 0.01074308 . Required tolerance = 1e-06
    -Finished!
    -Maximum number of iterations (400)  reached in 7.9 seconds.
    +Finished!
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  12%|█▏        | 47/400 [00:00<00:00, 460.26it/s]Upper bound on the fitting time:  24%|██▎       | 94/400 [00:00<00:00, 434.89it/s]Upper bound on the fitting time:  35%|███▍      | 139/400 [00:00<00:00, 438.71it/s]Upper bound on the fitting time:  46%|████▌     | 184/400 [00:00<00:00, 441.01it/s]Upper bound on the fitting time:  57%|█████▊    | 230/400 [00:00<00:00, 444.89it/s]Upper bound on the fitting time:  69%|██████▉   | 275/400 [00:00<00:00, 443.45it/s]Upper bound on the fitting time:  80%|████████  | 320/400 [00:00<00:00, 441.78it/s]Upper bound on the fitting time:  91%|█████████▏| 365/400 [00:00<00:00, 441.92it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 441.47it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 1.1 seconds.
     Last  criterion = 5.37e-06 . Required tolerance = 1e-06
     Fitting a PlnMixture model with diagonal covariances and 5 clusters.
     Intialization ...
     Fitting a PlnDiag model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (150)  reached in 1.0 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  71%|███████   | 106/150 [00:00<00:00, 1052.01it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 1049.85it/s]
    +
    +
    +
    Maximum number of iterations (150)  reached in 0.1 seconds.
     Last  criterion = 0.01074308 . Required tolerance = 1e-06
    -Finished!
    -Maximum number of iterations (400)  reached in 7.7 seconds.
    +Finished!
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  12%|█▏        | 49/400 [00:00<00:00, 481.96it/s]Upper bound on the fitting time:  24%|██▍       | 98/400 [00:00<00:00, 482.21it/s]Upper bound on the fitting time:  37%|███▋      | 147/400 [00:00<00:00, 479.80it/s]Upper bound on the fitting time:  49%|████▉     | 195/400 [00:00<00:00, 479.87it/s]Upper bound on the fitting time:  61%|██████    | 244/400 [00:00<00:00, 482.78it/s]Upper bound on the fitting time:  73%|███████▎  | 293/400 [00:00<00:00, 485.18it/s]Upper bound on the fitting time:  86%|████████▌ | 342/400 [00:00<00:00, 485.82it/s]Upper bound on the fitting time:  98%|█████████▊| 391/400 [00:00<00:00, 486.14it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 483.63it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 1.0 seconds.
     Last  criterion = 5.37e-06 . Required tolerance = 1e-06
     Fitting a PlnMixture model with diagonal covariances and 6 clusters.
     Intialization ...
     Fitting a PlnDiag model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (150)  reached in 1.0 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  70%|███████   | 105/150 [00:00<00:00, 1044.85it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 1049.52it/s]
    +
    +
    +
    Maximum number of iterations (150)  reached in 0.1 seconds.
     Last  criterion = 0.01074308 . Required tolerance = 1e-06
    -Finished!
    -Maximum number of iterations (400)  reached in 7.8 seconds.
    +Finished!
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  12%|█▏        | 46/400 [00:00<00:00, 454.97it/s]Upper bound on the fitting time:  23%|██▎       | 92/400 [00:00<00:00, 442.31it/s]Upper bound on the fitting time:  34%|███▍      | 137/400 [00:00<00:00, 438.68it/s]Upper bound on the fitting time:  46%|████▌     | 182/400 [00:00<00:00, 439.69it/s]Upper bound on the fitting time:  57%|█████▋    | 227/400 [00:00<00:00, 442.35it/s]Upper bound on the fitting time:  68%|██████▊   | 272/400 [00:00<00:00, 443.23it/s]Upper bound on the fitting time:  79%|███████▉  | 317/400 [00:00<00:00, 443.82it/s]Upper bound on the fitting time:  90%|█████████ | 362/400 [00:00<00:00, 443.97it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 442.71it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 1.1 seconds.
     Last  criterion = 5.37e-06 . Required tolerance = 1e-06
     Fitting a PlnMixture model with diagonal covariances and 7 clusters.
     Intialization ...
     Fitting a PlnDiag model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (150)  reached in 1.0 seconds.
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  69%|██████▉   | 104/150 [00:00<00:00, 1035.77it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 1033.99it/s]
    +
    +
    +
    Maximum number of iterations (150)  reached in 0.1 seconds.
     Last  criterion = 0.01074308 . Required tolerance = 1e-06
    -Finished!
    -Maximum number of iterations (400)  reached in 8.6 seconds.
    +Finished!
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   7%|▋         | 29/400 [00:00<00:01, 282.14it/s]Upper bound on the fitting time:  14%|█▍        | 58/400 [00:00<00:01, 272.19it/s]Upper bound on the fitting time:  22%|██▏       | 86/400 [00:00<00:01, 272.82it/s]Upper bound on the fitting time:  28%|██▊       | 114/400 [00:00<00:01, 273.85it/s]Upper bound on the fitting time:  36%|███▌      | 142/400 [00:00<00:00, 274.10it/s]Upper bound on the fitting time:  42%|████▎     | 170/400 [00:00<00:00, 274.32it/s]Upper bound on the fitting time:  50%|████▉     | 198/400 [00:00<00:00, 272.36it/s]Upper bound on the fitting time:  56%|█████▋    | 226/400 [00:00<00:00, 267.69it/s]Upper bound on the fitting time:  63%|██████▎   | 253/400 [00:00<00:00, 265.18it/s]Upper bound on the fitting time:  70%|███████   | 280/400 [00:01<00:00, 264.95it/s]Upper bound on the fitting time:  77%|███████▋  | 307/400 [00:01<00:00, 265.61it/s]Upper bound on the fitting time:  84%|████████▎ | 334/400 [00:01<00:00, 266.87it/s]Upper bound on the fitting time:  90%|█████████ | 362/400 [00:01<00:00, 268.37it/s]Upper bound on the fitting time:  98%|█████████▊| 390/400 [00:01<00:00, 269.65it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:01<00:00, 269.62it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 1.6 seconds.
     Last  criterion = 5.37e-06 . Required tolerance = 1e-06
     ======================================================================
     
    @@ -5257,26 +4961,19 @@ 

    -
    Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  11%|█▏        | 17/150 [00:00<00:00, 162.39it/s]Upper bound on the fitting time:  23%|██▎       | 34/150 [00:00<00:00, 154.52it/s]Upper bound on the fitting time:  33%|███▎      | 50/150 [00:00<00:00, 150.40it/s]Upper bound on the fitting time:  44%|████▍     | 66/150 [00:00<00:00, 152.47it/s]Upper bound on the fitting time:  55%|█████▍    | 82/150 [00:00<00:00, 149.67it/s]Upper bound on the fitting time:  65%|██████▍   | 97/150 [00:00<00:00, 135.74it/s]Upper bound on the fitting time:  74%|███████▍  | 111/150 [00:00<00:00, 136.05it/s]Upper bound on the fitting time:  83%|████████▎ | 125/150 [00:00<00:00, 135.74it/s]Upper bound on the fitting time:  93%|█████████▎| 139/150 [00:00<00:00, 134.61it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:01<00:00, 140.35it/s]
    -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 8/400 [00:00<00:05, 72.12it/s]Upper bound on the fitting time:   4%|▍         | 16/400 [00:00<00:05, 71.00it/s]Upper bound on the fitting time:   6%|▌         | 24/400 [00:00<00:05, 69.76it/s]Upper bound on the fitting time:   8%|▊         | 31/400 [00:00<00:05, 66.83it/s]Upper bound on the fitting time:  10%|▉         | 38/400 [00:00<00:05, 62.89it/s]Upper bound on the fitting time:  11%|█▏        | 45/400 [00:00<00:05, 62.09it/s]Upper bound on the fitting time:  13%|█▎        | 52/400 [00:00<00:05, 61.23it/s]Upper bound on the fitting time:  15%|█▍        | 59/400 [00:00<00:05, 62.70it/s]Upper bound on the fitting time:  17%|█▋        | 67/400 [00:01<00:05, 65.69it/s]Upper bound on the fitting time:  19%|█▉        | 75/400 [00:01<00:04, 68.18it/s]Upper bound on the fitting time:  20%|██        | 82/400 [00:01<00:04, 67.49it/s]Upper bound on the fitting time:  22%|██▎       | 90/400 [00:01<00:04, 70.70it/s]Upper bound on the fitting time:  25%|██▍       | 99/400 [00:01<00:04, 74.28it/s]Upper bound on the fitting time:  27%|██▋       | 107/400 [00:01<00:03, 74.03it/s]Upper bound on the fitting time:  29%|██▉       | 115/400 [00:01<00:03, 75.40it/s]Upper bound on the fitting time:  31%|███       | 124/400 [00:01<00:03, 77.14it/s]Upper bound on the fitting time:  33%|███▎      | 132/400 [00:01<00:03, 76.62it/s]Upper bound on the fitting time:  35%|███▌      | 140/400 [00:01<00:03, 76.56it/s]Upper bound on the fitting time:  37%|███▋      | 148/400 [00:02<00:03, 77.06it/s]Upper bound on the fitting time:  39%|███▉      | 156/400 [00:02<00:03, 76.93it/s]Upper bound on the fitting time:  41%|████      | 164/400 [00:02<00:03, 77.10it/s]Upper bound on the fitting time:  43%|████▎     | 172/400 [00:02<00:02, 77.53it/s]Upper bound on the fitting time:  45%|████▌     | 180/400 [00:02<00:02, 76.82it/s]Upper bound on the fitting time:  47%|████▋     | 188/400 [00:02<00:02, 76.12it/s]Upper bound on the fitting time:  49%|████▉     | 196/400 [00:02<00:02, 77.11it/s]Upper bound on the fitting time:  51%|█████     | 204/400 [00:02<00:02, 77.08it/s]Upper bound on the fitting time:  53%|█████▎    | 212/400 [00:02<00:02, 76.23it/s]Upper bound on the fitting time:  55%|█████▌    | 220/400 [00:03<00:02, 75.66it/s]Upper bound on the fitting time:  57%|█████▋    | 228/400 [00:03<00:02, 75.55it/s]Upper bound on the fitting time:  59%|█████▉    | 236/400 [00:03<00:02, 74.89it/s]Upper bound on the fitting time:  61%|██████    | 244/400 [00:03<00:02, 74.88it/s]Upper bound on the fitting time:  63%|██████▎   | 252/400 [00:03<00:01, 76.12it/s]Upper bound on the fitting time:  65%|██████▌   | 260/400 [00:03<00:01, 76.96it/s]Upper bound on the fitting time:  67%|██████▋   | 268/400 [00:03<00:01, 77.82it/s]Upper bound on the fitting time:  69%|██████▉   | 276/400 [00:03<00:01, 76.66it/s]Upper bound on the fitting time:  71%|███████   | 284/400 [00:03<00:01, 70.51it/s]Upper bound on the fitting time:  73%|███████▎  | 292/400 [00:04<00:01, 64.84it/s]Upper bound on the fitting time:  75%|███████▍  | 299/400 [00:04<00:01, 61.15it/s]Upper bound on the fitting time:  76%|███████▋  | 306/400 [00:04<00:01, 60.59it/s]Upper bound on the fitting time:  78%|███████▊  | 313/400 [00:04<00:01, 60.95it/s]Upper bound on the fitting time:  80%|████████  | 320/400 [00:04<00:01, 63.13it/s]Upper bound on the fitting time:  82%|████████▏ | 328/400 [00:04<00:01, 66.74it/s]Upper bound on the fitting time:  84%|████████▍ | 336/400 [00:04<00:00, 69.23it/s]Upper bound on the fitting time:  86%|████████▌ | 344/400 [00:04<00:00, 69.71it/s]Upper bound on the fitting time:  88%|████████▊ | 352/400 [00:04<00:00, 69.51it/s]Upper bound on the fitting time:  90%|████████▉ | 359/400 [00:05<00:00, 69.23it/s]Upper bound on the fitting time:  92%|█████████▏| 366/400 [00:05<00:00, 68.86it/s]Upper bound on the fitting time:  93%|█████████▎| 373/400 [00:05<00:00, 66.38it/s]Upper bound on the fitting time:  95%|█████████▌| 381/400 [00:05<00:00, 68.15it/s]Upper bound on the fitting time:  97%|█████████▋| 389/400 [00:05<00:00, 69.41it/s]Upper bound on the fitting time:  99%|█████████▉| 397/400 [00:05<00:00, 69.90it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:05<00:00, 70.82it/s]
    -Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:   9%|▊         | 13/150 [00:00<00:01, 129.09it/s]Upper bound on the fitting time:  17%|█▋        | 26/150 [00:00<00:00, 126.37it/s]Upper bound on the fitting time:  26%|██▌       | 39/150 [00:00<00:00, 126.16it/s]Upper bound on the fitting time:  35%|███▍      | 52/150 [00:00<00:00, 126.06it/s]Upper bound on the fitting time:  43%|████▎     | 65/150 [00:00<00:00, 127.14it/s]Upper bound on the fitting time:  53%|█████▎    | 79/150 [00:00<00:00, 128.81it/s]Upper bound on the fitting time:  62%|██████▏   | 93/150 [00:00<00:00, 131.52it/s]Upper bound on the fitting time:  71%|███████▏  | 107/150 [00:00<00:00, 127.00it/s]Upper bound on the fitting time:  80%|████████  | 120/150 [00:00<00:00, 126.44it/s]Upper bound on the fitting time:  89%|████████▊ | 133/150 [00:01<00:00, 126.04it/s]Upper bound on the fitting time:  97%|█████████▋| 146/150 [00:01<00:00, 117.56it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:01<00:00, 123.25it/s]
    -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 6/400 [00:00<00:07, 53.70it/s]Upper bound on the fitting time:   3%|▎         | 12/400 [00:00<00:06, 56.95it/s]Upper bound on the fitting time:   4%|▍         | 18/400 [00:00<00:06, 57.51it/s]Upper bound on the fitting time:   6%|▌         | 24/400 [00:00<00:06, 57.36it/s]Upper bound on the fitting time:   8%|▊         | 30/400 [00:00<00:06, 53.68it/s]Upper bound on the fitting time:   9%|▉         | 36/400 [00:00<00:07, 51.79it/s]Upper bound on the fitting time:  10%|█         | 42/400 [00:00<00:07, 50.90it/s]Upper bound on the fitting time:  12%|█▏        | 48/400 [00:00<00:07, 50.23it/s]Upper bound on the fitting time:  14%|█▎        | 54/400 [00:01<00:07, 48.73it/s]Upper bound on the fitting time:  15%|█▍        | 59/400 [00:01<00:06, 48.98it/s]Upper bound on the fitting time:  16%|█▋        | 66/400 [00:01<00:06, 53.46it/s]Upper bound on the fitting time:  18%|█▊        | 73/400 [00:01<00:05, 56.09it/s]Upper bound on the fitting time:  20%|██        | 80/400 [00:01<00:05, 57.65it/s]Upper bound on the fitting time:  22%|██▏       | 87/400 [00:01<00:05, 59.27it/s]Upper bound on the fitting time:  24%|██▎       | 94/400 [00:01<00:05, 60.08it/s]Upper bound on the fitting time:  25%|██▌       | 101/400 [00:01<00:05, 58.17it/s]Upper bound on the fitting time:  27%|██▋       | 107/400 [00:01<00:05, 57.90it/s]Upper bound on the fitting time:  28%|██▊       | 113/400 [00:02<00:04, 57.43it/s]Upper bound on the fitting time:  30%|███       | 120/400 [00:02<00:04, 58.48it/s]Upper bound on the fitting time:  32%|███▏      | 127/400 [00:02<00:04, 61.26it/s]Upper bound on the fitting time:  34%|███▎      | 134/400 [00:02<00:04, 63.05it/s]Upper bound on the fitting time:  36%|███▌      | 142/400 [00:02<00:03, 65.81it/s]Upper bound on the fitting time:  38%|███▊      | 150/400 [00:02<00:03, 67.80it/s]Upper bound on the fitting time:  40%|███▉      | 158/400 [00:02<00:03, 69.35it/s]Upper bound on the fitting time:  42%|████▏     | 166/400 [00:02<00:03, 70.70it/s]Upper bound on the fitting time:  44%|████▎     | 174/400 [00:02<00:03, 71.83it/s]Upper bound on the fitting time:  46%|████▌     | 182/400 [00:03<00:03, 72.05it/s]Upper bound on the fitting time:  48%|████▊     | 190/400 [00:03<00:02, 72.55it/s]Upper bound on the fitting time:  50%|████▉     | 198/400 [00:03<00:02, 72.78it/s]Upper bound on the fitting time:  52%|█████▏    | 206/400 [00:03<00:02, 73.18it/s]Upper bound on the fitting time:  54%|█████▎    | 214/400 [00:03<00:02, 72.85it/s]Upper bound on the fitting time:  56%|█████▌    | 222/400 [00:03<00:02, 72.97it/s]Upper bound on the fitting time:  57%|█████▊    | 230/400 [00:03<00:02, 73.35it/s]Upper bound on the fitting time:  60%|█████▉    | 238/400 [00:03<00:02, 73.23it/s]Upper bound on the fitting time:  62%|██████▏   | 246/400 [00:03<00:02, 73.36it/s]Upper bound on the fitting time:  64%|██████▎   | 254/400 [00:04<00:01, 73.38it/s]Upper bound on the fitting time:  66%|██████▌   | 262/400 [00:04<00:01, 73.50it/s]Upper bound on the fitting time:  68%|██████▊   | 270/400 [00:04<00:01, 72.77it/s]Upper bound on the fitting time:  70%|██████▉   | 278/400 [00:04<00:01, 72.78it/s]Upper bound on the fitting time:  72%|███████▏  | 286/400 [00:04<00:01, 72.91it/s]Upper bound on the fitting time:  74%|███████▎  | 294/400 [00:04<00:01, 67.25it/s]Upper bound on the fitting time:  75%|███████▌  | 301/400 [00:04<00:01, 63.21it/s]Upper bound on the fitting time:  77%|███████▋  | 308/400 [00:04<00:01, 58.71it/s]Upper bound on the fitting time:  78%|███████▊  | 314/400 [00:04<00:01, 57.53it/s]Upper bound on the fitting time:  80%|████████  | 321/400 [00:05<00:01, 58.56it/s]Upper bound on the fitting time:  82%|████████▏ | 327/400 [00:05<00:01, 58.67it/s]Upper bound on the fitting time:  83%|████████▎ | 333/400 [00:05<00:01, 58.36it/s]Upper bound on the fitting time:  85%|████████▍ | 339/400 [00:05<00:01, 57.96it/s]Upper bound on the fitting time:  86%|████████▋ | 345/400 [00:05<00:00, 56.09it/s]Upper bound on the fitting time:  88%|████████▊ | 352/400 [00:05<00:00, 57.98it/s]Upper bound on the fitting time:  90%|████████▉ | 358/400 [00:05<00:00, 57.85it/s]Upper bound on the fitting time:  91%|█████████ | 364/400 [00:05<00:00, 58.06it/s]Upper bound on the fitting time:  93%|█████████▎| 371/400 [00:05<00:00, 59.38it/s]Upper bound on the fitting time:  94%|█████████▍| 378/400 [00:06<00:00, 61.04it/s]Upper bound on the fitting time:  96%|█████████▋| 385/400 [00:06<00:00, 62.74it/s]Upper bound on the fitting time:  98%|█████████▊| 392/400 [00:06<00:00, 62.86it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:06<00:00, 66.09it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:06<00:00, 62.77it/s]
    -Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  11%|█         | 16/150 [00:00<00:00, 159.86it/s]Upper bound on the fitting time:  21%|██▏       | 32/150 [00:00<00:00, 150.89it/s]Upper bound on the fitting time:  32%|███▏      | 48/150 [00:00<00:00, 151.60it/s]Upper bound on the fitting time:  43%|████▎     | 64/150 [00:00<00:00, 149.76it/s]Upper bound on the fitting time:  53%|█████▎    | 79/150 [00:00<00:00, 148.43it/s]Upper bound on the fitting time:  64%|██████▍   | 96/150 [00:00<00:00, 152.98it/s]Upper bound on the fitting time:  75%|███████▍  | 112/150 [00:00<00:00, 154.12it/s]Upper bound on the fitting time:  85%|████████▌ | 128/150 [00:00<00:00, 154.37it/s]Upper bound on the fitting time:  96%|█████████▌| 144/150 [00:00<00:00, 155.95it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 153.48it/s]
    -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 7/400 [00:00<00:05, 68.36it/s]Upper bound on the fitting time:   4%|▎         | 14/400 [00:00<00:05, 66.41it/s]Upper bound on the fitting time:   5%|▌         | 21/400 [00:00<00:05, 64.65it/s]Upper bound on the fitting time:   7%|▋         | 28/400 [00:00<00:05, 64.40it/s]Upper bound on the fitting time:   9%|▉         | 35/400 [00:00<00:05, 64.16it/s]Upper bound on the fitting time:  10%|█         | 42/400 [00:00<00:05, 63.89it/s]Upper bound on the fitting time:  12%|█▏        | 49/400 [00:00<00:05, 63.52it/s]Upper bound on the fitting time:  14%|█▍        | 56/400 [00:00<00:05, 62.49it/s]Upper bound on the fitting time:  16%|█▌        | 63/400 [00:00<00:05, 63.00it/s]Upper bound on the fitting time:  18%|█▊        | 70/400 [00:01<00:05, 63.48it/s]Upper bound on the fitting time:  19%|█▉        | 77/400 [00:01<00:05, 63.22it/s]Upper bound on the fitting time:  21%|██        | 84/400 [00:01<00:05, 62.90it/s]Upper bound on the fitting time:  23%|██▎       | 91/400 [00:01<00:04, 63.41it/s]Upper bound on the fitting time:  24%|██▍       | 98/400 [00:01<00:04, 63.37it/s]Upper bound on the fitting time:  26%|██▋       | 105/400 [00:01<00:04, 63.27it/s]Upper bound on the fitting time:  28%|██▊       | 112/400 [00:01<00:04, 63.06it/s]Upper bound on the fitting time:  30%|██▉       | 119/400 [00:01<00:04, 62.85it/s]Upper bound on the fitting time:  32%|███▏      | 126/400 [00:01<00:04, 60.91it/s]Upper bound on the fitting time:  33%|███▎      | 133/400 [00:02<00:04, 58.70it/s]Upper bound on the fitting time:  35%|███▍      | 139/400 [00:02<00:04, 54.33it/s]Upper bound on the fitting time:  36%|███▋      | 145/400 [00:02<00:05, 50.25it/s]Upper bound on the fitting time:  38%|███▊      | 151/400 [00:02<00:04, 50.12it/s]Upper bound on the fitting time:  39%|███▉      | 157/400 [00:02<00:04, 49.43it/s]Upper bound on the fitting time:  40%|████      | 162/400 [00:02<00:04, 49.12it/s]Upper bound on the fitting time:  42%|████▏     | 167/400 [00:02<00:04, 47.41it/s]Upper bound on the fitting time:  43%|████▎     | 172/400 [00:02<00:04, 46.13it/s]Upper bound on the fitting time:  44%|████▍     | 177/400 [00:03<00:04, 46.48it/s]Upper bound on the fitting time:  46%|████▌     | 182/400 [00:03<00:04, 47.42it/s]Upper bound on the fitting time:  47%|████▋     | 187/400 [00:03<00:04, 47.86it/s]Upper bound on the fitting time:  48%|████▊     | 193/400 [00:03<00:04, 50.88it/s]Upper bound on the fitting time:  50%|████▉     | 199/400 [00:03<00:03, 52.24it/s]Upper bound on the fitting time:  51%|█████▏    | 205/400 [00:03<00:03, 53.29it/s]Upper bound on the fitting time:  53%|█████▎    | 211/400 [00:03<00:03, 52.16it/s]Upper bound on the fitting time:  54%|█████▍    | 217/400 [00:03<00:03, 50.05it/s]Upper bound on the fitting time:  56%|█████▌    | 224/400 [00:03<00:03, 53.96it/s]Upper bound on the fitting time:  58%|█████▊    | 231/400 [00:04<00:02, 56.70it/s]Upper bound on the fitting time:  60%|█████▉    | 238/400 [00:04<00:02, 58.58it/s]Upper bound on the fitting time:  61%|██████▏   | 245/400 [00:04<00:02, 59.76it/s]Upper bound on the fitting time:  63%|██████▎   | 252/400 [00:04<00:02, 60.78it/s]Upper bound on the fitting time:  65%|██████▍   | 259/400 [00:04<00:02, 61.14it/s]Upper bound on the fitting time:  66%|██████▋   | 266/400 [00:04<00:02, 61.89it/s]Upper bound on the fitting time:  68%|██████▊   | 273/400 [00:04<00:02, 62.05it/s]Upper bound on the fitting time:  70%|███████   | 280/400 [00:04<00:02, 59.04it/s]Upper bound on the fitting time:  72%|███████▏  | 286/400 [00:04<00:01, 58.64it/s]Upper bound on the fitting time:  73%|███████▎  | 292/400 [00:05<00:01, 58.82it/s]Upper bound on the fitting time:  75%|███████▍  | 299/400 [00:05<00:01, 60.68it/s]Upper bound on the fitting time:  76%|███████▋  | 306/400 [00:05<00:01, 61.76it/s]Upper bound on the fitting time:  78%|███████▊  | 313/400 [00:05<00:01, 62.30it/s]Upper bound on the fitting time:  80%|████████  | 320/400 [00:05<00:01, 61.84it/s]Upper bound on the fitting time:  82%|████████▏ | 327/400 [00:05<00:01, 62.17it/s]Upper bound on the fitting time:  84%|████████▎ | 334/400 [00:05<00:01, 62.09it/s]Upper bound on the fitting time:  85%|████████▌ | 341/400 [00:05<00:00, 62.77it/s]Upper bound on the fitting time:  87%|████████▋ | 348/400 [00:05<00:00, 62.73it/s]Upper bound on the fitting time:  89%|████████▉ | 355/400 [00:06<00:00, 62.71it/s]Upper bound on the fitting time:  90%|█████████ | 362/400 [00:06<00:00, 61.92it/s]Upper bound on the fitting time:  92%|█████████▏| 369/400 [00:06<00:00, 61.33it/s]Upper bound on the fitting time:  94%|█████████▍| 376/400 [00:06<00:00, 61.18it/s]Upper bound on the fitting time:  96%|█████████▌| 383/400 [00:06<00:00, 58.72it/s]Upper bound on the fitting time:  97%|█████████▋| 389/400 [00:06<00:00, 55.50it/s]Upper bound on the fitting time:  99%|█████████▉| 395/400 [00:06<00:00, 53.89it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:06<00:00, 57.98it/s]
    -Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  11%|█         | 16/150 [00:00<00:00, 151.54it/s]Upper bound on the fitting time:  21%|██▏       | 32/150 [00:00<00:00, 145.00it/s]Upper bound on the fitting time:  32%|███▏      | 48/150 [00:00<00:00, 147.73it/s]Upper bound on the fitting time:  42%|████▏     | 63/150 [00:00<00:00, 147.01it/s]Upper bound on the fitting time:  52%|█████▏    | 78/150 [00:00<00:00, 141.62it/s]Upper bound on the fitting time:  62%|██████▏   | 93/150 [00:00<00:00, 143.96it/s]Upper bound on the fitting time:  73%|███████▎  | 110/150 [00:00<00:00, 149.50it/s]Upper bound on the fitting time:  85%|████████▍ | 127/150 [00:00<00:00, 154.41it/s]Upper bound on the fitting time:  96%|█████████▌| 144/150 [00:00<00:00, 157.18it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 150.46it/s]
    -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 7/400 [00:00<00:06, 65.35it/s]Upper bound on the fitting time:   4%|▎         | 14/400 [00:00<00:06, 63.78it/s]Upper bound on the fitting time:   5%|▌         | 21/400 [00:00<00:05, 63.98it/s]Upper bound on the fitting time:   7%|▋         | 28/400 [00:00<00:05, 63.76it/s]Upper bound on the fitting time:   9%|▉         | 35/400 [00:00<00:05, 63.47it/s]Upper bound on the fitting time:  10%|█         | 42/400 [00:00<00:05, 63.78it/s]Upper bound on the fitting time:  12%|█▏        | 49/400 [00:00<00:05, 63.85it/s]Upper bound on the fitting time:  14%|█▍        | 56/400 [00:00<00:05, 62.42it/s]Upper bound on the fitting time:  16%|█▌        | 63/400 [00:00<00:05, 62.73it/s]Upper bound on the fitting time:  18%|█▊        | 70/400 [00:01<00:05, 62.51it/s]Upper bound on the fitting time:  19%|█▉        | 77/400 [00:01<00:05, 62.35it/s]Upper bound on the fitting time:  21%|██        | 84/400 [00:01<00:05, 62.67it/s]Upper bound on the fitting time:  23%|██▎       | 91/400 [00:01<00:04, 62.82it/s]Upper bound on the fitting time:  24%|██▍       | 98/400 [00:01<00:04, 61.21it/s]Upper bound on the fitting time:  26%|██▋       | 105/400 [00:01<00:05, 56.88it/s]Upper bound on the fitting time:  28%|██▊       | 111/400 [00:01<00:05, 55.72it/s]Upper bound on the fitting time:  29%|██▉       | 117/400 [00:01<00:05, 54.91it/s]Upper bound on the fitting time:  31%|███       | 123/400 [00:02<00:05, 54.44it/s]Upper bound on the fitting time:  32%|███▏      | 129/400 [00:02<00:05, 54.00it/s]Upper bound on the fitting time:  34%|███▍      | 135/400 [00:02<00:04, 53.35it/s]Upper bound on the fitting time:  35%|███▌      | 141/400 [00:02<00:04, 52.85it/s]Upper bound on the fitting time:  37%|███▋      | 147/400 [00:02<00:04, 52.99it/s]Upper bound on the fitting time:  38%|███▊      | 154/400 [00:02<00:04, 56.47it/s]Upper bound on the fitting time:  40%|████      | 161/400 [00:02<00:04, 58.31it/s]Upper bound on the fitting time:  42%|████▏     | 168/400 [00:02<00:03, 59.56it/s]Upper bound on the fitting time:  44%|████▍     | 175/400 [00:02<00:03, 60.27it/s]Upper bound on the fitting time:  46%|████▌     | 182/400 [00:03<00:03, 61.36it/s]Upper bound on the fitting time:  47%|████▋     | 189/400 [00:03<00:03, 61.99it/s]Upper bound on the fitting time:  49%|████▉     | 196/400 [00:03<00:03, 62.60it/s]Upper bound on the fitting time:  51%|█████     | 203/400 [00:03<00:03, 62.90it/s]Upper bound on the fitting time:  52%|█████▎    | 210/400 [00:03<00:03, 60.57it/s]Upper bound on the fitting time:  54%|█████▍    | 217/400 [00:03<00:03, 57.78it/s]Upper bound on the fitting time:  56%|█████▌    | 223/400 [00:03<00:03, 56.97it/s]Upper bound on the fitting time:  57%|█████▋    | 229/400 [00:03<00:03, 54.77it/s]Upper bound on the fitting time:  59%|█████▉    | 235/400 [00:03<00:02, 56.15it/s]Upper bound on the fitting time:  60%|██████    | 242/400 [00:04<00:02, 58.27it/s]Upper bound on the fitting time:  62%|██████▏   | 249/400 [00:04<00:02, 59.89it/s]Upper bound on the fitting time:  64%|██████▍   | 256/400 [00:04<00:02, 61.12it/s]Upper bound on the fitting time:  66%|██████▌   | 263/400 [00:04<00:02, 60.51it/s]Upper bound on the fitting time:  68%|██████▊   | 270/400 [00:04<00:02, 59.08it/s]Upper bound on the fitting time:  69%|██████▉   | 276/400 [00:04<00:02, 58.60it/s]Upper bound on the fitting time:  71%|███████   | 283/400 [00:04<00:01, 59.95it/s]Upper bound on the fitting time:  72%|███████▎  | 290/400 [00:04<00:01, 60.93it/s]Upper bound on the fitting time:  74%|███████▍  | 297/400 [00:04<00:01, 61.83it/s]Upper bound on the fitting time:  76%|███████▌  | 304/400 [00:05<00:01, 62.46it/s]Upper bound on the fitting time:  78%|███████▊  | 311/400 [00:05<00:01, 62.98it/s]Upper bound on the fitting time:  80%|███████▉  | 318/400 [00:05<00:01, 63.38it/s]Upper bound on the fitting time:  81%|████████▏ | 325/400 [00:05<00:01, 63.50it/s]Upper bound on the fitting time:  83%|████████▎ | 332/400 [00:05<00:01, 63.74it/s]Upper bound on the fitting time:  85%|████████▍ | 339/400 [00:05<00:00, 63.96it/s]Upper bound on the fitting time:  86%|████████▋ | 346/400 [00:05<00:00, 64.17it/s]Upper bound on the fitting time:  88%|████████▊ | 353/400 [00:05<00:00, 64.25it/s]Upper bound on the fitting time:  90%|█████████ | 360/400 [00:05<00:00, 64.02it/s]Upper bound on the fitting time:  92%|█████████▏| 367/400 [00:06<00:00, 62.90it/s]Upper bound on the fitting time:  94%|█████████▎| 374/400 [00:06<00:00, 60.23it/s]Upper bound on the fitting time:  95%|█████████▌| 381/400 [00:06<00:00, 61.15it/s]Upper bound on the fitting time:  97%|█████████▋| 388/400 [00:06<00:00, 61.84it/s]Upper bound on the fitting time:  99%|█████████▉| 395/400 [00:06<00:00, 62.99it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:06<00:00, 60.45it/s]
    -Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  11%|█▏        | 17/150 [00:00<00:00, 162.80it/s]Upper bound on the fitting time:  23%|██▎       | 34/150 [00:00<00:00, 154.76it/s]Upper bound on the fitting time:  33%|███▎      | 50/150 [00:00<00:00, 152.54it/s]Upper bound on the fitting time:  44%|████▍     | 66/150 [00:00<00:00, 151.98it/s]Upper bound on the fitting time:  55%|█████▍    | 82/150 [00:00<00:00, 149.94it/s]Upper bound on the fitting time:  65%|██████▌   | 98/150 [00:00<00:00, 153.13it/s]Upper bound on the fitting time:  76%|███████▌  | 114/150 [00:00<00:00, 149.91it/s]Upper bound on the fitting time:  87%|████████▋ | 130/150 [00:00<00:00, 150.39it/s]Upper bound on the fitting time:  98%|█████████▊| 147/150 [00:00<00:00, 155.02it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:00<00:00, 152.85it/s]
    -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 7/400 [00:00<00:06, 61.26it/s]Upper bound on the fitting time:   4%|▎         | 14/400 [00:00<00:06, 59.19it/s]Upper bound on the fitting time:   5%|▌         | 20/400 [00:00<00:06, 59.11it/s]Upper bound on the fitting time:   6%|▋         | 26/400 [00:00<00:06, 58.70it/s]Upper bound on the fitting time:   8%|▊         | 33/400 [00:00<00:06, 59.98it/s]Upper bound on the fitting time:  10%|▉         | 39/400 [00:00<00:06, 59.23it/s]Upper bound on the fitting time:  11%|█▏        | 45/400 [00:00<00:05, 59.23it/s]Upper bound on the fitting time:  13%|█▎        | 51/400 [00:00<00:05, 58.50it/s]Upper bound on the fitting time:  14%|█▍        | 57/400 [00:00<00:05, 57.89it/s]Upper bound on the fitting time:  16%|█▌        | 63/400 [00:01<00:05, 58.10it/s]Upper bound on the fitting time:  18%|█▊        | 70/400 [00:01<00:05, 58.98it/s]Upper bound on the fitting time:  19%|█▉        | 76/400 [00:01<00:05, 58.62it/s]Upper bound on the fitting time:  21%|██        | 83/400 [00:01<00:05, 59.90it/s]Upper bound on the fitting time:  22%|██▏       | 89/400 [00:01<00:05, 59.65it/s]Upper bound on the fitting time:  24%|██▍       | 96/400 [00:01<00:05, 60.28it/s]Upper bound on the fitting time:  26%|██▌       | 103/400 [00:01<00:04, 60.07it/s]Upper bound on the fitting time:  28%|██▊       | 110/400 [00:01<00:04, 60.24it/s]Upper bound on the fitting time:  29%|██▉       | 117/400 [00:01<00:04, 59.62it/s]Upper bound on the fitting time:  31%|███       | 124/400 [00:02<00:04, 59.93it/s]Upper bound on the fitting time:  33%|███▎      | 131/400 [00:02<00:04, 61.23it/s]Upper bound on the fitting time:  34%|███▍      | 138/400 [00:02<00:04, 60.54it/s]Upper bound on the fitting time:  36%|███▋      | 145/400 [00:02<00:04, 59.76it/s]Upper bound on the fitting time:  38%|███▊      | 151/400 [00:02<00:04, 58.84it/s]Upper bound on the fitting time:  39%|███▉      | 157/400 [00:02<00:04, 56.56it/s]Upper bound on the fitting time:  41%|████      | 163/400 [00:02<00:04, 56.71it/s]Upper bound on the fitting time:  42%|████▏     | 169/400 [00:02<00:04, 57.57it/s]Upper bound on the fitting time:  44%|████▍     | 176/400 [00:02<00:03, 58.43it/s]Upper bound on the fitting time:  46%|████▌     | 183/400 [00:03<00:03, 59.76it/s]Upper bound on the fitting time:  47%|████▋     | 189/400 [00:03<00:03, 59.80it/s]Upper bound on the fitting time:  49%|████▉     | 196/400 [00:03<00:03, 60.88it/s]Upper bound on the fitting time:  51%|█████     | 203/400 [00:03<00:03, 60.28it/s]Upper bound on the fitting time:  52%|█████▎    | 210/400 [00:03<00:03, 61.29it/s]Upper bound on the fitting time:  54%|█████▍    | 217/400 [00:03<00:02, 61.07it/s]Upper bound on the fitting time:  56%|█████▌    | 224/400 [00:03<00:02, 61.16it/s]Upper bound on the fitting time:  58%|█████▊    | 231/400 [00:03<00:02, 60.51it/s]Upper bound on the fitting time:  60%|█████▉    | 238/400 [00:03<00:02, 60.21it/s]Upper bound on the fitting time:  61%|██████▏   | 245/400 [00:04<00:02, 60.19it/s]Upper bound on the fitting time:  63%|██████▎   | 252/400 [00:04<00:02, 59.99it/s]Upper bound on the fitting time:  65%|██████▍   | 259/400 [00:04<00:02, 59.79it/s]Upper bound on the fitting time:  66%|██████▋   | 265/400 [00:04<00:02, 59.63it/s]Upper bound on the fitting time:  68%|██████▊   | 271/400 [00:04<00:02, 59.28it/s]Upper bound on the fitting time:  69%|██████▉   | 277/400 [00:04<00:02, 59.35it/s]Upper bound on the fitting time:  71%|███████   | 283/400 [00:04<00:01, 59.47it/s]Upper bound on the fitting time:  72%|███████▎  | 290/400 [00:04<00:01, 59.67it/s]Upper bound on the fitting time:  74%|███████▍  | 296/400 [00:04<00:01, 58.86it/s]Upper bound on the fitting time:  76%|███████▌  | 303/400 [00:05<00:01, 60.09it/s]Upper bound on the fitting time:  78%|███████▊  | 310/400 [00:05<00:01, 59.45it/s]Upper bound on the fitting time:  79%|███████▉  | 317/400 [00:05<00:01, 59.90it/s]Upper bound on the fitting time:  81%|████████  | 324/400 [00:05<00:01, 60.78it/s]Upper bound on the fitting time:  83%|████████▎ | 331/400 [00:05<00:01, 59.82it/s]Upper bound on the fitting time:  84%|████████▍ | 338/400 [00:05<00:01, 60.60it/s]Upper bound on the fitting time:  86%|████████▋ | 345/400 [00:05<00:00, 59.51it/s]Upper bound on the fitting time:  88%|████████▊ | 351/400 [00:05<00:00, 59.34it/s]Upper bound on the fitting time:  89%|████████▉ | 357/400 [00:05<00:00, 59.48it/s]Upper bound on the fitting time:  91%|█████████ | 363/400 [00:06<00:00, 59.02it/s]Upper bound on the fitting time:  92%|█████████▎| 370/400 [00:06<00:00, 59.94it/s]Upper bound on the fitting time:  94%|█████████▍| 377/400 [00:06<00:00, 60.62it/s]Upper bound on the fitting time:  96%|█████████▌| 384/400 [00:06<00:00, 60.29it/s]Upper bound on the fitting time:  98%|█████████▊| 391/400 [00:06<00:00, 60.61it/s]Upper bound on the fitting time: 100%|█████████▉| 398/400 [00:06<00:00, 61.11it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:06<00:00, 59.66it/s]
    -Upper bound on the fitting time:   0%|          | 0/150 [00:00<?, ?it/s]Upper bound on the fitting time:  11%|█▏        | 17/150 [00:00<00:00, 159.94it/s]Upper bound on the fitting time:  22%|██▏       | 33/150 [00:00<00:00, 158.07it/s]Upper bound on the fitting time:  33%|███▎      | 49/150 [00:00<00:00, 156.28it/s]Upper bound on the fitting time:  43%|████▎     | 65/150 [00:00<00:00, 146.11it/s]Upper bound on the fitting time:  53%|█████▎    | 80/150 [00:00<00:00, 140.75it/s]Upper bound on the fitting time:  63%|██████▎   | 95/150 [00:00<00:00, 138.72it/s]Upper bound on the fitting time:  73%|███████▎  | 109/150 [00:00<00:00, 138.28it/s]Upper bound on the fitting time:  83%|████████▎ | 124/150 [00:00<00:00, 139.94it/s]Upper bound on the fitting time:  93%|█████████▎| 139/150 [00:00<00:00, 142.93it/s]Upper bound on the fitting time: 100%|██████████| 150/150 [00:01<00:00, 144.24it/s]
    -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 6/400 [00:00<00:06, 56.64it/s]Upper bound on the fitting time:   3%|▎         | 12/400 [00:00<00:07, 54.66it/s]Upper bound on the fitting time:   4%|▍         | 18/400 [00:00<00:07, 50.76it/s]Upper bound on the fitting time:   6%|▌         | 24/400 [00:00<00:07, 49.41it/s]Upper bound on the fitting time:   7%|▋         | 29/400 [00:00<00:07, 48.79it/s]Upper bound on the fitting time:   8%|▊         | 34/400 [00:00<00:07, 48.47it/s]Upper bound on the fitting time:  10%|▉         | 39/400 [00:00<00:07, 47.81it/s]Upper bound on the fitting time:  11%|█         | 44/400 [00:00<00:07, 47.11it/s]Upper bound on the fitting time:  12%|█▏        | 49/400 [00:01<00:07, 46.42it/s]Upper bound on the fitting time:  14%|█▎        | 54/400 [00:01<00:07, 45.99it/s]Upper bound on the fitting time:  15%|█▍        | 59/400 [00:01<00:07, 45.73it/s]Upper bound on the fitting time:  16%|█▌        | 64/400 [00:01<00:07, 45.43it/s]Upper bound on the fitting time:  17%|█▋        | 69/400 [00:01<00:07, 45.60it/s]Upper bound on the fitting time:  18%|█▊        | 74/400 [00:01<00:07, 45.51it/s]Upper bound on the fitting time:  20%|█▉        | 79/400 [00:01<00:07, 45.56it/s]Upper bound on the fitting time:  21%|██        | 84/400 [00:01<00:06, 45.77it/s]Upper bound on the fitting time:  22%|██▏       | 89/400 [00:01<00:06, 45.90it/s]Upper bound on the fitting time:  24%|██▎       | 94/400 [00:02<00:06, 45.74it/s]Upper bound on the fitting time:  25%|██▍       | 99/400 [00:02<00:06, 45.44it/s]Upper bound on the fitting time:  26%|██▋       | 105/400 [00:02<00:06, 47.78it/s]Upper bound on the fitting time:  28%|██▊       | 111/400 [00:02<00:05, 50.77it/s]Upper bound on the fitting time:  29%|██▉       | 117/400 [00:02<00:05, 52.24it/s]Upper bound on the fitting time:  31%|███       | 123/400 [00:02<00:05, 53.38it/s]Upper bound on the fitting time:  32%|███▏      | 129/400 [00:02<00:04, 54.33it/s]Upper bound on the fitting time:  34%|███▍      | 135/400 [00:02<00:04, 54.99it/s]Upper bound on the fitting time:  35%|███▌      | 141/400 [00:02<00:04, 55.70it/s]Upper bound on the fitting time:  37%|███▋      | 147/400 [00:02<00:04, 56.18it/s]Upper bound on the fitting time:  38%|███▊      | 153/400 [00:03<00:04, 55.50it/s]Upper bound on the fitting time:  40%|███▉      | 159/400 [00:03<00:04, 55.76it/s]Upper bound on the fitting time:  41%|████▏     | 165/400 [00:03<00:04, 55.56it/s]Upper bound on the fitting time:  43%|████▎     | 171/400 [00:03<00:04, 55.33it/s]Upper bound on the fitting time:  44%|████▍     | 177/400 [00:03<00:04, 54.90it/s]Upper bound on the fitting time:  46%|████▌     | 183/400 [00:03<00:03, 54.81it/s]Upper bound on the fitting time:  47%|████▋     | 189/400 [00:03<00:03, 55.42it/s]Upper bound on the fitting time:  49%|████▉     | 195/400 [00:03<00:03, 56.19it/s]Upper bound on the fitting time:  50%|█████     | 201/400 [00:03<00:03, 55.61it/s]Upper bound on the fitting time:  52%|█████▏    | 207/400 [00:04<00:03, 56.28it/s]Upper bound on the fitting time:  53%|█████▎    | 213/400 [00:04<00:03, 56.27it/s]Upper bound on the fitting time:  55%|█████▍    | 219/400 [00:04<00:03, 56.04it/s]Upper bound on the fitting time:  56%|█████▋    | 225/400 [00:04<00:03, 55.63it/s]Upper bound on the fitting time:  58%|█████▊    | 231/400 [00:04<00:03, 55.75it/s]Upper bound on the fitting time:  59%|█████▉    | 237/400 [00:04<00:02, 56.48it/s]Upper bound on the fitting time:  61%|██████    | 243/400 [00:04<00:02, 56.20it/s]Upper bound on the fitting time:  62%|██████▏   | 249/400 [00:04<00:02, 56.34it/s]Upper bound on the fitting time:  64%|██████▍   | 255/400 [00:04<00:02, 56.89it/s]Upper bound on the fitting time:  65%|██████▌   | 261/400 [00:05<00:02, 56.44it/s]Upper bound on the fitting time:  67%|██████▋   | 267/400 [00:05<00:02, 55.23it/s]Upper bound on the fitting time:  68%|██████▊   | 273/400 [00:05<00:02, 55.42it/s]Upper bound on the fitting time:  70%|██████▉   | 279/400 [00:05<00:02, 55.59it/s]Upper bound on the fitting time:  71%|███████▏  | 285/400 [00:05<00:02, 55.36it/s]Upper bound on the fitting time:  73%|███████▎  | 291/400 [00:05<00:01, 56.08it/s]Upper bound on the fitting time:  74%|███████▍  | 297/400 [00:05<00:01, 55.45it/s]Upper bound on the fitting time:  76%|███████▌  | 303/400 [00:05<00:01, 54.83it/s]Upper bound on the fitting time:  77%|███████▋  | 309/400 [00:05<00:01, 54.65it/s]Upper bound on the fitting time:  79%|███████▉  | 315/400 [00:05<00:01, 55.10it/s]Upper bound on the fitting time:  80%|████████  | 321/400 [00:06<00:01, 55.65it/s]Upper bound on the fitting time:  82%|████████▏ | 327/400 [00:06<00:01, 55.80it/s]Upper bound on the fitting time:  83%|████████▎ | 333/400 [00:06<00:01, 55.41it/s]Upper bound on the fitting time:  85%|████████▍ | 339/400 [00:06<00:01, 56.09it/s]Upper bound on the fitting time:  86%|████████▋ | 345/400 [00:06<00:00, 55.76it/s]Upper bound on the fitting time:  88%|████████▊ | 351/400 [00:06<00:00, 55.84it/s]Upper bound on the fitting time:  89%|████████▉ | 357/400 [00:06<00:00, 56.05it/s]Upper bound on the fitting time:  91%|█████████ | 363/400 [00:06<00:00, 55.77it/s]Upper bound on the fitting time:  92%|█████████▏| 369/400 [00:06<00:00, 56.74it/s]Upper bound on the fitting time:  94%|█████████▍| 375/400 [00:07<00:00, 55.98it/s]Upper bound on the fitting time:  95%|█████████▌| 381/400 [00:07<00:00, 56.39it/s]Upper bound on the fitting time:  97%|█████████▋| 387/400 [00:07<00:00, 56.83it/s]Upper bound on the fitting time:  98%|█████████▊| 393/400 [00:07<00:00, 56.73it/s]Upper bound on the fitting time: 100%|█████████▉| 399/400 [00:07<00:00, 55.87it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:07<00:00, 53.31it/s]
    +

    4.5.1 Evaluate model quality

    -
    -
    collection.show(figsize=(8, 8))
    +
    +
    collection.show(figsize=(8, 8))
    -

    +
    +
    +

    +
    +

    This displays BIC, AIC, log-likelihood, and clustering metric (WCSS, silhouette) for each model.

    @@ -5287,14 +4984,14 @@

    4.5.2 Select the best model

    One can directly access the best model using the best_model method, with the metric of choice:

    -
    -
    best_mixture = collection.best_model("silhouette") # Could be also BIC, AIC, or WCSS.
    -print(best_mixture)
    +
    +
    best_mixture = collection.best_model("silhouette") # Could be also BIC, AIC, or WCSS.
    +print(best_mixture)
    A multivariate PlnMixture with diagonal covariances and 2 clusters.
     ======================================================================
          Loglike   Dimension    Nb param         BIC         AIC         ICL  Silhouette
    -   -25178.46          20          80  25418.1208  25258.4622    12105.51   0.5514621
    +   -25178.45          20          80  25418.1123  25258.4537    12101.03   0.5515394
     
     ======================================================================
     * Useful attributes
    @@ -5308,13 +5005,13 @@ 

    You can access specific models within the collection by using the cluster number as a key:

    -
    -
    print(collection[3])
    +
    +
    print(collection[3])
    A multivariate PlnMixture with diagonal covariances and 3 clusters.
     ======================================================================
          Loglike   Dimension    Nb param         BIC         AIC         ICL  Silhouette
    -   -24320.75          20         120  24680.2424  24440.7545    11700.29  0.42461434
    +   -24320.76          20         120  24680.2439   24440.756    11700.15   0.4245733
     
     ======================================================================
     * Useful attributes
    @@ -5328,257 +5025,425 @@ 

    and loop through the collection:

    -
    -
    for mixture in collection.values():
    -    print(mixture)
    +
    +
    for mixture in collection.values():
    +    print(mixture)
    +

    -

    References

    +

    References

    Batardière, Bastien, Joon Kwon, and Julien Chiquet. 2024. “pyPLNmodels: A Python Package to Analyze Multivariate High-Dimensional Count Data.” Journal of Open Source Software.
    + }); +
    + diff --git a/docs/source/tutorials/clustering.qmd b/docs/source/tutorials/clustering.qmd index 3bca890a..ea37a1fe 100644 --- a/docs/source/tutorials/clustering.qmd +++ b/docs/source/tutorials/clustering.qmd @@ -132,7 +132,18 @@ _ = dumb_lda.predict_clusters(endog_test, exog=torch.randn(endog_test.shape[0], ``` ⚠️ Exogenous variables must be full rank, and an intercept will be added to -account for the cluster bias.. Avoid one-hot encodings without intercept removal. +account for the cluster bias.. Avoid one-hot encodings without intercept removal, like this: + +```{python} +try: + wrong_lda = PlnLDA.from_formula("endog ~ 1 | labels", data = rna) +except ValueError as e: + print(str(e)) +try: + wrong_lda = PlnLDA.from_formula("endog ~ labels | labels", data = rna) +except ValueError as e: + print(str(e)) +``` # Unsupervised Clustering with `PlnMixture` @@ -165,8 +176,27 @@ print(mixture) _ = PlnMixture(endog, exog=torch.randn(endog.shape[0], 2), n_cluster=3) ``` -⚠️ exogenous variables must be full rank, and an intercept will be added to -account for the cluster bias. Avoid one-hot encodings without intercept removal. +⚠️ Exogenous variables must be full rank, and an intercept will be added to +account for the cluster bias. Avoid one-hot encodings without intercept removal: + + +```{python} +try: + wrong_mixt = PlnMixture.from_formula("endog ~ 1", data = rna, n_cluster = 3) +except ValueError as e: + print(str(e)) +try: + wrong_mixt = PlnMixture.from_formula("endog ~ labels", data = rna, n_cluster = 3) +except ValueError as e: + print(str(e)) +try: + wrong_mixt = PlnMixture(endog = rna["endog"], exog = rna["labels_1hot"], n_cluster = 3) +except ValueError as e: + print(str(e)) +right_mixt = PlnMixture.from_formula("endog ~ 0", data = rna, n_cluster = 3) +right_mixt = PlnMixture(endog = rna["endog"], exog = rna["labels_1hot"].iloc[:,1:], n_cluster = 3) +``` + ### Extracting Weights @@ -224,6 +254,7 @@ approach is given by the `PlnMixtureCollection` in the next section. To explore multiple cluster solutions, use `PlnMixtureCollection`: ```{python} +#| echo: false from pyPLNmodels import PlnMixtureCollection collection = PlnMixtureCollection(endog, n_clusters=range(2, 8)).fit() ``` diff --git a/docs/source/tutorials/formulas.html b/docs/source/tutorials/formulas.html index 3eb41eb4..33e88c60 100644 --- a/docs/source/tutorials/formulas.html +++ b/docs/source/tutorials/formulas.html @@ -2,13 +2,13 @@ - + -pyPLNmodels - Mathematical details 📐 +Mathematical details 📐 – pyPLNmodels - + - - + - + + + - +
    +

    1 Pln model

    -

    This package is designed to estimate model parameters from a count matrix \(Y \in \mathbb N^{n\times p}\), where \(n\) represents the number of observations (or individuals) and \(p\) denotes the number of variables. Users can also provide additional data, such as covariates (also known as exogenous variables) \(X\), and offsets \(o\). For each observation (or individual) \(i\), the following notations are used:

    +

    This package is designed to estimate model parameters from a count matrix \(Y \in \mathbb +N^{n\times p}\), where \(n\) represents the number of observations (or individuals) and \(p\) denotes the number of variables. Users can also provide additional data, such as covariates (also known as exogenous variables) \(X\), and offsets \(o\). For each observation (or individual) \(i\), the following notations are used:

    • \(Y_{ij}\) (endog): the \(j\)-th count for the \(i\)-th observation
    • \(X_i\) (exog): covariates for the \(i\)-th observation (if available)
    • @@ -4867,10 +4359,11 @@

      References

      +

      References

      Aitchison, John, and CH Ho. 1989. “The Multivariate Poisson-Log Normal Distribution.” Biometrika 76 (4): 643–53.
      @@ -4888,240 +4381,407 @@

      -window.document.addEventListener("DOMContentLoaded", function (event) { - const toggleBodyColorMode = (bsSheetEl) => { - const mode = bsSheetEl.getAttribute("data-mode"); - const bodyEl = window.document.querySelector("body"); - if (mode === "dark") { - bodyEl.classList.add("quarto-dark"); - bodyEl.classList.remove("quarto-light"); - } else { - bodyEl.classList.add("quarto-light"); - bodyEl.classList.remove("quarto-dark"); - } - } - const toggleBodyColorPrimary = () => { - const bsSheetEl = window.document.querySelector("link#quarto-bootstrap"); - if (bsSheetEl) { - toggleBodyColorMode(bsSheetEl); + window.document.addEventListener("DOMContentLoaded", function (event) { + const icon = ""; + const anchorJS = new window.AnchorJS(); + anchorJS.options = { + placement: 'right', + icon: icon + }; + anchorJS.add('.anchored'); + const isCodeAnnotation = (el) => { + for (const clz of el.classList) { + if (clz.startsWith('code-annotation-')) { + return true; + } + } + return false; } - } - toggleBodyColorPrimary(); - const icon = ""; - const anchorJS = new window.AnchorJS(); - anchorJS.options = { - placement: 'right', - icon: icon - }; - anchorJS.add('.anchored'); - const isCodeAnnotation = (el) => { - for (const clz of el.classList) { - if (clz.startsWith('code-annotation-')) { - return true; + const onCopySuccess = function(e) { + // button target + const button = e.trigger; + // don't keep focus + button.blur(); + // flash "checked" + button.classList.add('code-copy-button-checked'); + var currentTitle = button.getAttribute("title"); + button.setAttribute("title", "Copied!"); + let tooltip; + if (window.bootstrap) { + button.setAttribute("data-bs-toggle", "tooltip"); + button.setAttribute("data-bs-placement", "left"); + button.setAttribute("data-bs-title", "Copied!"); + tooltip = new bootstrap.Tooltip(button, + { trigger: "manual", + customClass: "code-copy-button-tooltip", + offset: [0, -8]}); + tooltip.show(); } + setTimeout(function() { + if (tooltip) { + tooltip.hide(); + button.removeAttribute("data-bs-title"); + button.removeAttribute("data-bs-toggle"); + button.removeAttribute("data-bs-placement"); + } + button.setAttribute("title", currentTitle); + button.classList.remove('code-copy-button-checked'); + }, 1000); + // clear code selection + e.clearSelection(); } - return false; - } - const clipboard = new window.ClipboardJS('.code-copy-button', { - text: function(trigger) { - const codeEl = trigger.previousElementSibling.cloneNode(true); - for (const childEl of codeEl.children) { - if (isCodeAnnotation(childEl)) { - childEl.remove(); + const getTextToCopy = function(trigger) { + const codeEl = trigger.previousElementSibling.cloneNode(true); + for (const childEl of codeEl.children) { + if (isCodeAnnotation(childEl)) { + childEl.remove(); + } } - } - return codeEl.innerText; + return codeEl.innerText; } - }); - clipboard.on('success', function(e) { - // button target - const button = e.trigger; - // don't keep focus - button.blur(); - // flash "checked" - button.classList.add('code-copy-button-checked'); - var currentTitle = button.getAttribute("title"); - button.setAttribute("title", "Copied!"); - let tooltip; - if (window.bootstrap) { - button.setAttribute("data-bs-toggle", "tooltip"); - button.setAttribute("data-bs-placement", "left"); - button.setAttribute("data-bs-title", "Copied!"); - tooltip = new bootstrap.Tooltip(button, - { trigger: "manual", - customClass: "code-copy-button-tooltip", - offset: [0, -8]}); - tooltip.show(); + const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', { + text: getTextToCopy + }); + clipboard.on('success', onCopySuccess); + if (window.document.getElementById('quarto-embedded-source-code-modal')) { + const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', { + text: getTextToCopy, + container: window.document.getElementById('quarto-embedded-source-code-modal') + }); + clipboardModal.on('success', onCopySuccess); } - setTimeout(function() { - if (tooltip) { - tooltip.hide(); - button.removeAttribute("data-bs-title"); - button.removeAttribute("data-bs-toggle"); - button.removeAttribute("data-bs-placement"); + var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//); + var mailtoRegex = new RegExp(/^mailto:/); + var filterRegex = new RegExp('/' + window.location.host + '/'); + var isInternal = (href) => { + return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); } - button.setAttribute("title", currentTitle); - button.classList.remove('code-copy-button-checked'); - }, 1000); - // clear code selection - e.clearSelection(); - }); - function tippyHover(el, contentFn) { - const config = { - allowHTML: true, - content: contentFn, - maxWidth: 500, - delay: 100, - arrow: false, - appendTo: function(el) { - return el.parentElement; - }, - interactive: true, - interactiveBorder: 10, - theme: 'quarto', - placement: 'bottom-start' - }; - window.tippy(el, config); - } - const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]'); - for (var i=0; i { - let cellAttr = 'data-code-cell="' + cell + '"'; - let lineAttr = 'data-code-annotation="' + annotation + '"'; - const selector = 'span[' + cellAttr + '][' + lineAttr + ']'; - return selector; + // Inspect non-navigation links and adorn them if external + var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)'); + for (var i=0; i { - const doc = window.document; - const targetCell = annoteEl.getAttribute("data-target-cell"); - const targetAnnotation = annoteEl.getAttribute("data-target-annotation"); - const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation)); - const lines = annoteSpan.getAttribute("data-code-lines").split(","); - const lineIds = lines.map((line) => { - return targetCell + "-" + line; - }) - let top = null; - let height = null; - let parent = null; - if (lineIds.length > 0) { - //compute the position of the single el (top and bottom and make a div) - const el = window.document.getElementById(lineIds[0]); - top = el.offsetTop; - height = el.offsetHeight; - parent = el.parentElement.parentElement; - if (lineIds.length > 1) { - const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]); - const bottom = lastEl.offsetTop + lastEl.offsetHeight; - height = bottom - top; + function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) { + const config = { + allowHTML: true, + maxWidth: 500, + delay: 100, + arrow: false, + appendTo: function(el) { + return el.parentElement; + }, + interactive: true, + interactiveBorder: 10, + theme: 'quarto', + placement: 'bottom-start', + }; + if (contentFn) { + config.content = contentFn; + } + if (onTriggerFn) { + config.onTrigger = onTriggerFn; + } + if (onUntriggerFn) { + config.onUntrigger = onUntriggerFn; + } + window.tippy(el, config); + } + const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]'); + for (var i=0; i { + // Strip column container classes + const stripColumnClz = (el) => { + el.classList.remove("page-full", "page-columns"); + if (el.children) { + for (const child of el.children) { + stripColumnClz(child); } - if (top !== null && height !== null && parent !== null) { - // cook up a div (if necessary) and position it - let div = window.document.getElementById("code-annotation-line-highlight"); - if (div === null) { - div = window.document.createElement("div"); - div.setAttribute("id", "code-annotation-line-highlight"); - div.style.position = 'absolute'; - parent.appendChild(div); + } + } + stripColumnClz(note) + if (id === null || id.startsWith('sec-')) { + // Special case sections, only their first couple elements + const container = document.createElement("div"); + if (note.children && note.children.length > 2) { + container.appendChild(note.children[0].cloneNode(true)); + for (let i = 1; i < note.children.length; i++) { + const child = note.children[i]; + if (child.tagName === "P" && child.innerText === "") { + continue; + } else { + container.appendChild(child.cloneNode(true)); + break; } - div.style.top = top - 2 + "px"; - div.style.height = height + 4 + "px"; - let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter"); - if (gutterDiv === null) { - gutterDiv = window.document.createElement("div"); - gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter"); - gutterDiv.style.position = 'absolute'; - const codeCell = window.document.getElementById(targetCell); - const gutter = codeCell.querySelector('.code-annotation-gutter'); - gutter.appendChild(gutterDiv); + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(container); + } + return container.innerHTML + } else { + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + return note.innerHTML; + } + } else { + // Remove any anchor links if they are present + const anchorLink = note.querySelector('a.anchorjs-link'); + if (anchorLink) { + anchorLink.remove(); + } + if (window.Quarto?.typesetMath) { + window.Quarto.typesetMath(note); + } + if (note.classList.contains("callout")) { + return note.outerHTML; + } else { + return note.innerHTML; + } + } + } + for (var i=0; i res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.getElementById(id); + if (note !== null) { + const html = processXRef(id, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); } - selectedAnnoteEl = annoteEl; + } else { + // See if we can fetch a full url (with no hash to target) + // This is a special case and we should probably do some content thinning / targeting + fetch(url) + .then(res => res.text()) + .then(html => { + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(html, "text/html"); + const note = htmlDoc.querySelector('main.content'); + if (note !== null) { + // This should only happen for chapter cross references + // (since there is no id in the URL) + // remove the first header + if (note.children.length > 0 && note.children[0].tagName === "HEADER") { + note.children[0].remove(); + } + const html = processXRef(null, note); + instance.setContent(html); + } + }).finally(() => { + instance.enable(); + instance.show(); + }); } - }; - const unselectCodeLines = () => { - const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"]; - elementsIds.forEach((elId) => { - const div = window.document.getElementById(elId); - if (div) { - div.remove(); + }, function(instance) { + }); + } + let selectedAnnoteEl; + const selectorForAnnotation = ( cell, annotation) => { + let cellAttr = 'data-code-cell="' + cell + '"'; + let lineAttr = 'data-code-annotation="' + annotation + '"'; + const selector = 'span[' + cellAttr + '][' + lineAttr + ']'; + return selector; + } + const selectCodeLines = (annoteEl) => { + const doc = window.document; + const targetCell = annoteEl.getAttribute("data-target-cell"); + const targetAnnotation = annoteEl.getAttribute("data-target-annotation"); + const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation)); + const lines = annoteSpan.getAttribute("data-code-lines").split(","); + const lineIds = lines.map((line) => { + return targetCell + "-" + line; + }) + let top = null; + let height = null; + let parent = null; + if (lineIds.length > 0) { + //compute the position of the single el (top and bottom and make a div) + const el = window.document.getElementById(lineIds[0]); + top = el.offsetTop; + height = el.offsetHeight; + parent = el.parentElement.parentElement; + if (lineIds.length > 1) { + const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]); + const bottom = lastEl.offsetTop + lastEl.offsetHeight; + height = bottom - top; + } + if (top !== null && height !== null && parent !== null) { + // cook up a div (if necessary) and position it + let div = window.document.getElementById("code-annotation-line-highlight"); + if (div === null) { + div = window.document.createElement("div"); + div.setAttribute("id", "code-annotation-line-highlight"); + div.style.position = 'absolute'; + parent.appendChild(div); + } + div.style.top = top - 2 + "px"; + div.style.height = height + 4 + "px"; + div.style.left = 0; + let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter"); + if (gutterDiv === null) { + gutterDiv = window.document.createElement("div"); + gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter"); + gutterDiv.style.position = 'absolute'; + const codeCell = window.document.getElementById(targetCell); + const gutter = codeCell.querySelector('.code-annotation-gutter'); + gutter.appendChild(gutterDiv); + } + gutterDiv.style.top = top - 2 + "px"; + gutterDiv.style.height = height + 4 + "px"; + } + selectedAnnoteEl = annoteEl; } - }); - selectedAnnoteEl = undefined; - }; - // Attach click handler to the DT - const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); - for (const annoteDlNode of annoteDls) { - annoteDlNode.addEventListener('click', (event) => { - const clickedEl = event.target; - if (clickedEl !== selectedAnnoteEl) { - unselectCodeLines(); - const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active'); - if (activeEl) { - activeEl.classList.remove('code-annotation-active'); + }; + const unselectCodeLines = () => { + const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"]; + elementsIds.forEach((elId) => { + const div = window.document.getElementById(elId); + if (div) { + div.remove(); } - selectCodeLines(clickedEl); - clickedEl.classList.add('code-annotation-active'); - } else { - // Unselect the line - unselectCodeLines(); - clickedEl.classList.remove('code-annotation-active'); + }); + selectedAnnoteEl = undefined; + }; + // Handle positioning of the toggle + window.addEventListener( + "resize", + throttle(() => { + elRect = undefined; + if (selectedAnnoteEl) { + selectCodeLines(selectedAnnoteEl); + } + }, 10) + ); + function throttle(fn, ms) { + let throttle = false; + let timer; + return (...args) => { + if(!throttle) { // first call gets through + fn.apply(this, args); + throttle = true; + } else { // all the others get throttled + if(timer) clearTimeout(timer); // cancel #2 + timer = setTimeout(() => { + fn.apply(this, args); + timer = throttle = false; + }, ms); } - }); - } - const findCites = (el) => { - const parentEl = el.parentElement; - if (parentEl) { - const cites = parentEl.dataset.cites; - if (cites) { - return { - el, - cites: cites.split(' ') }; + } + // Attach click handler to the DT + const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); + for (const annoteDlNode of annoteDls) { + annoteDlNode.addEventListener('click', (event) => { + const clickedEl = event.target; + if (clickedEl !== selectedAnnoteEl) { + unselectCodeLines(); + const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active'); + if (activeEl) { + activeEl.classList.remove('code-annotation-active'); + } + selectCodeLines(clickedEl); + clickedEl.classList.add('code-annotation-active'); + } else { + // Unselect the line + unselectCodeLines(); + clickedEl.classList.remove('code-annotation-active'); + } + }); + } + const findCites = (el) => { + const parentEl = el.parentElement; + if (parentEl) { + const cites = parentEl.dataset.cites; + if (cites) { + return { + el, + cites: cites.split(' ') + }; + } else { + return findCites(el.parentElement) + } } else { - return findCites(el.parentElement) + return undefined; } - } else { - return undefined; - } - }; - var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]'); - for (var i=0; i + }); +

      + diff --git a/docs/source/tutorials/index.html b/docs/source/tutorials/index.html index ed8836e1..2e724b7d 100644 --- a/docs/source/tutorials/index.html +++ b/docs/source/tutorials/index.html @@ -2,13 +2,13 @@ - + -pyPLNmodels - Home page 🏠 +Home page 🏠 – pyPLNmodels - + - - + - + + + - +
      +

      The Poisson lognormal model and its variants are used for the analysis of multivariate count data. This package implements efficient algorithms to extract meaningful insights from complex and difficult-to-interpret multivariate count data. It is designed to scale on large datasets, although it has memory limitations.

      1 In-depth pyPLNmodels tutorials

      @@ -4774,9 +4266,10 @@

      1 In-depth

      1.1 Installation

      First of all, you should run:

      -
      +
      pip install pyPLNmodels
      +

      The package depends on resource-intensive libraries like torch, so it may require significant storage space.

      1.2 Tutorials

      @@ -4792,249 +4285,417 @@

      References

      +

      References

      Batardière, Bastien, Joon Kwon, and Julien Chiquet. 2024. “pyPLNmodels: A Python Package to Analyze Multivariate High-Dimensional Count Data.” Journal of Open Source Software.
      + }); +
      + diff --git a/docs/source/tutorials/index.qmd b/docs/source/tutorials/index.qmd index 6f928583..bdf0d6c1 100644 --- a/docs/source/tutorials/index.qmd +++ b/docs/source/tutorials/index.qmd @@ -38,6 +38,8 @@ First of all, you should run: #| eval: false pip install pyPLNmodels ``` +The package depends on resource-intensive libraries like `torch`, so it may +require significant storage space. ## Tutorials diff --git a/docs/source/tutorials/model_specifying.html b/docs/source/tutorials/model_specifying.html index 9cf32fa3..badacc2d 100644 --- a/docs/source/tutorials/model_specifying.html +++ b/docs/source/tutorials/model_specifying.html @@ -2,13 +2,13 @@ - + -pyPLNmodels - How to specify a model 🛠️ +How to specify a model 🛠️ – pyPLNmodels - + - - + - + + + - +
      +

      1 Introduction

      This tutorial demonstrates how to specify a model in pyPLNmodels. Two primary approaches are available:

      @@ -4804,7 +4296,7 @@

      2 Count Data

      -

      Let’s explore real count data from the microcosm dataset (Mariadassou et al. 2023), introduced in the NCBI BioProject and provided by the load_microcsom function in the package. This dataset features microbiota members sampled from various body sites of dairy cows throughout their lactation period. The data includes response count variables (endog) and explanatory variables:

      +

      Let’s explore real count data from the microcosm dataset (Mariadassou et al. 2023), introduced in the NCBI BioProject PRJNA875059 and provided by the load_microcosm function in the package. This dataset features microbiota members sampled from various body sites of dairy cows throughout their lactation period. The data includes response count variables (endog) and explanatory variables:

      • Site information (site and site_1hot)
      • Time information (time and time_1hot)
      • @@ -4813,7 +4305,7 @@

        2 Count Data

        The 1_hot variables are one-hot encoded representations of the corresponding categorical variables.

        2.1 Data importation

        -
        +
        from pyPLNmodels import load_microcosm
         micro = load_microcosm(dim = 20)
         print('Data: ')
        @@ -4824,20 +4316,24 @@ 

        The counts (endog) are composed of \(400\) samples and \(20\) variables:

        -
        +
        print('Endog shape: ', micro["endog"].shape)
        Endog shape:  (400, 20)

        On a log scale, here is the distribution of the counts:

        -
        +
        import matplotlib.pyplot as plt
         plt.hist(micro["endog"].values.ravel(), bins=100)
         plt.yscale('log')
         plt.show()
        -

        +
        +
        +

        +
        +

        The counts are strongly zero-inflated here, but we do not make any zero-inflation hypothesis. To account for zero-inflation, please see the dedicated zero-inflation tutorial.

        @@ -4848,7 +4344,7 @@

        3 Model specifyin

        3.1 R-style formulas

        The model can be initialized using R-style formulas, just as in the statsmodels package. Here is a quick overview

        -
        +
        from pyPLNmodels import Pln
         
         pln = Pln.from_formula("endog ~ 1 + site", data=micro)
        @@ -4868,7 +4364,7 @@ 

        The formula specifies a model with an intercept (1) and the categorical covariate site. Internally, the formula is parsed using the patsy package, which handles categorical variables automatically by one-hot encoding them and excluding the reference level.

        You can specify more complex models, such as including multiple covariates:

        -
        +
        pln = Pln.from_formula("endog ~ 1 + site + time", data=micro)
         print('exog:', pln.exog)
         print('names:', pln.column_names_exog)
        @@ -4887,7 +4383,7 @@

        and interactions:

        -
        +
        pln = Pln.from_formula("endog ~ 1 + site * time", data=micro)
         print('exog:', pln.exog)
         print('names:', pln.column_names_exog)
        @@ -4909,13 +4405,28 @@

        -

        Note that the left-hand side (endog) must always match the key for the count matrix in your data dictionary. The offset is computed automatically unless explicitly provided using the offsets key in the data dictionary. By default, it is set to zero unless you specify compute_offsets_method="logsum", in which case the log of the row sums of the counts is used.

        -
        -
        import numpy as np
        -tmp_micro = load_microcosm()
        -print("No offsets:", Pln.from_formula("endog ~ 1", data = tmp_micro).offsets)
        -tmp_micro["offsets"] = np.log(tmp_micro["endog"] + 2)
        -print("Dumb offsets:", Pln.from_formula("endog ~ 1", data = tmp_micro).offsets)
        +

        Note that the left-hand side (endog) must always match the key for the count matrix in your data dictionary. By default, the offsets are set to zero unless you specify compute_offsets_method="logsum", in which case the log of the row sums of the counts is used:

        +
        +
        pln = Pln.from_formula("endog ~ 1 + site", data=micro, compute_offsets_method="logsum")
        +print('offsets:', pln.offsets)
        +
        +
        Setting the offsets as the log of the sum of `endog`.
        +offsets: tensor([[6.4281, 6.4281, 6.4281,  ..., 6.4281, 6.4281, 6.4281],
        +        [  -inf,   -inf,   -inf,  ...,   -inf,   -inf,   -inf],
        +        [4.7622, 4.7622, 4.7622,  ..., 4.7622, 4.7622, 4.7622],
        +        ...,
        +        [5.5053, 5.5053, 5.5053,  ..., 5.5053, 5.5053, 5.5053],
        +        [  -inf,   -inf,   -inf,  ...,   -inf,   -inf,   -inf],
        +        [5.3471, 5.3471, 5.3471,  ..., 5.3471, 5.3471, 5.3471]])
        +
        +
        +

        If the offsets key is in the data dictionary, then they are set to data["offsets"] automatically:

        +
        +
        import numpy as np
        +tmp_micro = load_microcosm()
        +print("No offsets:", Pln.from_formula("endog ~ 1", data = tmp_micro).offsets)
        +tmp_micro["offsets"] = np.log(tmp_micro["endog"] + 2)
        +print("Dumb offsets:", Pln.from_formula("endog ~ 1", data = tmp_micro).offsets)
        Setting the offsets to zero.
         No offsets: tensor([[0., 0., 0.,  ..., 0., 0., 0.],
        @@ -4940,24 +4451,24 @@ 

        3.2 Specifying arrays

        Instead of using a formula, you can pass the arrays directly using the class constructor. This offers more flexibility, especially if your covariates are already processed or you want full control over preprocessing.

        Here is how to specify a model with site as covariates:

        -
        -
        import pandas as pd
        -pln = Pln(
        -    endog=micro["endog"],
        -    exog=micro["site_1hot"],
        -    add_const=False,
        -    compute_offsets_method="logsum"  # use log row sums as offsets
        -)
        +
        +
        import pandas as pd
        +pln = Pln(
        +    endog=micro["endog"],
        +    exog=micro["site_1hot"],
        +    add_const=False,
        +    compute_offsets_method="logsum"  # use log row sums as offsets
        +)
        Setting the offsets as the log of the sum of `endog`.

        The exog matrix should be full-rank, otherwise the initialization will raise an error. By default, the model automatically adds a constant column (intercept) to the covariates. However, in cases where this would result in a non-full rank covariate matrix, you can disable this behavior by setting add_const=False, especially if your data already includes an intercept or is one hot encoded, just like the above case.

        If you do not wish to include covariates at all, simply omit the exog argument:

        -
        -
        pln = Pln(
        -    endog=micro["endog"]
        -)
        +
        +
        pln = Pln(
        +    endog=micro["endog"]
        +)
        Setting the offsets to zero.
        @@ -4968,23 +4479,28 @@

        4 Model fitting

        Once instantiate, one can simply calls .fit() to fit the model and infer the model parameters:

        -
        -
        pln.fit()
        +
        +
        pln.fit()
        Fitting a Pln model with full covariance.
         Intializing parameters ...
        -Initialization finished.
        -Maximum number of iterations (400)  reached in 5.1 seconds.
        +Initialization finished.
        +
        +
        +
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  18%|█▊        | 74/400 [00:00<00:00, 731.52it/s]Upper bound on the fitting time:  40%|███▉      | 158/400 [00:00<00:00, 790.41it/s]Upper bound on the fitting time:  60%|█████▉    | 238/400 [00:00<00:00, 736.03it/s]Upper bound on the fitting time:  78%|███████▊  | 313/400 [00:00<00:00, 731.76it/s]Upper bound on the fitting time:  97%|█████████▋| 387/400 [00:00<00:00, 730.88it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 736.00it/s]
        +
        +
        +
        Maximum number of iterations (400)  reached in 1.4 seconds.
         Last  criterion = 5.37e-06 . Required tolerance = 1e-06
        -
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   4%|▍         | 15/400 [00:00<00:02, 140.65it/s]Upper bound on the fitting time:   8%|▊         | 30/400 [00:00<00:02, 138.22it/s]Upper bound on the fitting time:  11%|█         | 44/400 [00:00<00:02, 136.70it/s]Upper bound on the fitting time:  14%|█▍        | 58/400 [00:00<00:02, 137.88it/s]Upper bound on the fitting time:  18%|█▊        | 73/400 [00:00<00:02, 138.82it/s]Upper bound on the fitting time:  22%|██▏       | 88/400 [00:00<00:02, 138.78it/s]Upper bound on the fitting time:  26%|██▌       | 102/400 [00:00<00:02, 138.09it/s]Upper bound on the fitting time:  29%|██▉       | 117/400 [00:00<00:02, 139.50it/s]Upper bound on the fitting time:  33%|███▎      | 132/400 [00:00<00:01, 140.16it/s]Upper bound on the fitting time:  37%|███▋      | 147/400 [00:01<00:01, 140.27it/s]Upper bound on the fitting time:  40%|████      | 162/400 [00:01<00:01, 139.73it/s]Upper bound on the fitting time:  44%|████▍     | 176/400 [00:01<00:01, 136.92it/s]Upper bound on the fitting time:  48%|████▊     | 190/400 [00:01<00:01, 137.73it/s]Upper bound on the fitting time:  51%|█████▏    | 205/400 [00:01<00:01, 138.41it/s]Upper bound on the fitting time:  55%|█████▌    | 220/400 [00:01<00:01, 139.13it/s]Upper bound on the fitting time:  58%|█████▊    | 234/400 [00:01<00:01, 137.23it/s]Upper bound on the fitting time:  62%|██████▏   | 248/400 [00:01<00:01, 136.84it/s]Upper bound on the fitting time:  66%|██████▌   | 262/400 [00:01<00:01, 135.08it/s]Upper bound on the fitting time:  69%|██████▉   | 276/400 [00:02<00:00, 136.14it/s]Upper bound on the fitting time:  73%|███████▎  | 291/400 [00:02<00:00, 137.61it/s]Upper bound on the fitting time:  76%|███████▋  | 305/400 [00:02<00:00, 137.62it/s]Upper bound on the fitting time:  80%|███████▉  | 319/400 [00:02<00:00, 137.34it/s]Upper bound on the fitting time:  83%|████████▎ | 333/400 [00:02<00:00, 137.42it/s]Upper bound on the fitting time:  87%|████████▋ | 347/400 [00:02<00:00, 135.79it/s]Upper bound on the fitting time:  90%|█████████ | 362/400 [00:02<00:00, 137.36it/s]Upper bound on the fitting time:  94%|█████████▍| 377/400 [00:02<00:00, 138.52it/s]Upper bound on the fitting time:  98%|█████████▊| 392/400 [00:02<00:00, 139.39it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:02<00:00, 138.13it/s]
        +
        -
        +
        A multivariate Pln with full covariance.
         ======================================================================
              Loglike   Dimension    Nb param         BIC         AIC         ICL
        -    -2658.12          20         230   3347.1434    2888.125    -61972.2
        +    -2658.12          20         230   3347.1434    2888.125   -61995.72
         
         ======================================================================
         * Useful attributes
        @@ -4998,27 +4514,33 @@ 

        4 Model fitting

        It is possible to fit the model directyly after specifying it:

        -
        -
        pln = Pln(endog = micro["endog"]).fit()
        +
        +
        pln = Pln(endog = micro["endog"]).fit()
        Setting the offsets to zero.
         Fitting a Pln model with full covariance.
         Intializing parameters ...
        -Initialization finished.
        -Maximum number of iterations (400)  reached in 3.0 seconds.
        +Initialization finished.
        +
        +
        +
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  18%|█▊        | 73/400 [00:00<00:00, 722.86it/s]Upper bound on the fitting time:  36%|███▋      | 146/400 [00:00<00:00, 723.58it/s]Upper bound on the fitting time:  55%|█████▍    | 219/400 [00:00<00:00, 724.82it/s]Upper bound on the fitting time:  73%|███████▎  | 292/400 [00:00<00:00, 725.33it/s]Upper bound on the fitting time:  91%|█████████▏| 365/400 [00:00<00:00, 724.18it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 723.65it/s]
        +
        +
        +
        Maximum number of iterations (400)  reached in 0.6 seconds.
         Last  criterion = 5.37e-06 . Required tolerance = 1e-06
        -
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   4%|▍         | 15/400 [00:00<00:02, 144.04it/s]Upper bound on the fitting time:   8%|▊         | 30/400 [00:00<00:02, 139.79it/s]Upper bound on the fitting time:  11%|█         | 44/400 [00:00<00:02, 138.73it/s]Upper bound on the fitting time:  14%|█▍        | 58/400 [00:00<00:02, 137.19it/s]Upper bound on the fitting time:  18%|█▊        | 72/400 [00:00<00:02, 136.87it/s]Upper bound on the fitting time:  22%|██▏       | 86/400 [00:00<00:02, 136.85it/s]Upper bound on the fitting time:  25%|██▌       | 100/400 [00:00<00:02, 134.37it/s]Upper bound on the fitting time:  28%|██▊       | 114/400 [00:00<00:02, 133.20it/s]Upper bound on the fitting time:  32%|███▏      | 128/400 [00:00<00:02, 133.72it/s]Upper bound on the fitting time:  36%|███▌      | 142/400 [00:01<00:01, 135.15it/s]Upper bound on the fitting time:  39%|███▉      | 156/400 [00:01<00:01, 135.10it/s]Upper bound on the fitting time:  42%|████▎     | 170/400 [00:01<00:01, 136.15it/s]Upper bound on the fitting time:  46%|████▌     | 184/400 [00:01<00:01, 134.65it/s]Upper bound on the fitting time:  50%|████▉     | 198/400 [00:01<00:01, 135.40it/s]Upper bound on the fitting time:  53%|█████▎    | 212/400 [00:01<00:01, 135.65it/s]Upper bound on the fitting time:  56%|█████▋    | 226/400 [00:01<00:01, 136.77it/s]Upper bound on the fitting time:  60%|██████    | 241/400 [00:01<00:01, 138.08it/s]Upper bound on the fitting time:  64%|██████▍   | 255/400 [00:01<00:01, 138.13it/s]Upper bound on the fitting time:  67%|██████▋   | 269/400 [00:01<00:00, 137.21it/s]Upper bound on the fitting time:  71%|███████   | 283/400 [00:02<00:00, 131.82it/s]Upper bound on the fitting time:  74%|███████▍  | 297/400 [00:02<00:00, 133.29it/s]Upper bound on the fitting time:  78%|███████▊  | 311/400 [00:02<00:00, 134.50it/s]Upper bound on the fitting time:  81%|████████▏ | 325/400 [00:02<00:00, 134.87it/s]Upper bound on the fitting time:  85%|████████▍ | 339/400 [00:02<00:00, 136.08it/s]Upper bound on the fitting time:  88%|████████▊ | 353/400 [00:02<00:00, 134.38it/s]Upper bound on the fitting time:  92%|█████████▏| 367/400 [00:02<00:00, 134.01it/s]Upper bound on the fitting time:  95%|█████████▌| 381/400 [00:02<00:00, 135.08it/s]Upper bound on the fitting time:  99%|█████████▉| 396/400 [00:02<00:00, 137.63it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:02<00:00, 135.70it/s]
        +

        See the basic analysis for more insights on the output of the model.

        +

        -

        References

        +

        References

        Aitchison, John, and CH Ho. 1989. “The Multivariate Poisson-Log Normal Distribution.” Biometrika 76 (4): 643–53.
        @@ -5030,240 +4552,407 @@

        4 Model fitting

        + }); +
        + diff --git a/docs/source/tutorials/model_specifying.qmd b/docs/source/tutorials/model_specifying.qmd index 05d89e6a..02f2d1c7 100644 --- a/docs/source/tutorials/model_specifying.qmd +++ b/docs/source/tutorials/model_specifying.qmd @@ -54,8 +54,8 @@ We review here how to create the design matrix $X$ (i.e. create the `exog` data Let's explore real count data from the microcosm dataset [@microcosm], introduced in the [NCBI -BioProject](https://www.ncbi.nlm.nih.gov/bioproject/?term=PRJNA875059) and -provided by the `load_microcsom` function in the package. +BioProject PRJNA875059](https://www.ncbi.nlm.nih.gov/bioproject/?term=PRJNA875059) and +provided by the `load_microcosm` function in the package. This dataset features microbiota members sampled from various body sites of dairy cows throughout their lactation period. The data includes response count variables (`endog`) and explanatory variables: @@ -67,6 +67,8 @@ The `1_hot` variables are one-hot encoded representations of the corresponding categorical variables. + + ## Data importation ```{python} @@ -131,12 +133,15 @@ print('names:', pln.column_names_exog) Note that the left-hand side (`endog`) must always match the key for the count matrix in your data dictionary. -The offset is computed automatically unless explicitly provided using the -`offsets` key in the data dictionary. -By default, it is set to zero unless you specify +By default, the `offsets` are set to zero unless you specify `compute_offsets_method="logsum"`, in which case the log of the row sums of the -counts is used. +counts is used: +```{python} +pln = Pln.from_formula("endog ~ 1 + site", data=micro, compute_offsets_method="logsum") +print('offsets:', pln.offsets) +``` +If the `offsets` key is in the data dictionary, then they are set to `data["offsets"]` automatically: ```{python} import numpy as np tmp_micro = load_microcosm() @@ -145,8 +150,6 @@ tmp_micro["offsets"] = np.log(tmp_micro["endog"] + 2) print("Dumb offsets:", Pln.from_formula("endog ~ 1", data = tmp_micro).offsets) ``` - - ## Specifying arrays diff --git a/docs/source/tutorials/network_analysis.html b/docs/source/tutorials/network_analysis.html index 5c0153f0..29d5862a 100644 --- a/docs/source/tutorials/network_analysis.html +++ b/docs/source/tutorials/network_analysis.html @@ -2,13 +2,13 @@ - + -pyPLNmodels - Network inference 🌐 +Network inference 🌐 – pyPLNmodels - + - - + - + + + - +
        +

        1 Introduction

        -

        The PlnNetwork model in the pyPLNmodels package is designed for sparse network inference from multivariate count data, using a penalized precision matrix. It allows for network structure learning between variables, such as genes in single-cell RNA sequencing datasets.

        +

        The PlnNetwork model in the pyPLNmodels package is designed for sparse network inference from multivariate count data, using a penalized precision matrix. It allows for network structure learning between variables, such as genes in single-cell RNA sequencing datasets. Moreover, it can induce sparsity on the coefficients of the regression matrix.

        This tutorial demonstrates how to:

        • Initialize a PlnNetwork (documentation) model from count data or using a formula interface

        • Fit the model with regularization on the precision matrix

        • Visualize inferred network structures and latent variables

        • Gives tools for selecting the optimal penalty

        • +
        • Induce sparsity on the regression matrix

        1.1 Statistical background

        @@ -4797,7 +4291,7 @@

        <

        1.2 Data importation

        For visualization purposes, we use only 20 variables (i.e. genes).

        -
        +
        from pyPLNmodels import load_scrna
         data = load_scrna(dim = 20)
         endog = data["endog"]
        @@ -4810,65 +4304,89 @@

        2 Model initialization and fitting

        A penalty needs to be specified for the model. The greater the penalty, the sparser the precision matrix will be and the lower the number of linked variables. We use a value of \(200\) for now.

        -
        +
        from pyPLNmodels import PlnNetwork
         net = PlnNetwork(endog, penalty=200).fit()
        Setting the offsets to zero.
        -Fitting a PlnNetwork model with  penalty 200.
        +Fitting a PlnNetwork model with penalty 200 on the precision matrix and lasso  penalty 0 on the regression coefficients.
         Intializing parameters ...
        -Initialization finished.
        -Maximum number of iterations (400)  reached in 6.4 seconds.
        +Initialization finished.
        +
        +
        +
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  18%|█▊        | 70/400 [00:00<00:00, 691.93it/s]Upper bound on the fitting time:  35%|███▌      | 140/400 [00:00<00:00, 682.99it/s]Upper bound on the fitting time:  52%|█████▎    | 210/400 [00:00<00:00, 688.57it/s]Upper bound on the fitting time:  70%|███████   | 280/400 [00:00<00:00, 692.55it/s]Upper bound on the fitting time:  88%|████████▊ | 351/400 [00:00<00:00, 697.08it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 694.52it/s]
        +
        +
        +
        Maximum number of iterations (400)  reached in 1.4 seconds.
         Last  criterion = 5.4e-06 . Required tolerance = 1e-06
        -
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   3%|▎         | 12/400 [00:00<00:03, 116.59it/s]Upper bound on the fitting time:   6%|▌         | 24/400 [00:00<00:03, 116.57it/s]Upper bound on the fitting time:   9%|▉         | 36/400 [00:00<00:03, 113.43it/s]Upper bound on the fitting time:  12%|█▏        | 48/400 [00:00<00:03, 115.91it/s]Upper bound on the fitting time:  15%|█▌        | 60/400 [00:00<00:02, 116.04it/s]Upper bound on the fitting time:  18%|█▊        | 72/400 [00:00<00:02, 116.01it/s]Upper bound on the fitting time:  21%|██        | 84/400 [00:00<00:02, 115.28it/s]Upper bound on the fitting time:  24%|██▍       | 96/400 [00:00<00:02, 115.73it/s]Upper bound on the fitting time:  27%|██▋       | 108/400 [00:00<00:02, 116.31it/s]Upper bound on the fitting time:  30%|███       | 120/400 [00:01<00:02, 117.37it/s]Upper bound on the fitting time:  33%|███▎      | 132/400 [00:01<00:02, 114.87it/s]Upper bound on the fitting time:  36%|███▌      | 144/400 [00:01<00:02, 114.69it/s]Upper bound on the fitting time:  39%|███▉      | 156/400 [00:01<00:02, 114.92it/s]Upper bound on the fitting time:  42%|████▏     | 168/400 [00:01<00:02, 113.17it/s]Upper bound on the fitting time:  45%|████▌     | 180/400 [00:01<00:01, 111.13it/s]Upper bound on the fitting time:  48%|████▊     | 193/400 [00:01<00:01, 114.34it/s]Upper bound on the fitting time:  51%|█████▏    | 205/400 [00:01<00:01, 115.95it/s]Upper bound on the fitting time:  54%|█████▍    | 217/400 [00:01<00:01, 115.05it/s]Upper bound on the fitting time:  57%|█████▋    | 229/400 [00:01<00:01, 116.04it/s]Upper bound on the fitting time:  60%|██████    | 241/400 [00:02<00:01, 116.80it/s]Upper bound on the fitting time:  63%|██████▎   | 253/400 [00:02<00:01, 116.63it/s]Upper bound on the fitting time:  66%|██████▋   | 266/400 [00:02<00:01, 117.86it/s]Upper bound on the fitting time:  70%|██████▉   | 278/400 [00:02<00:01, 117.10it/s]Upper bound on the fitting time:  72%|███████▎  | 290/400 [00:02<00:00, 115.55it/s]Upper bound on the fitting time:  76%|███████▌  | 302/400 [00:02<00:00, 114.02it/s]Upper bound on the fitting time:  78%|███████▊  | 314/400 [00:02<00:00, 114.17it/s]Upper bound on the fitting time:  82%|████████▏ | 326/400 [00:02<00:00, 115.37it/s]Upper bound on the fitting time:  85%|████████▍ | 339/400 [00:02<00:00, 117.19it/s]Upper bound on the fitting time:  88%|████████▊ | 351/400 [00:03<00:00, 114.98it/s]Upper bound on the fitting time:  91%|█████████ | 363/400 [00:03<00:00, 116.16it/s]Upper bound on the fitting time:  94%|█████████▍| 375/400 [00:03<00:00, 117.26it/s]Upper bound on the fitting time:  97%|█████████▋| 387/400 [00:03<00:00, 116.69it/s]Upper bound on the fitting time: 100%|█████████▉| 399/400 [00:03<00:00, 115.31it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:03<00:00, 115.41it/s]
        +

        3 Network visualization

        -
        -
        net.viz_network()
        +
        +
        net.viz_network()
        -

        +
        +
        +

        +
        +

        The network can be accessed as a dictionnary through the network attribute:

        -
        -
        network = net.network
        -print(network)
        -print("Genes associated with APOE: ", network["APOE"])
        +
        +
        network = net.network
        +print(network)
        +print("Genes associated with APOE: ", network["APOE"])
        -
        {'FTL': ['FTH1', 'SPP1', 'APOE', 'B2M', 'ACTB', 'HLA-DRA', 'APOC1', 'MT-CO1', 'TMSB10', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'LYZ'], 'MALAT1': ['HLA-DRA'], 'FTH1': ['FTL', 'TMSB4X', 'SPP1', 'APOE', 'ACTB', 'HLA-DRA', 'APOC1', 'TMSB10', 'EEF1A1', 'HLA-DRB1', 'LYZ', 'RPLP1'], 'TMSB4X': ['FTH1', 'HLA-DRA', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'MT-CO2', 'LYZ', 'RPLP1'], 'CD74': ['SPP1', 'APOE', 'B2M', 'ACTB', 'HLA-DRA', 'APOC1', 'MT-CO1', 'TMSB10', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'LYZ'], 'SPP1': ['FTL', 'FTH1', 'CD74', 'APOE', 'HLA-DRA', 'APOC1', 'LYZ'], 'APOE': ['FTL', 'FTH1', 'CD74', 'SPP1', 'HLA-DRA', 'APOC1', 'MT-CO1', 'TMSB10', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'LYZ'], 'B2M': ['FTL', 'CD74', 'HLA-DRA', 'TMSB10', 'HLA-DRB1', 'RPLP1'], 'ACTB': ['FTL', 'FTH1', 'CD74', 'HLA-DRA', 'MT-CO1', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'MT-CO2', 'RPLP1'], 'HLA-DRA': ['FTL', 'MALAT1', 'FTH1', 'TMSB4X', 'CD74', 'SPP1', 'APOE', 'B2M', 'ACTB', 'APOC1', 'MT-CO1', 'TMSB10', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'MT-CO2', 'LYZ', 'RPLP1'], 'APOC1': ['FTL', 'FTH1', 'CD74', 'SPP1', 'APOE', 'HLA-DRA', 'MT-CO1', 'TMSB10', 'HLA-DPB1', 'LYZ'], 'MT-CO1': ['FTL', 'CD74', 'APOE', 'ACTB', 'HLA-DRA', 'APOC1', 'TMSB10', 'EEF1A1', 'LYZ'], 'TMSB10': ['FTL', 'FTH1', 'CD74', 'APOE', 'B2M', 'HLA-DRA', 'APOC1', 'MT-CO1', 'EEF1A1', 'HLA-DRB1', 'LYZ', 'RPLP1'], 'EEF1A1': ['FTH1', 'TMSB4X', 'APOE', 'ACTB', 'HLA-DRA', 'MT-CO1', 'TMSB10', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'RPLP1'], 'HLA-DRB1': ['FTL', 'FTH1', 'TMSB4X', 'CD74', 'APOE', 'B2M', 'ACTB', 'HLA-DRA', 'TMSB10', 'EEF1A1', 'HLA-DPA1', 'HLA-DPB1', 'LYZ'], 'HLA-DPA1': ['FTL', 'TMSB4X', 'CD74', 'APOE', 'ACTB', 'HLA-DRA', 'EEF1A1', 'HLA-DRB1', 'HLA-DPB1', 'MT-CO2', 'LYZ'], 'HLA-DPB1': ['FTL', 'CD74', 'APOE', 'HLA-DRA', 'APOC1', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'MT-CO2', 'LYZ'], 'MT-CO2': ['TMSB4X', 'ACTB', 'HLA-DRA', 'HLA-DPA1', 'HLA-DPB1'], 'LYZ': ['FTL', 'FTH1', 'TMSB4X', 'CD74', 'SPP1', 'APOE', 'HLA-DRA', 'APOC1', 'MT-CO1', 'TMSB10', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'RPLP1'], 'RPLP1': ['FTH1', 'TMSB4X', 'B2M', 'ACTB', 'HLA-DRA', 'TMSB10', 'EEF1A1', 'LYZ']}
        -Genes associated with APOE:  ['FTL', 'FTH1', 'CD74', 'SPP1', 'HLA-DRA', 'APOC1', 'MT-CO1', 'TMSB10', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'LYZ']
        +
        {'FTL': ['FTH1', 'SPP1', 'APOE', 'B2M', 'HLA-DRA', 'APOC1', 'TMSB10', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'LYZ'], 'MALAT1': ['APOE', 'HLA-DRA', 'APOC1', 'EEF1A1'], 'FTH1': ['FTL', 'TMSB4X', 'APOE', 'B2M', 'ACTB', 'HLA-DRA', 'APOC1', 'TMSB10', 'EEF1A1', 'HLA-DPA1', 'HLA-DPB1', 'LYZ', 'RPLP1'], 'TMSB4X': ['FTH1', 'ACTB', 'HLA-DRA', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'MT-CO2', 'LYZ', 'RPLP1'], 'CD74': ['SPP1', 'APOE', 'ACTB', 'HLA-DRA', 'MT-CO1', 'TMSB10', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'LYZ', 'RPLP1'], 'SPP1': ['FTL', 'CD74', 'APOE', 'HLA-DRA', 'APOC1', 'LYZ'], 'APOE': ['FTL', 'MALAT1', 'FTH1', 'CD74', 'SPP1', 'HLA-DRA', 'APOC1', 'TMSB10', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'LYZ'], 'B2M': ['FTL', 'FTH1', 'HLA-DRA', 'TMSB10', 'HLA-DRB1'], 'ACTB': ['FTH1', 'TMSB4X', 'CD74', 'HLA-DRA', 'MT-CO1', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'RPLP1'], 'HLA-DRA': ['FTL', 'MALAT1', 'FTH1', 'TMSB4X', 'CD74', 'SPP1', 'APOE', 'B2M', 'ACTB', 'APOC1', 'MT-CO1', 'TMSB10', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'MT-CO2', 'LYZ', 'RPLP1'], 'APOC1': ['FTL', 'MALAT1', 'FTH1', 'SPP1', 'APOE', 'HLA-DRA', 'MT-CO1', 'HLA-DRB1', 'HLA-DPB1', 'LYZ'], 'MT-CO1': ['CD74', 'ACTB', 'HLA-DRA', 'APOC1', 'TMSB10', 'EEF1A1', 'HLA-DPB1', 'LYZ'], 'TMSB10': ['FTL', 'FTH1', 'CD74', 'APOE', 'B2M', 'HLA-DRA', 'MT-CO1', 'EEF1A1', 'HLA-DRB1', 'HLA-DPB1', 'LYZ', 'RPLP1'], 'EEF1A1': ['MALAT1', 'FTH1', 'TMSB4X', 'APOE', 'ACTB', 'HLA-DRA', 'MT-CO1', 'TMSB10', 'HLA-DPA1', 'HLA-DPB1', 'RPLP1'], 'HLA-DRB1': ['FTL', 'TMSB4X', 'CD74', 'APOE', 'B2M', 'ACTB', 'HLA-DRA', 'APOC1', 'TMSB10', 'HLA-DPA1', 'HLA-DPB1', 'LYZ'], 'HLA-DPA1': ['FTL', 'FTH1', 'TMSB4X', 'CD74', 'APOE', 'ACTB', 'HLA-DRA', 'EEF1A1', 'HLA-DRB1', 'HLA-DPB1', 'MT-CO2', 'LYZ'], 'HLA-DPB1': ['FTL', 'FTH1', 'CD74', 'APOE', 'HLA-DRA', 'APOC1', 'MT-CO1', 'TMSB10', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'LYZ', 'RPLP1'], 'MT-CO2': ['TMSB4X', 'HLA-DRA', 'HLA-DPA1'], 'LYZ': ['FTL', 'FTH1', 'TMSB4X', 'CD74', 'SPP1', 'APOE', 'HLA-DRA', 'APOC1', 'MT-CO1', 'TMSB10', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'RPLP1'], 'RPLP1': ['FTH1', 'TMSB4X', 'CD74', 'ACTB', 'HLA-DRA', 'TMSB10', 'EEF1A1', 'HLA-DPB1', 'LYZ']}
        +Genes associated with APOE:  ['FTL', 'MALAT1', 'FTH1', 'CD74', 'SPP1', 'HLA-DRA', 'APOC1', 'TMSB10', 'EEF1A1', 'HLA-DRB1', 'HLA-DPA1', 'HLA-DPB1', 'LYZ']

        4 Use PlnNetworkCollection for selecting the optimal penalty

        The penalty is an hyperparameter that needs to be tuned. To explore multiple penalty solutions, use PlnNetworkCollection:

        -
        -
        from pyPLNmodels import PlnNetworkCollection
        -collection = PlnNetworkCollection(endog, penalties=[0.1,10,1000]).fit()
        +
        +
        from pyPLNmodels import PlnNetworkCollection
        +collection = PlnNetworkCollection(endog, penalties=[0.1,10,1000]).fit()
        Setting the offsets to zero.
         Adjusting 3 PlnNetwork models.
         
        -Fitting a PlnNetwork model with  penalty 0.1.
        +Fitting a PlnNetwork model with penalty 0.1 on the precision matrix and lasso  penalty 0 on the regression coefficients.
         Intializing parameters ...
        -Initialization finished.
        -Maximum number of iterations (400)  reached in 3.5 seconds.
        +Initialization finished.
        +
        +
        +
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  18%|█▊        | 71/400 [00:00<00:00, 703.92it/s]Upper bound on the fitting time:  36%|███▌      | 142/400 [00:00<00:00, 706.76it/s]Upper bound on the fitting time:  53%|█████▎    | 213/400 [00:00<00:00, 708.08it/s]Upper bound on the fitting time:  71%|███████   | 284/400 [00:00<00:00, 672.22it/s]Upper bound on the fitting time:  88%|████████▊ | 352/400 [00:00<00:00, 649.95it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 667.32it/s]
        +
        +
        +
        Maximum number of iterations (400)  reached in 0.6 seconds.
         Last  criterion = 5.4e-06 . Required tolerance = 1e-06
        -Fitting a PlnNetwork model with  penalty 10.
        +Fitting a PlnNetwork model with penalty 10 on the precision matrix and lasso  penalty 0 on the regression coefficients.
         Intializing parameters ...
        -Initialization finished.
        -Maximum number of iterations (400)  reached in 3.6 seconds.
        +Initialization finished.
        +
        +
        +
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  16%|█▋        | 66/400 [00:00<00:00, 657.66it/s]Upper bound on the fitting time:  33%|███▎      | 133/400 [00:00<00:00, 660.60it/s]Upper bound on the fitting time:  50%|█████     | 200/400 [00:00<00:00, 630.42it/s]Upper bound on the fitting time:  66%|██████▋   | 266/400 [00:00<00:00, 640.46it/s]Upper bound on the fitting time:  83%|████████▎ | 333/400 [00:00<00:00, 649.95it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 654.62it/s]
        +
        +
        +
        Maximum number of iterations (400)  reached in 0.6 seconds.
         Last  criterion = 5.4e-06 . Required tolerance = 1e-06
        -Fitting a PlnNetwork model with  penalty 1000.
        +Fitting a PlnNetwork model with penalty 1000 on the precision matrix and lasso  penalty 0 on the regression coefficients.
         Intializing parameters ...
        -Initialization finished.
        -Maximum number of iterations (400)  reached in 3.5 seconds.
        +Initialization finished.
        +
        +
        +
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  17%|█▋        | 68/400 [00:00<00:00, 676.81it/s]Upper bound on the fitting time:  34%|███▍      | 136/400 [00:00<00:00, 673.03it/s]Upper bound on the fitting time:  51%|█████     | 204/400 [00:00<00:00, 659.33it/s]Upper bound on the fitting time:  68%|██████▊   | 272/400 [00:00<00:00, 665.27it/s]Upper bound on the fitting time:  85%|████████▌ | 341/400 [00:00<00:00, 672.94it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 671.85it/s]
        +
        +
        +
        Maximum number of iterations (400)  reached in 0.6 seconds.
         Last  criterion = 5.4e-06 . Required tolerance = 1e-06
         ======================================================================
         
        @@ -4880,17 +4398,19 @@ 

        4 Use PlnNe

        -
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   3%|▎         | 13/400 [00:00<00:03, 127.94it/s]Upper bound on the fitting time:   6%|▋         | 26/400 [00:00<00:03, 117.24it/s]Upper bound on the fitting time:  10%|▉         | 38/400 [00:00<00:03, 116.78it/s]Upper bound on the fitting time:  12%|█▎        | 50/400 [00:00<00:02, 117.88it/s]Upper bound on the fitting time:  16%|█▌        | 62/400 [00:00<00:02, 118.51it/s]Upper bound on the fitting time:  19%|█▉        | 75/400 [00:00<00:02, 119.49it/s]Upper bound on the fitting time:  22%|██▏       | 88/400 [00:00<00:02, 120.32it/s]Upper bound on the fitting time:  25%|██▌       | 101/400 [00:00<00:02, 118.44it/s]Upper bound on the fitting time:  28%|██▊       | 113/400 [00:00<00:02, 118.78it/s]Upper bound on the fitting time:  32%|███▏      | 126/400 [00:01<00:02, 118.69it/s]Upper bound on the fitting time:  35%|███▍      | 139/400 [00:01<00:02, 119.98it/s]Upper bound on the fitting time:  38%|███▊      | 152/400 [00:01<00:02, 119.94it/s]Upper bound on the fitting time:  41%|████      | 164/400 [00:01<00:02, 117.19it/s]Upper bound on the fitting time:  44%|████▍     | 176/400 [00:01<00:01, 117.39it/s]Upper bound on the fitting time:  47%|████▋     | 188/400 [00:01<00:01, 118.01it/s]Upper bound on the fitting time:  50%|█████     | 200/400 [00:01<00:01, 117.87it/s]Upper bound on the fitting time:  53%|█████▎    | 212/400 [00:01<00:01, 118.08it/s]Upper bound on the fitting time:  56%|█████▋    | 225/400 [00:01<00:01, 119.19it/s]Upper bound on the fitting time:  59%|█████▉    | 237/400 [00:02<00:01, 116.58it/s]Upper bound on the fitting time:  62%|██████▏   | 249/400 [00:02<00:01, 116.48it/s]Upper bound on the fitting time:  65%|██████▌   | 261/400 [00:02<00:01, 116.88it/s]Upper bound on the fitting time:  68%|██████▊   | 273/400 [00:02<00:01, 116.25it/s]Upper bound on the fitting time:  71%|███████▏  | 285/400 [00:02<00:00, 117.01it/s]Upper bound on the fitting time:  74%|███████▍  | 297/400 [00:02<00:00, 117.22it/s]Upper bound on the fitting time:  77%|███████▋  | 309/400 [00:02<00:00, 115.31it/s]Upper bound on the fitting time:  80%|████████  | 322/400 [00:02<00:00, 116.97it/s]Upper bound on the fitting time:  84%|████████▎ | 334/400 [00:02<00:00, 117.59it/s]Upper bound on the fitting time:  86%|████████▋ | 346/400 [00:02<00:00, 118.17it/s]Upper bound on the fitting time:  90%|████████▉ | 358/400 [00:03<00:00, 117.88it/s]Upper bound on the fitting time:  92%|█████████▎| 370/400 [00:03<00:00, 118.12it/s]Upper bound on the fitting time:  96%|█████████▌| 382/400 [00:03<00:00, 113.44it/s]Upper bound on the fitting time:  98%|█████████▊| 394/400 [00:03<00:00, 100.98it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:03<00:00, 115.18it/s]
        -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 8/400 [00:00<00:05, 74.48it/s]Upper bound on the fitting time:   4%|▍         | 16/400 [00:00<00:05, 72.80it/s]Upper bound on the fitting time:   6%|▌         | 24/400 [00:00<00:04, 75.31it/s]Upper bound on the fitting time:   8%|▊         | 34/400 [00:00<00:04, 82.78it/s]Upper bound on the fitting time:  11%|█         | 44/400 [00:00<00:04, 88.45it/s]Upper bound on the fitting time:  14%|█▍        | 55/400 [00:00<00:03, 94.60it/s]Upper bound on the fitting time:  17%|█▋        | 67/400 [00:00<00:03, 102.62it/s]Upper bound on the fitting time:  20%|█▉        | 79/400 [00:00<00:02, 107.20it/s]Upper bound on the fitting time:  23%|██▎       | 91/400 [00:00<00:02, 108.80it/s]Upper bound on the fitting time:  26%|██▌       | 103/400 [00:01<00:02, 110.81it/s]Upper bound on the fitting time:  29%|██▉       | 116/400 [00:01<00:02, 114.16it/s]Upper bound on the fitting time:  32%|███▏      | 129/400 [00:01<00:02, 116.13it/s]Upper bound on the fitting time:  36%|███▌      | 142/400 [00:01<00:02, 118.19it/s]Upper bound on the fitting time:  39%|███▉      | 155/400 [00:01<00:02, 118.90it/s]Upper bound on the fitting time:  42%|████▏     | 167/400 [00:01<00:01, 117.54it/s]Upper bound on the fitting time:  45%|████▍     | 179/400 [00:01<00:01, 117.67it/s]Upper bound on the fitting time:  48%|████▊     | 192/400 [00:01<00:01, 118.37it/s]Upper bound on the fitting time:  51%|█████     | 204/400 [00:01<00:01, 116.86it/s]Upper bound on the fitting time:  54%|█████▍    | 216/400 [00:01<00:01, 117.02it/s]Upper bound on the fitting time:  57%|█████▋    | 228/400 [00:02<00:01, 117.00it/s]Upper bound on the fitting time:  60%|██████    | 240/400 [00:02<00:01, 117.58it/s]Upper bound on the fitting time:  63%|██████▎   | 253/400 [00:02<00:01, 118.36it/s]Upper bound on the fitting time:  66%|██████▋   | 266/400 [00:02<00:01, 119.48it/s]Upper bound on the fitting time:  70%|██████▉   | 278/400 [00:02<00:01, 119.60it/s]Upper bound on the fitting time:  72%|███████▎  | 290/400 [00:02<00:00, 119.62it/s]Upper bound on the fitting time:  76%|███████▌  | 302/400 [00:02<00:00, 117.82it/s]Upper bound on the fitting time:  78%|███████▊  | 314/400 [00:02<00:00, 117.69it/s]Upper bound on the fitting time:  82%|████████▏ | 326/400 [00:02<00:00, 118.16it/s]Upper bound on the fitting time:  85%|████████▍ | 339/400 [00:03<00:00, 119.42it/s]Upper bound on the fitting time:  88%|████████▊ | 351/400 [00:03<00:00, 113.86it/s]Upper bound on the fitting time:  91%|█████████ | 363/400 [00:03<00:00, 115.07it/s]Upper bound on the fitting time:  94%|█████████▍| 375/400 [00:03<00:00, 114.35it/s]Upper bound on the fitting time:  97%|█████████▋| 387/400 [00:03<00:00, 115.63it/s]Upper bound on the fitting time: 100%|█████████▉| 399/400 [00:03<00:00, 116.86it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:03<00:00, 112.12it/s]
        -Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   3%|▎         | 12/400 [00:00<00:03, 118.97it/s]Upper bound on the fitting time:   6%|▌         | 24/400 [00:00<00:03, 102.87it/s]Upper bound on the fitting time:   9%|▉         | 35/400 [00:00<00:03, 104.60it/s]Upper bound on the fitting time:  12%|█▏        | 47/400 [00:00<00:03, 108.85it/s]Upper bound on the fitting time:  15%|█▍        | 59/400 [00:00<00:03, 111.82it/s]Upper bound on the fitting time:  18%|█▊        | 71/400 [00:00<00:02, 114.00it/s]Upper bound on the fitting time:  21%|██        | 83/400 [00:00<00:02, 114.80it/s]Upper bound on the fitting time:  24%|██▍       | 95/400 [00:00<00:02, 115.25it/s]Upper bound on the fitting time:  27%|██▋       | 107/400 [00:00<00:02, 112.24it/s]Upper bound on the fitting time:  30%|██▉       | 119/400 [00:01<00:02, 112.11it/s]Upper bound on the fitting time:  33%|███▎      | 131/400 [00:01<00:02, 113.37it/s]Upper bound on the fitting time:  36%|███▌      | 143/400 [00:01<00:02, 113.19it/s]Upper bound on the fitting time:  39%|███▉      | 155/400 [00:01<00:02, 114.86it/s]Upper bound on the fitting time:  42%|████▏     | 168/400 [00:01<00:01, 117.22it/s]Upper bound on the fitting time:  45%|████▌     | 180/400 [00:01<00:01, 116.24it/s]Upper bound on the fitting time:  48%|████▊     | 192/400 [00:01<00:01, 116.81it/s]Upper bound on the fitting time:  51%|█████▏    | 205/400 [00:01<00:01, 117.82it/s]Upper bound on the fitting time:  55%|█████▍    | 218/400 [00:01<00:01, 119.37it/s]Upper bound on the fitting time:  57%|█████▊    | 230/400 [00:02<00:01, 119.36it/s]Upper bound on the fitting time:  60%|██████    | 242/400 [00:02<00:01, 118.99it/s]Upper bound on the fitting time:  64%|██████▎   | 254/400 [00:02<00:01, 116.78it/s]Upper bound on the fitting time:  66%|██████▋   | 266/400 [00:02<00:01, 117.40it/s]Upper bound on the fitting time:  70%|██████▉   | 278/400 [00:02<00:01, 117.37it/s]Upper bound on the fitting time:  72%|███████▎  | 290/400 [00:02<00:00, 117.41it/s]Upper bound on the fitting time:  76%|███████▌  | 302/400 [00:02<00:00, 117.88it/s]Upper bound on the fitting time:  78%|███████▊  | 314/400 [00:02<00:00, 116.76it/s]Upper bound on the fitting time:  82%|████████▏ | 326/400 [00:02<00:00, 116.89it/s]Upper bound on the fitting time:  84%|████████▍ | 338/400 [00:02<00:00, 117.80it/s]Upper bound on the fitting time:  88%|████████▊ | 350/400 [00:03<00:00, 116.88it/s]Upper bound on the fitting time:  90%|█████████ | 362/400 [00:03<00:00, 114.64it/s]Upper bound on the fitting time:  94%|█████████▎| 374/400 [00:03<00:00, 115.93it/s]Upper bound on the fitting time:  96%|█████████▋| 386/400 [00:03<00:00, 115.17it/s]Upper bound on the fitting time: 100%|█████████▉| 398/400 [00:03<00:00, 115.45it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:03<00:00, 115.29it/s]
        +

        4.1 Evaluate model quality

        -
        -
        collection.show(figsize=(8, 8))
        +
        +
        collection.show(figsize=(8, 8))
        -

        +
        +
        +

        +
        +

        This displays the BIC, AIC and log-likelihood criteria for each model, helping to identify the most suitable one. Additionally, the number of links (i.e., non-zero elements in the precision matrix) is provided. You may consider using the ELBOW method to select the optimal model based on the number of links.

        @@ -4898,14 +4418,14 @@

        <

        4.2 Selecting the best model

        The best model can be chosen according to the BIC or AIC:

        -
        -
        best_net = collection.best_model("BIC") # Could be also AIC.
        -print(best_net)
        +
        +
        best_net = collection.best_model("BIC") # Could be also AIC.
        +print(best_net)
        -
        A multivariate PlnNetwork with  penalty 0.1.
        +
        A multivariate PlnNetwork with penalty 0.1 on the precision matrix and lasso  penalty 0 on the regression coefficients.
         ======================================================================
              Loglike   Dimension    Nb param         BIC         AIC         ICL    Nb edges
        -   -22940.33          20         229  23626.3528  23169.3301    10467.28         189
        +   -22940.33          20         227  23620.3633   23167.332    10461.07         187
         
         ======================================================================
         * Useful attributes
        @@ -4919,13 +4439,13 @@ 

        One can also access each individual model in the collection, using the penalty as a key:

        -
        -
        print(collection[10])
        +
        +
        print(collection[10])
        -
        A multivariate PlnNetwork with  penalty 10.
        +
        A multivariate PlnNetwork with penalty 10 on the precision matrix and lasso  penalty 0 on the regression coefficients.
         ======================================================================
              Loglike   Dimension    Nb param         BIC         AIC         ICL    Nb edges
        -   -23560.48          20         174  24081.7398  23734.4824    10591.98         134
        +   -23557.72          20         172  24072.9867  23729.7207    10589.69         132
         
         ======================================================================
         * Useful attributes
        @@ -4939,17 +4459,72 @@ 

        and loop through the collection:

        -
        -
        for net in collection.values():
        -    print(net)
        +
        +
        for net in collection.values():
        +    print(net)
        +
        +
        +
        +

        4.3 Inducing sparsity on the regression matrix

        +

        By default, PlnNetwork does not impose any sparsity on the regression matrix. To induce sparsity, set the penalty_coef parameter to a positive float when initializing the model:

        +
        +
        net = PlnNetwork.from_formula("endog ~ 1 + labels", data = data,  penalty_coef=20, penalty=200).fit()
        +net.show()
        +
        +
        Setting the offsets to zero.
        +Fitting a PlnNetwork model with penalty 200 on the precision matrix and lasso  penalty 20 on the regression coefficients.
        +Intializing parameters ...
        +Initialization finished.
        +
        +
        +
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  17%|█▋        | 68/400 [00:00<00:00, 672.44it/s]Upper bound on the fitting time:  34%|███▍      | 136/400 [00:00<00:00, 673.39it/s]Upper bound on the fitting time:  51%|█████     | 204/400 [00:00<00:00, 675.82it/s]Upper bound on the fitting time:  68%|██████▊   | 272/400 [00:00<00:00, 656.90it/s]Upper bound on the fitting time:  85%|████████▌ | 340/400 [00:00<00:00, 662.94it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 668.17it/s]
        +
        +
        +
        Maximum number of iterations (400)  reached in 0.6 seconds.
        +Last  criterion = 5.4e-06 . Required tolerance = 1e-06
        +
        +
        +
        +
        +

        +
        +
        +
        +
        +

        The default sparsity is the lasso penalty, but you can also use the group_lasso and sparse_group_lasso penalties. This can be done by specifying the penalty_coef_type parameter when initializing the model:

        +
        +
        net = PlnNetwork.from_formula("endog ~ 1 + labels", data = data, penalty_coef_type="group_lasso",  penalty_coef=50, penalty=200).fit()
        +net.show()
        +
        +
        Setting the offsets to zero.
        +Fitting a PlnNetwork model with penalty 200 on the precision matrix and group_lasso  penalty 50 on the regression coefficients.
        +Intializing parameters ...
        +Initialization finished.
        +
        +
        +
        Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  16%|█▌        | 64/400 [00:00<00:00, 631.56it/s]Upper bound on the fitting time:  33%|███▎      | 132/400 [00:00<00:00, 657.47it/s]Upper bound on the fitting time:  50%|█████     | 201/400 [00:00<00:00, 670.88it/s]Upper bound on the fitting time:  68%|██████▊   | 270/400 [00:00<00:00, 677.57it/s]Upper bound on the fitting time:  85%|████████▍ | 339/400 [00:00<00:00, 680.24it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 675.01it/s]
        +
        +
        Maximum number of iterations (400)  reached in 0.6 seconds.
        +Last  criterion = 5.39e-06 . Required tolerance = 1e-06
        +
        +
        +
        +
        +

        +
        +
        +
        +
        +

        The coefficients of the regression matrix are therefore sparse.

        +

        -

        References

        +

        References

        Batardière, Bastien, Joon Kwon, and Julien Chiquet. 2024. “pyPLNmodels: A Python Package to Analyze Multivariate High-Dimensional Count Data.” Journal of Open Source Software.
        @@ -4958,240 +4533,407 @@

        + }); +
        + diff --git a/docs/source/tutorials/network_analysis.qmd b/docs/source/tutorials/network_analysis.qmd index c7bd53a4..0bd6f80b 100644 --- a/docs/source/tutorials/network_analysis.qmd +++ b/docs/source/tutorials/network_analysis.qmd @@ -21,7 +21,8 @@ nocite: | The `PlnNetwork` model in the pyPLNmodels package is designed for sparse network inference from multivariate count data, using a penalized precision matrix. It allows for network structure learning between -variables, such as genes in single-cell RNA sequencing datasets. +variables, such as genes in single-cell RNA sequencing datasets. Moreover, it +can induce sparsity on the coefficients of the regression matrix. This tutorial demonstrates how to: @@ -33,6 +34,8 @@ This tutorial demonstrates how to: - Gives tools for selecting the optimal penalty +- Induce sparsity on the regression matrix + ## Statistical background Compared to the `Pln` model, a constraint is imposed on the precision matrix @@ -125,3 +128,27 @@ and loop through the collection: for net in collection.values(): print(net) ``` + + +## Inducing sparsity on the regression matrix + + +By default, `PlnNetwork` does not impose any sparsity on the regression matrix. To +induce sparsity, set the `penalty_coef` parameter to a positive float when initializing the model: + +```{python} +net = PlnNetwork.from_formula("endog ~ 1 + labels", data = data, penalty_coef=20, penalty=200).fit() +net.show() +``` + +The default sparsity is the `lasso` penalty, but you can also use the +`group_lasso` and `sparse_group_lasso` penalties. This can be done by +specifying the `penalty_coef_type` parameter when initializing the model: + +```{python} +net = PlnNetwork.from_formula("endog ~ 1 + labels", data = data, penalty_coef_type="group_lasso", penalty_coef=50, penalty=200).fit() +net.show() +``` + + +The coefficients of the regression matrix are therefore sparse. diff --git a/docs/source/tutorials/references.html b/docs/source/tutorials/references.html index b617d0ac..c529fc95 100644 --- a/docs/source/tutorials/references.html +++ b/docs/source/tutorials/references.html @@ -2,13 +2,13 @@ - + -pyPLNmodels - References 📘 +References 📘 – pyPLNmodels - + - - + - + + + - +
        +
        +

        1 References

        +

        Please cite the following works when using the package.

        -

        1 References

        +

        References

        Aitchison, John, and CH Ho. 1989. “The Multivariate Poisson-Log Normal Distribution.” Biometrika 76 (4): 643–53.
        @@ -4757,240 +4250,407 @@

        References 📘

        + }); +
        + diff --git a/docs/source/tutorials/zero_inflation.html b/docs/source/tutorials/zero_inflation.html index 754db9a0..edbc8769 100644 --- a/docs/source/tutorials/zero_inflation.html +++ b/docs/source/tutorials/zero_inflation.html @@ -2,13 +2,13 @@ - + -pyPLNmodels - Zero-inflation 0️⃣ +Zero-inflation 0️⃣ – pyPLNmodels - + - - + - + + + - +
        +

        1 Introduction

        This tutorial demonstrates how to analyze zero-inflated count data using the pyPLNmodels package. Traditional models like Zero-Inflated Poisson Regression (ZIP) may fail to capture important features, such as correlations between variables, when dealing with complex datasets.

        @@ -4801,7 +4293,7 @@

        <
      • \(Y_{ij}\) (endog): the \(j\)-th count for the \(i\)-th observation
      • \(X_i\) (exog): covariates for the \(i\)-th observation (if available, defaults to 1)
      • \(X^0_i\) (exog_inflation): covariates for the \(i\)-th observation specific to the inflation component (if available, defaults to 1)
      • -
      • \(o_i\) (offsets): offset for the \(i\)-th observation (if available, defaults to a vector of 0’s)
      • +
      • \(o_i\) (offsets): offset for the \(i\)-th observation (if available, defaults to a vector of 0s)

      The model parameters are:

        @@ -4819,7 +4311,7 @@

        \(Z\) and \(W\)
      • Visualize the latent variables and their correlations
      -

      This is achieved using the input count matrix \(Y\), along with optional covariate matrices \(X\) (defaulting to a vector of 1’s) and \(X^0\) (for zero-inflation, also defaulting to a vector of 1’s), as well as offsets \(O\) (defaulting to a matrix of 0’s).

      +

      This is achieved using the input count matrix \(Y\), along with optional covariate matrices \(X\) (defaulting to a vector of 1) and \(X^0\) (for zero-inflation, also defaulting to a vector of 1s), as well as offsets \(O\) (defaulting to a matrix of 0s).

      @@ -4831,7 +4323,7 @@

      2 Data Import

      Lineage information (lineage and lineage_1hot)

    The 1_hot variables are one-hot encoded representations of the corresponding categorical variables. Depending on the analysis objectives, you can select different variables to include in your model. For simplicity, we limit the analysis to 20 variables (dimensions):

    -
    +
    from pyPLNmodels import load_microcosm
     micro = load_microcosm(dim=20)
     print('Data: ', micro.keys())
    @@ -4842,7 +4334,7 @@

    2 Data Import

    2.1 Endogenous Variables

    The dataset is highly zero-inflated, with approximately 96% of the values being zeros:

    -
    +
    endog = micro["endog"]
     print("Percentage of zeros: ", (endog == 0).sum().sum() / endog.size * 100, "%")
    @@ -4850,20 +4342,24 @@

    The distribution of counts can be visualized on a log scale:

    -
    +
    import matplotlib.pyplot as plt
     plt.hist(endog.values.ravel(), bins=100)
     plt.yscale('log')
     plt.show()
    -

    +
    +
    +

    +
    +

    2.2 Exogenous Variables

    Explanatory variables (also referred to as ‘exogenous’ or ‘covariates’) are available in the dataset:

    -
    +
    site = micro["site"]
     print('Possible sites: ', site.unique())
     time = micro["time"]
    @@ -4881,7 +4377,7 @@ 

    3 Model Fitting Without Zero-Inflation

    To begin, we fit a Pln model without accounting for zero-inflation. This serves as a baseline for comparison (see this tutorial on Pln). In this example, we only consider the site covariates:

    -
    +
    from pyPLNmodels import Pln
     pln = Pln.from_formula('endog ~ 1 + site', data=micro).fit()
     pln.viz(colors=micro["site"])
    @@ -4889,15 +4385,21 @@

    3 Model Fitting W
    Setting the offsets to zero.
     Fitting a Pln model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (400)  reached in 6.1 seconds.
    -Last  criterion = 5.37e-06 . Required tolerance = 1e-06
    +Initialization finished.

    -
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   3%|▎         | 12/400 [00:00<00:03, 112.25it/s]Upper bound on the fitting time:   6%|▋         | 26/400 [00:00<00:03, 123.92it/s]Upper bound on the fitting time:  10%|█         | 40/400 [00:00<00:02, 129.34it/s]Upper bound on the fitting time:  14%|█▎        | 54/400 [00:00<00:02, 130.49it/s]Upper bound on the fitting time:  17%|█▋        | 68/400 [00:00<00:02, 131.37it/s]Upper bound on the fitting time:  20%|██        | 82/400 [00:00<00:02, 132.00it/s]Upper bound on the fitting time:  24%|██▍       | 96/400 [00:00<00:02, 133.39it/s]Upper bound on the fitting time:  28%|██▊       | 110/400 [00:00<00:02, 129.47it/s]Upper bound on the fitting time:  31%|███       | 124/400 [00:00<00:02, 131.40it/s]Upper bound on the fitting time:  34%|███▍      | 138/400 [00:01<00:01, 131.64it/s]Upper bound on the fitting time:  38%|███▊      | 152/400 [00:01<00:01, 131.16it/s]Upper bound on the fitting time:  42%|████▏     | 166/400 [00:01<00:01, 132.47it/s]Upper bound on the fitting time:  45%|████▌     | 180/400 [00:01<00:01, 131.80it/s]Upper bound on the fitting time:  48%|████▊     | 194/400 [00:01<00:01, 133.51it/s]Upper bound on the fitting time:  52%|█████▏    | 208/400 [00:01<00:01, 134.58it/s]Upper bound on the fitting time:  56%|█████▌    | 222/400 [00:01<00:01, 135.26it/s]Upper bound on the fitting time:  59%|█████▉    | 236/400 [00:01<00:01, 135.75it/s]Upper bound on the fitting time:  62%|██████▎   | 250/400 [00:01<00:01, 136.13it/s]Upper bound on the fitting time:  66%|██████▌   | 264/400 [00:01<00:01, 134.22it/s]Upper bound on the fitting time:  70%|██████▉   | 278/400 [00:02<00:00, 135.10it/s]Upper bound on the fitting time:  73%|███████▎  | 292/400 [00:02<00:00, 136.46it/s]Upper bound on the fitting time:  76%|███████▋  | 306/400 [00:02<00:00, 137.06it/s]Upper bound on the fitting time:  80%|████████  | 320/400 [00:02<00:00, 136.67it/s]Upper bound on the fitting time:  84%|████████▎ | 334/400 [00:02<00:00, 136.06it/s]Upper bound on the fitting time:  87%|████████▋ | 348/400 [00:02<00:00, 134.45it/s]Upper bound on the fitting time:  90%|█████████ | 362/400 [00:02<00:00, 133.86it/s]Upper bound on the fitting time:  94%|█████████▍| 376/400 [00:02<00:00, 133.25it/s]Upper bound on the fitting time:  98%|█████████▊| 390/400 [00:02<00:00, 134.26it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:03<00:00, 133.28it/s]
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  22%|██▏       | 86/400 [00:00<00:00, 850.01it/s]Upper bound on the fitting time:  43%|████▎     | 172/400 [00:00<00:00, 823.67it/s]Upper bound on the fitting time:  64%|██████▍   | 256/400 [00:00<00:00, 830.22it/s]Upper bound on the fitting time:  86%|████████▌ | 344/400 [00:00<00:00, 847.00it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 844.10it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 1.3 seconds.
    +Last  criterion = 5.37e-06 . Required tolerance = 1e-06
    -

    +
    +
    +

    +
    +

    The latent variables demonstrate a clear time effect, as anticipated, although the associated noise appears to be relatively high.

    @@ -4905,34 +4407,40 @@

    3 Model Fitting W

    4 Model Fitting With Zero-Inflation

    Next, we fit a ZIPln model that accounts for zero-inflation. This model improves the handling of datasets with a high proportion of zeros:

    -
    -
    from pyPLNmodels import ZIPln
    -zipln = ZIPln.from_formula('endog ~ 1 + site', data=micro).fit()
    -zipln.viz(colors=micro["site"])
    +
    +
    from pyPLNmodels import ZIPln
    +zipln = ZIPln.from_formula('endog ~ 1 + site', data=micro).fit()
    +zipln.viz(colors=micro["site"])
    `exog_inflation` and `exog` are set to the same array. If you need different `exog_inflation`, specify it with a pipe: '|' like in the following: endog ~ 1 + x | x + y
     Setting the offsets to zero.
     Fitting a ZIPln model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (400)  reached in 6.2 seconds.
    -Last  criterion = 5.83e-06 . Required tolerance = 1e-06
    +Initialization finished.
    -
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 9/400 [00:00<00:04, 85.07it/s]Upper bound on the fitting time:   4%|▍         | 18/400 [00:00<00:04, 82.12it/s]Upper bound on the fitting time:   7%|▋         | 27/400 [00:00<00:04, 81.50it/s]Upper bound on the fitting time:   9%|▉         | 36/400 [00:00<00:04, 81.08it/s]Upper bound on the fitting time:  11%|█▏        | 45/400 [00:00<00:04, 80.47it/s]Upper bound on the fitting time:  14%|█▎        | 54/400 [00:00<00:04, 80.90it/s]Upper bound on the fitting time:  16%|█▌        | 63/400 [00:00<00:04, 81.05it/s]Upper bound on the fitting time:  18%|█▊        | 72/400 [00:00<00:04, 81.81it/s]Upper bound on the fitting time:  20%|██        | 81/400 [00:01<00:04, 79.34it/s]Upper bound on the fitting time:  22%|██▏       | 89/400 [00:01<00:03, 79.49it/s]Upper bound on the fitting time:  24%|██▍       | 98/400 [00:01<00:03, 79.75it/s]Upper bound on the fitting time:  26%|██▋       | 106/400 [00:01<00:03, 79.41it/s]Upper bound on the fitting time:  28%|██▊       | 114/400 [00:01<00:04, 68.37it/s]Upper bound on the fitting time:  30%|███       | 122/400 [00:01<00:03, 70.20it/s]Upper bound on the fitting time:  32%|███▎      | 130/400 [00:01<00:04, 66.63it/s]Upper bound on the fitting time:  34%|███▍      | 137/400 [00:01<00:03, 66.09it/s]Upper bound on the fitting time:  36%|███▌      | 144/400 [00:01<00:03, 67.06it/s]Upper bound on the fitting time:  38%|███▊      | 151/400 [00:02<00:03, 65.87it/s]Upper bound on the fitting time:  40%|███▉      | 158/400 [00:02<00:03, 65.94it/s]Upper bound on the fitting time:  42%|████▏     | 166/400 [00:02<00:03, 68.53it/s]Upper bound on the fitting time:  44%|████▎     | 174/400 [00:02<00:03, 70.90it/s]Upper bound on the fitting time:  46%|████▌     | 182/400 [00:02<00:03, 70.24it/s]Upper bound on the fitting time:  48%|████▊     | 190/400 [00:02<00:02, 71.50it/s]Upper bound on the fitting time:  50%|████▉     | 198/400 [00:02<00:02, 73.66it/s]Upper bound on the fitting time:  52%|█████▏    | 206/400 [00:02<00:02, 74.39it/s]Upper bound on the fitting time:  54%|█████▎    | 214/400 [00:02<00:02, 75.04it/s]Upper bound on the fitting time:  56%|█████▌    | 222/400 [00:02<00:02, 75.30it/s]Upper bound on the fitting time:  57%|█████▊    | 230/400 [00:03<00:02, 71.78it/s]Upper bound on the fitting time:  60%|█████▉    | 238/400 [00:03<00:02, 72.22it/s]Upper bound on the fitting time:  62%|██████▏   | 246/400 [00:03<00:02, 72.56it/s]Upper bound on the fitting time:  64%|██████▎   | 254/400 [00:03<00:02, 71.68it/s]Upper bound on the fitting time:  66%|██████▌   | 262/400 [00:03<00:01, 71.44it/s]Upper bound on the fitting time:  68%|██████▊   | 270/400 [00:03<00:01, 71.46it/s]Upper bound on the fitting time:  70%|██████▉   | 278/400 [00:03<00:01, 70.38it/s]Upper bound on the fitting time:  72%|███████▏  | 286/400 [00:03<00:01, 70.87it/s]Upper bound on the fitting time:  74%|███████▎  | 294/400 [00:04<00:01, 71.10it/s]Upper bound on the fitting time:  76%|███████▌  | 302/400 [00:04<00:01, 71.20it/s]Upper bound on the fitting time:  78%|███████▊  | 310/400 [00:04<00:01, 71.53it/s]Upper bound on the fitting time:  80%|███████▉  | 318/400 [00:04<00:01, 71.20it/s]Upper bound on the fitting time:  82%|████████▏ | 326/400 [00:04<00:01, 70.59it/s]Upper bound on the fitting time:  84%|████████▎ | 334/400 [00:04<00:00, 70.83it/s]Upper bound on the fitting time:  86%|████████▌ | 342/400 [00:04<00:00, 70.98it/s]Upper bound on the fitting time:  88%|████████▊ | 350/400 [00:04<00:00, 70.88it/s]Upper bound on the fitting time:  90%|████████▉ | 358/400 [00:04<00:00, 70.29it/s]Upper bound on the fitting time:  92%|█████████▏| 366/400 [00:05<00:00, 69.87it/s]Upper bound on the fitting time:  93%|█████████▎| 373/400 [00:05<00:00, 64.65it/s]Upper bound on the fitting time:  95%|█████████▌| 381/400 [00:05<00:00, 66.65it/s]Upper bound on the fitting time:  97%|█████████▋| 388/400 [00:05<00:00, 67.40it/s]Upper bound on the fitting time:  99%|█████████▉| 395/400 [00:05<00:00, 68.09it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:05<00:00, 71.99it/s]
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  13%|█▎        | 53/400 [00:00<00:00, 520.48it/s]Upper bound on the fitting time:  26%|██▋       | 106/400 [00:00<00:00, 506.45it/s]Upper bound on the fitting time:  39%|███▉      | 157/400 [00:00<00:00, 497.75it/s]Upper bound on the fitting time:  52%|█████▏    | 207/400 [00:00<00:00, 493.22it/s]Upper bound on the fitting time:  64%|██████▍   | 257/400 [00:00<00:00, 491.12it/s]Upper bound on the fitting time:  77%|███████▋  | 308/400 [00:00<00:00, 495.76it/s]Upper bound on the fitting time:  90%|████████▉ | 358/400 [00:00<00:00, 494.96it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 496.73it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 0.9 seconds.
    +Last  criterion = 5.72e-06 . Required tolerance = 1e-06
    -

    +
    +
    +

    +
    +

    Incorporating zero-inflation improves the model by minimizing noise in the latent variables. To explore the model further, you can print it to access detailed information, along with its available methods and attributes:

    -
    -
    print(zipln)
    +
    +
    print(zipln)
    A multivariate ZIPln with full covariance.
     ======================================================================
          Loglike   Dimension    Nb param         BIC         AIC         ICL
    -    -2502.31          20         370   3610.7281   2872.3071   -10906.62
    +    -2502.82          20         370   3611.2398   2872.8188    -10833.0
     
     ======================================================================
     * Useful attributes
    @@ -4950,24 +4458,32 @@ 

    4 Model Fitting W

    5 Zero-Inflation Parameters

    The ZIPln model includes regression parameters for the zero-inflation component. These parameters, along with other model insights, can be visualized using the .show() method:

    -
    -
    zipln.show()
    +
    +
    zipln.show()
    -

    +
    +
    +

    +
    +

    Additionally, the model infers the probability of zero-inflation for each entry in endog, and can be visualized using the .show_prob() method:

    -
    -
    zipln.show_prob()
    +
    +
    zipln.show_prob()
    -

    +
    +
    +

    +
    +

    This probability is naturally zero for non-zero counts. To explore the latent probability of zero-inflation, you can use the latent_prob attribute:

    -
    -
    print(zipln.latent_prob)
    +
    +
    print(zipln.latent_prob)
    -
    tensor([[1.0000, 0.9998, 1.0000,  ..., 0.9999, 1.0000, 0.9587],
    +
    tensor([[1.0000, 0.9984, 1.0000,  ..., 0.9999, 1.0000, 0.9095],
             [1.0000, 1.0000, 1.0000,  ..., 1.0000, 1.0000, 1.0000],
             [1.0000, 1.0000, 1.0000,  ..., 1.0000, 1.0000, 1.0000],
             ...,
    @@ -4980,30 +4496,40 @@ 

    5 Zero-Inflation

    6 Using Different Covariates for Zero-Inflation and Count Components

    The ZIPln model allows you to specify different covariates for the zero-inflation and count components. When using formula parsing, the covariates for the zero-inflation part are separated by a | symbol. For example, to use the site covariate for the count part and the time covariate for the zero-inflation part:

    -
    -
    zitime_pln = ZIPln.from_formula('endog ~ 1 + site | time', data=micro).fit()
    -zitime_pln.show()
    +
    +
    zitime_pln = ZIPln.from_formula('endog ~ 1 + site | time', data=micro).fit()
    +zitime_pln.show()
    Setting the offsets to zero.
     Fitting a ZIPln model with full covariance.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (400)  reached in 6.4 seconds.
    -Last  criterion = 1.232e-05 . Required tolerance = 1e-06
    +Initialization finished.

    -
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:   2%|▏         | 9/400 [00:00<00:04, 84.46it/s]Upper bound on the fitting time:   4%|▍         | 18/400 [00:00<00:04, 84.01it/s]Upper bound on the fitting time:   7%|▋         | 27/400 [00:00<00:04, 81.70it/s]Upper bound on the fitting time:   9%|▉         | 36/400 [00:00<00:04, 81.03it/s]Upper bound on the fitting time:  11%|█▏        | 45/400 [00:00<00:04, 80.53it/s]Upper bound on the fitting time:  14%|█▎        | 54/400 [00:00<00:04, 80.25it/s]Upper bound on the fitting time:  16%|█▌        | 63/400 [00:00<00:04, 80.54it/s]Upper bound on the fitting time:  18%|█▊        | 72/400 [00:00<00:04, 80.93it/s]Upper bound on the fitting time:  20%|██        | 81/400 [00:00<00:03, 80.82it/s]Upper bound on the fitting time:  22%|██▎       | 90/400 [00:01<00:03, 79.67it/s]Upper bound on the fitting time:  25%|██▍       | 99/400 [00:01<00:03, 80.11it/s]Upper bound on the fitting time:  27%|██▋       | 108/400 [00:01<00:03, 75.74it/s]Upper bound on the fitting time:  29%|██▉       | 116/400 [00:01<00:03, 73.21it/s]Upper bound on the fitting time:  31%|███       | 124/400 [00:01<00:04, 67.78it/s]Upper bound on the fitting time:  33%|███▎      | 131/400 [00:01<00:03, 68.32it/s]Upper bound on the fitting time:  34%|███▍      | 138/400 [00:01<00:03, 67.80it/s]Upper bound on the fitting time:  36%|███▋      | 145/400 [00:01<00:03, 67.42it/s]Upper bound on the fitting time:  38%|███▊      | 152/400 [00:02<00:03, 67.83it/s]Upper bound on the fitting time:  40%|███▉      | 159/400 [00:02<00:03, 65.87it/s]Upper bound on the fitting time:  42%|████▏     | 166/400 [00:02<00:03, 64.52it/s]Upper bound on the fitting time:  43%|████▎     | 173/400 [00:02<00:03, 61.85it/s]Upper bound on the fitting time:  45%|████▌     | 180/400 [00:02<00:03, 59.85it/s]Upper bound on the fitting time:  47%|████▋     | 187/400 [00:02<00:03, 59.05it/s]Upper bound on the fitting time:  48%|████▊     | 193/400 [00:02<00:03, 58.29it/s]Upper bound on the fitting time:  50%|█████     | 200/400 [00:02<00:03, 61.26it/s]Upper bound on the fitting time:  52%|█████▏    | 207/400 [00:02<00:03, 62.23it/s]Upper bound on the fitting time:  54%|█████▍    | 215/400 [00:03<00:02, 65.92it/s]Upper bound on the fitting time:  56%|█████▌    | 223/400 [00:03<00:02, 68.78it/s]Upper bound on the fitting time:  57%|█████▊    | 230/400 [00:03<00:02, 66.27it/s]Upper bound on the fitting time:  59%|█████▉    | 237/400 [00:03<00:02, 67.05it/s]Upper bound on the fitting time:  61%|██████    | 244/400 [00:03<00:02, 65.25it/s]Upper bound on the fitting time:  63%|██████▎   | 251/400 [00:03<00:02, 66.35it/s]Upper bound on the fitting time:  64%|██████▍   | 258/400 [00:03<00:02, 67.23it/s]Upper bound on the fitting time:  66%|██████▋   | 265/400 [00:03<00:01, 67.76it/s]Upper bound on the fitting time:  68%|██████▊   | 273/400 [00:03<00:01, 68.72it/s]Upper bound on the fitting time:  70%|███████   | 280/400 [00:04<00:01, 68.72it/s]Upper bound on the fitting time:  72%|███████▏  | 287/400 [00:04<00:01, 68.63it/s]Upper bound on the fitting time:  74%|███████▎  | 294/400 [00:04<00:01, 68.73it/s]Upper bound on the fitting time:  75%|███████▌  | 301/400 [00:04<00:01, 68.80it/s]Upper bound on the fitting time:  77%|███████▋  | 309/400 [00:04<00:01, 69.34it/s]Upper bound on the fitting time:  79%|███████▉  | 316/400 [00:04<00:01, 69.48it/s]Upper bound on the fitting time:  81%|████████  | 324/400 [00:04<00:01, 69.69it/s]Upper bound on the fitting time:  83%|████████▎ | 331/400 [00:04<00:01, 68.82it/s]Upper bound on the fitting time:  85%|████████▍ | 339/400 [00:04<00:00, 69.39it/s]Upper bound on the fitting time:  86%|████████▋ | 346/400 [00:04<00:00, 69.43it/s]Upper bound on the fitting time:  88%|████████▊ | 353/400 [00:05<00:00, 68.42it/s]Upper bound on the fitting time:  90%|█████████ | 360/400 [00:05<00:00, 66.46it/s]Upper bound on the fitting time:  92%|█████████▏| 367/400 [00:05<00:00, 66.17it/s]Upper bound on the fitting time:  94%|█████████▎| 374/400 [00:05<00:00, 67.26it/s]Upper bound on the fitting time:  96%|█████████▌| 382/400 [00:05<00:00, 69.22it/s]Upper bound on the fitting time:  98%|█████████▊| 390/400 [00:05<00:00, 71.13it/s]Upper bound on the fitting time: 100%|█████████▉| 398/400 [00:05<00:00, 72.62it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:05<00:00, 69.73it/s]
    +
    Upper bound on the fitting time:   0%|          | 0/400 [00:00<?, ?it/s]Upper bound on the fitting time:  13%|█▎        | 52/400 [00:00<00:00, 518.24it/s]Upper bound on the fitting time:  26%|██▌       | 104/400 [00:00<00:00, 501.39it/s]Upper bound on the fitting time:  39%|███▉      | 156/400 [00:00<00:00, 508.64it/s]Upper bound on the fitting time:  52%|█████▏    | 207/400 [00:00<00:00, 498.12it/s]Upper bound on the fitting time:  64%|██████▍   | 258/400 [00:00<00:00, 501.77it/s]Upper bound on the fitting time:  78%|███████▊  | 310/400 [00:00<00:00, 506.98it/s]Upper bound on the fitting time:  90%|█████████ | 362/400 [00:00<00:00, 510.78it/s]Upper bound on the fitting time: 100%|██████████| 400/400 [00:00<00:00, 508.13it/s]
    +
    +
    +
    Maximum number of iterations (400)  reached in 0.9 seconds.
    +Last  criterion = 1.397e-05 . Required tolerance = 1e-06
    -

    +
    +
    +

    +
    +

    If no pipe | is specified, the model will use the same covariates for both components.

    You can also visualize the latent variables, colored by the time covariate:

    -
    -
    zitime_pln.viz(colors=micro["time"])
    +
    +
    zitime_pln.viz(colors=micro["time"])
    -

    +
    +
    +

    +
    +
    @@ -5011,39 +4537,48 @@

    6 Using Different

    7 Handling High-Dimensional Data: ZIPlnPCA

    The ZIPlnPCA model is the zero-inflated counterpart of the PlnPCA model, designed specifically for high-dimensional datasets. It introduces a trade-off by reducing the accuracy of the covariance matrix to improve computational efficiency.

    To fit a ZIPlnPCA model, you can specify the rank:

    -
    -
    from pyPLNmodels import ZIPlnPCA
    -high_d_micro = load_microcosm(dim=500)
    -zipca = ZIPlnPCA.from_formula('endog ~ 1 + site', data=high_d_micro, rank=5).fit()
    +
    +
    from pyPLNmodels import ZIPlnPCA
    +high_d_micro = load_microcosm(dim=500)
    +zipca = ZIPlnPCA.from_formula('endog ~ 1 + site', data=high_d_micro, rank=5).fit()
    `exog_inflation` and `exog` are set to the same array. If you need different `exog_inflation`, specify it with a pipe: '|' like in the following: endog ~ 1 + x | x + y
     Setting the offsets to zero.
     Now dataset of size torch.Size([400, 496]).
     Fitting a ZIPlnPCA model with 5 principal components.
    -Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (1000)  reached in 72.6 seconds.
    -Last  criterion = 5.25e-06 . Required tolerance = 9.999999999999999e-10
    +Intializing parameters ...

    +
    +
    +
    /home/bastien/These/redesign/pyPLNmodels/pyPLNmodels/utils/_data_handler.py:431: UserWarning:
    +
    +The (4) following (index) variables contain only zeros and are removed: [144 267 268 364].
    +
    +
    +
    +
    Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time:   1%|          | 9/1000 [00:00<00:11, 88.44it/s]Upper bound on the fitting time:   2%|▏         | 18/1000 [00:00<00:11, 85.57it/s]Upper bound on the fitting time:   3%|▎         | 28/1000 [00:00<00:10, 89.57it/s]Upper bound on the fitting time:   4%|▎         | 37/1000 [00:00<00:11, 87.53it/s]Upper bound on the fitting time:   5%|▍         | 47/1000 [00:00<00:10, 88.92it/s]Upper bound on the fitting time:   6%|▌         | 57/1000 [00:00<00:10, 89.99it/s]Upper bound on the fitting time:   7%|▋         | 66/1000 [00:00<00:10, 88.30it/s]Upper bound on the fitting time:   8%|▊         | 75/1000 [00:00<00:10, 88.19it/s]Upper bound on the fitting time:   8%|▊         | 85/1000 [00:00<00:10, 88.93it/s]Upper bound on the fitting time:   9%|▉         | 94/1000 [00:01<00:10, 88.63it/s]Upper bound on the fitting time:  10%|█         | 104/1000 [00:01<00:09, 89.68it/s]Upper bound on the fitting time:  11%|█▏        | 113/1000 [00:01<00:09, 89.34it/s]Upper bound on the fitting time:  12%|█▏        | 122/1000 [00:01<00:09, 88.69it/s]Upper bound on the fitting time:  13%|█▎        | 131/1000 [00:01<00:10, 86.86it/s]Upper bound on the fitting time:  14%|█▍        | 140/1000 [00:01<00:09, 86.76it/s]Upper bound on the fitting time:  15%|█▍        | 149/1000 [00:01<00:09, 85.99it/s]Upper bound on the fitting time:  16%|█▌        | 159/1000 [00:01<00:09, 87.41it/s]Upper bound on the fitting time:  17%|█▋        | 168/1000 [00:01<00:09, 87.79it/s]Upper bound on the fitting time:  18%|█▊        | 177/1000 [00:02<00:09, 87.19it/s]Upper bound on the fitting time:  19%|█▊        | 186/1000 [00:02<00:09, 87.90it/s]Upper bound on the fitting time:  20%|█▉        | 195/1000 [00:02<00:09, 87.21it/s]Upper bound on the fitting time:  20%|██        | 204/1000 [00:02<00:09, 85.83it/s]Upper bound on the fitting time:  21%|██▏       | 213/1000 [00:02<00:09, 86.71it/s]Upper bound on the fitting time:  22%|██▏       | 222/1000 [00:02<00:09, 86.38it/s]Upper bound on the fitting time:  23%|██▎       | 231/1000 [00:02<00:08, 87.39it/s]Upper bound on the fitting time:  24%|██▍       | 240/1000 [00:02<00:08, 86.71it/s]Upper bound on the fitting time:  25%|██▌       | 250/1000 [00:02<00:08, 87.20it/s]Upper bound on the fitting time:  26%|██▌       | 259/1000 [00:02<00:08, 87.69it/s]Upper bound on the fitting time:  27%|██▋       | 268/1000 [00:03<00:08, 87.61it/s]Upper bound on the fitting time:  28%|██▊       | 277/1000 [00:03<00:08, 85.28it/s]Upper bound on the fitting time:  29%|██▊       | 286/1000 [00:03<00:08, 85.65it/s]Upper bound on the fitting time:  30%|██▉       | 295/1000 [00:03<00:08, 86.89it/s]Upper bound on the fitting time:  30%|███       | 305/1000 [00:03<00:07, 87.86it/s]Upper bound on the fitting time:  31%|███▏      | 314/1000 [00:03<00:07, 87.97it/s]Upper bound on the fitting time:  32%|███▏      | 323/1000 [00:03<00:07, 88.11it/s]Upper bound on the fitting time:  33%|███▎      | 332/1000 [00:03<00:07, 88.45it/s]Upper bound on the fitting time:  34%|███▍      | 341/1000 [00:03<00:07, 86.10it/s]Upper bound on the fitting time:  35%|███▌      | 350/1000 [00:04<00:07, 85.58it/s]Upper bound on the fitting time:  36%|███▌      | 359/1000 [00:04<00:07, 83.71it/s]Upper bound on the fitting time:  37%|███▋      | 368/1000 [00:04<00:07, 84.72it/s]Upper bound on the fitting time:  38%|███▊      | 377/1000 [00:04<00:07, 85.09it/s]Upper bound on the fitting time:  39%|███▊      | 386/1000 [00:04<00:07, 86.22it/s]Upper bound on the fitting time:  40%|███▉      | 395/1000 [00:04<00:07, 85.59it/s]Upper bound on the fitting time:  40%|████      | 404/1000 [00:04<00:06, 85.45it/s]Upper bound on the fitting time:  41%|████▏     | 413/1000 [00:04<00:06, 86.74it/s]Upper bound on the fitting time:  42%|████▏     | 422/1000 [00:04<00:06, 87.20it/s]Upper bound on the fitting time:  43%|████▎     | 432/1000 [00:04<00:06, 88.12it/s]Upper bound on the fitting time:  44%|████▍     | 441/1000 [00:05<00:06, 87.06it/s]Upper bound on the fitting time:  45%|████▌     | 451/1000 [00:05<00:06, 88.03it/s]Upper bound on the fitting time:  46%|████▌     | 460/1000 [00:05<00:06, 88.19it/s]Upper bound on the fitting time:  47%|████▋     | 469/1000 [00:05<00:06, 88.48it/s]Upper bound on the fitting time:  48%|████▊     | 478/1000 [00:05<00:06, 86.70it/s]Upper bound on the fitting time:  49%|████▊     | 487/1000 [00:05<00:05, 87.31it/s]Upper bound on the fitting time:  50%|████▉     | 496/1000 [00:05<00:05, 87.90it/s]Upper bound on the fitting time:  50%|█████     | 505/1000 [00:05<00:05, 88.05it/s]Upper bound on the fitting time:  51%|█████▏    | 514/1000 [00:05<00:05, 88.45it/s]Upper bound on the fitting time:  52%|█████▏    | 523/1000 [00:05<00:05, 88.33it/s]Upper bound on the fitting time:  53%|█████▎    | 532/1000 [00:06<00:05, 88.40it/s]Upper bound on the fitting time:  54%|█████▍    | 541/1000 [00:06<00:05, 88.49it/s]Upper bound on the fitting time:  55%|█████▌    | 550/1000 [00:06<00:05, 88.53it/s]Upper bound on the fitting time:  56%|█████▌    | 559/1000 [00:06<00:05, 88.08it/s]Upper bound on the fitting time:  57%|█████▋    | 568/1000 [00:06<00:04, 87.82it/s]Upper bound on the fitting time:  58%|█████▊    | 577/1000 [00:06<00:04, 87.96it/s]Upper bound on the fitting time:  59%|█████▊    | 586/1000 [00:06<00:04, 87.93it/s]Upper bound on the fitting time:  60%|█████▉    | 595/1000 [00:06<00:04, 87.77it/s]Upper bound on the fitting time:  60%|██████    | 604/1000 [00:06<00:04, 87.79it/s]Upper bound on the fitting time:  61%|██████▏   | 613/1000 [00:07<00:04, 88.06it/s]Upper bound on the fitting time:  62%|██████▏   | 622/1000 [00:07<00:04, 88.08it/s]Upper bound on the fitting time:  63%|██████▎   | 631/1000 [00:07<00:04, 86.65it/s]Upper bound on the fitting time:  64%|██████▍   | 640/1000 [00:07<00:04, 86.66it/s]Upper bound on the fitting time:  65%|██████▍   | 649/1000 [00:07<00:04, 84.19it/s]Upper bound on the fitting time:  66%|██████▌   | 658/1000 [00:07<00:04, 85.20it/s]Upper bound on the fitting time:  67%|██████▋   | 667/1000 [00:07<00:03, 85.91it/s]Upper bound on the fitting time:  68%|██████▊   | 676/1000 [00:07<00:03, 85.80it/s]Upper bound on the fitting time:  68%|██████▊   | 685/1000 [00:07<00:03, 86.67it/s]Upper bound on the fitting time:  69%|██████▉   | 694/1000 [00:07<00:03, 87.45it/s]Upper bound on the fitting time:  70%|███████   | 703/1000 [00:08<00:03, 87.09it/s]Upper bound on the fitting time:  71%|███████   | 712/1000 [00:08<00:03, 86.73it/s]Upper bound on the fitting time:  72%|███████▏  | 721/1000 [00:08<00:03, 86.01it/s]Upper bound on the fitting time:  73%|███████▎  | 730/1000 [00:08<00:03, 86.41it/s]Upper bound on the fitting time:  74%|███████▍  | 739/1000 [00:08<00:02, 87.07it/s]Upper bound on the fitting time:  75%|███████▍  | 748/1000 [00:08<00:02, 86.71it/s]Upper bound on the fitting time:  76%|███████▌  | 757/1000 [00:08<00:02, 87.63it/s]Upper bound on the fitting time:  77%|███████▋  | 767/1000 [00:08<00:02, 88.65it/s]Upper bound on the fitting time:  78%|███████▊  | 776/1000 [00:08<00:02, 88.83it/s]Upper bound on the fitting time:  79%|███████▊  | 786/1000 [00:08<00:02, 89.33it/s]Upper bound on the fitting time:  80%|███████▉  | 795/1000 [00:09<00:02, 88.91it/s]Upper bound on the fitting time:  80%|████████  | 804/1000 [00:09<00:02, 88.49it/s]Upper bound on the fitting time:  81%|████████▏ | 813/1000 [00:09<00:02, 87.38it/s]Upper bound on the fitting time:  82%|████████▏ | 822/1000 [00:09<00:02, 87.73it/s]Upper bound on the fitting time:  83%|████████▎ | 831/1000 [00:09<00:02, 84.02it/s]Upper bound on the fitting time:  84%|████████▍ | 840/1000 [00:09<00:01, 81.90it/s]Upper bound on the fitting time:  85%|████████▍ | 849/1000 [00:09<00:01, 83.53it/s]Upper bound on the fitting time:  86%|████████▌ | 858/1000 [00:09<00:01, 84.09it/s]Upper bound on the fitting time:  87%|████████▋ | 867/1000 [00:09<00:01, 80.20it/s]Upper bound on the fitting time:  88%|████████▊ | 876/1000 [00:10<00:01, 80.20it/s]Upper bound on the fitting time:  88%|████████▊ | 885/1000 [00:10<00:01, 80.51it/s]Upper bound on the fitting time:  89%|████████▉ | 894/1000 [00:10<00:01, 81.20it/s]Upper bound on the fitting time:  90%|█████████ | 903/1000 [00:10<00:01, 80.86it/s]Upper bound on the fitting time:  91%|█████████ | 912/1000 [00:10<00:01, 76.76it/s]Upper bound on the fitting time:  92%|█████████▏| 921/1000 [00:10<00:01, 78.40it/s]Upper bound on the fitting time:  93%|█████████▎| 930/1000 [00:10<00:00, 80.72it/s]Upper bound on the fitting time:  94%|█████████▍| 939/1000 [00:10<00:00, 82.29it/s]Upper bound on the fitting time:  95%|█████████▍| 948/1000 [00:10<00:00, 83.76it/s]Upper bound on the fitting time:  96%|█████████▌| 957/1000 [00:11<00:00, 84.68it/s]Upper bound on the fitting time:  97%|█████████▋| 966/1000 [00:11<00:00, 85.86it/s]Upper bound on the fitting time:  98%|█████████▊| 975/1000 [00:11<00:00, 86.71it/s]Upper bound on the fitting time:  98%|█████████▊| 984/1000 [00:11<00:00, 87.09it/s]Upper bound on the fitting time:  99%|█████████▉| 993/1000 [00:11<00:00, 87.41it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [00:11<00:00, 86.46it/s]
    +
    +
    +
    Maximum number of iterations (1000)  reached in 12.1 seconds.
    +Last  criterion = 1.243e-05 . Required tolerance = 9.999999999999999e-10
    -
    /home/bastien/These/redesign/pyPLNmodels/pyPLNmodels/utils/_data_handler.py:431: UserWarning: The (4) following (index) variables contain only zeros and are removed: [144 267 268 364].
    -  warnings.warn(
    -Upper bound on the fitting time:   0%|          | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time:   0%|          | 2/1000 [00:00<01:12, 13.74it/s]Upper bound on the fitting time:   0%|          | 4/1000 [00:00<01:06, 14.98it/s]Upper bound on the fitting time:   1%|          | 6/1000 [00:00<01:04, 15.41it/s]Upper bound on the fitting time:   1%|          | 8/1000 [00:00<01:03, 15.58it/s]Upper bound on the fitting time:   1%|          | 10/1000 [00:00<01:03, 15.62it/s]Upper bound on the fitting time:   1%|          | 12/1000 [00:00<01:03, 15.60it/s]Upper bound on the fitting time:   1%|▏         | 14/1000 [00:00<01:03, 15.51it/s]Upper bound on the fitting time:   2%|▏         | 16/1000 [00:01<01:03, 15.52it/s]Upper bound on the fitting time:   2%|▏         | 18/1000 [00:01<01:03, 15.58it/s]Upper bound on the fitting time:   2%|▏         | 20/1000 [00:01<01:02, 15.63it/s]Upper bound on the fitting time:   2%|▏         | 22/1000 [00:01<01:03, 15.50it/s]Upper bound on the fitting time:   2%|▏         | 24/1000 [00:01<01:02, 15.59it/s]Upper bound on the fitting time:   3%|▎         | 26/1000 [00:01<01:02, 15.58it/s]Upper bound on the fitting time:   3%|▎         | 28/1000 [00:01<01:02, 15.65it/s]Upper bound on the fitting time:   3%|▎         | 30/1000 [00:01<01:01, 15.72it/s]Upper bound on the fitting time:   3%|▎         | 32/1000 [00:02<01:02, 15.56it/s]Upper bound on the fitting time:   3%|▎         | 34/1000 [00:02<01:02, 15.49it/s]Upper bound on the fitting time:   4%|▎         | 36/1000 [00:02<01:01, 15.62it/s]Upper bound on the fitting time:   4%|▍         | 38/1000 [00:02<01:01, 15.55it/s]Upper bound on the fitting time:   4%|▍         | 40/1000 [00:02<01:01, 15.56it/s]Upper bound on the fitting time:   4%|▍         | 42/1000 [00:02<01:02, 15.41it/s]Upper bound on the fitting time:   4%|▍         | 44/1000 [00:02<01:01, 15.46it/s]Upper bound on the fitting time:   5%|▍         | 46/1000 [00:02<01:02, 15.22it/s]Upper bound on the fitting time:   5%|▍         | 48/1000 [00:03<01:02, 15.15it/s]Upper bound on the fitting time:   5%|▌         | 50/1000 [00:03<01:06, 14.24it/s]Upper bound on the fitting time:   5%|▌         | 52/1000 [00:03<01:10, 13.37it/s]Upper bound on the fitting time:   5%|▌         | 54/1000 [00:03<01:13, 12.95it/s]Upper bound on the fitting time:   6%|▌         | 56/1000 [00:03<01:13, 12.80it/s]Upper bound on the fitting time:   6%|▌         | 58/1000 [00:03<01:13, 12.86it/s]Upper bound on the fitting time:   6%|▌         | 60/1000 [00:04<01:12, 12.93it/s]Upper bound on the fitting time:   6%|▌         | 62/1000 [00:04<01:14, 12.67it/s]Upper bound on the fitting time:   6%|▋         | 64/1000 [00:04<01:14, 12.52it/s]Upper bound on the fitting time:   7%|▋         | 66/1000 [00:04<01:13, 12.72it/s]Upper bound on the fitting time:   7%|▋         | 68/1000 [00:04<01:13, 12.74it/s]Upper bound on the fitting time:   7%|▋         | 70/1000 [00:04<01:15, 12.29it/s]Upper bound on the fitting time:   7%|▋         | 72/1000 [00:05<01:14, 12.41it/s]Upper bound on the fitting time:   7%|▋         | 74/1000 [00:05<01:15, 12.34it/s]Upper bound on the fitting time:   8%|▊         | 76/1000 [00:05<01:13, 12.65it/s]Upper bound on the fitting time:   8%|▊         | 78/1000 [00:05<01:08, 13.41it/s]Upper bound on the fitting time:   8%|▊         | 80/1000 [00:05<01:05, 13.96it/s]Upper bound on the fitting time:   8%|▊         | 82/1000 [00:05<01:03, 14.42it/s]Upper bound on the fitting time:   8%|▊         | 84/1000 [00:05<01:01, 14.80it/s]Upper bound on the fitting time:   9%|▊         | 86/1000 [00:06<01:02, 14.65it/s]Upper bound on the fitting time:   9%|▉         | 88/1000 [00:06<01:01, 14.94it/s]Upper bound on the fitting time:   9%|▉         | 90/1000 [00:06<01:00, 14.93it/s]Upper bound on the fitting time:   9%|▉         | 92/1000 [00:06<01:00, 15.09it/s]Upper bound on the fitting time:   9%|▉         | 94/1000 [00:06<01:00, 15.08it/s]Upper bound on the fitting time:  10%|▉         | 96/1000 [00:06<00:59, 15.30it/s]Upper bound on the fitting time:  10%|▉         | 98/1000 [00:06<00:58, 15.38it/s]Upper bound on the fitting time:  10%|█         | 100/1000 [00:06<00:58, 15.35it/s]Upper bound on the fitting time:  10%|█         | 102/1000 [00:07<00:58, 15.40it/s]Upper bound on the fitting time:  10%|█         | 104/1000 [00:07<00:57, 15.50it/s]Upper bound on the fitting time:  11%|█         | 106/1000 [00:07<00:57, 15.55it/s]Upper bound on the fitting time:  11%|█         | 108/1000 [00:07<00:57, 15.50it/s]Upper bound on the fitting time:  11%|█         | 110/1000 [00:07<00:57, 15.45it/s]Upper bound on the fitting time:  11%|█         | 112/1000 [00:07<00:56, 15.61it/s]Upper bound on the fitting time:  11%|█▏        | 114/1000 [00:07<00:56, 15.65it/s]Upper bound on the fitting time:  12%|█▏        | 116/1000 [00:07<00:56, 15.68it/s]Upper bound on the fitting time:  12%|█▏        | 118/1000 [00:08<00:56, 15.66it/s]Upper bound on the fitting time:  12%|█▏        | 120/1000 [00:08<00:57, 15.42it/s]Upper bound on the fitting time:  12%|█▏        | 122/1000 [00:08<01:00, 14.44it/s]Upper bound on the fitting time:  12%|█▏        | 124/1000 [00:08<01:03, 13.90it/s]Upper bound on the fitting time:  13%|█▎        | 126/1000 [00:08<01:05, 13.35it/s]Upper bound on the fitting time:  13%|█▎        | 128/1000 [00:08<01:07, 12.94it/s]Upper bound on the fitting time:  13%|█▎        | 130/1000 [00:09<01:08, 12.67it/s]Upper bound on the fitting time:  13%|█▎        | 132/1000 [00:09<01:08, 12.73it/s]Upper bound on the fitting time:  13%|█▎        | 134/1000 [00:09<01:07, 12.79it/s]Upper bound on the fitting time:  14%|█▎        | 136/1000 [00:09<01:08, 12.53it/s]Upper bound on the fitting time:  14%|█▍        | 138/1000 [00:09<01:08, 12.58it/s]Upper bound on the fitting time:  14%|█▍        | 140/1000 [00:09<01:08, 12.58it/s]Upper bound on the fitting time:  14%|█▍        | 142/1000 [00:09<01:05, 13.07it/s]Upper bound on the fitting time:  14%|█▍        | 144/1000 [00:10<01:02, 13.68it/s]Upper bound on the fitting time:  15%|█▍        | 146/1000 [00:10<01:01, 13.79it/s]Upper bound on the fitting time:  15%|█▍        | 148/1000 [00:10<01:04, 13.31it/s]Upper bound on the fitting time:  15%|█▌        | 150/1000 [00:10<01:01, 13.78it/s]Upper bound on the fitting time:  15%|█▌        | 152/1000 [00:10<00:59, 14.35it/s]Upper bound on the fitting time:  15%|█▌        | 154/1000 [00:10<00:57, 14.78it/s]Upper bound on the fitting time:  16%|█▌        | 156/1000 [00:10<00:56, 14.83it/s]Upper bound on the fitting time:  16%|█▌        | 158/1000 [00:11<00:55, 15.10it/s]Upper bound on the fitting time:  16%|█▌        | 160/1000 [00:11<00:55, 15.12it/s]Upper bound on the fitting time:  16%|█▌        | 162/1000 [00:11<00:56, 14.77it/s]Upper bound on the fitting time:  16%|█▋        | 164/1000 [00:11<00:57, 14.46it/s]Upper bound on the fitting time:  17%|█▋        | 166/1000 [00:11<00:58, 14.34it/s]Upper bound on the fitting time:  17%|█▋        | 168/1000 [00:11<00:57, 14.36it/s]Upper bound on the fitting time:  17%|█▋        | 170/1000 [00:11<00:57, 14.35it/s]Upper bound on the fitting time:  17%|█▋        | 172/1000 [00:12<00:58, 14.10it/s]Upper bound on the fitting time:  17%|█▋        | 174/1000 [00:12<00:59, 13.93it/s]Upper bound on the fitting time:  18%|█▊        | 176/1000 [00:12<00:59, 13.85it/s]Upper bound on the fitting time:  18%|█▊        | 178/1000 [00:12<00:59, 13.91it/s]Upper bound on the fitting time:  18%|█▊        | 180/1000 [00:12<00:58, 13.91it/s]Upper bound on the fitting time:  18%|█▊        | 182/1000 [00:12<00:57, 14.27it/s]Upper bound on the fitting time:  18%|█▊        | 184/1000 [00:12<00:57, 14.27it/s]Upper bound on the fitting time:  19%|█▊        | 186/1000 [00:13<00:56, 14.42it/s]Upper bound on the fitting time:  19%|█▉        | 188/1000 [00:13<00:58, 13.99it/s]Upper bound on the fitting time:  19%|█▉        | 190/1000 [00:13<01:01, 13.22it/s]Upper bound on the fitting time:  19%|█▉        | 192/1000 [00:13<01:02, 13.01it/s]Upper bound on the fitting time:  19%|█▉        | 194/1000 [00:13<01:00, 13.36it/s]Upper bound on the fitting time:  20%|█▉        | 196/1000 [00:13<00:58, 13.74it/s]Upper bound on the fitting time:  20%|█▉        | 198/1000 [00:13<00:56, 14.27it/s]Upper bound on the fitting time:  20%|██        | 200/1000 [00:14<00:54, 14.60it/s]Upper bound on the fitting time:  20%|██        | 202/1000 [00:14<00:53, 14.99it/s]Upper bound on the fitting time:  20%|██        | 204/1000 [00:14<00:53, 14.99it/s]Upper bound on the fitting time:  21%|██        | 206/1000 [00:14<00:52, 14.99it/s]Upper bound on the fitting time:  21%|██        | 208/1000 [00:14<00:52, 15.04it/s]Upper bound on the fitting time:  21%|██        | 210/1000 [00:14<00:52, 15.13it/s]Upper bound on the fitting time:  21%|██        | 212/1000 [00:14<00:51, 15.24it/s]Upper bound on the fitting time:  21%|██▏       | 214/1000 [00:14<00:55, 14.08it/s]Upper bound on the fitting time:  22%|██▏       | 216/1000 [00:15<00:57, 13.66it/s]Upper bound on the fitting time:  22%|██▏       | 218/1000 [00:15<00:55, 14.11it/s]Upper bound on the fitting time:  22%|██▏       | 220/1000 [00:15<00:53, 14.50it/s]Upper bound on the fitting time:  22%|██▏       | 222/1000 [00:15<00:52, 14.77it/s]Upper bound on the fitting time:  22%|██▏       | 224/1000 [00:15<00:51, 14.95it/s]Upper bound on the fitting time:  23%|██▎       | 226/1000 [00:15<00:51, 15.13it/s]Upper bound on the fitting time:  23%|██▎       | 228/1000 [00:15<00:50, 15.14it/s]Upper bound on the fitting time:  23%|██▎       | 230/1000 [00:16<00:51, 14.98it/s]Upper bound on the fitting time:  23%|██▎       | 232/1000 [00:16<00:50, 15.26it/s]Upper bound on the fitting time:  23%|██▎       | 234/1000 [00:16<00:49, 15.49it/s]Upper bound on the fitting time:  24%|██▎       | 236/1000 [00:16<00:49, 15.42it/s]Upper bound on the fitting time:  24%|██▍       | 238/1000 [00:16<00:49, 15.49it/s]Upper bound on the fitting time:  24%|██▍       | 240/1000 [00:16<00:49, 15.45it/s]Upper bound on the fitting time:  24%|██▍       | 242/1000 [00:16<00:48, 15.52it/s]Upper bound on the fitting time:  24%|██▍       | 244/1000 [00:16<00:50, 15.12it/s]Upper bound on the fitting time:  25%|██▍       | 246/1000 [00:17<00:51, 14.61it/s]Upper bound on the fitting time:  25%|██▍       | 248/1000 [00:17<00:50, 14.94it/s]Upper bound on the fitting time:  25%|██▌       | 250/1000 [00:17<00:49, 15.15it/s]Upper bound on the fitting time:  25%|██▌       | 252/1000 [00:17<00:50, 14.95it/s]Upper bound on the fitting time:  25%|██▌       | 254/1000 [00:17<00:49, 15.19it/s]Upper bound on the fitting time:  26%|██▌       | 256/1000 [00:17<00:48, 15.38it/s]Upper bound on the fitting time:  26%|██▌       | 258/1000 [00:17<00:47, 15.51it/s]Upper bound on the fitting time:  26%|██▌       | 260/1000 [00:17<00:47, 15.61it/s]Upper bound on the fitting time:  26%|██▌       | 262/1000 [00:18<00:47, 15.55it/s]Upper bound on the fitting time:  26%|██▋       | 264/1000 [00:18<00:47, 15.60it/s]Upper bound on the fitting time:  27%|██▋       | 266/1000 [00:18<00:47, 15.61it/s]Upper bound on the fitting time:  27%|██▋       | 268/1000 [00:18<00:46, 15.58it/s]Upper bound on the fitting time:  27%|██▋       | 270/1000 [00:18<00:47, 15.51it/s]Upper bound on the fitting time:  27%|██▋       | 272/1000 [00:18<00:48, 15.13it/s]Upper bound on the fitting time:  27%|██▋       | 274/1000 [00:18<00:48, 15.08it/s]Upper bound on the fitting time:  28%|██▊       | 276/1000 [00:19<00:48, 14.95it/s]Upper bound on the fitting time:  28%|██▊       | 278/1000 [00:19<00:48, 14.98it/s]Upper bound on the fitting time:  28%|██▊       | 280/1000 [00:19<00:47, 15.18it/s]Upper bound on the fitting time:  28%|██▊       | 282/1000 [00:19<00:47, 15.23it/s]Upper bound on the fitting time:  28%|██▊       | 284/1000 [00:19<00:47, 15.13it/s]Upper bound on the fitting time:  29%|██▊       | 286/1000 [00:19<00:46, 15.29it/s]Upper bound on the fitting time:  29%|██▉       | 288/1000 [00:19<00:46, 15.19it/s]Upper bound on the fitting time:  29%|██▉       | 290/1000 [00:19<00:46, 15.33it/s]Upper bound on the fitting time:  29%|██▉       | 292/1000 [00:20<00:46, 15.20it/s]Upper bound on the fitting time:  29%|██▉       | 294/1000 [00:20<00:45, 15.35it/s]Upper bound on the fitting time:  30%|██▉       | 296/1000 [00:20<00:45, 15.41it/s]Upper bound on the fitting time:  30%|██▉       | 298/1000 [00:20<00:45, 15.45it/s]Upper bound on the fitting time:  30%|███       | 300/1000 [00:20<00:45, 15.54it/s]Upper bound on the fitting time:  30%|███       | 302/1000 [00:20<00:44, 15.55it/s]Upper bound on the fitting time:  30%|███       | 304/1000 [00:20<00:45, 15.22it/s]Upper bound on the fitting time:  31%|███       | 306/1000 [00:20<00:44, 15.46it/s]Upper bound on the fitting time:  31%|███       | 308/1000 [00:21<00:44, 15.49it/s]Upper bound on the fitting time:  31%|███       | 310/1000 [00:21<00:44, 15.53it/s]Upper bound on the fitting time:  31%|███       | 312/1000 [00:21<00:44, 15.43it/s]Upper bound on the fitting time:  31%|███▏      | 314/1000 [00:21<00:44, 15.52it/s]Upper bound on the fitting time:  32%|███▏      | 316/1000 [00:21<00:43, 15.57it/s]Upper bound on the fitting time:  32%|███▏      | 318/1000 [00:21<00:43, 15.63it/s]Upper bound on the fitting time:  32%|███▏      | 320/1000 [00:21<00:43, 15.58it/s]Upper bound on the fitting time:  32%|███▏      | 322/1000 [00:22<00:43, 15.62it/s]Upper bound on the fitting time:  32%|███▏      | 324/1000 [00:22<00:43, 15.59it/s]Upper bound on the fitting time:  33%|███▎      | 326/1000 [00:22<00:43, 15.51it/s]Upper bound on the fitting time:  33%|███▎      | 328/1000 [00:22<00:43, 15.49it/s]Upper bound on the fitting time:  33%|███▎      | 330/1000 [00:22<00:43, 15.45it/s]Upper bound on the fitting time:  33%|███▎      | 332/1000 [00:22<00:43, 15.29it/s]Upper bound on the fitting time:  33%|███▎      | 334/1000 [00:22<00:43, 15.36it/s]Upper bound on the fitting time:  34%|███▎      | 336/1000 [00:22<00:43, 15.40it/s]Upper bound on the fitting time:  34%|███▍      | 338/1000 [00:23<00:43, 15.38it/s]Upper bound on the fitting time:  34%|███▍      | 340/1000 [00:23<00:43, 15.29it/s]Upper bound on the fitting time:  34%|███▍      | 342/1000 [00:23<00:43, 15.12it/s]Upper bound on the fitting time:  34%|███▍      | 344/1000 [00:23<00:44, 14.73it/s]Upper bound on the fitting time:  35%|███▍      | 346/1000 [00:23<00:43, 14.92it/s]Upper bound on the fitting time:  35%|███▍      | 348/1000 [00:23<00:42, 15.22it/s]Upper bound on the fitting time:  35%|███▌      | 350/1000 [00:23<00:42, 15.24it/s]Upper bound on the fitting time:  35%|███▌      | 352/1000 [00:23<00:42, 15.33it/s]Upper bound on the fitting time:  35%|███▌      | 354/1000 [00:24<00:41, 15.50it/s]Upper bound on the fitting time:  36%|███▌      | 356/1000 [00:24<00:41, 15.59it/s]Upper bound on the fitting time:  36%|███▌      | 358/1000 [00:24<00:41, 15.62it/s]Upper bound on the fitting time:  36%|███▌      | 360/1000 [00:24<00:41, 15.58it/s]Upper bound on the fitting time:  36%|███▌      | 362/1000 [00:24<00:40, 15.58it/s]Upper bound on the fitting time:  36%|███▋      | 364/1000 [00:24<00:40, 15.52it/s]Upper bound on the fitting time:  37%|███▋      | 366/1000 [00:24<00:40, 15.60it/s]Upper bound on the fitting time:  37%|███▋      | 368/1000 [00:25<00:40, 15.53it/s]Upper bound on the fitting time:  37%|███▋      | 370/1000 [00:25<00:40, 15.53it/s]Upper bound on the fitting time:  37%|███▋      | 372/1000 [00:25<00:40, 15.54it/s]Upper bound on the fitting time:  37%|███▋      | 374/1000 [00:25<00:40, 15.46it/s]Upper bound on the fitting time:  38%|███▊      | 376/1000 [00:25<00:40, 15.27it/s]Upper bound on the fitting time:  38%|███▊      | 378/1000 [00:25<00:41, 15.16it/s]Upper bound on the fitting time:  38%|███▊      | 380/1000 [00:25<00:40, 15.36it/s]Upper bound on the fitting time:  38%|███▊      | 382/1000 [00:25<00:40, 15.38it/s]Upper bound on the fitting time:  38%|███▊      | 384/1000 [00:26<00:39, 15.52it/s]Upper bound on the fitting time:  39%|███▊      | 386/1000 [00:26<00:39, 15.49it/s]Upper bound on the fitting time:  39%|███▉      | 388/1000 [00:26<00:39, 15.56it/s]Upper bound on the fitting time:  39%|███▉      | 390/1000 [00:26<00:39, 15.47it/s]Upper bound on the fitting time:  39%|███▉      | 392/1000 [00:26<00:39, 15.54it/s]Upper bound on the fitting time:  39%|███▉      | 394/1000 [00:26<00:39, 15.42it/s]Upper bound on the fitting time:  40%|███▉      | 396/1000 [00:26<00:39, 15.45it/s]Upper bound on the fitting time:  40%|███▉      | 398/1000 [00:26<00:38, 15.52it/s]Upper bound on the fitting time:  40%|████      | 400/1000 [00:27<00:38, 15.60it/s]Upper bound on the fitting time:  40%|████      | 402/1000 [00:27<00:38, 15.47it/s]Upper bound on the fitting time:  40%|████      | 404/1000 [00:27<00:38, 15.52it/s]Upper bound on the fitting time:  41%|████      | 406/1000 [00:27<00:38, 15.57it/s]Upper bound on the fitting time:  41%|████      | 408/1000 [00:27<00:38, 15.28it/s]Upper bound on the fitting time:  41%|████      | 410/1000 [00:27<00:38, 15.28it/s]Upper bound on the fitting time:  41%|████      | 412/1000 [00:27<00:38, 15.45it/s]Upper bound on the fitting time:  41%|████▏     | 414/1000 [00:27<00:37, 15.52it/s]Upper bound on the fitting time:  42%|████▏     | 416/1000 [00:28<00:37, 15.59it/s]Upper bound on the fitting time:  42%|████▏     | 418/1000 [00:28<00:38, 15.06it/s]Upper bound on the fitting time:  42%|████▏     | 420/1000 [00:28<00:38, 15.20it/s]Upper bound on the fitting time:  42%|████▏     | 422/1000 [00:28<00:37, 15.41it/s]Upper bound on the fitting time:  42%|████▏     | 424/1000 [00:28<00:37, 15.47it/s]Upper bound on the fitting time:  43%|████▎     | 426/1000 [00:28<00:37, 15.19it/s]Upper bound on the fitting time:  43%|████▎     | 428/1000 [00:28<00:38, 15.03it/s]Upper bound on the fitting time:  43%|████▎     | 430/1000 [00:29<00:39, 14.53it/s]Upper bound on the fitting time:  43%|████▎     | 432/1000 [00:29<00:38, 14.81it/s]Upper bound on the fitting time:  43%|████▎     | 434/1000 [00:29<00:37, 14.90it/s]Upper bound on the fitting time:  44%|████▎     | 436/1000 [00:29<00:39, 14.19it/s]Upper bound on the fitting time:  44%|████▍     | 438/1000 [00:29<00:38, 14.64it/s]Upper bound on the fitting time:  44%|████▍     | 440/1000 [00:29<00:37, 14.79it/s]Upper bound on the fitting time:  44%|████▍     | 442/1000 [00:29<00:37, 15.05it/s]Upper bound on the fitting time:  44%|████▍     | 444/1000 [00:30<00:36, 15.09it/s]Upper bound on the fitting time:  45%|████▍     | 446/1000 [00:30<00:36, 15.29it/s]Upper bound on the fitting time:  45%|████▍     | 448/1000 [00:30<00:36, 15.09it/s]Upper bound on the fitting time:  45%|████▌     | 450/1000 [00:30<00:36, 15.20it/s]Upper bound on the fitting time:  45%|████▌     | 452/1000 [00:30<00:36, 15.09it/s]Upper bound on the fitting time:  45%|████▌     | 454/1000 [00:30<00:37, 14.63it/s]Upper bound on the fitting time:  46%|████▌     | 456/1000 [00:30<00:36, 14.84it/s]Upper bound on the fitting time:  46%|████▌     | 458/1000 [00:30<00:36, 14.84it/s]Upper bound on the fitting time:  46%|████▌     | 460/1000 [00:31<00:35, 15.10it/s]Upper bound on the fitting time:  46%|████▌     | 462/1000 [00:31<00:35, 15.24it/s]Upper bound on the fitting time:  46%|████▋     | 464/1000 [00:31<00:34, 15.34it/s]Upper bound on the fitting time:  47%|████▋     | 466/1000 [00:31<00:35, 15.03it/s]Upper bound on the fitting time:  47%|████▋     | 468/1000 [00:31<00:35, 15.03it/s]Upper bound on the fitting time:  47%|████▋     | 470/1000 [00:31<00:35, 14.96it/s]Upper bound on the fitting time:  47%|████▋     | 472/1000 [00:31<00:35, 14.84it/s]Upper bound on the fitting time:  47%|████▋     | 474/1000 [00:32<00:34, 15.07it/s]Upper bound on the fitting time:  48%|████▊     | 476/1000 [00:32<00:34, 15.04it/s]Upper bound on the fitting time:  48%|████▊     | 478/1000 [00:32<00:34, 15.18it/s]Upper bound on the fitting time:  48%|████▊     | 480/1000 [00:32<00:34, 15.16it/s]Upper bound on the fitting time:  48%|████▊     | 482/1000 [00:32<00:35, 14.46it/s]Upper bound on the fitting time:  48%|████▊     | 484/1000 [00:32<00:35, 14.74it/s]Upper bound on the fitting time:  49%|████▊     | 486/1000 [00:32<00:34, 14.98it/s]Upper bound on the fitting time:  49%|████▉     | 488/1000 [00:32<00:34, 14.96it/s]Upper bound on the fitting time:  49%|████▉     | 490/1000 [00:33<00:33, 15.07it/s]Upper bound on the fitting time:  49%|████▉     | 492/1000 [00:33<00:33, 15.22it/s]Upper bound on the fitting time:  49%|████▉     | 494/1000 [00:33<00:32, 15.42it/s]Upper bound on the fitting time:  50%|████▉     | 496/1000 [00:33<00:32, 15.47it/s]Upper bound on the fitting time:  50%|████▉     | 498/1000 [00:33<00:32, 15.46it/s]Upper bound on the fitting time:  50%|█████     | 500/1000 [00:33<00:32, 15.28it/s]Upper bound on the fitting time:  50%|█████     | 502/1000 [00:33<00:33, 14.83it/s]Upper bound on the fitting time:  50%|█████     | 504/1000 [00:33<00:33, 14.99it/s]Upper bound on the fitting time:  51%|█████     | 506/1000 [00:34<00:32, 15.12it/s]Upper bound on the fitting time:  51%|█████     | 508/1000 [00:34<00:32, 15.25it/s]Upper bound on the fitting time:  51%|█████     | 510/1000 [00:34<00:34, 14.09it/s]Upper bound on the fitting time:  51%|█████     | 512/1000 [00:34<00:35, 13.74it/s]Upper bound on the fitting time:  51%|█████▏    | 514/1000 [00:34<00:36, 13.49it/s]Upper bound on the fitting time:  52%|█████▏    | 516/1000 [00:34<00:37, 12.94it/s]Upper bound on the fitting time:  52%|█████▏    | 518/1000 [00:35<00:36, 13.11it/s]Upper bound on the fitting time:  52%|█████▏    | 520/1000 [00:35<00:37, 12.93it/s]Upper bound on the fitting time:  52%|█████▏    | 522/1000 [00:35<00:36, 13.00it/s]Upper bound on the fitting time:  52%|█████▏    | 524/1000 [00:35<00:36, 13.07it/s]Upper bound on the fitting time:  53%|█████▎    | 526/1000 [00:35<00:35, 13.36it/s]Upper bound on the fitting time:  53%|█████▎    | 528/1000 [00:35<00:35, 13.22it/s]Upper bound on the fitting time:  53%|█████▎    | 530/1000 [00:35<00:35, 13.22it/s]Upper bound on the fitting time:  53%|█████▎    | 532/1000 [00:36<00:35, 13.16it/s]Upper bound on the fitting time:  53%|█████▎    | 534/1000 [00:36<00:35, 13.26it/s]Upper bound on the fitting time:  54%|█████▎    | 536/1000 [00:36<00:35, 13.09it/s]Upper bound on the fitting time:  54%|█████▍    | 538/1000 [00:36<00:35, 12.94it/s]Upper bound on the fitting time:  54%|█████▍    | 540/1000 [00:36<00:35, 12.79it/s]Upper bound on the fitting time:  54%|█████▍    | 542/1000 [00:36<00:37, 12.35it/s]Upper bound on the fitting time:  54%|█████▍    | 544/1000 [00:37<00:35, 12.77it/s]Upper bound on the fitting time:  55%|█████▍    | 546/1000 [00:37<00:35, 12.90it/s]Upper bound on the fitting time:  55%|█████▍    | 548/1000 [00:37<00:34, 13.04it/s]Upper bound on the fitting time:  55%|█████▌    | 550/1000 [00:37<00:34, 12.99it/s]Upper bound on the fitting time:  55%|█████▌    | 552/1000 [00:37<00:34, 13.07it/s]Upper bound on the fitting time:  55%|█████▌    | 554/1000 [00:37<00:33, 13.29it/s]Upper bound on the fitting time:  56%|█████▌    | 556/1000 [00:37<00:33, 13.42it/s]Upper bound on the fitting time:  56%|█████▌    | 558/1000 [00:38<00:32, 13.59it/s]Upper bound on the fitting time:  56%|█████▌    | 560/1000 [00:38<00:31, 13.78it/s]Upper bound on the fitting time:  56%|█████▌    | 562/1000 [00:38<00:31, 13.72it/s]Upper bound on the fitting time:  56%|█████▋    | 564/1000 [00:38<00:32, 13.45it/s]Upper bound on the fitting time:  57%|█████▋    | 566/1000 [00:38<00:32, 13.43it/s]Upper bound on the fitting time:  57%|█████▋    | 568/1000 [00:38<00:32, 13.19it/s]Upper bound on the fitting time:  57%|█████▋    | 570/1000 [00:39<00:33, 12.79it/s]Upper bound on the fitting time:  57%|█████▋    | 572/1000 [00:39<00:33, 12.60it/s]Upper bound on the fitting time:  57%|█████▋    | 574/1000 [00:39<00:33, 12.55it/s]Upper bound on the fitting time:  58%|█████▊    | 576/1000 [00:39<00:33, 12.56it/s]Upper bound on the fitting time:  58%|█████▊    | 578/1000 [00:39<00:33, 12.56it/s]Upper bound on the fitting time:  58%|█████▊    | 580/1000 [00:39<00:33, 12.55it/s]Upper bound on the fitting time:  58%|█████▊    | 582/1000 [00:39<00:33, 12.50it/s]Upper bound on the fitting time:  58%|█████▊    | 584/1000 [00:40<00:33, 12.41it/s]Upper bound on the fitting time:  59%|█████▊    | 586/1000 [00:40<00:33, 12.38it/s]Upper bound on the fitting time:  59%|█████▉    | 588/1000 [00:40<00:33, 12.40it/s]Upper bound on the fitting time:  59%|█████▉    | 590/1000 [00:40<00:32, 12.48it/s]Upper bound on the fitting time:  59%|█████▉    | 592/1000 [00:40<00:32, 12.48it/s]Upper bound on the fitting time:  59%|█████▉    | 594/1000 [00:40<00:32, 12.50it/s]Upper bound on the fitting time:  60%|█████▉    | 596/1000 [00:41<00:32, 12.56it/s]Upper bound on the fitting time:  60%|█████▉    | 598/1000 [00:41<00:31, 12.56it/s]Upper bound on the fitting time:  60%|██████    | 600/1000 [00:41<00:31, 12.53it/s]Upper bound on the fitting time:  60%|██████    | 602/1000 [00:41<00:31, 12.51it/s]Upper bound on the fitting time:  60%|██████    | 604/1000 [00:41<00:31, 12.55it/s]Upper bound on the fitting time:  61%|██████    | 606/1000 [00:41<00:31, 12.57it/s]Upper bound on the fitting time:  61%|██████    | 608/1000 [00:42<00:31, 12.56it/s]Upper bound on the fitting time:  61%|██████    | 610/1000 [00:42<00:31, 12.46it/s]Upper bound on the fitting time:  61%|██████    | 612/1000 [00:42<00:31, 12.51it/s]Upper bound on the fitting time:  61%|██████▏   | 614/1000 [00:42<00:30, 12.49it/s]Upper bound on the fitting time:  62%|██████▏   | 616/1000 [00:42<00:30, 12.46it/s]Upper bound on the fitting time:  62%|██████▏   | 618/1000 [00:42<00:30, 12.40it/s]Upper bound on the fitting time:  62%|██████▏   | 620/1000 [00:43<00:30, 12.26it/s]Upper bound on the fitting time:  62%|██████▏   | 622/1000 [00:43<00:30, 12.25it/s]Upper bound on the fitting time:  62%|██████▏   | 624/1000 [00:43<00:30, 12.33it/s]Upper bound on the fitting time:  63%|██████▎   | 626/1000 [00:43<00:30, 12.32it/s]Upper bound on the fitting time:  63%|██████▎   | 628/1000 [00:43<00:30, 12.31it/s]Upper bound on the fitting time:  63%|██████▎   | 630/1000 [00:43<00:29, 12.36it/s]Upper bound on the fitting time:  63%|██████▎   | 632/1000 [00:43<00:29, 12.38it/s]Upper bound on the fitting time:  63%|██████▎   | 634/1000 [00:44<00:29, 12.42it/s]Upper bound on the fitting time:  64%|██████▎   | 636/1000 [00:44<00:29, 12.46it/s]Upper bound on the fitting time:  64%|██████▍   | 638/1000 [00:44<00:28, 12.49it/s]Upper bound on the fitting time:  64%|██████▍   | 640/1000 [00:44<00:28, 12.46it/s]Upper bound on the fitting time:  64%|██████▍   | 642/1000 [00:44<00:28, 12.45it/s]Upper bound on the fitting time:  64%|██████▍   | 644/1000 [00:44<00:28, 12.28it/s]Upper bound on the fitting time:  65%|██████▍   | 646/1000 [00:45<00:28, 12.30it/s]Upper bound on the fitting time:  65%|██████▍   | 648/1000 [00:45<00:28, 12.31it/s]Upper bound on the fitting time:  65%|██████▌   | 650/1000 [00:45<00:28, 12.42it/s]Upper bound on the fitting time:  65%|██████▌   | 652/1000 [00:45<00:27, 12.51it/s]Upper bound on the fitting time:  65%|██████▌   | 654/1000 [00:45<00:27, 12.48it/s]Upper bound on the fitting time:  66%|██████▌   | 656/1000 [00:45<00:27, 12.50it/s]Upper bound on the fitting time:  66%|██████▌   | 658/1000 [00:46<00:27, 12.54it/s]Upper bound on the fitting time:  66%|██████▌   | 660/1000 [00:46<00:27, 12.50it/s]Upper bound on the fitting time:  66%|██████▌   | 662/1000 [00:46<00:26, 12.54it/s]Upper bound on the fitting time:  66%|██████▋   | 664/1000 [00:46<00:26, 12.52it/s]Upper bound on the fitting time:  67%|██████▋   | 666/1000 [00:46<00:26, 12.52it/s]Upper bound on the fitting time:  67%|██████▋   | 668/1000 [00:46<00:26, 12.53it/s]Upper bound on the fitting time:  67%|██████▋   | 670/1000 [00:47<00:26, 12.45it/s]Upper bound on the fitting time:  67%|██████▋   | 672/1000 [00:47<00:26, 12.23it/s]Upper bound on the fitting time:  67%|██████▋   | 674/1000 [00:47<00:26, 12.19it/s]Upper bound on the fitting time:  68%|██████▊   | 676/1000 [00:47<00:26, 12.14it/s]Upper bound on the fitting time:  68%|██████▊   | 678/1000 [00:47<00:26, 12.15it/s]Upper bound on the fitting time:  68%|██████▊   | 680/1000 [00:47<00:26, 12.25it/s]Upper bound on the fitting time:  68%|██████▊   | 682/1000 [00:48<00:26, 12.22it/s]Upper bound on the fitting time:  68%|██████▊   | 684/1000 [00:48<00:25, 12.42it/s]Upper bound on the fitting time:  69%|██████▊   | 686/1000 [00:48<00:24, 12.60it/s]Upper bound on the fitting time:  69%|██████▉   | 688/1000 [00:48<00:25, 12.42it/s]Upper bound on the fitting time:  69%|██████▉   | 690/1000 [00:48<00:25, 12.38it/s]Upper bound on the fitting time:  69%|██████▉   | 692/1000 [00:48<00:23, 13.19it/s]Upper bound on the fitting time:  69%|██████▉   | 694/1000 [00:48<00:22, 13.65it/s]Upper bound on the fitting time:  70%|██████▉   | 696/1000 [00:49<00:21, 14.26it/s]Upper bound on the fitting time:  70%|██████▉   | 698/1000 [00:49<00:20, 14.56it/s]Upper bound on the fitting time:  70%|███████   | 700/1000 [00:49<00:20, 14.78it/s]Upper bound on the fitting time:  70%|███████   | 702/1000 [00:49<00:19, 14.97it/s]Upper bound on the fitting time:  70%|███████   | 704/1000 [00:49<00:19, 15.02it/s]Upper bound on the fitting time:  71%|███████   | 706/1000 [00:49<00:19, 15.17it/s]Upper bound on the fitting time:  71%|███████   | 708/1000 [00:49<00:19, 15.12it/s]Upper bound on the fitting time:  71%|███████   | 710/1000 [00:49<00:19, 15.19it/s]Upper bound on the fitting time:  71%|███████   | 712/1000 [00:50<00:18, 15.32it/s]Upper bound on the fitting time:  71%|███████▏  | 714/1000 [00:50<00:18, 15.38it/s]Upper bound on the fitting time:  72%|███████▏  | 716/1000 [00:50<00:18, 15.43it/s]Upper bound on the fitting time:  72%|███████▏  | 718/1000 [00:50<00:18, 15.51it/s]Upper bound on the fitting time:  72%|███████▏  | 720/1000 [00:50<00:18, 15.48it/s]Upper bound on the fitting time:  72%|███████▏  | 722/1000 [00:50<00:18, 15.34it/s]Upper bound on the fitting time:  72%|███████▏  | 724/1000 [00:50<00:18, 15.05it/s]Upper bound on the fitting time:  73%|███████▎  | 726/1000 [00:51<00:18, 15.21it/s]Upper bound on the fitting time:  73%|███████▎  | 728/1000 [00:51<00:17, 15.40it/s]Upper bound on the fitting time:  73%|███████▎  | 730/1000 [00:51<00:17, 15.50it/s]Upper bound on the fitting time:  73%|███████▎  | 732/1000 [00:51<00:17, 15.55it/s]Upper bound on the fitting time:  73%|███████▎  | 734/1000 [00:51<00:17, 15.45it/s]Upper bound on the fitting time:  74%|███████▎  | 736/1000 [00:51<00:17, 15.42it/s]Upper bound on the fitting time:  74%|███████▍  | 738/1000 [00:51<00:16, 15.54it/s]Upper bound on the fitting time:  74%|███████▍  | 740/1000 [00:51<00:16, 15.58it/s]Upper bound on the fitting time:  74%|███████▍  | 742/1000 [00:52<00:16, 15.59it/s]Upper bound on the fitting time:  74%|███████▍  | 744/1000 [00:52<00:16, 15.51it/s]Upper bound on the fitting time:  75%|███████▍  | 746/1000 [00:52<00:16, 15.51it/s]Upper bound on the fitting time:  75%|███████▍  | 748/1000 [00:52<00:16, 15.56it/s]Upper bound on the fitting time:  75%|███████▌  | 750/1000 [00:52<00:16, 15.39it/s]Upper bound on the fitting time:  75%|███████▌  | 752/1000 [00:52<00:16, 15.22it/s]Upper bound on the fitting time:  75%|███████▌  | 754/1000 [00:52<00:16, 15.33it/s]Upper bound on the fitting time:  76%|███████▌  | 756/1000 [00:52<00:16, 15.20it/s]Upper bound on the fitting time:  76%|███████▌  | 758/1000 [00:53<00:16, 15.12it/s]Upper bound on the fitting time:  76%|███████▌  | 760/1000 [00:53<00:15, 15.20it/s]Upper bound on the fitting time:  76%|███████▌  | 762/1000 [00:53<00:15, 15.02it/s]Upper bound on the fitting time:  76%|███████▋  | 764/1000 [00:53<00:15, 15.06it/s]Upper bound on the fitting time:  77%|███████▋  | 766/1000 [00:53<00:15, 14.81it/s]Upper bound on the fitting time:  77%|███████▋  | 768/1000 [00:53<00:15, 14.95it/s]Upper bound on the fitting time:  77%|███████▋  | 770/1000 [00:53<00:15, 15.08it/s]Upper bound on the fitting time:  77%|███████▋  | 772/1000 [00:54<00:14, 15.25it/s]Upper bound on the fitting time:  77%|███████▋  | 774/1000 [00:54<00:14, 15.22it/s]Upper bound on the fitting time:  78%|███████▊  | 776/1000 [00:54<00:15, 14.39it/s]Upper bound on the fitting time:  78%|███████▊  | 778/1000 [00:54<00:15, 14.69it/s]Upper bound on the fitting time:  78%|███████▊  | 780/1000 [00:54<00:14, 14.87it/s]Upper bound on the fitting time:  78%|███████▊  | 782/1000 [00:54<00:14, 15.05it/s]Upper bound on the fitting time:  78%|███████▊  | 784/1000 [00:54<00:14, 15.09it/s]Upper bound on the fitting time:  79%|███████▊  | 786/1000 [00:54<00:14, 14.73it/s]Upper bound on the fitting time:  79%|███████▉  | 788/1000 [00:55<00:14, 14.95it/s]Upper bound on the fitting time:  79%|███████▉  | 790/1000 [00:55<00:13, 15.13it/s]Upper bound on the fitting time:  79%|███████▉  | 792/1000 [00:55<00:13, 15.22it/s]Upper bound on the fitting time:  79%|███████▉  | 794/1000 [00:55<00:13, 15.35it/s]Upper bound on the fitting time:  80%|███████▉  | 796/1000 [00:55<00:13, 15.36it/s]Upper bound on the fitting time:  80%|███████▉  | 798/1000 [00:55<00:13, 15.46it/s]Upper bound on the fitting time:  80%|████████  | 800/1000 [00:55<00:12, 15.56it/s]Upper bound on the fitting time:  80%|████████  | 802/1000 [00:56<00:12, 15.44it/s]Upper bound on the fitting time:  80%|████████  | 804/1000 [00:56<00:12, 15.39it/s]Upper bound on the fitting time:  81%|████████  | 806/1000 [00:56<00:12, 15.47it/s]Upper bound on the fitting time:  81%|████████  | 808/1000 [00:56<00:12, 15.56it/s]Upper bound on the fitting time:  81%|████████  | 810/1000 [00:56<00:12, 15.46it/s]Upper bound on the fitting time:  81%|████████  | 812/1000 [00:56<00:12, 15.44it/s]Upper bound on the fitting time:  81%|████████▏ | 814/1000 [00:56<00:11, 15.60it/s]Upper bound on the fitting time:  82%|████████▏ | 816/1000 [00:56<00:12, 15.26it/s]Upper bound on the fitting time:  82%|████████▏ | 818/1000 [00:57<00:11, 15.31it/s]Upper bound on the fitting time:  82%|████████▏ | 820/1000 [00:57<00:11, 15.43it/s]Upper bound on the fitting time:  82%|████████▏ | 822/1000 [00:57<00:11, 15.48it/s]Upper bound on the fitting time:  82%|████████▏ | 824/1000 [00:57<00:11, 15.51it/s]Upper bound on the fitting time:  83%|████████▎ | 826/1000 [00:57<00:11, 15.17it/s]Upper bound on the fitting time:  83%|████████▎ | 828/1000 [00:57<00:11, 15.37it/s]Upper bound on the fitting time:  83%|████████▎ | 830/1000 [00:57<00:11, 15.43it/s]Upper bound on the fitting time:  83%|████████▎ | 832/1000 [00:57<00:10, 15.47it/s]Upper bound on the fitting time:  83%|████████▎ | 834/1000 [00:58<00:10, 15.60it/s]Upper bound on the fitting time:  84%|████████▎ | 836/1000 [00:58<00:10, 15.71it/s]Upper bound on the fitting time:  84%|████████▍ | 838/1000 [00:58<00:10, 15.79it/s]Upper bound on the fitting time:  84%|████████▍ | 840/1000 [00:58<00:10, 15.76it/s]Upper bound on the fitting time:  84%|████████▍ | 842/1000 [00:58<00:10, 15.74it/s]Upper bound on the fitting time:  84%|████████▍ | 844/1000 [00:58<00:09, 15.75it/s]Upper bound on the fitting time:  85%|████████▍ | 846/1000 [00:58<00:09, 15.67it/s]Upper bound on the fitting time:  85%|████████▍ | 848/1000 [00:58<00:09, 15.69it/s]Upper bound on the fitting time:  85%|████████▌ | 850/1000 [00:59<00:09, 15.58it/s]Upper bound on the fitting time:  85%|████████▌ | 852/1000 [00:59<00:09, 15.63it/s]Upper bound on the fitting time:  85%|████████▌ | 854/1000 [00:59<00:09, 15.64it/s]Upper bound on the fitting time:  86%|████████▌ | 856/1000 [00:59<00:09, 15.74it/s]Upper bound on the fitting time:  86%|████████▌ | 858/1000 [00:59<00:09, 15.61it/s]Upper bound on the fitting time:  86%|████████▌ | 860/1000 [00:59<00:09, 15.23it/s]Upper bound on the fitting time:  86%|████████▌ | 862/1000 [00:59<00:09, 15.32it/s]Upper bound on the fitting time:  86%|████████▋ | 864/1000 [01:00<00:08, 15.26it/s]Upper bound on the fitting time:  87%|████████▋ | 866/1000 [01:00<00:08, 15.38it/s]Upper bound on the fitting time:  87%|████████▋ | 868/1000 [01:00<00:08, 15.52it/s]Upper bound on the fitting time:  87%|████████▋ | 870/1000 [01:00<00:08, 15.57it/s]Upper bound on the fitting time:  87%|████████▋ | 872/1000 [01:00<00:08, 15.59it/s]Upper bound on the fitting time:  87%|████████▋ | 874/1000 [01:00<00:08, 15.68it/s]Upper bound on the fitting time:  88%|████████▊ | 876/1000 [01:00<00:07, 15.59it/s]Upper bound on the fitting time:  88%|████████▊ | 878/1000 [01:00<00:07, 15.52it/s]Upper bound on the fitting time:  88%|████████▊ | 880/1000 [01:01<00:07, 15.56it/s]Upper bound on the fitting time:  88%|████████▊ | 882/1000 [01:01<00:07, 15.61it/s]Upper bound on the fitting time:  88%|████████▊ | 884/1000 [01:01<00:07, 15.68it/s]Upper bound on the fitting time:  89%|████████▊ | 886/1000 [01:01<00:07, 15.72it/s]Upper bound on the fitting time:  89%|████████▉ | 888/1000 [01:01<00:07, 15.87it/s]Upper bound on the fitting time:  89%|████████▉ | 890/1000 [01:01<00:07, 15.57it/s]Upper bound on the fitting time:  89%|████████▉ | 892/1000 [01:01<00:06, 15.61it/s]Upper bound on the fitting time:  89%|████████▉ | 894/1000 [01:01<00:06, 15.38it/s]Upper bound on the fitting time:  90%|████████▉ | 896/1000 [01:02<00:06, 15.34it/s]Upper bound on the fitting time:  90%|████████▉ | 898/1000 [01:02<00:06, 14.90it/s]Upper bound on the fitting time:  90%|█████████ | 900/1000 [01:02<00:06, 15.00it/s]Upper bound on the fitting time:  90%|█████████ | 902/1000 [01:02<00:06, 15.08it/s]Upper bound on the fitting time:  90%|█████████ | 904/1000 [01:02<00:06, 14.75it/s]Upper bound on the fitting time:  91%|█████████ | 906/1000 [01:02<00:06, 14.46it/s]Upper bound on the fitting time:  91%|█████████ | 908/1000 [01:02<00:06, 14.02it/s]Upper bound on the fitting time:  91%|█████████ | 910/1000 [01:03<00:06, 13.56it/s]Upper bound on the fitting time:  91%|█████████ | 912/1000 [01:03<00:06, 13.59it/s]Upper bound on the fitting time:  91%|█████████▏| 914/1000 [01:03<00:06, 13.56it/s]Upper bound on the fitting time:  92%|█████████▏| 916/1000 [01:03<00:06, 13.35it/s]Upper bound on the fitting time:  92%|█████████▏| 918/1000 [01:03<00:06, 13.15it/s]Upper bound on the fitting time:  92%|█████████▏| 920/1000 [01:03<00:05, 13.76it/s]Upper bound on the fitting time:  92%|█████████▏| 922/1000 [01:03<00:05, 14.15it/s]Upper bound on the fitting time:  92%|█████████▏| 924/1000 [01:04<00:05, 14.60it/s]Upper bound on the fitting time:  93%|█████████▎| 926/1000 [01:04<00:04, 14.85it/s]Upper bound on the fitting time:  93%|█████████▎| 928/1000 [01:04<00:04, 15.02it/s]Upper bound on the fitting time:  93%|█████████▎| 930/1000 [01:04<00:04, 15.24it/s]Upper bound on the fitting time:  93%|█████████▎| 932/1000 [01:04<00:04, 15.46it/s]Upper bound on the fitting time:  93%|█████████▎| 934/1000 [01:04<00:04, 15.49it/s]Upper bound on the fitting time:  94%|█████████▎| 936/1000 [01:04<00:04, 15.58it/s]Upper bound on the fitting time:  94%|█████████▍| 938/1000 [01:04<00:04, 15.40it/s]Upper bound on the fitting time:  94%|█████████▍| 940/1000 [01:05<00:03, 15.38it/s]Upper bound on the fitting time:  94%|█████████▍| 942/1000 [01:05<00:03, 14.95it/s]Upper bound on the fitting time:  94%|█████████▍| 944/1000 [01:05<00:03, 14.00it/s]Upper bound on the fitting time:  95%|█████████▍| 946/1000 [01:05<00:03, 13.85it/s]Upper bound on the fitting time:  95%|█████████▍| 948/1000 [01:05<00:03, 13.81it/s]Upper bound on the fitting time:  95%|█████████▌| 950/1000 [01:05<00:03, 14.25it/s]Upper bound on the fitting time:  95%|█████████▌| 952/1000 [01:05<00:03, 14.53it/s]Upper bound on the fitting time:  95%|█████████▌| 954/1000 [01:06<00:03, 14.84it/s]Upper bound on the fitting time:  96%|█████████▌| 956/1000 [01:06<00:03, 14.48it/s]Upper bound on the fitting time:  96%|█████████▌| 958/1000 [01:06<00:02, 14.78it/s]Upper bound on the fitting time:  96%|█████████▌| 960/1000 [01:06<00:02, 14.76it/s]Upper bound on the fitting time:  96%|█████████▌| 962/1000 [01:06<00:02, 15.06it/s]Upper bound on the fitting time:  96%|█████████▋| 964/1000 [01:06<00:02, 15.21it/s]Upper bound on the fitting time:  97%|█████████▋| 966/1000 [01:06<00:02, 15.16it/s]Upper bound on the fitting time:  97%|█████████▋| 968/1000 [01:07<00:02, 15.25it/s]Upper bound on the fitting time:  97%|█████████▋| 970/1000 [01:07<00:01, 15.27it/s]Upper bound on the fitting time:  97%|█████████▋| 972/1000 [01:07<00:01, 15.43it/s]Upper bound on the fitting time:  97%|█████████▋| 974/1000 [01:07<00:01, 15.44it/s]Upper bound on the fitting time:  98%|█████████▊| 976/1000 [01:07<00:01, 15.49it/s]Upper bound on the fitting time:  98%|█████████▊| 978/1000 [01:07<00:01, 15.58it/s]Upper bound on the fitting time:  98%|█████████▊| 980/1000 [01:07<00:01, 15.47it/s]Upper bound on the fitting time:  98%|█████████▊| 982/1000 [01:07<00:01, 15.39it/s]Upper bound on the fitting time:  98%|█████████▊| 984/1000 [01:08<00:01, 15.38it/s]Upper bound on the fitting time:  99%|█████████▊| 986/1000 [01:08<00:00, 15.44it/s]Upper bound on the fitting time:  99%|█████████▉| 988/1000 [01:08<00:00, 15.58it/s]Upper bound on the fitting time:  99%|█████████▉| 990/1000 [01:08<00:00, 15.67it/s]Upper bound on the fitting time:  99%|█████████▉| 992/1000 [01:08<00:00, 15.63it/s]Upper bound on the fitting time:  99%|█████████▉| 994/1000 [01:08<00:00, 15.72it/s]Upper bound on the fitting time: 100%|█████████▉| 996/1000 [01:08<00:00, 15.75it/s]Upper bound on the fitting time: 100%|█████████▉| 998/1000 [01:08<00:00, 15.52it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [01:09<00:00, 15.60it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [01:09<00:00, 14.48it/s]
    +

    7.1 ZIPlnPCACollection for multiple ranks

    The rank is a hyperparameter that can be manually defined. Alternatively, a data-driven approach to rank selection can be performed using the ZIPlnPCACollection class (documentation). This class fits multiple models with different ranks:

    -
    -
    from pyPLNmodels import ZIPlnPCACollection
    -zipcas = ZIPlnPCACollection.from_formula('endog ~ 1 + site', data=high_d_micro, ranks=[3, 5, 10, 15]).fit()
    +
    +
    from pyPLNmodels import ZIPlnPCACollection
    +zipcas = ZIPlnPCACollection.from_formula('endog ~ 1 + site', data=high_d_micro, ranks=[3, 5, 10, 15]).fit()
    -
    /home/bastien/These/redesign/pyPLNmodels/pyPLNmodels/utils/_data_handler.py:431: UserWarning: The (4) following (index) variables contain only zeros and are removed: [144 267 268 364].
    -  warnings.warn(
    -Upper bound on the fitting time:   0%|          | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time:   0%|          | 2/1000 [00:00<01:03, 15.79it/s]Upper bound on the fitting time:   0%|          | 4/1000 [00:00<01:02, 15.95it/s]Upper bound on the fitting time:   1%|          | 6/1000 [00:00<01:02, 15.88it/s]Upper bound on the fitting time:   1%|          | 8/1000 [00:00<01:02, 15.86it/s]Upper bound on the fitting time:   1%|          | 10/1000 [00:00<01:09, 14.32it/s]Upper bound on the fitting time:   1%|          | 12/1000 [00:00<01:10, 14.11it/s]Upper bound on the fitting time:   1%|▏         | 14/1000 [00:00<01:12, 13.59it/s]Upper bound on the fitting time:   2%|▏         | 16/1000 [00:01<01:12, 13.55it/s]Upper bound on the fitting time:   2%|▏         | 18/1000 [00:01<01:15, 13.09it/s]Upper bound on the fitting time:   2%|▏         | 20/1000 [00:01<01:13, 13.32it/s]Upper bound on the fitting time:   2%|▏         | 22/1000 [00:01<01:13, 13.24it/s]Upper bound on the fitting time:   2%|▏         | 24/1000 [00:01<01:13, 13.26it/s]Upper bound on the fitting time:   3%|▎         | 26/1000 [00:01<01:13, 13.26it/s]Upper bound on the fitting time:   3%|▎         | 28/1000 [00:02<01:13, 13.28it/s]Upper bound on the fitting time:   3%|▎         | 30/1000 [00:02<01:11, 13.48it/s]Upper bound on the fitting time:   3%|▎         | 32/1000 [00:02<01:11, 13.46it/s]Upper bound on the fitting time:   3%|▎         | 34/1000 [00:02<01:11, 13.49it/s]Upper bound on the fitting time:   4%|▎         | 36/1000 [00:02<01:10, 13.74it/s]Upper bound on the fitting time:   4%|▍         | 38/1000 [00:02<01:08, 14.14it/s]Upper bound on the fitting time:   4%|▍         | 40/1000 [00:02<01:06, 14.51it/s]Upper bound on the fitting time:   4%|▍         | 42/1000 [00:03<01:04, 14.79it/s]Upper bound on the fitting time:   4%|▍         | 44/1000 [00:03<01:04, 14.88it/s]Upper bound on the fitting time:   5%|▍         | 46/1000 [00:03<01:03, 15.11it/s]Upper bound on the fitting time:   5%|▍         | 48/1000 [00:03<01:02, 15.22it/s]Upper bound on the fitting time:   5%|▌         | 50/1000 [00:03<01:02, 15.30it/s]Upper bound on the fitting time:   5%|▌         | 52/1000 [00:03<01:02, 15.18it/s]Upper bound on the fitting time:   5%|▌         | 54/1000 [00:03<01:03, 14.89it/s]Upper bound on the fitting time:   6%|▌         | 56/1000 [00:03<01:04, 14.63it/s]Upper bound on the fitting time:   6%|▌         | 58/1000 [00:04<01:03, 14.90it/s]Upper bound on the fitting time:   6%|▌         | 60/1000 [00:04<01:03, 14.70it/s]Upper bound on the fitting time:   6%|▌         | 62/1000 [00:04<01:04, 14.54it/s]Upper bound on the fitting time:   6%|▋         | 64/1000 [00:04<01:09, 13.48it/s]Upper bound on the fitting time:   7%|▋         | 66/1000 [00:04<01:09, 13.45it/s]Upper bound on the fitting time:   7%|▋         | 68/1000 [00:04<01:13, 12.68it/s]Upper bound on the fitting time:   7%|▋         | 70/1000 [00:05<01:13, 12.64it/s]Upper bound on the fitting time:   7%|▋         | 72/1000 [00:05<01:11, 13.03it/s]Upper bound on the fitting time:   7%|▋         | 74/1000 [00:05<01:10, 13.04it/s]Upper bound on the fitting time:   8%|▊         | 76/1000 [00:05<01:09, 13.22it/s]Upper bound on the fitting time:   8%|▊         | 78/1000 [00:05<01:08, 13.43it/s]Upper bound on the fitting time:   8%|▊         | 80/1000 [00:05<01:08, 13.44it/s]Upper bound on the fitting time:   8%|▊         | 82/1000 [00:05<01:08, 13.48it/s]Upper bound on the fitting time:   8%|▊         | 84/1000 [00:06<01:07, 13.57it/s]Upper bound on the fitting time:   9%|▊         | 86/1000 [00:06<01:06, 13.69it/s]Upper bound on the fitting time:   9%|▉         | 88/1000 [00:06<01:06, 13.81it/s]Upper bound on the fitting time:   9%|▉         | 90/1000 [00:06<01:06, 13.72it/s]Upper bound on the fitting time:   9%|▉         | 92/1000 [00:06<01:05, 13.80it/s]Upper bound on the fitting time:   9%|▉         | 94/1000 [00:06<01:05, 13.75it/s]Upper bound on the fitting time:  10%|▉         | 96/1000 [00:06<01:06, 13.50it/s]Upper bound on the fitting time:  10%|▉         | 98/1000 [00:07<01:07, 13.30it/s]Upper bound on the fitting time:  10%|█         | 100/1000 [00:07<01:07, 13.38it/s]Upper bound on the fitting time:  10%|█         | 102/1000 [00:07<01:06, 13.45it/s]Upper bound on the fitting time:  10%|█         | 104/1000 [00:07<01:06, 13.52it/s]Upper bound on the fitting time:  11%|█         | 106/1000 [00:07<01:06, 13.47it/s]Upper bound on the fitting time:  11%|█         | 108/1000 [00:07<01:09, 12.88it/s]Upper bound on the fitting time:  11%|█         | 110/1000 [00:07<01:10, 12.71it/s]Upper bound on the fitting time:  11%|█         | 112/1000 [00:08<01:10, 12.53it/s]Upper bound on the fitting time:  11%|█▏        | 114/1000 [00:08<01:15, 11.69it/s]Upper bound on the fitting time:  12%|█▏        | 116/1000 [00:08<01:15, 11.68it/s]Upper bound on the fitting time:  12%|█▏        | 118/1000 [00:08<01:13, 12.00it/s]Upper bound on the fitting time:  12%|█▏        | 120/1000 [00:08<01:13, 12.02it/s]Upper bound on the fitting time:  12%|█▏        | 122/1000 [00:09<01:12, 12.08it/s]Upper bound on the fitting time:  12%|█▏        | 124/1000 [00:09<01:10, 12.47it/s]Upper bound on the fitting time:  13%|█▎        | 126/1000 [00:09<01:08, 12.80it/s]Upper bound on the fitting time:  13%|█▎        | 128/1000 [00:09<01:09, 12.55it/s]Upper bound on the fitting time:  13%|█▎        | 130/1000 [00:09<01:09, 12.57it/s]Upper bound on the fitting time:  13%|█▎        | 132/1000 [00:09<01:10, 12.38it/s]Upper bound on the fitting time:  13%|█▎        | 134/1000 [00:09<01:09, 12.48it/s]Upper bound on the fitting time:  14%|█▎        | 136/1000 [00:10<01:08, 12.62it/s]Upper bound on the fitting time:  14%|█▍        | 138/1000 [00:10<01:08, 12.60it/s]Upper bound on the fitting time:  14%|█▍        | 140/1000 [00:10<01:08, 12.50it/s]Upper bound on the fitting time:  14%|█▍        | 142/1000 [00:10<01:08, 12.46it/s]Upper bound on the fitting time:  14%|█▍        | 144/1000 [00:10<01:08, 12.41it/s]Upper bound on the fitting time:  15%|█▍        | 146/1000 [00:10<01:08, 12.46it/s]Upper bound on the fitting time:  15%|█▍        | 148/1000 [00:11<01:08, 12.50it/s]Upper bound on the fitting time:  15%|█▌        | 150/1000 [00:11<01:07, 12.51it/s]Upper bound on the fitting time:  15%|█▌        | 152/1000 [00:11<01:07, 12.48it/s]Upper bound on the fitting time:  15%|█▌        | 154/1000 [00:11<01:08, 12.44it/s]Upper bound on the fitting time:  16%|█▌        | 156/1000 [00:11<01:08, 12.30it/s]Upper bound on the fitting time:  16%|█▌        | 158/1000 [00:11<01:07, 12.39it/s]Upper bound on the fitting time:  16%|█▌        | 160/1000 [00:12<01:07, 12.49it/s]Upper bound on the fitting time:  16%|█▌        | 162/1000 [00:12<01:06, 12.67it/s]Upper bound on the fitting time:  16%|█▋        | 164/1000 [00:12<01:05, 12.71it/s]Upper bound on the fitting time:  17%|█▋        | 166/1000 [00:12<01:06, 12.57it/s]Upper bound on the fitting time:  17%|█▋        | 168/1000 [00:12<01:06, 12.57it/s]Upper bound on the fitting time:  17%|█▋        | 170/1000 [00:12<01:05, 12.59it/s]Upper bound on the fitting time:  17%|█▋        | 172/1000 [00:12<01:05, 12.57it/s]Upper bound on the fitting time:  17%|█▋        | 174/1000 [00:13<01:06, 12.47it/s]Upper bound on the fitting time:  18%|█▊        | 176/1000 [00:13<01:06, 12.36it/s]Upper bound on the fitting time:  18%|█▊        | 178/1000 [00:13<01:06, 12.36it/s]Upper bound on the fitting time:  18%|█▊        | 180/1000 [00:13<01:06, 12.37it/s]Upper bound on the fitting time:  18%|█▊        | 182/1000 [00:13<01:05, 12.42it/s]Upper bound on the fitting time:  18%|█▊        | 184/1000 [00:13<01:04, 12.57it/s]Upper bound on the fitting time:  19%|█▊        | 186/1000 [00:14<01:05, 12.50it/s]Upper bound on the fitting time:  19%|█▉        | 188/1000 [00:14<01:05, 12.46it/s]Upper bound on the fitting time:  19%|█▉        | 190/1000 [00:14<01:04, 12.52it/s]Upper bound on the fitting time:  19%|█▉        | 192/1000 [00:14<01:05, 12.37it/s]Upper bound on the fitting time:  19%|█▉        | 194/1000 [00:14<01:05, 12.32it/s]Upper bound on the fitting time:  20%|█▉        | 196/1000 [00:14<01:04, 12.38it/s]Upper bound on the fitting time:  20%|█▉        | 198/1000 [00:15<01:04, 12.40it/s]Upper bound on the fitting time:  20%|██        | 200/1000 [00:15<01:04, 12.39it/s]Upper bound on the fitting time:  20%|██        | 202/1000 [00:15<01:04, 12.34it/s]Upper bound on the fitting time:  20%|██        | 204/1000 [00:15<01:04, 12.38it/s]Upper bound on the fitting time:  21%|██        | 206/1000 [00:15<01:03, 12.52it/s]Upper bound on the fitting time:  21%|██        | 208/1000 [00:15<01:03, 12.52it/s]Upper bound on the fitting time:  21%|██        | 210/1000 [00:16<01:02, 12.55it/s]Upper bound on the fitting time:  21%|██        | 212/1000 [00:16<01:03, 12.42it/s]Upper bound on the fitting time:  21%|██▏       | 214/1000 [00:16<01:03, 12.36it/s]Upper bound on the fitting time:  22%|██▏       | 216/1000 [00:16<01:03, 12.37it/s]Upper bound on the fitting time:  22%|██▏       | 218/1000 [00:16<01:02, 12.43it/s]Upper bound on the fitting time:  22%|██▏       | 220/1000 [00:16<01:02, 12.46it/s]Upper bound on the fitting time:  22%|██▏       | 222/1000 [00:17<01:02, 12.38it/s]Upper bound on the fitting time:  22%|██▏       | 224/1000 [00:17<01:02, 12.43it/s]Upper bound on the fitting time:  23%|██▎       | 226/1000 [00:17<01:02, 12.40it/s]Upper bound on the fitting time:  23%|██▎       | 228/1000 [00:17<01:02, 12.30it/s]Upper bound on the fitting time:  23%|██▎       | 230/1000 [00:17<01:02, 12.38it/s]Upper bound on the fitting time:  23%|██▎       | 232/1000 [00:17<01:01, 12.49it/s]Upper bound on the fitting time:  23%|██▎       | 234/1000 [00:17<01:00, 12.59it/s]Upper bound on the fitting time:  24%|██▎       | 236/1000 [00:18<01:00, 12.63it/s]Upper bound on the fitting time:  24%|██▍       | 238/1000 [00:18<01:00, 12.56it/s]Upper bound on the fitting time:  24%|██▍       | 240/1000 [00:18<01:00, 12.52it/s]Upper bound on the fitting time:  24%|██▍       | 242/1000 [00:18<01:01, 12.36it/s]Upper bound on the fitting time:  24%|██▍       | 244/1000 [00:18<01:02, 12.18it/s]Upper bound on the fitting time:  25%|██▍       | 246/1000 [00:18<01:03, 11.89it/s]Upper bound on the fitting time:  25%|██▍       | 248/1000 [00:19<01:03, 11.83it/s]Upper bound on the fitting time:  25%|██▌       | 250/1000 [00:19<01:03, 11.76it/s]Upper bound on the fitting time:  25%|██▌       | 252/1000 [00:19<01:05, 11.36it/s]Upper bound on the fitting time:  25%|██▌       | 254/1000 [00:19<01:07, 11.00it/s]Upper bound on the fitting time:  26%|██▌       | 256/1000 [00:19<01:06, 11.13it/s]Upper bound on the fitting time:  26%|██▌       | 258/1000 [00:20<01:01, 12.11it/s]Upper bound on the fitting time:  26%|██▌       | 260/1000 [00:20<00:57, 12.83it/s]Upper bound on the fitting time:  26%|██▌       | 262/1000 [00:20<00:54, 13.48it/s]Upper bound on the fitting time:  26%|██▋       | 264/1000 [00:20<00:52, 13.89it/s]Upper bound on the fitting time:  27%|██▋       | 266/1000 [00:20<00:51, 14.33it/s]Upper bound on the fitting time:  27%|██▋       | 268/1000 [00:20<00:50, 14.37it/s]Upper bound on the fitting time:  27%|██▋       | 270/1000 [00:20<00:49, 14.60it/s]Upper bound on the fitting time:  27%|██▋       | 272/1000 [00:20<00:50, 14.48it/s]Upper bound on the fitting time:  27%|██▋       | 274/1000 [00:21<00:50, 14.51it/s]Upper bound on the fitting time:  28%|██▊       | 276/1000 [00:21<00:49, 14.68it/s]Upper bound on the fitting time:  28%|██▊       | 278/1000 [00:21<00:48, 14.80it/s]Upper bound on the fitting time:  28%|██▊       | 280/1000 [00:21<00:48, 14.76it/s]Upper bound on the fitting time:  28%|██▊       | 282/1000 [00:21<00:48, 14.87it/s]Upper bound on the fitting time:  28%|██▊       | 284/1000 [00:21<00:48, 14.62it/s]Upper bound on the fitting time:  29%|██▊       | 286/1000 [00:21<00:48, 14.86it/s]Upper bound on the fitting time:  29%|██▉       | 288/1000 [00:22<00:47, 15.05it/s]Upper bound on the fitting time:  29%|██▉       | 290/1000 [00:22<00:46, 15.14it/s]Upper bound on the fitting time:  29%|██▉       | 292/1000 [00:22<00:48, 14.69it/s]Upper bound on the fitting time:  29%|██▉       | 294/1000 [00:22<00:47, 14.84it/s]Upper bound on the fitting time:  30%|██▉       | 296/1000 [00:22<00:46, 15.03it/s]Upper bound on the fitting time:  30%|██▉       | 298/1000 [00:22<00:47, 14.67it/s]Upper bound on the fitting time:  30%|███       | 300/1000 [00:22<00:47, 14.80it/s]Upper bound on the fitting time:  30%|███       | 302/1000 [00:22<00:46, 14.98it/s]Upper bound on the fitting time:  30%|███       | 304/1000 [00:23<00:46, 15.06it/s]Upper bound on the fitting time:  31%|███       | 306/1000 [00:23<00:45, 15.17it/s]Upper bound on the fitting time:  31%|███       | 308/1000 [00:23<00:45, 15.15it/s]Upper bound on the fitting time:  31%|███       | 310/1000 [00:23<00:45, 15.08it/s]Upper bound on the fitting time:  31%|███       | 312/1000 [00:23<00:45, 15.23it/s]Upper bound on the fitting time:  31%|███▏      | 314/1000 [00:23<00:45, 15.01it/s]Upper bound on the fitting time:  32%|███▏      | 316/1000 [00:23<00:45, 15.09it/s]Upper bound on the fitting time:  32%|███▏      | 318/1000 [00:24<00:45, 14.93it/s]Upper bound on the fitting time:  32%|███▏      | 320/1000 [00:24<00:49, 13.70it/s]Upper bound on the fitting time:  32%|███▏      | 322/1000 [00:24<00:55, 12.21it/s]Upper bound on the fitting time:  32%|███▏      | 324/1000 [00:24<00:55, 12.12it/s]Upper bound on the fitting time:  33%|███▎      | 326/1000 [00:24<00:55, 12.19it/s]Upper bound on the fitting time:  33%|███▎      | 328/1000 [00:24<00:53, 12.60it/s]Upper bound on the fitting time:  33%|███▎      | 330/1000 [00:25<00:53, 12.63it/s]Upper bound on the fitting time:  33%|███▎      | 332/1000 [00:25<00:57, 11.70it/s]Upper bound on the fitting time:  33%|███▎      | 334/1000 [00:25<01:07,  9.81it/s]Upper bound on the fitting time:  34%|███▎      | 336/1000 [00:25<01:07,  9.84it/s]Upper bound on the fitting time:  34%|███▍      | 338/1000 [00:25<01:07,  9.87it/s]Upper bound on the fitting time:  34%|███▍      | 340/1000 [00:26<01:05, 10.00it/s]Upper bound on the fitting time:  34%|███▍      | 342/1000 [00:26<01:07,  9.72it/s]Upper bound on the fitting time:  34%|███▍      | 343/1000 [00:26<01:10,  9.36it/s]Upper bound on the fitting time:  34%|███▍      | 344/1000 [00:26<01:10,  9.34it/s]Upper bound on the fitting time:  34%|███▍      | 345/1000 [00:26<01:12,  9.06it/s]Upper bound on the fitting time:  35%|███▍      | 346/1000 [00:26<01:14,  8.82it/s]Upper bound on the fitting time:  35%|███▍      | 347/1000 [00:26<01:19,  8.22it/s]Upper bound on the fitting time:  35%|███▍      | 348/1000 [00:27<01:22,  7.90it/s]Upper bound on the fitting time:  35%|███▍      | 349/1000 [00:27<01:25,  7.62it/s]Upper bound on the fitting time:  35%|███▌      | 350/1000 [00:27<01:33,  6.93it/s]Upper bound on the fitting time:  35%|███▌      | 351/1000 [00:27<01:35,  6.82it/s]Upper bound on the fitting time:  35%|███▌      | 352/1000 [00:27<01:33,  6.94it/s]Upper bound on the fitting time:  35%|███▌      | 353/1000 [00:27<01:33,  6.92it/s]Upper bound on the fitting time:  35%|███▌      | 354/1000 [00:27<01:28,  7.32it/s]Upper bound on the fitting time:  36%|███▌      | 355/1000 [00:28<01:23,  7.70it/s]Upper bound on the fitting time:  36%|███▌      | 356/1000 [00:28<01:23,  7.74it/s]Upper bound on the fitting time:  36%|███▌      | 357/1000 [00:28<01:24,  7.61it/s]Upper bound on the fitting time:  36%|███▌      | 358/1000 [00:28<01:28,  7.26it/s]Upper bound on the fitting time:  36%|███▌      | 359/1000 [00:28<01:29,  7.13it/s]Upper bound on the fitting time:  36%|███▌      | 360/1000 [00:28<01:31,  7.01it/s]Upper bound on the fitting time:  36%|███▌      | 361/1000 [00:28<01:30,  7.07it/s]Upper bound on the fitting time:  36%|███▌      | 362/1000 [00:29<01:31,  6.94it/s]Upper bound on the fitting time:  36%|███▋      | 363/1000 [00:29<01:34,  6.75it/s]Upper bound on the fitting time:  36%|███▋      | 364/1000 [00:29<01:30,  7.00it/s]Upper bound on the fitting time:  36%|███▋      | 365/1000 [00:29<01:28,  7.21it/s]Upper bound on the fitting time:  37%|███▋      | 366/1000 [00:29<01:27,  7.29it/s]Upper bound on the fitting time:  37%|███▋      | 367/1000 [00:29<01:27,  7.23it/s]Upper bound on the fitting time:  37%|███▋      | 368/1000 [00:29<01:30,  6.96it/s]Upper bound on the fitting time:  37%|███▋      | 369/1000 [00:30<01:30,  6.94it/s]Upper bound on the fitting time:  37%|███▋      | 370/1000 [00:30<01:29,  7.07it/s]Upper bound on the fitting time:  37%|███▋      | 371/1000 [00:30<01:29,  7.01it/s]Upper bound on the fitting time:  37%|███▋      | 372/1000 [00:30<01:30,  6.93it/s]Upper bound on the fitting time:  37%|███▋      | 373/1000 [00:30<01:25,  7.31it/s]Upper bound on the fitting time:  37%|███▋      | 374/1000 [00:30<01:28,  7.08it/s]Upper bound on the fitting time:  38%|███▊      | 375/1000 [00:30<01:28,  7.08it/s]Upper bound on the fitting time:  38%|███▊      | 376/1000 [00:31<01:27,  7.09it/s]Upper bound on the fitting time:  38%|███▊      | 377/1000 [00:31<01:26,  7.20it/s]Upper bound on the fitting time:  38%|███▊      | 378/1000 [00:31<01:25,  7.24it/s]Upper bound on the fitting time:  38%|███▊      | 379/1000 [00:31<01:23,  7.43it/s]Upper bound on the fitting time:  38%|███▊      | 380/1000 [00:31<01:27,  7.10it/s]Upper bound on the fitting time:  38%|███▊      | 381/1000 [00:31<01:29,  6.92it/s]Upper bound on the fitting time:  38%|███▊      | 382/1000 [00:31<01:34,  6.53it/s]Upper bound on the fitting time:  38%|███▊      | 383/1000 [00:32<01:40,  6.17it/s]Upper bound on the fitting time:  38%|███▊      | 384/1000 [00:32<01:36,  6.41it/s]Upper bound on the fitting time:  38%|███▊      | 385/1000 [00:32<01:54,  5.38it/s]Upper bound on the fitting time:  39%|███▊      | 386/1000 [00:32<01:47,  5.71it/s]Upper bound on the fitting time:  39%|███▊      | 387/1000 [00:32<01:41,  6.04it/s]Upper bound on the fitting time:  39%|███▉      | 388/1000 [00:32<01:32,  6.60it/s]Upper bound on the fitting time:  39%|███▉      | 389/1000 [00:33<01:26,  7.07it/s]Upper bound on the fitting time:  39%|███▉      | 390/1000 [00:33<01:20,  7.60it/s]Upper bound on the fitting time:  39%|███▉      | 391/1000 [00:33<01:16,  7.97it/s]Upper bound on the fitting time:  39%|███▉      | 392/1000 [00:33<01:19,  7.62it/s]Upper bound on the fitting time:  39%|███▉      | 393/1000 [00:33<01:20,  7.52it/s]Upper bound on the fitting time:  39%|███▉      | 394/1000 [00:33<01:20,  7.49it/s]Upper bound on the fitting time:  40%|███▉      | 395/1000 [00:33<01:24,  7.15it/s]Upper bound on the fitting time:  40%|███▉      | 396/1000 [00:33<01:27,  6.86it/s]Upper bound on the fitting time:  40%|███▉      | 397/1000 [00:34<01:24,  7.13it/s]Upper bound on the fitting time:  40%|███▉      | 398/1000 [00:34<01:20,  7.47it/s]Upper bound on the fitting time:  40%|███▉      | 399/1000 [00:34<01:18,  7.66it/s]Upper bound on the fitting time:  40%|████      | 400/1000 [00:34<01:17,  7.77it/s]Upper bound on the fitting time:  40%|████      | 401/1000 [00:34<01:15,  7.98it/s]Upper bound on the fitting time:  40%|████      | 402/1000 [00:34<01:13,  8.17it/s]Upper bound on the fitting time:  40%|████      | 403/1000 [00:34<01:10,  8.42it/s]Upper bound on the fitting time:  40%|████      | 404/1000 [00:34<01:08,  8.74it/s]Upper bound on the fitting time:  40%|████      | 405/1000 [00:35<01:08,  8.66it/s]Upper bound on the fitting time:  41%|████      | 406/1000 [00:35<01:10,  8.41it/s]Upper bound on the fitting time:  41%|████      | 407/1000 [00:35<01:14,  8.01it/s]Upper bound on the fitting time:  41%|████      | 408/1000 [00:35<01:15,  7.84it/s]Upper bound on the fitting time:  41%|████      | 409/1000 [00:35<01:13,  8.02it/s]Upper bound on the fitting time:  41%|████      | 410/1000 [00:35<01:12,  8.18it/s]Upper bound on the fitting time:  41%|████      | 411/1000 [00:35<01:10,  8.36it/s]Upper bound on the fitting time:  41%|████      | 412/1000 [00:35<01:08,  8.61it/s]Upper bound on the fitting time:  41%|████▏     | 413/1000 [00:36<01:07,  8.66it/s]Upper bound on the fitting time:  41%|████▏     | 414/1000 [00:36<01:08,  8.53it/s]Upper bound on the fitting time:  42%|████▏     | 415/1000 [00:36<01:08,  8.50it/s]Upper bound on the fitting time:  42%|████▏     | 416/1000 [00:36<01:07,  8.67it/s]Upper bound on the fitting time:  42%|████▏     | 417/1000 [00:36<01:05,  8.95it/s]Upper bound on the fitting time:  42%|████▏     | 419/1000 [00:36<01:00,  9.61it/s]Upper bound on the fitting time:  42%|████▏     | 420/1000 [00:36<01:02,  9.33it/s]Upper bound on the fitting time:  42%|████▏     | 421/1000 [00:36<01:05,  8.90it/s]Upper bound on the fitting time:  42%|████▏     | 422/1000 [00:37<01:12,  7.93it/s]Upper bound on the fitting time:  42%|████▏     | 423/1000 [00:37<01:12,  7.96it/s]Upper bound on the fitting time:  42%|████▏     | 424/1000 [00:37<01:14,  7.72it/s]Upper bound on the fitting time:  42%|████▎     | 425/1000 [00:37<01:14,  7.75it/s]Upper bound on the fitting time:  43%|████▎     | 426/1000 [00:37<01:13,  7.80it/s]Upper bound on the fitting time:  43%|████▎     | 427/1000 [00:37<01:13,  7.78it/s]Upper bound on the fitting time:  43%|████▎     | 428/1000 [00:37<01:15,  7.60it/s]Upper bound on the fitting time:  43%|████▎     | 429/1000 [00:37<01:16,  7.49it/s]Upper bound on the fitting time:  43%|████▎     | 430/1000 [00:38<01:18,  7.24it/s]Upper bound on the fitting time:  43%|████▎     | 431/1000 [00:38<01:17,  7.33it/s]Upper bound on the fitting time:  43%|████▎     | 432/1000 [00:38<01:17,  7.31it/s]Upper bound on the fitting time:  43%|████▎     | 433/1000 [00:38<01:19,  7.15it/s]Upper bound on the fitting time:  43%|████▎     | 434/1000 [00:38<01:18,  7.19it/s]Upper bound on the fitting time:  44%|████▎     | 435/1000 [00:38<01:21,  6.96it/s]Upper bound on the fitting time:  44%|████▎     | 436/1000 [00:38<01:19,  7.09it/s]Upper bound on the fitting time:  44%|████▎     | 437/1000 [00:39<01:16,  7.39it/s]Upper bound on the fitting time:  44%|████▍     | 438/1000 [00:39<01:12,  7.72it/s]Upper bound on the fitting time:  44%|████▍     | 439/1000 [00:39<01:10,  7.93it/s]Upper bound on the fitting time:  44%|████▍     | 440/1000 [00:39<01:14,  7.52it/s]Upper bound on the fitting time:  44%|████▍     | 441/1000 [00:39<01:12,  7.76it/s]Upper bound on the fitting time:  44%|████▍     | 442/1000 [00:39<01:12,  7.67it/s]Upper bound on the fitting time:  44%|████▍     | 443/1000 [00:39<01:12,  7.71it/s]Upper bound on the fitting time:  44%|████▍     | 444/1000 [00:39<01:10,  7.88it/s]Upper bound on the fitting time:  44%|████▍     | 445/1000 [00:40<01:15,  7.32it/s]Upper bound on the fitting time:  45%|████▍     | 446/1000 [00:40<01:15,  7.38it/s]Upper bound on the fitting time:  45%|████▍     | 447/1000 [00:40<01:12,  7.63it/s]Upper bound on the fitting time:  45%|████▍     | 448/1000 [00:40<01:14,  7.46it/s]Upper bound on the fitting time:  45%|████▍     | 449/1000 [00:40<01:13,  7.53it/s]Upper bound on the fitting time:  45%|████▌     | 450/1000 [00:40<01:17,  7.10it/s]Upper bound on the fitting time:  45%|████▌     | 451/1000 [00:40<01:16,  7.20it/s]Upper bound on the fitting time:  45%|████▌     | 452/1000 [00:41<01:16,  7.17it/s]Upper bound on the fitting time:  45%|████▌     | 453/1000 [00:41<01:29,  6.12it/s]Upper bound on the fitting time:  45%|████▌     | 454/1000 [00:41<01:32,  5.92it/s]Upper bound on the fitting time:  46%|████▌     | 455/1000 [00:41<01:35,  5.70it/s]Upper bound on the fitting time:  46%|████▌     | 456/1000 [00:41<01:28,  6.13it/s]Upper bound on the fitting time:  46%|████▌     | 457/1000 [00:41<01:23,  6.47it/s]Upper bound on the fitting time:  46%|████▌     | 458/1000 [00:42<01:16,  7.05it/s]Upper bound on the fitting time:  46%|████▌     | 459/1000 [00:42<01:10,  7.65it/s]Upper bound on the fitting time:  46%|████▌     | 460/1000 [00:42<01:07,  7.98it/s]Upper bound on the fitting time:  46%|████▌     | 461/1000 [00:42<01:04,  8.32it/s]Upper bound on the fitting time:  46%|████▌     | 462/1000 [00:42<01:03,  8.43it/s]Upper bound on the fitting time:  46%|████▋     | 463/1000 [00:42<01:02,  8.54it/s]Upper bound on the fitting time:  46%|████▋     | 464/1000 [00:42<01:02,  8.52it/s]Upper bound on the fitting time:  46%|████▋     | 465/1000 [00:42<01:02,  8.52it/s]Upper bound on the fitting time:  47%|████▋     | 466/1000 [00:43<01:04,  8.28it/s]Upper bound on the fitting time:  47%|████▋     | 467/1000 [00:43<01:02,  8.50it/s]Upper bound on the fitting time:  47%|████▋     | 468/1000 [00:43<01:01,  8.62it/s]Upper bound on the fitting time:  47%|████▋     | 469/1000 [00:43<00:59,  8.89it/s]Upper bound on the fitting time:  47%|████▋     | 470/1000 [00:43<01:00,  8.74it/s]Upper bound on the fitting time:  47%|████▋     | 471/1000 [00:43<01:01,  8.56it/s]Upper bound on the fitting time:  47%|████▋     | 472/1000 [00:43<01:01,  8.58it/s]Upper bound on the fitting time:  47%|████▋     | 473/1000 [00:43<01:01,  8.60it/s]Upper bound on the fitting time:  47%|████▋     | 474/1000 [00:43<01:00,  8.66it/s]Upper bound on the fitting time:  48%|████▊     | 475/1000 [00:44<00:58,  8.90it/s]Upper bound on the fitting time:  48%|████▊     | 476/1000 [00:44<00:57,  9.10it/s]Upper bound on the fitting time:  48%|████▊     | 478/1000 [00:44<00:54,  9.55it/s]Upper bound on the fitting time:  48%|████▊     | 479/1000 [00:44<00:56,  9.24it/s]Upper bound on the fitting time:  48%|████▊     | 480/1000 [00:44<00:57,  9.06it/s]Upper bound on the fitting time:  48%|████▊     | 481/1000 [00:44<00:58,  8.85it/s]Upper bound on the fitting time:  48%|████▊     | 482/1000 [00:44<01:00,  8.55it/s]Upper bound on the fitting time:  48%|████▊     | 483/1000 [00:44<01:00,  8.51it/s]Upper bound on the fitting time:  48%|████▊     | 484/1000 [00:45<00:59,  8.73it/s]Upper bound on the fitting time:  48%|████▊     | 485/1000 [00:45<00:58,  8.86it/s]Upper bound on the fitting time:  49%|████▊     | 486/1000 [00:45<00:57,  8.94it/s]Upper bound on the fitting time:  49%|████▊     | 487/1000 [00:45<00:56,  9.05it/s]Upper bound on the fitting time:  49%|████▉     | 488/1000 [00:45<00:56,  9.06it/s]Upper bound on the fitting time:  49%|████▉     | 489/1000 [00:45<00:57,  8.91it/s]Upper bound on the fitting time:  49%|████▉     | 490/1000 [00:45<00:58,  8.65it/s]Upper bound on the fitting time:  49%|████▉     | 491/1000 [00:45<00:57,  8.89it/s]Upper bound on the fitting time:  49%|████▉     | 492/1000 [00:45<00:57,  8.82it/s]Upper bound on the fitting time:  49%|████▉     | 493/1000 [00:46<00:57,  8.75it/s]Upper bound on the fitting time:  49%|████▉     | 494/1000 [00:46<00:58,  8.71it/s]Upper bound on the fitting time:  50%|████▉     | 495/1000 [00:46<00:57,  8.73it/s]Upper bound on the fitting time:  50%|████▉     | 496/1000 [00:46<00:58,  8.62it/s]Upper bound on the fitting time:  50%|████▉     | 497/1000 [00:46<00:58,  8.63it/s]Upper bound on the fitting time:  50%|████▉     | 498/1000 [00:46<00:58,  8.65it/s]Upper bound on the fitting time:  50%|████▉     | 499/1000 [00:46<00:57,  8.75it/s]Upper bound on the fitting time:  50%|█████     | 500/1000 [00:46<00:56,  8.86it/s]Upper bound on the fitting time:  50%|█████     | 501/1000 [00:46<00:55,  8.97it/s]Upper bound on the fitting time:  50%|█████     | 502/1000 [00:47<00:54,  9.16it/s]Upper bound on the fitting time:  50%|█████     | 503/1000 [00:47<00:53,  9.34it/s]Upper bound on the fitting time:  50%|█████     | 504/1000 [00:47<00:53,  9.25it/s]Upper bound on the fitting time:  50%|█████     | 505/1000 [00:47<00:53,  9.19it/s]Upper bound on the fitting time:  51%|█████     | 506/1000 [00:47<00:53,  9.32it/s]Upper bound on the fitting time:  51%|█████     | 507/1000 [00:47<00:52,  9.46it/s]Upper bound on the fitting time:  51%|█████     | 508/1000 [00:47<00:51,  9.48it/s]Upper bound on the fitting time:  51%|█████     | 509/1000 [00:47<00:51,  9.56it/s]Upper bound on the fitting time:  51%|█████     | 510/1000 [00:47<00:51,  9.42it/s]Upper bound on the fitting time:  51%|█████     | 512/1000 [00:48<00:49,  9.89it/s]Upper bound on the fitting time:  51%|█████▏    | 514/1000 [00:48<00:48, 10.03it/s]Upper bound on the fitting time:  52%|█████▏    | 515/1000 [00:48<00:48,  9.97it/s]Upper bound on the fitting time:  52%|█████▏    | 516/1000 [00:48<00:49,  9.74it/s]Upper bound on the fitting time:  52%|█████▏    | 517/1000 [00:48<00:50,  9.60it/s]Upper bound on the fitting time:  52%|█████▏    | 518/1000 [00:48<00:50,  9.50it/s]Upper bound on the fitting time:  52%|█████▏    | 519/1000 [00:48<00:51,  9.41it/s]Upper bound on the fitting time:  52%|█████▏    | 520/1000 [00:48<00:50,  9.41it/s]Upper bound on the fitting time:  52%|█████▏    | 521/1000 [00:49<00:50,  9.40it/s]Upper bound on the fitting time:  52%|█████▏    | 522/1000 [00:49<00:50,  9.48it/s]Upper bound on the fitting time:  52%|█████▏    | 523/1000 [00:49<00:51,  9.30it/s]Upper bound on the fitting time:  52%|█████▏    | 524/1000 [00:49<00:51,  9.27it/s]Upper bound on the fitting time:  52%|█████▎    | 525/1000 [00:49<00:51,  9.31it/s]Upper bound on the fitting time:  53%|█████▎    | 526/1000 [00:49<00:50,  9.39it/s]Upper bound on the fitting time:  53%|█████▎    | 527/1000 [00:49<00:50,  9.46it/s]Upper bound on the fitting time:  53%|█████▎    | 528/1000 [00:49<00:50,  9.43it/s]Upper bound on the fitting time:  53%|█████▎    | 529/1000 [00:49<00:49,  9.44it/s]Upper bound on the fitting time:  53%|█████▎    | 530/1000 [00:50<00:50,  9.32it/s]Upper bound on the fitting time:  53%|█████▎    | 531/1000 [00:50<00:49,  9.45it/s]Upper bound on the fitting time:  53%|█████▎    | 532/1000 [00:50<00:48,  9.57it/s]Upper bound on the fitting time:  53%|█████▎    | 533/1000 [00:50<00:49,  9.46it/s]Upper bound on the fitting time:  53%|█████▎    | 534/1000 [00:50<00:48,  9.60it/s]Upper bound on the fitting time:  54%|█████▎    | 536/1000 [00:50<00:46,  9.94it/s]Upper bound on the fitting time:  54%|█████▍    | 538/1000 [00:50<00:45, 10.12it/s]Upper bound on the fitting time:  54%|█████▍    | 540/1000 [00:51<00:45, 10.05it/s]Upper bound on the fitting time:  54%|█████▍    | 541/1000 [00:51<00:45, 10.03it/s]Upper bound on the fitting time:  54%|█████▍    | 542/1000 [00:51<00:47,  9.65it/s]Upper bound on the fitting time:  54%|█████▍    | 543/1000 [00:51<00:49,  9.16it/s]Upper bound on the fitting time:  54%|█████▍    | 544/1000 [00:51<00:52,  8.75it/s]Upper bound on the fitting time:  55%|█████▍    | 545/1000 [00:51<00:51,  8.80it/s]Upper bound on the fitting time:  55%|█████▍    | 546/1000 [00:51<00:52,  8.72it/s]Upper bound on the fitting time:  55%|█████▍    | 547/1000 [00:51<00:51,  8.72it/s]Upper bound on the fitting time:  55%|█████▍    | 548/1000 [00:51<00:51,  8.80it/s]Upper bound on the fitting time:  55%|█████▌    | 550/1000 [00:52<00:47,  9.42it/s]Upper bound on the fitting time:  55%|█████▌    | 551/1000 [00:52<00:47,  9.53it/s]Upper bound on the fitting time:  55%|█████▌    | 553/1000 [00:52<00:46,  9.67it/s]Upper bound on the fitting time:  55%|█████▌    | 554/1000 [00:52<00:47,  9.29it/s]Upper bound on the fitting time:  56%|█████▌    | 555/1000 [00:52<00:48,  9.15it/s]Upper bound on the fitting time:  56%|█████▌    | 557/1000 [00:52<00:46,  9.60it/s]Upper bound on the fitting time:  56%|█████▌    | 559/1000 [00:53<00:44,  9.85it/s]Upper bound on the fitting time:  56%|█████▌    | 560/1000 [00:53<00:44,  9.80it/s]Upper bound on the fitting time:  56%|█████▌    | 561/1000 [00:53<00:44,  9.83it/s]Upper bound on the fitting time:  56%|█████▌    | 562/1000 [00:53<00:45,  9.58it/s]Upper bound on the fitting time:  56%|█████▋    | 563/1000 [00:53<00:45,  9.67it/s]Upper bound on the fitting time:  56%|█████▋    | 564/1000 [00:53<00:44,  9.71it/s]Upper bound on the fitting time:  56%|█████▋    | 565/1000 [00:53<00:45,  9.58it/s]Upper bound on the fitting time:  57%|█████▋    | 567/1000 [00:53<00:44,  9.72it/s]Upper bound on the fitting time:  57%|█████▋    | 568/1000 [00:53<00:45,  9.54it/s]Upper bound on the fitting time:  57%|█████▋    | 569/1000 [00:54<00:45,  9.45it/s]Upper bound on the fitting time:  57%|█████▋    | 570/1000 [00:54<00:45,  9.51it/s]Upper bound on the fitting time:  57%|█████▋    | 571/1000 [00:54<00:46,  9.26it/s]Upper bound on the fitting time:  57%|█████▋    | 572/1000 [00:54<00:45,  9.45it/s]Upper bound on the fitting time:  57%|█████▋    | 573/1000 [00:54<00:44,  9.59it/s]Upper bound on the fitting time:  57%|█████▋    | 574/1000 [00:54<00:43,  9.69it/s]Upper bound on the fitting time:  58%|█████▊    | 576/1000 [00:54<00:43,  9.85it/s]Upper bound on the fitting time:  58%|█████▊    | 577/1000 [00:54<00:42,  9.84it/s]Upper bound on the fitting time:  58%|█████▊    | 579/1000 [00:55<00:41, 10.05it/s]Upper bound on the fitting time:  58%|█████▊    | 580/1000 [00:55<00:42,  9.98it/s]Upper bound on the fitting time:  58%|█████▊    | 581/1000 [00:55<00:42,  9.95it/s]Upper bound on the fitting time:  58%|█████▊    | 582/1000 [00:55<00:42,  9.81it/s]Upper bound on the fitting time:  58%|█████▊    | 584/1000 [00:55<00:41,  9.98it/s]Upper bound on the fitting time:  59%|█████▊    | 586/1000 [00:55<00:41, 10.07it/s]Upper bound on the fitting time:  59%|█████▊    | 587/1000 [00:55<00:41,  9.96it/s]Upper bound on the fitting time:  59%|█████▉    | 588/1000 [00:56<00:41,  9.96it/s]Upper bound on the fitting time:  59%|█████▉    | 590/1000 [00:56<00:40, 10.08it/s]Upper bound on the fitting time:  59%|█████▉    | 592/1000 [00:56<00:39, 10.27it/s]Upper bound on the fitting time:  59%|█████▉    | 594/1000 [00:56<00:39, 10.31it/s]Upper bound on the fitting time:  60%|█████▉    | 596/1000 [00:56<00:41,  9.74it/s]Upper bound on the fitting time:  60%|█████▉    | 597/1000 [00:56<00:41,  9.68it/s]Upper bound on the fitting time:  60%|█████▉    | 598/1000 [00:57<00:42,  9.51it/s]Upper bound on the fitting time:  60%|█████▉    | 599/1000 [00:57<00:42,  9.54it/s]Upper bound on the fitting time:  60%|██████    | 601/1000 [00:57<00:40,  9.88it/s]Upper bound on the fitting time:  60%|██████    | 602/1000 [00:57<00:40,  9.90it/s]Upper bound on the fitting time:  60%|██████    | 604/1000 [00:57<00:39, 10.01it/s]Upper bound on the fitting time:  60%|██████    | 605/1000 [00:57<00:40,  9.84it/s]Upper bound on the fitting time:  61%|██████    | 606/1000 [00:57<00:40,  9.72it/s]Upper bound on the fitting time:  61%|██████    | 607/1000 [00:57<00:40,  9.74it/s]Upper bound on the fitting time:  61%|██████    | 608/1000 [00:58<00:40,  9.65it/s]Upper bound on the fitting time:  61%|██████    | 609/1000 [00:58<00:41,  9.51it/s]Upper bound on the fitting time:  61%|██████    | 610/1000 [00:58<00:41,  9.46it/s]Upper bound on the fitting time:  61%|██████    | 611/1000 [00:58<00:41,  9.47it/s]Upper bound on the fitting time:  61%|██████    | 612/1000 [00:58<00:41,  9.37it/s]Upper bound on the fitting time:  61%|██████▏   | 613/1000 [00:58<00:41,  9.36it/s]Upper bound on the fitting time:  61%|██████▏   | 614/1000 [00:58<00:41,  9.35it/s]Upper bound on the fitting time:  62%|██████▏   | 615/1000 [00:58<00:41,  9.29it/s]Upper bound on the fitting time:  62%|██████▏   | 616/1000 [00:58<00:41,  9.24it/s]Upper bound on the fitting time:  62%|██████▏   | 617/1000 [00:59<00:42,  9.08it/s]Upper bound on the fitting time:  62%|██████▏   | 618/1000 [00:59<00:43,  8.88it/s]Upper bound on the fitting time:  62%|██████▏   | 619/1000 [00:59<00:42,  8.89it/s]Upper bound on the fitting time:  62%|██████▏   | 620/1000 [00:59<00:42,  9.02it/s]Upper bound on the fitting time:  62%|██████▏   | 621/1000 [00:59<00:41,  9.16it/s]Upper bound on the fitting time:  62%|██████▏   | 622/1000 [00:59<00:40,  9.24it/s]Upper bound on the fitting time:  62%|██████▏   | 623/1000 [00:59<00:41,  9.15it/s]Upper bound on the fitting time:  62%|██████▏   | 624/1000 [00:59<00:40,  9.30it/s]Upper bound on the fitting time:  62%|██████▎   | 625/1000 [00:59<00:39,  9.43it/s]Upper bound on the fitting time:  63%|██████▎   | 626/1000 [01:00<00:40,  9.24it/s]Upper bound on the fitting time:  63%|██████▎   | 627/1000 [01:00<00:39,  9.41it/s]Upper bound on the fitting time:  63%|██████▎   | 628/1000 [01:00<00:39,  9.51it/s]Upper bound on the fitting time:  63%|██████▎   | 630/1000 [01:00<00:37,  9.89it/s]Upper bound on the fitting time:  63%|██████▎   | 631/1000 [01:00<00:38,  9.68it/s]Upper bound on the fitting time:  63%|██████▎   | 633/1000 [01:00<00:36, 10.05it/s]Upper bound on the fitting time:  63%|██████▎   | 634/1000 [01:00<00:37,  9.77it/s]Upper bound on the fitting time:  64%|██████▎   | 635/1000 [01:00<00:38,  9.52it/s]Upper bound on the fitting time:  64%|██████▎   | 636/1000 [01:01<00:38,  9.44it/s]Upper bound on the fitting time:  64%|██████▎   | 637/1000 [01:01<00:38,  9.46it/s]Upper bound on the fitting time:  64%|██████▍   | 638/1000 [01:01<00:38,  9.52it/s]Upper bound on the fitting time:  64%|██████▍   | 640/1000 [01:01<00:36,  9.83it/s]Upper bound on the fitting time:  64%|██████▍   | 641/1000 [01:01<00:36,  9.82it/s]Upper bound on the fitting time:  64%|██████▍   | 642/1000 [01:01<00:36,  9.84it/s]Upper bound on the fitting time:  64%|██████▍   | 644/1000 [01:01<00:35, 10.00it/s]Upper bound on the fitting time:  65%|██████▍   | 646/1000 [01:02<00:34, 10.19it/s]Upper bound on the fitting time:  65%|██████▍   | 648/1000 [01:02<00:34, 10.23it/s]Upper bound on the fitting time:  65%|██████▌   | 650/1000 [01:02<00:34, 10.07it/s]Upper bound on the fitting time:  65%|██████▌   | 652/1000 [01:02<00:34, 10.11it/s]Upper bound on the fitting time:  65%|██████▌   | 654/1000 [01:02<00:33, 10.22it/s]Upper bound on the fitting time:  66%|██████▌   | 656/1000 [01:03<00:33, 10.19it/s]Upper bound on the fitting time:  66%|██████▌   | 658/1000 [01:03<00:33, 10.17it/s]Upper bound on the fitting time:  66%|██████▌   | 660/1000 [01:03<00:33, 10.12it/s]Upper bound on the fitting time:  66%|██████▌   | 662/1000 [01:03<00:32, 10.28it/s]Upper bound on the fitting time:  66%|██████▋   | 664/1000 [01:03<00:33, 10.05it/s]Upper bound on the fitting time:  67%|██████▋   | 666/1000 [01:04<00:32, 10.16it/s]Upper bound on the fitting time:  67%|██████▋   | 668/1000 [01:04<00:32, 10.16it/s]Upper bound on the fitting time:  67%|██████▋   | 670/1000 [01:04<00:33,  9.92it/s]Upper bound on the fitting time:  67%|██████▋   | 671/1000 [01:04<00:33,  9.80it/s]Upper bound on the fitting time:  67%|██████▋   | 673/1000 [01:04<00:32, 10.09it/s]Upper bound on the fitting time:  68%|██████▊   | 675/1000 [01:04<00:31, 10.19it/s]Upper bound on the fitting time:  68%|██████▊   | 677/1000 [01:05<00:31, 10.16it/s]Upper bound on the fitting time:  68%|██████▊   | 679/1000 [01:05<00:31, 10.15it/s]Upper bound on the fitting time:  68%|██████▊   | 681/1000 [01:05<00:31, 10.25it/s]Upper bound on the fitting time:  68%|██████▊   | 683/1000 [01:05<00:31, 10.15it/s]Upper bound on the fitting time:  68%|██████▊   | 685/1000 [01:05<00:30, 10.24it/s]Upper bound on the fitting time:  69%|██████▊   | 687/1000 [01:06<00:30, 10.13it/s]Upper bound on the fitting time:  69%|██████▉   | 689/1000 [01:06<00:30, 10.04it/s]Upper bound on the fitting time:  69%|██████▉   | 691/1000 [01:06<00:30, 10.14it/s]Upper bound on the fitting time:  69%|██████▉   | 693/1000 [01:06<00:29, 10.27it/s]Upper bound on the fitting time:  70%|██████▉   | 695/1000 [01:06<00:29, 10.25it/s]Upper bound on the fitting time:  70%|██████▉   | 697/1000 [01:07<00:29, 10.18it/s]Upper bound on the fitting time:  70%|██████▉   | 699/1000 [01:07<00:29, 10.16it/s]Upper bound on the fitting time:  70%|███████   | 701/1000 [01:07<00:29,  9.99it/s]Upper bound on the fitting time:  70%|███████   | 702/1000 [01:07<00:29,  9.98it/s]Upper bound on the fitting time:  70%|███████   | 703/1000 [01:07<00:30,  9.74it/s]Upper bound on the fitting time:  70%|███████   | 704/1000 [01:07<00:30,  9.78it/s]Upper bound on the fitting time:  70%|███████   | 705/1000 [01:07<00:30,  9.77it/s]Upper bound on the fitting time:  71%|███████   | 707/1000 [01:08<00:29, 10.08it/s]Upper bound on the fitting time:  71%|███████   | 708/1000 [01:08<00:29, 10.01it/s]Upper bound on the fitting time:  71%|███████   | 709/1000 [01:08<00:29,  9.95it/s]Upper bound on the fitting time:  71%|███████   | 710/1000 [01:08<00:29,  9.89it/s]Upper bound on the fitting time:  71%|███████   | 711/1000 [01:08<00:29,  9.85it/s]Upper bound on the fitting time:  71%|███████▏  | 713/1000 [01:08<00:28, 10.06it/s]Upper bound on the fitting time:  71%|███████▏  | 714/1000 [01:08<00:28, 10.04it/s]Upper bound on the fitting time:  72%|███████▏  | 715/1000 [01:08<00:28,  9.98it/s]Upper bound on the fitting time:  72%|███████▏  | 716/1000 [01:08<00:28,  9.93it/s]Upper bound on the fitting time:  72%|███████▏  | 717/1000 [01:09<00:28,  9.93it/s]Upper bound on the fitting time:  72%|███████▏  | 718/1000 [01:09<00:28,  9.93it/s]Upper bound on the fitting time:  72%|███████▏  | 720/1000 [01:09<00:27, 10.09it/s]Upper bound on the fitting time:  72%|███████▏  | 722/1000 [01:09<00:27, 10.25it/s]Upper bound on the fitting time:  72%|███████▏  | 724/1000 [01:09<00:26, 10.29it/s]Upper bound on the fitting time:  73%|███████▎  | 726/1000 [01:09<00:27, 10.13it/s]Upper bound on the fitting time:  73%|███████▎  | 728/1000 [01:10<00:26, 10.09it/s]Upper bound on the fitting time:  73%|███████▎  | 730/1000 [01:10<00:27,  9.98it/s]Upper bound on the fitting time:  73%|███████▎  | 731/1000 [01:10<00:27,  9.96it/s]Upper bound on the fitting time:  73%|███████▎  | 732/1000 [01:10<00:27,  9.86it/s]Upper bound on the fitting time:  73%|███████▎  | 734/1000 [01:10<00:26, 10.11it/s]Upper bound on the fitting time:  74%|███████▎  | 736/1000 [01:10<00:26, 10.15it/s]Upper bound on the fitting time:  74%|███████▍  | 738/1000 [01:11<00:25, 10.16it/s]Upper bound on the fitting time:  74%|███████▍  | 740/1000 [01:11<00:25, 10.24it/s]Upper bound on the fitting time:  74%|███████▍  | 742/1000 [01:11<00:25, 10.13it/s]Upper bound on the fitting time:  74%|███████▍  | 744/1000 [01:11<00:25, 10.11it/s]Upper bound on the fitting time:  75%|███████▍  | 746/1000 [01:11<00:25, 10.08it/s]Upper bound on the fitting time:  75%|███████▍  | 748/1000 [01:12<00:25, 10.08it/s]Upper bound on the fitting time:  75%|███████▌  | 750/1000 [01:12<00:24, 10.15it/s]Upper bound on the fitting time:  75%|███████▌  | 752/1000 [01:12<00:24, 10.29it/s]Upper bound on the fitting time:  75%|███████▌  | 754/1000 [01:12<00:23, 10.38it/s]Upper bound on the fitting time:  76%|███████▌  | 756/1000 [01:12<00:23, 10.31it/s]Upper bound on the fitting time:  76%|███████▌  | 758/1000 [01:13<00:23, 10.28it/s]Upper bound on the fitting time:  76%|███████▌  | 760/1000 [01:13<00:23, 10.39it/s]Upper bound on the fitting time:  76%|███████▌  | 762/1000 [01:13<00:22, 10.35it/s]Upper bound on the fitting time:  76%|███████▋  | 764/1000 [01:13<00:22, 10.32it/s]Upper bound on the fitting time:  77%|███████▋  | 766/1000 [01:13<00:23, 10.16it/s]Upper bound on the fitting time:  77%|███████▋  | 768/1000 [01:14<00:23, 10.05it/s]Upper bound on the fitting time:  77%|███████▋  | 770/1000 [01:14<00:22, 10.06it/s]Upper bound on the fitting time:  77%|███████▋  | 772/1000 [01:14<00:22,  9.99it/s]Upper bound on the fitting time:  77%|███████▋  | 774/1000 [01:14<00:22, 10.03it/s]Upper bound on the fitting time:  78%|███████▊  | 776/1000 [01:14<00:22,  9.97it/s]Upper bound on the fitting time:  78%|███████▊  | 778/1000 [01:15<00:21, 10.14it/s]Upper bound on the fitting time:  78%|███████▊  | 780/1000 [01:15<00:21, 10.13it/s]Upper bound on the fitting time:  78%|███████▊  | 782/1000 [01:15<00:21,  9.94it/s]Upper bound on the fitting time:  78%|███████▊  | 783/1000 [01:15<00:21,  9.93it/s]Upper bound on the fitting time:  78%|███████▊  | 785/1000 [01:15<00:21, 10.03it/s]Upper bound on the fitting time:  79%|███████▊  | 787/1000 [01:15<00:20, 10.19it/s]Upper bound on the fitting time:  79%|███████▉  | 789/1000 [01:16<00:20, 10.23it/s]Upper bound on the fitting time:  79%|███████▉  | 791/1000 [01:16<00:20, 10.19it/s]Upper bound on the fitting time:  79%|███████▉  | 793/1000 [01:16<00:20, 10.03it/s]Upper bound on the fitting time:  80%|███████▉  | 795/1000 [01:16<00:20,  9.99it/s]Upper bound on the fitting time:  80%|███████▉  | 796/1000 [01:16<00:20,  9.98it/s]Upper bound on the fitting time:  80%|███████▉  | 798/1000 [01:17<00:20, 10.10it/s]Upper bound on the fitting time:  80%|████████  | 800/1000 [01:17<00:19, 10.00it/s]Upper bound on the fitting time:  80%|████████  | 802/1000 [01:17<00:19,  9.98it/s]Upper bound on the fitting time:  80%|████████  | 804/1000 [01:17<00:19, 10.17it/s]Upper bound on the fitting time:  81%|████████  | 806/1000 [01:17<00:18, 10.23it/s]Upper bound on the fitting time:  81%|████████  | 808/1000 [01:18<00:18, 10.40it/s]Upper bound on the fitting time:  81%|████████  | 810/1000 [01:18<00:18, 10.29it/s]Upper bound on the fitting time:  81%|████████  | 812/1000 [01:18<00:18, 10.21it/s]Upper bound on the fitting time:  81%|████████▏ | 814/1000 [01:18<00:18, 10.13it/s]Upper bound on the fitting time:  82%|████████▏ | 816/1000 [01:18<00:18, 10.07it/s]Upper bound on the fitting time:  82%|████████▏ | 818/1000 [01:19<00:17, 10.18it/s]Upper bound on the fitting time:  82%|████████▏ | 820/1000 [01:19<00:17, 10.24it/s]Upper bound on the fitting time:  82%|████████▏ | 822/1000 [01:19<00:17, 10.07it/s]Upper bound on the fitting time:  82%|████████▏ | 824/1000 [01:19<00:17, 10.17it/s]Upper bound on the fitting time:  83%|████████▎ | 826/1000 [01:19<00:17,  9.88it/s]Upper bound on the fitting time:  83%|████████▎ | 827/1000 [01:19<00:17,  9.79it/s]Upper bound on the fitting time:  83%|████████▎ | 829/1000 [01:20<00:17,  9.98it/s]Upper bound on the fitting time:  83%|████████▎ | 831/1000 [01:20<00:16, 10.08it/s]Upper bound on the fitting time:  83%|████████▎ | 833/1000 [01:20<00:16, 10.12it/s]Upper bound on the fitting time:  84%|████████▎ | 835/1000 [01:20<00:16,  9.93it/s]Upper bound on the fitting time:  84%|████████▎ | 837/1000 [01:20<00:16, 10.12it/s]Upper bound on the fitting time:  84%|████████▍ | 839/1000 [01:21<00:15, 10.18it/s]Upper bound on the fitting time:  84%|████████▍ | 841/1000 [01:21<00:15,  9.95it/s]Upper bound on the fitting time:  84%|████████▍ | 842/1000 [01:21<00:16,  9.46it/s]Upper bound on the fitting time:  84%|████████▍ | 843/1000 [01:21<00:17,  9.09it/s]Upper bound on the fitting time:  84%|████████▍ | 844/1000 [01:21<00:17,  8.98it/s]Upper bound on the fitting time:  84%|████████▍ | 845/1000 [01:21<00:17,  8.87it/s]Upper bound on the fitting time:  85%|████████▍ | 846/1000 [01:21<00:18,  8.43it/s]Upper bound on the fitting time:  85%|████████▍ | 847/1000 [01:22<00:18,  8.40it/s]Upper bound on the fitting time:  85%|████████▍ | 848/1000 [01:22<00:17,  8.56it/s]Upper bound on the fitting time:  85%|████████▍ | 849/1000 [01:22<00:17,  8.68it/s]Upper bound on the fitting time:  85%|████████▌ | 850/1000 [01:22<00:17,  8.65it/s]Upper bound on the fitting time:  85%|████████▌ | 851/1000 [01:22<00:17,  8.65it/s]Upper bound on the fitting time:  85%|████████▌ | 852/1000 [01:22<00:16,  8.81it/s]Upper bound on the fitting time:  85%|████████▌ | 853/1000 [01:22<00:16,  8.81it/s]Upper bound on the fitting time:  85%|████████▌ | 854/1000 [01:22<00:16,  9.05it/s]Upper bound on the fitting time:  86%|████████▌ | 855/1000 [01:22<00:15,  9.06it/s]Upper bound on the fitting time:  86%|████████▌ | 856/1000 [01:23<00:16,  8.96it/s]Upper bound on the fitting time:  86%|████████▌ | 857/1000 [01:23<00:15,  9.10it/s]Upper bound on the fitting time:  86%|████████▌ | 858/1000 [01:23<00:15,  8.96it/s]Upper bound on the fitting time:  86%|████████▌ | 859/1000 [01:23<00:15,  9.04it/s]Upper bound on the fitting time:  86%|████████▌ | 860/1000 [01:23<00:15,  9.13it/s]Upper bound on the fitting time:  86%|████████▌ | 861/1000 [01:23<00:15,  9.10it/s]Upper bound on the fitting time:  86%|████████▌ | 862/1000 [01:23<00:15,  9.12it/s]Upper bound on the fitting time:  86%|████████▋ | 863/1000 [01:23<00:14,  9.21it/s]Upper bound on the fitting time:  86%|████████▋ | 864/1000 [01:23<00:14,  9.30it/s]Upper bound on the fitting time:  86%|████████▋ | 865/1000 [01:24<00:14,  9.34it/s]Upper bound on the fitting time:  87%|████████▋ | 866/1000 [01:24<00:14,  9.25it/s]Upper bound on the fitting time:  87%|████████▋ | 867/1000 [01:24<00:14,  9.33it/s]Upper bound on the fitting time:  87%|████████▋ | 868/1000 [01:24<00:14,  9.22it/s]Upper bound on the fitting time:  87%|████████▋ | 869/1000 [01:24<00:14,  9.12it/s]Upper bound on the fitting time:  87%|████████▋ | 870/1000 [01:24<00:14,  8.75it/s]Upper bound on the fitting time:  87%|████████▋ | 871/1000 [01:24<00:14,  8.78it/s]Upper bound on the fitting time:  87%|████████▋ | 872/1000 [01:24<00:14,  8.71it/s]Upper bound on the fitting time:  87%|████████▋ | 873/1000 [01:24<00:14,  8.78it/s]Upper bound on the fitting time:  87%|████████▋ | 874/1000 [01:25<00:14,  8.83it/s]Upper bound on the fitting time:  88%|████████▊ | 875/1000 [01:25<00:14,  8.66it/s]Upper bound on the fitting time:  88%|████████▊ | 876/1000 [01:25<00:14,  8.58it/s]Upper bound on the fitting time:  88%|████████▊ | 877/1000 [01:25<00:14,  8.46it/s]Upper bound on the fitting time:  88%|████████▊ | 878/1000 [01:25<00:14,  8.46it/s]Upper bound on the fitting time:  88%|████████▊ | 879/1000 [01:25<00:14,  8.47it/s]Upper bound on the fitting time:  88%|████████▊ | 880/1000 [01:25<00:14,  8.48it/s]Upper bound on the fitting time:  88%|████████▊ | 881/1000 [01:25<00:13,  8.53it/s]Upper bound on the fitting time:  88%|████████▊ | 882/1000 [01:26<00:13,  8.63it/s]Upper bound on the fitting time:  88%|████████▊ | 883/1000 [01:26<00:13,  8.67it/s]Upper bound on the fitting time:  88%|████████▊ | 884/1000 [01:26<00:13,  8.63it/s]Upper bound on the fitting time:  88%|████████▊ | 885/1000 [01:26<00:13,  8.57it/s]Upper bound on the fitting time:  89%|████████▊ | 886/1000 [01:26<00:13,  8.60it/s]Upper bound on the fitting time:  89%|████████▊ | 887/1000 [01:26<00:13,  8.60it/s]Upper bound on the fitting time:  89%|████████▉ | 888/1000 [01:26<00:13,  8.60it/s]Upper bound on the fitting time:  89%|████████▉ | 889/1000 [01:26<00:12,  8.67it/s]Upper bound on the fitting time:  89%|████████▉ | 890/1000 [01:26<00:12,  8.75it/s]Upper bound on the fitting time:  89%|████████▉ | 891/1000 [01:27<00:12,  8.67it/s]Upper bound on the fitting time:  89%|████████▉ | 892/1000 [01:27<00:12,  8.64it/s]Upper bound on the fitting time:  89%|████████▉ | 893/1000 [01:27<00:12,  8.72it/s]Upper bound on the fitting time:  89%|████████▉ | 894/1000 [01:27<00:12,  8.78it/s]Upper bound on the fitting time:  90%|████████▉ | 895/1000 [01:27<00:11,  8.78it/s]Upper bound on the fitting time:  90%|████████▉ | 896/1000 [01:27<00:12,  8.64it/s]Upper bound on the fitting time:  90%|████████▉ | 897/1000 [01:27<00:11,  8.66it/s]Upper bound on the fitting time:  90%|████████▉ | 898/1000 [01:27<00:11,  8.83it/s]Upper bound on the fitting time:  90%|████████▉ | 899/1000 [01:27<00:11,  8.92it/s]Upper bound on the fitting time:  90%|█████████ | 900/1000 [01:28<00:11,  8.93it/s]Upper bound on the fitting time:  90%|█████████ | 901/1000 [01:28<00:11,  8.90it/s]Upper bound on the fitting time:  90%|█████████ | 902/1000 [01:28<00:11,  8.88it/s]Upper bound on the fitting time:  90%|█████████ | 903/1000 [01:28<00:10,  8.84it/s]Upper bound on the fitting time:  90%|█████████ | 904/1000 [01:28<00:10,  8.82it/s]Upper bound on the fitting time:  90%|█████████ | 905/1000 [01:28<00:10,  8.97it/s]Upper bound on the fitting time:  91%|█████████ | 906/1000 [01:28<00:10,  9.09it/s]Upper bound on the fitting time:  91%|█████████ | 907/1000 [01:28<00:10,  8.94it/s]Upper bound on the fitting time:  91%|█████████ | 908/1000 [01:28<00:10,  8.85it/s]Upper bound on the fitting time:  91%|█████████ | 909/1000 [01:29<00:10,  8.89it/s]Upper bound on the fitting time:  91%|█████████ | 910/1000 [01:29<00:10,  8.94it/s]Upper bound on the fitting time:  91%|█████████ | 911/1000 [01:29<00:09,  9.00it/s]Upper bound on the fitting time:  91%|█████████ | 912/1000 [01:29<00:09,  8.98it/s]Upper bound on the fitting time:  91%|█████████▏| 913/1000 [01:29<00:09,  9.00it/s]Upper bound on the fitting time:  91%|█████████▏| 914/1000 [01:29<00:09,  8.80it/s]Upper bound on the fitting time:  92%|█████████▏| 915/1000 [01:29<00:09,  8.88it/s]Upper bound on the fitting time:  92%|█████████▏| 916/1000 [01:29<00:09,  8.93it/s]Upper bound on the fitting time:  92%|█████████▏| 917/1000 [01:30<00:09,  8.95it/s]Upper bound on the fitting time:  92%|█████████▏| 918/1000 [01:30<00:09,  8.90it/s]Upper bound on the fitting time:  92%|█████████▏| 919/1000 [01:30<00:09,  8.98it/s]Upper bound on the fitting time:  92%|█████████▏| 920/1000 [01:30<00:08,  9.04it/s]Upper bound on the fitting time:  92%|█████████▏| 921/1000 [01:30<00:08,  9.15it/s]Upper bound on the fitting time:  92%|█████████▏| 922/1000 [01:30<00:08,  9.18it/s]Upper bound on the fitting time:  92%|█████████▏| 923/1000 [01:30<00:08,  8.97it/s]Upper bound on the fitting time:  92%|█████████▏| 924/1000 [01:30<00:08,  9.00it/s]Upper bound on the fitting time:  92%|█████████▎| 925/1000 [01:30<00:08,  8.97it/s]Upper bound on the fitting time:  93%|█████████▎| 926/1000 [01:31<00:08,  8.84it/s]Upper bound on the fitting time:  93%|█████████▎| 927/1000 [01:31<00:08,  8.74it/s]Upper bound on the fitting time:  93%|█████████▎| 928/1000 [01:31<00:08,  8.72it/s]Upper bound on the fitting time:  93%|█████████▎| 929/1000 [01:31<00:08,  8.70it/s]Upper bound on the fitting time:  93%|█████████▎| 930/1000 [01:31<00:08,  8.66it/s]Upper bound on the fitting time:  93%|█████████▎| 931/1000 [01:31<00:07,  8.68it/s]Upper bound on the fitting time:  93%|█████████▎| 932/1000 [01:31<00:07,  8.56it/s]Upper bound on the fitting time:  93%|█████████▎| 933/1000 [01:31<00:07,  8.67it/s]Upper bound on the fitting time:  93%|█████████▎| 934/1000 [01:31<00:07,  8.66it/s]Upper bound on the fitting time:  94%|█████████▎| 935/1000 [01:32<00:07,  8.59it/s]Upper bound on the fitting time:  94%|█████████▎| 936/1000 [01:32<00:07,  8.60it/s]Upper bound on the fitting time:  94%|█████████▎| 937/1000 [01:32<00:07,  8.55it/s]Upper bound on the fitting time:  94%|█████████▍| 938/1000 [01:32<00:07,  8.57it/s]Upper bound on the fitting time:  94%|█████████▍| 939/1000 [01:32<00:07,  8.64it/s]Upper bound on the fitting time:  94%|█████████▍| 940/1000 [01:32<00:06,  8.79it/s]Upper bound on the fitting time:  94%|█████████▍| 941/1000 [01:32<00:06,  8.71it/s]Upper bound on the fitting time:  94%|█████████▍| 942/1000 [01:32<00:06,  8.68it/s]Upper bound on the fitting time:  94%|█████████▍| 943/1000 [01:32<00:06,  8.67it/s]Upper bound on the fitting time:  94%|█████████▍| 944/1000 [01:33<00:06,  8.72it/s]Upper bound on the fitting time:  94%|█████████▍| 945/1000 [01:33<00:06,  8.76it/s]Upper bound on the fitting time:  95%|█████████▍| 946/1000 [01:33<00:06,  8.79it/s]Upper bound on the fitting time:  95%|█████████▍| 947/1000 [01:33<00:06,  8.78it/s]Upper bound on the fitting time:  95%|█████████▍| 948/1000 [01:33<00:05,  8.68it/s]Upper bound on the fitting time:  95%|█████████▍| 949/1000 [01:33<00:05,  8.78it/s]Upper bound on the fitting time:  95%|█████████▌| 950/1000 [01:33<00:05,  8.74it/s]Upper bound on the fitting time:  95%|█████████▌| 951/1000 [01:33<00:05,  8.61it/s]Upper bound on the fitting time:  95%|█████████▌| 952/1000 [01:34<00:05,  8.60it/s]Upper bound on the fitting time:  95%|█████████▌| 953/1000 [01:34<00:05,  8.63it/s]Upper bound on the fitting time:  95%|█████████▌| 954/1000 [01:34<00:05,  8.52it/s]Upper bound on the fitting time:  96%|█████████▌| 955/1000 [01:34<00:05,  8.28it/s]Upper bound on the fitting time:  96%|█████████▌| 956/1000 [01:34<00:05,  8.12it/s]Upper bound on the fitting time:  96%|█████████▌| 957/1000 [01:34<00:05,  8.25it/s]Upper bound on the fitting time:  96%|█████████▌| 958/1000 [01:34<00:04,  8.42it/s]Upper bound on the fitting time:  96%|█████████▌| 959/1000 [01:34<00:04,  8.60it/s]Upper bound on the fitting time:  96%|█████████▌| 960/1000 [01:34<00:04,  8.65it/s]Upper bound on the fitting time:  96%|█████████▌| 961/1000 [01:35<00:04,  8.74it/s]Upper bound on the fitting time:  96%|█████████▌| 962/1000 [01:35<00:04,  8.92it/s]Upper bound on the fitting time:  96%|█████████▋| 963/1000 [01:35<00:04,  8.93it/s]Upper bound on the fitting time:  96%|█████████▋| 964/1000 [01:35<00:04,  8.96it/s]Upper bound on the fitting time:  96%|█████████▋| 965/1000 [01:35<00:03,  9.04it/s]Upper bound on the fitting time:  97%|█████████▋| 966/1000 [01:35<00:03,  9.11it/s]Upper bound on the fitting time:  97%|█████████▋| 967/1000 [01:35<00:03,  9.12it/s]Upper bound on the fitting time:  97%|█████████▋| 968/1000 [01:35<00:03,  9.27it/s]Upper bound on the fitting time:  97%|█████████▋| 969/1000 [01:35<00:03,  9.23it/s]Upper bound on the fitting time:  97%|█████████▋| 970/1000 [01:36<00:03,  9.19it/s]Upper bound on the fitting time:  97%|█████████▋| 971/1000 [01:36<00:03,  9.19it/s]Upper bound on the fitting time:  97%|█████████▋| 972/1000 [01:36<00:03,  9.04it/s]Upper bound on the fitting time:  97%|█████████▋| 973/1000 [01:36<00:02,  9.11it/s]Upper bound on the fitting time:  97%|█████████▋| 974/1000 [01:36<00:02,  9.07it/s]Upper bound on the fitting time:  98%|█████████▊| 975/1000 [01:36<00:02,  9.21it/s]Upper bound on the fitting time:  98%|█████████▊| 976/1000 [01:36<00:02,  9.16it/s]Upper bound on the fitting time:  98%|█████████▊| 977/1000 [01:36<00:02,  9.16it/s]Upper bound on the fitting time:  98%|█████████▊| 978/1000 [01:36<00:02,  9.30it/s]Upper bound on the fitting time:  98%|█████████▊| 979/1000 [01:37<00:02,  9.36it/s]Upper bound on the fitting time:  98%|█████████▊| 980/1000 [01:37<00:02,  9.38it/s]Upper bound on the fitting time:  98%|█████████▊| 981/1000 [01:37<00:02,  9.18it/s]Upper bound on the fitting time:  98%|█████████▊| 982/1000 [01:37<00:01,  9.11it/s]Upper bound on the fitting time:  98%|█████████▊| 983/1000 [01:37<00:01,  9.06it/s]Upper bound on the fitting time:  98%|█████████▊| 984/1000 [01:37<00:01,  8.80it/s]Upper bound on the fitting time:  98%|█████████▊| 985/1000 [01:37<00:01,  8.61it/s]Upper bound on the fitting time:  99%|█████████▊| 986/1000 [01:37<00:01,  8.69it/s]Upper bound on the fitting time:  99%|█████████▊| 987/1000 [01:37<00:01,  8.72it/s]Upper bound on the fitting time:  99%|█████████▉| 988/1000 [01:38<00:01,  8.80it/s]Upper bound on the fitting time:  99%|█████████▉| 989/1000 [01:38<00:01,  8.86it/s]Upper bound on the fitting time:  99%|█████████▉| 990/1000 [01:38<00:01,  8.83it/s]Upper bound on the fitting time:  99%|█████████▉| 991/1000 [01:38<00:01,  8.72it/s]Upper bound on the fitting time:  99%|█████████▉| 992/1000 [01:38<00:00,  8.66it/s]Upper bound on the fitting time:  99%|█████████▉| 993/1000 [01:38<00:00,  8.59it/s]Upper bound on the fitting time:  99%|█████████▉| 994/1000 [01:38<00:00,  8.65it/s]Upper bound on the fitting time: 100%|█████████▉| 995/1000 [01:38<00:00,  8.67it/s]Upper bound on the fitting time: 100%|█████████▉| 996/1000 [01:38<00:00,  8.68it/s]Upper bound on the fitting time: 100%|█████████▉| 997/1000 [01:39<00:00,  8.61it/s]Upper bound on the fitting time: 100%|█████████▉| 998/1000 [01:39<00:00,  8.56it/s]Upper bound on the fitting time: 100%|█████████▉| 999/1000 [01:39<00:00,  8.57it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [01:39<00:00,  8.62it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [01:39<00:00, 10.06it/s]
    -Upper bound on the fitting time:   0%|          | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time:   0%|          | 1/1000 [00:00<01:45,  9.51it/s]Upper bound on the fitting time:   0%|          | 2/1000 [00:00<01:48,  9.22it/s]Upper bound on the fitting time:   0%|          | 3/1000 [00:00<01:55,  8.64it/s]Upper bound on the fitting time:   0%|          | 4/1000 [00:00<01:57,  8.48it/s]Upper bound on the fitting time:   0%|          | 5/1000 [00:00<01:56,  8.53it/s]Upper bound on the fitting time:   1%|          | 6/1000 [00:00<01:54,  8.66it/s]Upper bound on the fitting time:   1%|          | 7/1000 [00:00<01:54,  8.68it/s]Upper bound on the fitting time:   1%|          | 8/1000 [00:00<01:55,  8.55it/s]Upper bound on the fitting time:   1%|          | 9/1000 [00:01<01:57,  8.44it/s]Upper bound on the fitting time:   1%|          | 10/1000 [00:01<01:57,  8.42it/s]Upper bound on the fitting time:   1%|          | 11/1000 [00:01<01:56,  8.52it/s]Upper bound on the fitting time:   1%|          | 12/1000 [00:01<01:55,  8.54it/s]Upper bound on the fitting time:   1%|▏         | 13/1000 [00:01<01:53,  8.68it/s]Upper bound on the fitting time:   1%|▏         | 14/1000 [00:01<01:55,  8.52it/s]Upper bound on the fitting time:   2%|▏         | 15/1000 [00:01<01:53,  8.71it/s]Upper bound on the fitting time:   2%|▏         | 16/1000 [00:01<01:54,  8.58it/s]Upper bound on the fitting time:   2%|▏         | 17/1000 [00:01<01:53,  8.63it/s]Upper bound on the fitting time:   2%|▏         | 18/1000 [00:02<01:52,  8.71it/s]Upper bound on the fitting time:   2%|▏         | 19/1000 [00:02<01:54,  8.55it/s]Upper bound on the fitting time:   2%|▏         | 20/1000 [00:02<01:57,  8.36it/s]Upper bound on the fitting time:   2%|▏         | 21/1000 [00:02<02:00,  8.13it/s]Upper bound on the fitting time:   2%|▏         | 22/1000 [00:02<02:00,  8.14it/s]Upper bound on the fitting time:   2%|▏         | 23/1000 [00:02<01:56,  8.42it/s]Upper bound on the fitting time:   2%|▏         | 24/1000 [00:02<01:53,  8.61it/s]Upper bound on the fitting time:   2%|▎         | 25/1000 [00:02<01:53,  8.62it/s]Upper bound on the fitting time:   3%|▎         | 26/1000 [00:03<01:52,  8.63it/s]Upper bound on the fitting time:   3%|▎         | 27/1000 [00:03<01:50,  8.84it/s]Upper bound on the fitting time:   3%|▎         | 29/1000 [00:03<01:42,  9.46it/s]Upper bound on the fitting time:   3%|▎         | 30/1000 [00:03<01:46,  9.15it/s]Upper bound on the fitting time:   3%|▎         | 31/1000 [00:03<01:50,  8.74it/s]Upper bound on the fitting time:   3%|▎         | 32/1000 [00:03<01:53,  8.55it/s]Upper bound on the fitting time:   3%|▎         | 33/1000 [00:03<01:56,  8.30it/s]Upper bound on the fitting time:   3%|▎         | 34/1000 [00:03<01:59,  8.08it/s]Upper bound on the fitting time:   4%|▎         | 35/1000 [00:04<02:00,  8.02it/s]Upper bound on the fitting time:   4%|▎         | 36/1000 [00:04<01:55,  8.31it/s]Upper bound on the fitting time:   4%|▎         | 37/1000 [00:04<01:53,  8.47it/s]Upper bound on the fitting time:   4%|▍         | 38/1000 [00:04<01:50,  8.74it/s]Upper bound on the fitting time:   4%|▍         | 39/1000 [00:04<01:48,  8.88it/s]Upper bound on the fitting time:   4%|▍         | 40/1000 [00:04<01:45,  9.09it/s]Upper bound on the fitting time:   4%|▍         | 42/1000 [00:04<01:40,  9.57it/s]Upper bound on the fitting time:   4%|▍         | 43/1000 [00:04<01:39,  9.61it/s]Upper bound on the fitting time:   4%|▍         | 44/1000 [00:05<01:38,  9.68it/s]Upper bound on the fitting time:   4%|▍         | 45/1000 [00:05<01:38,  9.69it/s]Upper bound on the fitting time:   5%|▍         | 46/1000 [00:05<01:40,  9.53it/s]Upper bound on the fitting time:   5%|▍         | 47/1000 [00:05<01:39,  9.61it/s]Upper bound on the fitting time:   5%|▍         | 49/1000 [00:05<01:37,  9.75it/s]Upper bound on the fitting time:   5%|▌         | 50/1000 [00:05<01:37,  9.79it/s]Upper bound on the fitting time:   5%|▌         | 51/1000 [00:05<01:39,  9.55it/s]Upper bound on the fitting time:   5%|▌         | 52/1000 [00:05<01:39,  9.54it/s]Upper bound on the fitting time:   5%|▌         | 53/1000 [00:05<01:38,  9.57it/s]Upper bound on the fitting time:   5%|▌         | 54/1000 [00:06<01:40,  9.45it/s]Upper bound on the fitting time:   6%|▌         | 55/1000 [00:06<01:40,  9.40it/s]Upper bound on the fitting time:   6%|▌         | 57/1000 [00:06<01:37,  9.72it/s]Upper bound on the fitting time:   6%|▌         | 58/1000 [00:06<01:36,  9.74it/s]Upper bound on the fitting time:   6%|▌         | 60/1000 [00:06<01:35,  9.88it/s]Upper bound on the fitting time:   6%|▌         | 62/1000 [00:06<01:33, 10.03it/s]Upper bound on the fitting time:   6%|▋         | 63/1000 [00:06<01:34,  9.89it/s]Upper bound on the fitting time:   6%|▋         | 64/1000 [00:07<01:34,  9.89it/s]Upper bound on the fitting time:   6%|▋         | 65/1000 [00:07<01:35,  9.82it/s]Upper bound on the fitting time:   7%|▋         | 67/1000 [00:07<01:32, 10.10it/s]Upper bound on the fitting time:   7%|▋         | 68/1000 [00:07<01:33,  9.97it/s]Upper bound on the fitting time:   7%|▋         | 69/1000 [00:07<01:33,  9.96it/s]Upper bound on the fitting time:   7%|▋         | 70/1000 [00:07<01:34,  9.82it/s]Upper bound on the fitting time:   7%|▋         | 71/1000 [00:07<01:35,  9.71it/s]Upper bound on the fitting time:   7%|▋         | 72/1000 [00:07<01:36,  9.65it/s]Upper bound on the fitting time:   7%|▋         | 73/1000 [00:08<01:36,  9.63it/s]Upper bound on the fitting time:   7%|▋         | 74/1000 [00:08<01:35,  9.72it/s]Upper bound on the fitting time:   8%|▊         | 75/1000 [00:08<01:36,  9.63it/s]Upper bound on the fitting time:   8%|▊         | 76/1000 [00:08<01:37,  9.49it/s]Upper bound on the fitting time:   8%|▊         | 77/1000 [00:08<01:37,  9.49it/s]Upper bound on the fitting time:   8%|▊         | 78/1000 [00:08<01:39,  9.26it/s]Upper bound on the fitting time:   8%|▊         | 79/1000 [00:08<01:45,  8.76it/s]Upper bound on the fitting time:   8%|▊         | 80/1000 [00:08<01:50,  8.32it/s]Upper bound on the fitting time:   8%|▊         | 81/1000 [00:08<01:50,  8.30it/s]Upper bound on the fitting time:   8%|▊         | 82/1000 [00:09<01:46,  8.61it/s]Upper bound on the fitting time:   8%|▊         | 83/1000 [00:09<01:44,  8.81it/s]Upper bound on the fitting time:   8%|▊         | 85/1000 [00:09<01:37,  9.40it/s]Upper bound on the fitting time:   9%|▊         | 86/1000 [00:09<01:35,  9.52it/s]Upper bound on the fitting time:   9%|▉         | 88/1000 [00:09<01:32,  9.83it/s]Upper bound on the fitting time:   9%|▉         | 89/1000 [00:09<01:32,  9.82it/s]Upper bound on the fitting time:   9%|▉         | 91/1000 [00:09<01:31,  9.96it/s]Upper bound on the fitting time:   9%|▉         | 92/1000 [00:10<01:31,  9.94it/s]Upper bound on the fitting time:   9%|▉         | 94/1000 [00:10<01:29, 10.10it/s]Upper bound on the fitting time:  10%|▉         | 96/1000 [00:10<01:28, 10.18it/s]Upper bound on the fitting time:  10%|▉         | 98/1000 [00:10<01:28, 10.18it/s]Upper bound on the fitting time:  10%|█         | 100/1000 [00:10<01:28, 10.14it/s]Upper bound on the fitting time:  10%|█         | 102/1000 [00:11<01:29, 10.07it/s]Upper bound on the fitting time:  10%|█         | 104/1000 [00:11<01:29,  9.97it/s]Upper bound on the fitting time:  10%|█         | 105/1000 [00:11<01:29,  9.96it/s]Upper bound on the fitting time:  11%|█         | 106/1000 [00:11<01:29,  9.97it/s]Upper bound on the fitting time:  11%|█         | 107/1000 [00:11<01:31,  9.80it/s]Upper bound on the fitting time:  11%|█         | 109/1000 [00:11<01:29,  9.98it/s]Upper bound on the fitting time:  11%|█         | 111/1000 [00:11<01:28, 10.09it/s]Upper bound on the fitting time:  11%|█▏        | 113/1000 [00:12<01:27, 10.09it/s]Upper bound on the fitting time:  12%|█▏        | 115/1000 [00:12<01:27, 10.07it/s]Upper bound on the fitting time:  12%|█▏        | 117/1000 [00:12<01:26, 10.15it/s]Upper bound on the fitting time:  12%|█▏        | 119/1000 [00:12<01:30,  9.72it/s]Upper bound on the fitting time:  12%|█▏        | 120/1000 [00:12<01:32,  9.51it/s]Upper bound on the fitting time:  12%|█▏        | 121/1000 [00:12<01:33,  9.41it/s]Upper bound on the fitting time:  12%|█▏        | 122/1000 [00:13<01:33,  9.40it/s]Upper bound on the fitting time:  12%|█▏        | 124/1000 [00:13<01:30,  9.69it/s]Upper bound on the fitting time:  12%|█▎        | 125/1000 [00:13<01:30,  9.72it/s]Upper bound on the fitting time:  13%|█▎        | 126/1000 [00:13<01:32,  9.49it/s]Upper bound on the fitting time:  13%|█▎        | 128/1000 [00:13<01:28,  9.88it/s]Upper bound on the fitting time:  13%|█▎        | 129/1000 [00:13<01:29,  9.68it/s]Upper bound on the fitting time:  13%|█▎        | 130/1000 [00:13<01:31,  9.55it/s]Upper bound on the fitting time:  13%|█▎        | 131/1000 [00:14<01:31,  9.48it/s]Upper bound on the fitting time:  13%|█▎        | 132/1000 [00:14<01:32,  9.37it/s]Upper bound on the fitting time:  13%|█▎        | 133/1000 [00:14<01:32,  9.39it/s]Upper bound on the fitting time:  13%|█▎        | 134/1000 [00:14<01:31,  9.43it/s]Upper bound on the fitting time:  14%|█▎        | 135/1000 [00:14<01:33,  9.30it/s]Upper bound on the fitting time:  14%|█▎        | 136/1000 [00:14<01:31,  9.42it/s]Upper bound on the fitting time:  14%|█▎        | 137/1000 [00:14<01:30,  9.56it/s]Upper bound on the fitting time:  14%|█▍        | 138/1000 [00:14<01:29,  9.68it/s]Upper bound on the fitting time:  14%|█▍        | 140/1000 [00:14<01:26,  9.91it/s]Upper bound on the fitting time:  14%|█▍        | 141/1000 [00:15<01:27,  9.87it/s]Upper bound on the fitting time:  14%|█▍        | 143/1000 [00:15<01:24, 10.14it/s]Upper bound on the fitting time:  14%|█▍        | 145/1000 [00:15<01:24, 10.15it/s]Upper bound on the fitting time:  15%|█▍        | 147/1000 [00:15<01:23, 10.22it/s]Upper bound on the fitting time:  15%|█▍        | 149/1000 [00:15<01:23, 10.23it/s]Upper bound on the fitting time:  15%|█▌        | 151/1000 [00:16<01:22, 10.28it/s]Upper bound on the fitting time:  15%|█▌        | 153/1000 [00:16<01:21, 10.34it/s]Upper bound on the fitting time:  16%|█▌        | 155/1000 [00:16<01:23, 10.10it/s]Upper bound on the fitting time:  16%|█▌        | 157/1000 [00:16<01:24, 10.03it/s]Upper bound on the fitting time:  16%|█▌        | 159/1000 [00:16<01:22, 10.14it/s]Upper bound on the fitting time:  16%|█▌        | 161/1000 [00:16<01:22, 10.21it/s]Upper bound on the fitting time:  16%|█▋        | 163/1000 [00:17<01:23, 10.01it/s]Upper bound on the fitting time:  16%|█▋        | 165/1000 [00:17<01:23,  9.98it/s]Upper bound on the fitting time:  17%|█▋        | 166/1000 [00:17<01:23,  9.97it/s]Upper bound on the fitting time:  17%|█▋        | 167/1000 [00:17<01:25,  9.75it/s]Upper bound on the fitting time:  17%|█▋        | 168/1000 [00:17<01:25,  9.70it/s]Upper bound on the fitting time:  17%|█▋        | 169/1000 [00:17<01:27,  9.52it/s]Upper bound on the fitting time:  17%|█▋        | 170/1000 [00:17<01:27,  9.53it/s]Upper bound on the fitting time:  17%|█▋        | 171/1000 [00:18<01:27,  9.46it/s]Upper bound on the fitting time:  17%|█▋        | 172/1000 [00:18<01:27,  9.43it/s]Upper bound on the fitting time:  17%|█▋        | 173/1000 [00:18<01:28,  9.33it/s]Upper bound on the fitting time:  17%|█▋        | 174/1000 [00:18<01:28,  9.34it/s]Upper bound on the fitting time:  18%|█▊        | 175/1000 [00:18<01:27,  9.45it/s]Upper bound on the fitting time:  18%|█▊        | 176/1000 [00:18<01:27,  9.45it/s]Upper bound on the fitting time:  18%|█▊        | 177/1000 [00:18<01:27,  9.44it/s]Upper bound on the fitting time:  18%|█▊        | 178/1000 [00:18<01:26,  9.47it/s]Upper bound on the fitting time:  18%|█▊        | 179/1000 [00:18<01:26,  9.52it/s]Upper bound on the fitting time:  18%|█▊        | 180/1000 [00:18<01:25,  9.54it/s]Upper bound on the fitting time:  18%|█▊        | 181/1000 [00:19<01:26,  9.52it/s]Upper bound on the fitting time:  18%|█▊        | 182/1000 [00:19<01:26,  9.48it/s]Upper bound on the fitting time:  18%|█▊        | 183/1000 [00:19<01:28,  9.23it/s]Upper bound on the fitting time:  18%|█▊        | 184/1000 [00:19<01:30,  9.01it/s]Upper bound on the fitting time:  18%|█▊        | 185/1000 [00:19<01:31,  8.91it/s]Upper bound on the fitting time:  19%|█▊        | 186/1000 [00:19<01:29,  9.13it/s]Upper bound on the fitting time:  19%|█▊        | 187/1000 [00:19<01:29,  9.08it/s]Upper bound on the fitting time:  19%|█▉        | 188/1000 [00:19<01:30,  8.98it/s]Upper bound on the fitting time:  19%|█▉        | 189/1000 [00:19<01:28,  9.18it/s]Upper bound on the fitting time:  19%|█▉        | 190/1000 [00:20<01:26,  9.36it/s]Upper bound on the fitting time:  19%|█▉        | 191/1000 [00:20<01:24,  9.53it/s]Upper bound on the fitting time:  19%|█▉        | 192/1000 [00:20<01:23,  9.66it/s]Upper bound on the fitting time:  19%|█▉        | 194/1000 [00:20<01:20, 10.00it/s]Upper bound on the fitting time:  20%|█▉        | 196/1000 [00:20<01:19, 10.17it/s]Upper bound on the fitting time:  20%|█▉        | 198/1000 [00:20<01:17, 10.31it/s]Upper bound on the fitting time:  20%|██        | 200/1000 [00:21<01:17, 10.33it/s]Upper bound on the fitting time:  20%|██        | 202/1000 [00:21<01:17, 10.24it/s]Upper bound on the fitting time:  20%|██        | 204/1000 [00:21<01:17, 10.28it/s]Upper bound on the fitting time:  21%|██        | 206/1000 [00:21<01:18, 10.18it/s]Upper bound on the fitting time:  21%|██        | 208/1000 [00:21<01:17, 10.19it/s]Upper bound on the fitting time:  21%|██        | 210/1000 [00:22<01:16, 10.28it/s]Upper bound on the fitting time:  21%|██        | 212/1000 [00:22<01:19,  9.89it/s]Upper bound on the fitting time:  21%|██▏       | 213/1000 [00:22<01:20,  9.77it/s]Upper bound on the fitting time:  21%|██▏       | 214/1000 [00:22<01:21,  9.68it/s]Upper bound on the fitting time:  22%|██▏       | 215/1000 [00:22<01:20,  9.72it/s]Upper bound on the fitting time:  22%|██▏       | 216/1000 [00:22<01:20,  9.77it/s]Upper bound on the fitting time:  22%|██▏       | 218/1000 [00:22<01:17, 10.03it/s]Upper bound on the fitting time:  22%|██▏       | 220/1000 [00:23<01:16, 10.16it/s]Upper bound on the fitting time:  22%|██▏       | 222/1000 [00:23<01:16, 10.17it/s]Upper bound on the fitting time:  22%|██▏       | 224/1000 [00:23<01:15, 10.25it/s]Upper bound on the fitting time:  23%|██▎       | 226/1000 [00:23<01:17,  9.98it/s]Upper bound on the fitting time:  23%|██▎       | 227/1000 [00:23<01:19,  9.69it/s]Upper bound on the fitting time:  23%|██▎       | 229/1000 [00:23<01:18,  9.80it/s]Upper bound on the fitting time:  23%|██▎       | 230/1000 [00:24<01:18,  9.78it/s]Upper bound on the fitting time:  23%|██▎       | 231/1000 [00:24<01:19,  9.65it/s]Upper bound on the fitting time:  23%|██▎       | 232/1000 [00:24<01:20,  9.52it/s]Upper bound on the fitting time:  23%|██▎       | 233/1000 [00:24<01:21,  9.43it/s]Upper bound on the fitting time:  23%|██▎       | 234/1000 [00:24<01:21,  9.35it/s]Upper bound on the fitting time:  24%|██▎       | 236/1000 [00:24<01:16,  9.97it/s]Upper bound on the fitting time:  24%|██▎       | 237/1000 [00:24<01:17,  9.86it/s]Upper bound on the fitting time:  24%|██▍       | 239/1000 [00:24<01:15, 10.06it/s]Upper bound on the fitting time:  24%|██▍       | 240/1000 [00:25<01:16,  9.96it/s]Upper bound on the fitting time:  24%|██▍       | 242/1000 [00:25<01:14, 10.11it/s]Upper bound on the fitting time:  24%|██▍       | 244/1000 [00:25<01:14, 10.14it/s]Upper bound on the fitting time:  25%|██▍       | 246/1000 [00:25<01:14, 10.12it/s]Upper bound on the fitting time:  25%|██▍       | 248/1000 [00:25<01:13, 10.29it/s]Upper bound on the fitting time:  25%|██▌       | 250/1000 [00:26<01:12, 10.32it/s]Upper bound on the fitting time:  25%|██▌       | 252/1000 [00:26<01:12, 10.31it/s]Upper bound on the fitting time:  25%|██▌       | 254/1000 [00:26<01:12, 10.31it/s]Upper bound on the fitting time:  26%|██▌       | 256/1000 [00:26<01:11, 10.36it/s]Upper bound on the fitting time:  26%|██▌       | 258/1000 [00:26<01:11, 10.41it/s]Upper bound on the fitting time:  26%|██▌       | 260/1000 [00:27<01:11, 10.38it/s]Upper bound on the fitting time:  26%|██▌       | 262/1000 [00:27<01:10, 10.42it/s]Upper bound on the fitting time:  26%|██▋       | 264/1000 [00:27<01:11, 10.33it/s]Upper bound on the fitting time:  27%|██▋       | 266/1000 [00:27<01:10, 10.35it/s]Upper bound on the fitting time:  27%|██▋       | 268/1000 [00:27<01:12, 10.14it/s]Upper bound on the fitting time:  27%|██▋       | 270/1000 [00:28<01:12, 10.00it/s]Upper bound on the fitting time:  27%|██▋       | 272/1000 [00:28<01:12, 10.07it/s]Upper bound on the fitting time:  27%|██▋       | 274/1000 [00:28<01:11, 10.09it/s]Upper bound on the fitting time:  28%|██▊       | 276/1000 [00:28<01:11, 10.15it/s]Upper bound on the fitting time:  28%|██▊       | 278/1000 [00:28<01:10, 10.21it/s]Upper bound on the fitting time:  28%|██▊       | 280/1000 [00:28<01:09, 10.33it/s]Upper bound on the fitting time:  28%|██▊       | 282/1000 [00:29<01:08, 10.42it/s]Upper bound on the fitting time:  28%|██▊       | 284/1000 [00:29<01:08, 10.42it/s]Upper bound on the fitting time:  29%|██▊       | 286/1000 [00:29<01:09, 10.33it/s]Upper bound on the fitting time:  29%|██▉       | 288/1000 [00:29<01:09, 10.30it/s]Upper bound on the fitting time:  29%|██▉       | 290/1000 [00:29<01:08, 10.32it/s]Upper bound on the fitting time:  29%|██▉       | 292/1000 [00:30<01:08, 10.30it/s]Upper bound on the fitting time:  29%|██▉       | 294/1000 [00:30<01:08, 10.37it/s]Upper bound on the fitting time:  30%|██▉       | 296/1000 [00:30<01:07, 10.36it/s]Upper bound on the fitting time:  30%|██▉       | 298/1000 [00:30<01:07, 10.36it/s]Upper bound on the fitting time:  30%|███       | 300/1000 [00:30<01:09, 10.08it/s]Upper bound on the fitting time:  30%|███       | 302/1000 [00:31<01:09, 10.05it/s]Upper bound on the fitting time:  30%|███       | 304/1000 [00:31<01:09,  9.99it/s]Upper bound on the fitting time:  31%|███       | 306/1000 [00:31<01:09, 10.05it/s]Upper bound on the fitting time:  31%|███       | 308/1000 [00:31<01:13,  9.37it/s]Upper bound on the fitting time:  31%|███       | 309/1000 [00:31<01:14,  9.31it/s]Upper bound on the fitting time:  31%|███       | 310/1000 [00:32<01:14,  9.28it/s]Upper bound on the fitting time:  31%|███       | 311/1000 [00:32<01:16,  9.01it/s]Upper bound on the fitting time:  31%|███       | 312/1000 [00:32<01:19,  8.64it/s]Upper bound on the fitting time:  31%|███▏      | 313/1000 [00:32<01:19,  8.61it/s]Upper bound on the fitting time:  31%|███▏      | 314/1000 [00:32<01:18,  8.74it/s]Upper bound on the fitting time:  32%|███▏      | 315/1000 [00:32<01:18,  8.76it/s]Upper bound on the fitting time:  32%|███▏      | 316/1000 [00:32<01:17,  8.78it/s]Upper bound on the fitting time:  32%|███▏      | 317/1000 [00:32<01:16,  8.91it/s]Upper bound on the fitting time:  32%|███▏      | 318/1000 [00:32<01:15,  9.05it/s]Upper bound on the fitting time:  32%|███▏      | 319/1000 [00:33<01:15,  9.05it/s]Upper bound on the fitting time:  32%|███▏      | 320/1000 [00:33<01:14,  9.09it/s]Upper bound on the fitting time:  32%|███▏      | 321/1000 [00:33<01:13,  9.25it/s]Upper bound on the fitting time:  32%|███▏      | 322/1000 [00:33<01:12,  9.34it/s]Upper bound on the fitting time:  32%|███▏      | 323/1000 [00:33<01:13,  9.16it/s]Upper bound on the fitting time:  32%|███▏      | 324/1000 [00:33<01:15,  9.00it/s]Upper bound on the fitting time:  32%|███▎      | 325/1000 [00:33<01:14,  9.12it/s]Upper bound on the fitting time:  33%|███▎      | 326/1000 [00:33<01:14,  9.04it/s]Upper bound on the fitting time:  33%|███▎      | 327/1000 [00:33<01:13,  9.17it/s]Upper bound on the fitting time:  33%|███▎      | 328/1000 [00:34<01:12,  9.33it/s]Upper bound on the fitting time:  33%|███▎      | 329/1000 [00:34<01:11,  9.33it/s]Upper bound on the fitting time:  33%|███▎      | 330/1000 [00:34<01:12,  9.24it/s]Upper bound on the fitting time:  33%|███▎      | 331/1000 [00:34<01:12,  9.20it/s]Upper bound on the fitting time:  33%|███▎      | 332/1000 [00:34<01:13,  9.05it/s]Upper bound on the fitting time:  33%|███▎      | 333/1000 [00:34<01:14,  8.89it/s]Upper bound on the fitting time:  33%|███▎      | 334/1000 [00:34<01:14,  8.94it/s]Upper bound on the fitting time:  34%|███▎      | 335/1000 [00:34<01:13,  8.99it/s]Upper bound on the fitting time:  34%|███▎      | 336/1000 [00:34<01:15,  8.84it/s]Upper bound on the fitting time:  34%|███▎      | 337/1000 [00:35<01:15,  8.81it/s]Upper bound on the fitting time:  34%|███▍      | 338/1000 [00:35<01:14,  8.84it/s]Upper bound on the fitting time:  34%|███▍      | 339/1000 [00:35<01:15,  8.81it/s]Upper bound on the fitting time:  34%|███▍      | 340/1000 [00:35<01:14,  8.89it/s]Upper bound on the fitting time:  34%|███▍      | 341/1000 [00:35<01:13,  8.92it/s]Upper bound on the fitting time:  34%|███▍      | 342/1000 [00:35<01:13,  8.90it/s]Upper bound on the fitting time:  34%|███▍      | 343/1000 [00:35<01:15,  8.66it/s]Upper bound on the fitting time:  34%|███▍      | 344/1000 [00:35<01:15,  8.66it/s]Upper bound on the fitting time:  34%|███▍      | 345/1000 [00:35<01:15,  8.70it/s]Upper bound on the fitting time:  35%|███▍      | 346/1000 [00:36<01:15,  8.71it/s]Upper bound on the fitting time:  35%|███▍      | 347/1000 [00:36<01:14,  8.79it/s]Upper bound on the fitting time:  35%|███▍      | 348/1000 [00:36<01:15,  8.67it/s]Upper bound on the fitting time:  35%|███▍      | 349/1000 [00:36<01:14,  8.78it/s]Upper bound on the fitting time:  35%|███▌      | 350/1000 [00:36<01:13,  8.88it/s]Upper bound on the fitting time:  35%|███▌      | 351/1000 [00:36<01:13,  8.86it/s]Upper bound on the fitting time:  35%|███▌      | 352/1000 [00:36<01:12,  8.95it/s]Upper bound on the fitting time:  35%|███▌      | 353/1000 [00:36<01:12,  8.93it/s]Upper bound on the fitting time:  35%|███▌      | 354/1000 [00:36<01:11,  8.98it/s]Upper bound on the fitting time:  36%|███▌      | 355/1000 [00:37<01:12,  8.86it/s]Upper bound on the fitting time:  36%|███▌      | 356/1000 [00:37<01:11,  8.97it/s]Upper bound on the fitting time:  36%|███▌      | 357/1000 [00:37<01:12,  8.85it/s]Upper bound on the fitting time:  36%|███▌      | 358/1000 [00:37<01:13,  8.73it/s]Upper bound on the fitting time:  36%|███▌      | 359/1000 [00:37<01:14,  8.66it/s]Upper bound on the fitting time:  36%|███▌      | 360/1000 [00:37<01:14,  8.63it/s]Upper bound on the fitting time:  36%|███▌      | 361/1000 [00:37<01:14,  8.57it/s]Upper bound on the fitting time:  36%|███▌      | 362/1000 [00:37<01:13,  8.69it/s]Upper bound on the fitting time:  36%|███▋      | 363/1000 [00:37<01:13,  8.67it/s]Upper bound on the fitting time:  36%|███▋      | 364/1000 [00:38<01:12,  8.79it/s]Upper bound on the fitting time:  36%|███▋      | 365/1000 [00:38<01:11,  8.87it/s]Upper bound on the fitting time:  37%|███▋      | 366/1000 [00:38<01:11,  8.81it/s]Upper bound on the fitting time:  37%|███▋      | 367/1000 [00:38<01:12,  8.72it/s]Upper bound on the fitting time:  37%|███▋      | 368/1000 [00:38<01:12,  8.69it/s]Upper bound on the fitting time:  37%|███▋      | 369/1000 [00:38<01:13,  8.58it/s]Upper bound on the fitting time:  37%|███▋      | 370/1000 [00:38<01:13,  8.60it/s]Upper bound on the fitting time:  37%|███▋      | 371/1000 [00:38<01:13,  8.58it/s]Upper bound on the fitting time:  37%|███▋      | 372/1000 [00:39<01:13,  8.60it/s]Upper bound on the fitting time:  37%|███▋      | 373/1000 [00:39<01:13,  8.57it/s]Upper bound on the fitting time:  37%|███▋      | 374/1000 [00:39<01:12,  8.59it/s]Upper bound on the fitting time:  38%|███▊      | 375/1000 [00:39<01:12,  8.59it/s]Upper bound on the fitting time:  38%|███▊      | 376/1000 [00:39<01:12,  8.58it/s]Upper bound on the fitting time:  38%|███▊      | 377/1000 [00:39<01:12,  8.60it/s]Upper bound on the fitting time:  38%|███▊      | 378/1000 [00:39<01:11,  8.68it/s]Upper bound on the fitting time:  38%|███▊      | 379/1000 [00:39<01:10,  8.79it/s]Upper bound on the fitting time:  38%|███▊      | 380/1000 [00:39<01:09,  8.97it/s]Upper bound on the fitting time:  38%|███▊      | 381/1000 [00:40<01:09,  8.87it/s]Upper bound on the fitting time:  38%|███▊      | 382/1000 [00:40<01:09,  8.95it/s]Upper bound on the fitting time:  38%|███▊      | 383/1000 [00:40<01:08,  8.98it/s]Upper bound on the fitting time:  38%|███▊      | 384/1000 [00:40<01:09,  8.89it/s]Upper bound on the fitting time:  38%|███▊      | 385/1000 [00:40<01:10,  8.77it/s]Upper bound on the fitting time:  39%|███▊      | 386/1000 [00:40<01:10,  8.72it/s]Upper bound on the fitting time:  39%|███▊      | 387/1000 [00:40<01:10,  8.69it/s]Upper bound on the fitting time:  39%|███▉      | 388/1000 [00:40<01:09,  8.78it/s]Upper bound on the fitting time:  39%|███▉      | 389/1000 [00:40<01:09,  8.83it/s]Upper bound on the fitting time:  39%|███▉      | 390/1000 [00:41<01:08,  8.92it/s]Upper bound on the fitting time:  39%|███▉      | 391/1000 [00:41<01:09,  8.79it/s]Upper bound on the fitting time:  39%|███▉      | 392/1000 [00:41<01:09,  8.76it/s]Upper bound on the fitting time:  39%|███▉      | 393/1000 [00:41<01:09,  8.73it/s]Upper bound on the fitting time:  39%|███▉      | 394/1000 [00:41<01:08,  8.86it/s]Upper bound on the fitting time:  40%|███▉      | 395/1000 [00:41<01:07,  8.95it/s]Upper bound on the fitting time:  40%|███▉      | 396/1000 [00:41<01:08,  8.87it/s]Upper bound on the fitting time:  40%|███▉      | 397/1000 [00:41<01:08,  8.78it/s]Upper bound on the fitting time:  40%|███▉      | 398/1000 [00:41<01:06,  9.00it/s]Upper bound on the fitting time:  40%|███▉      | 399/1000 [00:42<01:05,  9.15it/s]Upper bound on the fitting time:  40%|████      | 400/1000 [00:42<01:07,  8.92it/s]Upper bound on the fitting time:  40%|████      | 401/1000 [00:42<01:07,  8.93it/s]Upper bound on the fitting time:  40%|████      | 402/1000 [00:42<01:06,  9.03it/s]Upper bound on the fitting time:  40%|████      | 403/1000 [00:42<01:05,  9.11it/s]Upper bound on the fitting time:  40%|████      | 404/1000 [00:42<01:06,  9.00it/s]Upper bound on the fitting time:  40%|████      | 405/1000 [00:42<01:07,  8.84it/s]Upper bound on the fitting time:  41%|████      | 406/1000 [00:42<01:07,  8.86it/s]Upper bound on the fitting time:  41%|████      | 407/1000 [00:42<01:06,  8.87it/s]Upper bound on the fitting time:  41%|████      | 408/1000 [00:43<01:07,  8.79it/s]Upper bound on the fitting time:  41%|████      | 409/1000 [00:43<01:06,  8.90it/s]Upper bound on the fitting time:  41%|████      | 410/1000 [00:43<01:07,  8.80it/s]Upper bound on the fitting time:  41%|████      | 411/1000 [00:43<01:06,  8.85it/s]Upper bound on the fitting time:  41%|████      | 412/1000 [00:43<01:05,  8.97it/s]Upper bound on the fitting time:  41%|████▏     | 413/1000 [00:43<01:07,  8.74it/s]Upper bound on the fitting time:  41%|████▏     | 414/1000 [00:43<01:07,  8.64it/s]Upper bound on the fitting time:  42%|████▏     | 415/1000 [00:43<01:07,  8.66it/s]Upper bound on the fitting time:  42%|████▏     | 416/1000 [00:44<01:06,  8.74it/s]Upper bound on the fitting time:  42%|████▏     | 417/1000 [00:44<01:07,  8.67it/s]Upper bound on the fitting time:  42%|████▏     | 418/1000 [00:44<01:05,  8.89it/s]Upper bound on the fitting time:  42%|████▏     | 419/1000 [00:44<01:04,  9.05it/s]Upper bound on the fitting time:  42%|████▏     | 420/1000 [00:44<01:04,  8.94it/s]Upper bound on the fitting time:  42%|████▏     | 421/1000 [00:44<01:04,  8.92it/s]Upper bound on the fitting time:  42%|████▏     | 422/1000 [00:44<01:04,  8.99it/s]Upper bound on the fitting time:  42%|████▏     | 423/1000 [00:44<01:04,  9.01it/s]Upper bound on the fitting time:  42%|████▏     | 424/1000 [00:44<01:03,  9.11it/s]Upper bound on the fitting time:  42%|████▎     | 425/1000 [00:44<01:02,  9.15it/s]Upper bound on the fitting time:  43%|████▎     | 426/1000 [00:45<01:03,  9.11it/s]Upper bound on the fitting time:  43%|████▎     | 427/1000 [00:45<01:03,  9.01it/s]Upper bound on the fitting time:  43%|████▎     | 428/1000 [00:45<01:03,  9.01it/s]Upper bound on the fitting time:  43%|████▎     | 429/1000 [00:45<01:03,  8.97it/s]Upper bound on the fitting time:  43%|████▎     | 430/1000 [00:45<01:03,  9.02it/s]Upper bound on the fitting time:  43%|████▎     | 431/1000 [00:45<01:03,  8.98it/s]Upper bound on the fitting time:  43%|████▎     | 432/1000 [00:45<01:03,  8.91it/s]Upper bound on the fitting time:  43%|████▎     | 433/1000 [00:45<01:03,  8.86it/s]Upper bound on the fitting time:  43%|████▎     | 434/1000 [00:46<01:03,  8.97it/s]Upper bound on the fitting time:  44%|████▎     | 435/1000 [00:46<01:03,  8.95it/s]Upper bound on the fitting time:  44%|████▎     | 436/1000 [00:46<01:03,  8.93it/s]Upper bound on the fitting time:  44%|████▎     | 437/1000 [00:46<01:03,  8.87it/s]Upper bound on the fitting time:  44%|████▍     | 438/1000 [00:46<01:03,  8.87it/s]Upper bound on the fitting time:  44%|████▍     | 439/1000 [00:46<01:03,  8.86it/s]Upper bound on the fitting time:  44%|████▍     | 440/1000 [00:46<01:03,  8.83it/s]Upper bound on the fitting time:  44%|████▍     | 441/1000 [00:46<01:04,  8.68it/s]Upper bound on the fitting time:  44%|████▍     | 442/1000 [00:46<01:04,  8.69it/s]Upper bound on the fitting time:  44%|████▍     | 443/1000 [00:47<01:03,  8.71it/s]Upper bound on the fitting time:  44%|████▍     | 444/1000 [00:47<01:03,  8.76it/s]Upper bound on the fitting time:  44%|████▍     | 445/1000 [00:47<01:03,  8.68it/s]Upper bound on the fitting time:  45%|████▍     | 446/1000 [00:47<01:03,  8.70it/s]Upper bound on the fitting time:  45%|████▍     | 447/1000 [00:47<01:04,  8.56it/s]Upper bound on the fitting time:  45%|████▍     | 448/1000 [00:47<01:04,  8.56it/s]Upper bound on the fitting time:  45%|████▍     | 449/1000 [00:47<01:04,  8.51it/s]Upper bound on the fitting time:  45%|████▌     | 450/1000 [00:47<01:05,  8.41it/s]Upper bound on the fitting time:  45%|████▌     | 451/1000 [00:47<01:05,  8.34it/s]Upper bound on the fitting time:  45%|████▌     | 452/1000 [00:48<01:04,  8.49it/s]Upper bound on the fitting time:  45%|████▌     | 453/1000 [00:48<01:02,  8.72it/s]Upper bound on the fitting time:  45%|████▌     | 454/1000 [00:48<01:02,  8.74it/s]Upper bound on the fitting time:  46%|████▌     | 455/1000 [00:48<01:01,  8.79it/s]Upper bound on the fitting time:  46%|████▌     | 456/1000 [00:48<01:01,  8.91it/s]Upper bound on the fitting time:  46%|████▌     | 457/1000 [00:48<01:01,  8.82it/s]Upper bound on the fitting time:  46%|████▌     | 458/1000 [00:48<01:01,  8.88it/s]Upper bound on the fitting time:  46%|████▌     | 459/1000 [00:48<01:01,  8.84it/s]Upper bound on the fitting time:  46%|████▌     | 460/1000 [00:48<01:00,  8.91it/s]Upper bound on the fitting time:  46%|████▌     | 461/1000 [00:49<01:00,  8.90it/s]Upper bound on the fitting time:  46%|████▌     | 462/1000 [00:49<01:00,  8.95it/s]Upper bound on the fitting time:  46%|████▋     | 463/1000 [00:49<01:00,  8.88it/s]Upper bound on the fitting time:  46%|████▋     | 464/1000 [00:49<01:00,  8.82it/s]Upper bound on the fitting time:  46%|████▋     | 465/1000 [00:49<01:00,  8.86it/s]Upper bound on the fitting time:  47%|████▋     | 466/1000 [00:49<00:59,  8.94it/s]Upper bound on the fitting time:  47%|████▋     | 467/1000 [00:49<00:59,  8.91it/s]Upper bound on the fitting time:  47%|████▋     | 468/1000 [00:49<01:00,  8.86it/s]Upper bound on the fitting time:  47%|████▋     | 469/1000 [00:49<00:59,  8.88it/s]Upper bound on the fitting time:  47%|████▋     | 470/1000 [00:50<00:59,  8.91it/s]Upper bound on the fitting time:  47%|████▋     | 471/1000 [00:50<00:59,  8.96it/s]Upper bound on the fitting time:  47%|████▋     | 472/1000 [00:50<00:58,  8.99it/s]Upper bound on the fitting time:  47%|████▋     | 473/1000 [00:50<00:58,  9.00it/s]Upper bound on the fitting time:  47%|████▋     | 474/1000 [00:50<00:58,  9.03it/s]Upper bound on the fitting time:  48%|████▊     | 475/1000 [00:50<01:00,  8.66it/s]Upper bound on the fitting time:  48%|████▊     | 476/1000 [00:50<01:00,  8.61it/s]Upper bound on the fitting time:  48%|████▊     | 477/1000 [00:50<01:01,  8.55it/s]Upper bound on the fitting time:  48%|████▊     | 478/1000 [00:51<01:01,  8.52it/s]Upper bound on the fitting time:  48%|████▊     | 479/1000 [00:51<01:01,  8.47it/s]Upper bound on the fitting time:  48%|████▊     | 480/1000 [00:51<01:00,  8.59it/s]Upper bound on the fitting time:  48%|████▊     | 481/1000 [00:51<01:00,  8.61it/s]Upper bound on the fitting time:  48%|████▊     | 482/1000 [00:51<01:01,  8.46it/s]Upper bound on the fitting time:  48%|████▊     | 483/1000 [00:51<01:01,  8.45it/s]Upper bound on the fitting time:  48%|████▊     | 484/1000 [00:51<01:01,  8.42it/s]Upper bound on the fitting time:  48%|████▊     | 485/1000 [00:51<01:01,  8.37it/s]Upper bound on the fitting time:  49%|████▊     | 486/1000 [00:51<00:59,  8.62it/s]Upper bound on the fitting time:  49%|████▊     | 487/1000 [00:52<01:00,  8.54it/s]Upper bound on the fitting time:  49%|████▉     | 488/1000 [00:52<00:59,  8.66it/s]Upper bound on the fitting time:  49%|████▉     | 489/1000 [00:52<00:59,  8.56it/s]Upper bound on the fitting time:  49%|████▉     | 490/1000 [00:52<00:58,  8.72it/s]Upper bound on the fitting time:  49%|████▉     | 491/1000 [00:52<01:02,  8.20it/s]Upper bound on the fitting time:  49%|████▉     | 492/1000 [00:52<01:05,  7.80it/s]Upper bound on the fitting time:  49%|████▉     | 493/1000 [00:52<01:04,  7.90it/s]Upper bound on the fitting time:  50%|████▉     | 495/1000 [00:52<00:51,  9.74it/s]Upper bound on the fitting time:  50%|████▉     | 497/1000 [00:53<00:45, 10.97it/s]Upper bound on the fitting time:  50%|████▉     | 499/1000 [00:53<00:42, 11.78it/s]Upper bound on the fitting time:  50%|█████     | 501/1000 [00:53<00:40, 12.35it/s]Upper bound on the fitting time:  50%|█████     | 503/1000 [00:53<00:37, 13.13it/s]Upper bound on the fitting time:  50%|█████     | 505/1000 [00:53<00:36, 13.70it/s]Upper bound on the fitting time:  51%|█████     | 507/1000 [00:53<00:35, 13.91it/s]Upper bound on the fitting time:  51%|█████     | 509/1000 [00:53<00:34, 14.07it/s]Upper bound on the fitting time:  51%|█████     | 511/1000 [00:54<00:34, 14.33it/s]Upper bound on the fitting time:  51%|█████▏    | 513/1000 [00:54<00:34, 14.15it/s]Upper bound on the fitting time:  52%|█████▏    | 515/1000 [00:54<00:36, 13.23it/s]Upper bound on the fitting time:  52%|█████▏    | 517/1000 [00:54<00:43, 11.04it/s]Upper bound on the fitting time:  52%|█████▏    | 519/1000 [00:54<00:43, 11.16it/s]Upper bound on the fitting time:  52%|█████▏    | 521/1000 [00:55<00:42, 11.15it/s]Upper bound on the fitting time:  52%|█████▏    | 523/1000 [00:55<00:42, 11.28it/s]Upper bound on the fitting time:  52%|█████▎    | 525/1000 [00:55<00:42, 11.13it/s]Upper bound on the fitting time:  53%|█████▎    | 527/1000 [00:55<00:43, 10.79it/s]Upper bound on the fitting time:  53%|█████▎    | 529/1000 [00:55<00:44, 10.56it/s]Upper bound on the fitting time:  53%|█████▎    | 531/1000 [00:56<00:47,  9.96it/s]Upper bound on the fitting time:  53%|█████▎    | 533/1000 [00:56<00:46,  9.94it/s]Upper bound on the fitting time:  54%|█████▎    | 535/1000 [00:56<00:45, 10.14it/s]Upper bound on the fitting time:  54%|█████▎    | 537/1000 [00:56<00:45, 10.22it/s]Upper bound on the fitting time:  54%|█████▍    | 539/1000 [00:56<00:47,  9.66it/s]Upper bound on the fitting time:  54%|█████▍    | 540/1000 [00:56<00:47,  9.59it/s]Upper bound on the fitting time:  54%|█████▍    | 541/1000 [00:57<00:48,  9.41it/s]Upper bound on the fitting time:  54%|█████▍    | 542/1000 [00:57<00:49,  9.19it/s]Upper bound on the fitting time:  54%|█████▍    | 543/1000 [00:57<00:52,  8.63it/s]Upper bound on the fitting time:  54%|█████▍    | 544/1000 [00:57<00:51,  8.78it/s]Upper bound on the fitting time:  55%|█████▍    | 545/1000 [00:57<00:51,  8.82it/s]Upper bound on the fitting time:  55%|█████▍    | 546/1000 [00:57<00:52,  8.73it/s]Upper bound on the fitting time:  55%|█████▍    | 547/1000 [00:57<00:56,  8.02it/s]Upper bound on the fitting time:  55%|█████▍    | 548/1000 [00:57<00:56,  8.03it/s]Upper bound on the fitting time:  55%|█████▍    | 549/1000 [00:58<00:57,  7.80it/s]Upper bound on the fitting time:  55%|█████▌    | 550/1000 [00:58<00:56,  8.00it/s]Upper bound on the fitting time:  55%|█████▌    | 551/1000 [00:58<00:56,  7.97it/s]Upper bound on the fitting time:  55%|█████▌    | 552/1000 [00:58<00:59,  7.52it/s]Upper bound on the fitting time:  55%|█████▌    | 553/1000 [00:58<00:57,  7.77it/s]Upper bound on the fitting time:  56%|█████▌    | 555/1000 [00:58<00:50,  8.82it/s]Upper bound on the fitting time:  56%|█████▌    | 556/1000 [00:58<00:50,  8.77it/s]Upper bound on the fitting time:  56%|█████▌    | 558/1000 [00:59<00:46,  9.58it/s]Upper bound on the fitting time:  56%|█████▌    | 560/1000 [00:59<00:43, 10.03it/s]Upper bound on the fitting time:  56%|█████▌    | 561/1000 [00:59<00:44,  9.88it/s]Upper bound on the fitting time:  56%|█████▌    | 562/1000 [00:59<00:47,  9.22it/s]Upper bound on the fitting time:  56%|█████▋    | 563/1000 [00:59<00:48,  8.93it/s]Upper bound on the fitting time:  56%|█████▋    | 564/1000 [00:59<00:52,  8.23it/s]Upper bound on the fitting time:  56%|█████▋    | 565/1000 [00:59<00:56,  7.72it/s]Upper bound on the fitting time:  57%|█████▋    | 566/1000 [01:00<00:55,  7.88it/s]Upper bound on the fitting time:  57%|█████▋    | 567/1000 [01:00<00:53,  8.09it/s]Upper bound on the fitting time:  57%|█████▋    | 568/1000 [01:00<00:51,  8.31it/s]Upper bound on the fitting time:  57%|█████▋    | 569/1000 [01:00<00:51,  8.30it/s]Upper bound on the fitting time:  57%|█████▋    | 570/1000 [01:00<01:02,  6.89it/s]Upper bound on the fitting time:  57%|█████▋    | 571/1000 [01:00<01:00,  7.09it/s]Upper bound on the fitting time:  57%|█████▋    | 572/1000 [01:00<01:02,  6.87it/s]Upper bound on the fitting time:  57%|█████▋    | 573/1000 [01:00<01:01,  6.94it/s]Upper bound on the fitting time:  57%|█████▋    | 574/1000 [01:01<01:00,  7.08it/s]Upper bound on the fitting time:  57%|█████▊    | 575/1000 [01:01<00:57,  7.38it/s]Upper bound on the fitting time:  58%|█████▊    | 576/1000 [01:01<00:54,  7.79it/s]Upper bound on the fitting time:  58%|█████▊    | 577/1000 [01:01<00:53,  7.96it/s]Upper bound on the fitting time:  58%|█████▊    | 578/1000 [01:01<00:51,  8.21it/s]Upper bound on the fitting time:  58%|█████▊    | 579/1000 [01:01<00:51,  8.10it/s]Upper bound on the fitting time:  58%|█████▊    | 580/1000 [01:01<00:52,  7.95it/s]Upper bound on the fitting time:  58%|█████▊    | 581/1000 [01:01<00:53,  7.87it/s]Upper bound on the fitting time:  58%|█████▊    | 582/1000 [01:02<00:51,  8.13it/s]Upper bound on the fitting time:  58%|█████▊    | 583/1000 [01:02<00:50,  8.18it/s]Upper bound on the fitting time:  58%|█████▊    | 584/1000 [01:02<00:50,  8.30it/s]Upper bound on the fitting time:  58%|█████▊    | 585/1000 [01:02<00:48,  8.54it/s]Upper bound on the fitting time:  59%|█████▊    | 586/1000 [01:02<00:47,  8.77it/s]Upper bound on the fitting time:  59%|█████▊    | 587/1000 [01:02<00:46,  8.93it/s]Upper bound on the fitting time:  59%|█████▉    | 588/1000 [01:02<00:45,  9.08it/s]Upper bound on the fitting time:  59%|█████▉    | 589/1000 [01:02<00:45,  9.13it/s]Upper bound on the fitting time:  59%|█████▉    | 590/1000 [01:02<00:45,  9.04it/s]Upper bound on the fitting time:  59%|█████▉    | 591/1000 [01:03<00:47,  8.67it/s]Upper bound on the fitting time:  59%|█████▉    | 592/1000 [01:03<00:48,  8.39it/s]Upper bound on the fitting time:  59%|█████▉    | 593/1000 [01:03<00:49,  8.18it/s]Upper bound on the fitting time:  59%|█████▉    | 594/1000 [01:03<00:50,  8.04it/s]Upper bound on the fitting time:  60%|█████▉    | 595/1000 [01:03<00:49,  8.10it/s]Upper bound on the fitting time:  60%|█████▉    | 596/1000 [01:03<00:49,  8.18it/s]Upper bound on the fitting time:  60%|█████▉    | 597/1000 [01:03<00:49,  8.16it/s]Upper bound on the fitting time:  60%|█████▉    | 598/1000 [01:03<00:49,  8.07it/s]Upper bound on the fitting time:  60%|█████▉    | 599/1000 [01:04<00:53,  7.51it/s]Upper bound on the fitting time:  60%|██████    | 600/1000 [01:04<00:53,  7.55it/s]Upper bound on the fitting time:  60%|██████    | 601/1000 [01:04<00:53,  7.49it/s]Upper bound on the fitting time:  60%|██████    | 602/1000 [01:04<00:52,  7.63it/s]Upper bound on the fitting time:  60%|██████    | 603/1000 [01:04<00:54,  7.25it/s]Upper bound on the fitting time:  60%|██████    | 604/1000 [01:04<00:54,  7.26it/s]Upper bound on the fitting time:  60%|██████    | 605/1000 [01:04<00:53,  7.33it/s]Upper bound on the fitting time:  61%|██████    | 606/1000 [01:05<00:54,  7.23it/s]Upper bound on the fitting time:  61%|██████    | 607/1000 [01:05<00:54,  7.19it/s]Upper bound on the fitting time:  61%|██████    | 608/1000 [01:05<00:52,  7.48it/s]Upper bound on the fitting time:  61%|██████    | 609/1000 [01:05<00:50,  7.76it/s]Upper bound on the fitting time:  61%|██████    | 610/1000 [01:05<00:49,  7.86it/s]Upper bound on the fitting time:  61%|██████    | 611/1000 [01:05<00:47,  8.24it/s]Upper bound on the fitting time:  61%|██████    | 612/1000 [01:05<00:46,  8.35it/s]Upper bound on the fitting time:  61%|██████▏   | 613/1000 [01:05<00:45,  8.48it/s]Upper bound on the fitting time:  61%|██████▏   | 614/1000 [01:06<00:46,  8.35it/s]Upper bound on the fitting time:  62%|██████▏   | 615/1000 [01:06<00:47,  8.10it/s]Upper bound on the fitting time:  62%|██████▏   | 616/1000 [01:06<00:48,  7.93it/s]Upper bound on the fitting time:  62%|██████▏   | 617/1000 [01:06<00:48,  7.95it/s]Upper bound on the fitting time:  62%|██████▏   | 618/1000 [01:06<00:46,  8.17it/s]Upper bound on the fitting time:  62%|██████▏   | 619/1000 [01:06<00:44,  8.47it/s]Upper bound on the fitting time:  62%|██████▏   | 620/1000 [01:06<00:43,  8.81it/s]Upper bound on the fitting time:  62%|██████▏   | 621/1000 [01:06<00:42,  8.90it/s]Upper bound on the fitting time:  62%|██████▏   | 622/1000 [01:07<00:44,  8.58it/s]Upper bound on the fitting time:  62%|██████▏   | 623/1000 [01:07<00:48,  7.83it/s]Upper bound on the fitting time:  62%|██████▏   | 624/1000 [01:07<00:48,  7.83it/s]Upper bound on the fitting time:  62%|██████▎   | 625/1000 [01:07<00:45,  8.18it/s]Upper bound on the fitting time:  63%|██████▎   | 626/1000 [01:07<00:45,  8.18it/s]Upper bound on the fitting time:  63%|██████▎   | 627/1000 [01:07<00:47,  7.86it/s]Upper bound on the fitting time:  63%|██████▎   | 628/1000 [01:07<00:49,  7.52it/s]Upper bound on the fitting time:  63%|██████▎   | 629/1000 [01:07<00:47,  7.82it/s]Upper bound on the fitting time:  63%|██████▎   | 630/1000 [01:08<00:45,  8.21it/s]Upper bound on the fitting time:  63%|██████▎   | 631/1000 [01:08<00:44,  8.28it/s]Upper bound on the fitting time:  63%|██████▎   | 632/1000 [01:08<00:48,  7.62it/s]Upper bound on the fitting time:  63%|██████▎   | 633/1000 [01:08<00:49,  7.35it/s]Upper bound on the fitting time:  63%|██████▎   | 634/1000 [01:08<00:51,  7.07it/s]Upper bound on the fitting time:  64%|██████▎   | 635/1000 [01:08<00:50,  7.24it/s]Upper bound on the fitting time:  64%|██████▎   | 636/1000 [01:08<00:46,  7.88it/s]Upper bound on the fitting time:  64%|██████▎   | 637/1000 [01:08<00:43,  8.34it/s]Upper bound on the fitting time:  64%|██████▍   | 638/1000 [01:09<00:44,  8.15it/s]Upper bound on the fitting time:  64%|██████▍   | 639/1000 [01:09<00:43,  8.26it/s]Upper bound on the fitting time:  64%|██████▍   | 640/1000 [01:09<00:42,  8.40it/s]Upper bound on the fitting time:  64%|██████▍   | 641/1000 [01:09<00:42,  8.44it/s]Upper bound on the fitting time:  64%|██████▍   | 642/1000 [01:09<00:42,  8.36it/s]Upper bound on the fitting time:  64%|██████▍   | 643/1000 [01:09<00:43,  8.29it/s]Upper bound on the fitting time:  64%|██████▍   | 644/1000 [01:09<00:43,  8.20it/s]Upper bound on the fitting time:  64%|██████▍   | 645/1000 [01:09<00:45,  7.73it/s]Upper bound on the fitting time:  65%|██████▍   | 646/1000 [01:10<00:49,  7.15it/s]Upper bound on the fitting time:  65%|██████▍   | 647/1000 [01:10<00:47,  7.40it/s]Upper bound on the fitting time:  65%|██████▍   | 648/1000 [01:10<00:50,  7.03it/s]Upper bound on the fitting time:  65%|██████▍   | 649/1000 [01:10<00:49,  7.10it/s]Upper bound on the fitting time:  65%|██████▌   | 650/1000 [01:10<00:50,  6.97it/s]Upper bound on the fitting time:  65%|██████▌   | 651/1000 [01:10<00:48,  7.25it/s]Upper bound on the fitting time:  65%|██████▌   | 652/1000 [01:10<00:45,  7.58it/s]Upper bound on the fitting time:  65%|██████▌   | 653/1000 [01:11<00:46,  7.45it/s]Upper bound on the fitting time:  65%|██████▌   | 654/1000 [01:11<00:49,  7.06it/s]Upper bound on the fitting time:  66%|██████▌   | 655/1000 [01:11<00:50,  6.81it/s]Upper bound on the fitting time:  66%|██████▌   | 656/1000 [01:11<00:53,  6.48it/s]Upper bound on the fitting time:  66%|██████▌   | 657/1000 [01:11<00:54,  6.35it/s]Upper bound on the fitting time:  66%|██████▌   | 658/1000 [01:11<00:54,  6.23it/s]Upper bound on the fitting time:  66%|██████▌   | 659/1000 [01:12<00:54,  6.26it/s]Upper bound on the fitting time:  66%|██████▌   | 660/1000 [01:12<00:53,  6.39it/s]Upper bound on the fitting time:  66%|██████▌   | 661/1000 [01:12<00:50,  6.76it/s]Upper bound on the fitting time:  66%|██████▌   | 662/1000 [01:12<00:47,  7.18it/s]Upper bound on the fitting time:  66%|██████▋   | 663/1000 [01:12<00:45,  7.48it/s]Upper bound on the fitting time:  66%|██████▋   | 664/1000 [01:12<00:44,  7.56it/s]Upper bound on the fitting time:  66%|██████▋   | 665/1000 [01:12<00:43,  7.63it/s]Upper bound on the fitting time:  67%|██████▋   | 666/1000 [01:12<00:44,  7.55it/s]Upper bound on the fitting time:  67%|██████▋   | 667/1000 [01:13<00:42,  7.76it/s]Upper bound on the fitting time:  67%|██████▋   | 668/1000 [01:13<00:40,  8.19it/s]Upper bound on the fitting time:  67%|██████▋   | 669/1000 [01:13<00:38,  8.60it/s]Upper bound on the fitting time:  67%|██████▋   | 670/1000 [01:13<00:40,  8.22it/s]Upper bound on the fitting time:  67%|██████▋   | 671/1000 [01:13<00:42,  7.78it/s]Upper bound on the fitting time:  67%|██████▋   | 672/1000 [01:13<00:44,  7.37it/s]Upper bound on the fitting time:  67%|██████▋   | 673/1000 [01:13<00:46,  7.01it/s]Upper bound on the fitting time:  67%|██████▋   | 674/1000 [01:14<00:47,  6.81it/s]Upper bound on the fitting time:  68%|██████▊   | 675/1000 [01:14<00:48,  6.71it/s]Upper bound on the fitting time:  68%|██████▊   | 676/1000 [01:14<00:48,  6.72it/s]Upper bound on the fitting time:  68%|██████▊   | 677/1000 [01:14<00:45,  7.15it/s]Upper bound on the fitting time:  68%|██████▊   | 678/1000 [01:14<00:41,  7.75it/s]Upper bound on the fitting time:  68%|██████▊   | 679/1000 [01:14<00:39,  8.20it/s]Upper bound on the fitting time:  68%|██████▊   | 680/1000 [01:14<00:38,  8.35it/s]Upper bound on the fitting time:  68%|██████▊   | 681/1000 [01:14<00:39,  7.99it/s]Upper bound on the fitting time:  68%|██████▊   | 683/1000 [01:15<00:34,  9.07it/s]Upper bound on the fitting time:  68%|██████▊   | 684/1000 [01:15<00:34,  9.27it/s]Upper bound on the fitting time:  68%|██████▊   | 685/1000 [01:15<00:34,  9.13it/s]Upper bound on the fitting time:  69%|██████▊   | 686/1000 [01:15<00:38,  8.12it/s]Upper bound on the fitting time:  69%|██████▉   | 688/1000 [01:15<00:32,  9.60it/s]Upper bound on the fitting time:  69%|██████▉   | 690/1000 [01:15<00:28, 10.84it/s]Upper bound on the fitting time:  69%|██████▉   | 692/1000 [01:15<00:27, 11.19it/s]Upper bound on the fitting time:  69%|██████▉   | 694/1000 [01:16<00:26, 11.50it/s]Upper bound on the fitting time:  70%|██████▉   | 696/1000 [01:16<00:25, 11.95it/s]Upper bound on the fitting time:  70%|██████▉   | 698/1000 [01:16<00:23, 12.67it/s]Upper bound on the fitting time:  70%|███████   | 700/1000 [01:16<00:22, 13.34it/s]Upper bound on the fitting time:  70%|███████   | 702/1000 [01:16<00:21, 13.68it/s]Upper bound on the fitting time:  70%|███████   | 704/1000 [01:16<00:20, 14.22it/s]Upper bound on the fitting time:  71%|███████   | 706/1000 [01:16<00:20, 14.29it/s]Upper bound on the fitting time:  71%|███████   | 708/1000 [01:17<00:20, 14.55it/s]Upper bound on the fitting time:  71%|███████   | 710/1000 [01:17<00:19, 14.79it/s]Upper bound on the fitting time:  71%|███████   | 712/1000 [01:17<00:19, 14.55it/s]Upper bound on the fitting time:  71%|███████▏  | 714/1000 [01:17<00:19, 14.50it/s]Upper bound on the fitting time:  72%|███████▏  | 716/1000 [01:17<00:19, 14.73it/s]Upper bound on the fitting time:  72%|███████▏  | 718/1000 [01:17<00:19, 14.68it/s]Upper bound on the fitting time:  72%|███████▏  | 720/1000 [01:17<00:19, 14.73it/s]Upper bound on the fitting time:  72%|███████▏  | 722/1000 [01:18<00:18, 14.85it/s]Upper bound on the fitting time:  72%|███████▏  | 724/1000 [01:18<00:18, 14.66it/s]Upper bound on the fitting time:  73%|███████▎  | 726/1000 [01:18<00:19, 14.26it/s]Upper bound on the fitting time:  73%|███████▎  | 728/1000 [01:18<00:19, 13.92it/s]Upper bound on the fitting time:  73%|███████▎  | 730/1000 [01:18<00:19, 13.82it/s]Upper bound on the fitting time:  73%|███████▎  | 732/1000 [01:18<00:19, 13.82it/s]Upper bound on the fitting time:  73%|███████▎  | 734/1000 [01:18<00:19, 13.77it/s]Upper bound on the fitting time:  74%|███████▎  | 736/1000 [01:19<00:19, 13.85it/s]Upper bound on the fitting time:  74%|███████▍  | 738/1000 [01:19<00:18, 13.86it/s]Upper bound on the fitting time:  74%|███████▍  | 740/1000 [01:19<00:18, 13.99it/s]Upper bound on the fitting time:  74%|███████▍  | 742/1000 [01:19<00:18, 14.02it/s]Upper bound on the fitting time:  74%|███████▍  | 744/1000 [01:19<00:19, 13.22it/s]Upper bound on the fitting time:  75%|███████▍  | 746/1000 [01:19<00:19, 12.99it/s]Upper bound on the fitting time:  75%|███████▍  | 748/1000 [01:19<00:18, 13.28it/s]Upper bound on the fitting time:  75%|███████▌  | 750/1000 [01:20<00:18, 13.83it/s]Upper bound on the fitting time:  75%|███████▌  | 752/1000 [01:20<00:17, 14.08it/s]Upper bound on the fitting time:  75%|███████▌  | 754/1000 [01:20<00:17, 14.15it/s]Upper bound on the fitting time:  76%|███████▌  | 756/1000 [01:20<00:17, 14.32it/s]Upper bound on the fitting time:  76%|███████▌  | 758/1000 [01:20<00:16, 14.69it/s]Upper bound on the fitting time:  76%|███████▌  | 760/1000 [01:20<00:16, 14.91it/s]Upper bound on the fitting time:  76%|███████▌  | 762/1000 [01:20<00:15, 14.96it/s]Upper bound on the fitting time:  76%|███████▋  | 764/1000 [01:21<00:15, 15.11it/s]Upper bound on the fitting time:  77%|███████▋  | 766/1000 [01:21<00:15, 15.19it/s]Upper bound on the fitting time:  77%|███████▋  | 768/1000 [01:21<00:15, 15.26it/s]Upper bound on the fitting time:  77%|███████▋  | 770/1000 [01:21<00:14, 15.35it/s]Upper bound on the fitting time:  77%|███████▋  | 772/1000 [01:21<00:14, 15.21it/s]Upper bound on the fitting time:  77%|███████▋  | 774/1000 [01:21<00:14, 15.30it/s]Upper bound on the fitting time:  78%|███████▊  | 776/1000 [01:21<00:14, 15.07it/s]Upper bound on the fitting time:  78%|███████▊  | 778/1000 [01:21<00:14, 15.03it/s]Upper bound on the fitting time:  78%|███████▊  | 780/1000 [01:22<00:14, 15.00it/s]Upper bound on the fitting time:  78%|███████▊  | 782/1000 [01:22<00:14, 15.11it/s]Upper bound on the fitting time:  78%|███████▊  | 784/1000 [01:22<00:14, 15.17it/s]Upper bound on the fitting time:  79%|███████▊  | 786/1000 [01:22<00:14, 15.19it/s]Upper bound on the fitting time:  79%|███████▉  | 788/1000 [01:22<00:14, 15.14it/s]Upper bound on the fitting time:  79%|███████▉  | 790/1000 [01:22<00:13, 15.18it/s]Upper bound on the fitting time:  79%|███████▉  | 792/1000 [01:22<00:13, 15.29it/s]Upper bound on the fitting time:  79%|███████▉  | 794/1000 [01:22<00:13, 14.76it/s]Upper bound on the fitting time:  80%|███████▉  | 796/1000 [01:23<00:13, 15.06it/s]Upper bound on the fitting time:  80%|███████▉  | 798/1000 [01:23<00:13, 15.11it/s]Upper bound on the fitting time:  80%|████████  | 800/1000 [01:23<00:13, 15.02it/s]Upper bound on the fitting time:  80%|████████  | 802/1000 [01:23<00:13, 15.06it/s]Upper bound on the fitting time:  80%|████████  | 804/1000 [01:23<00:12, 15.15it/s]Upper bound on the fitting time:  81%|████████  | 806/1000 [01:23<00:12, 15.14it/s]Upper bound on the fitting time:  81%|████████  | 808/1000 [01:23<00:12, 15.09it/s]Upper bound on the fitting time:  81%|████████  | 810/1000 [01:24<00:12, 15.23it/s]Upper bound on the fitting time:  81%|████████  | 812/1000 [01:24<00:12, 15.36it/s]Upper bound on the fitting time:  81%|████████▏ | 814/1000 [01:24<00:12, 14.92it/s]Upper bound on the fitting time:  82%|████████▏ | 816/1000 [01:24<00:12, 14.64it/s]Upper bound on the fitting time:  82%|████████▏ | 818/1000 [01:24<00:12, 14.17it/s]Upper bound on the fitting time:  82%|████████▏ | 820/1000 [01:24<00:12, 14.42it/s]Upper bound on the fitting time:  82%|████████▏ | 822/1000 [01:24<00:12, 14.76it/s]Upper bound on the fitting time:  82%|████████▏ | 824/1000 [01:24<00:11, 14.88it/s]Upper bound on the fitting time:  83%|████████▎ | 826/1000 [01:25<00:11, 14.97it/s]Upper bound on the fitting time:  83%|████████▎ | 828/1000 [01:25<00:11, 15.07it/s]Upper bound on the fitting time:  83%|████████▎ | 830/1000 [01:25<00:11, 15.23it/s]Upper bound on the fitting time:  83%|████████▎ | 832/1000 [01:25<00:10, 15.33it/s]Upper bound on the fitting time:  83%|████████▎ | 834/1000 [01:25<00:10, 15.31it/s]Upper bound on the fitting time:  84%|████████▎ | 836/1000 [01:25<00:10, 15.18it/s]Upper bound on the fitting time:  84%|████████▍ | 838/1000 [01:25<00:10, 15.12it/s]Upper bound on the fitting time:  84%|████████▍ | 840/1000 [01:26<00:10, 14.62it/s]Upper bound on the fitting time:  84%|████████▍ | 842/1000 [01:26<00:10, 14.72it/s]Upper bound on the fitting time:  84%|████████▍ | 844/1000 [01:26<00:10, 14.88it/s]Upper bound on the fitting time:  85%|████████▍ | 846/1000 [01:26<00:10, 15.02it/s]Upper bound on the fitting time:  85%|████████▍ | 848/1000 [01:26<00:10, 15.15it/s]Upper bound on the fitting time:  85%|████████▌ | 850/1000 [01:26<00:09, 15.28it/s]Upper bound on the fitting time:  85%|████████▌ | 852/1000 [01:26<00:09, 15.29it/s]Upper bound on the fitting time:  85%|████████▌ | 854/1000 [01:26<00:09, 15.15it/s]Upper bound on the fitting time:  86%|████████▌ | 856/1000 [01:27<00:09, 15.19it/s]Upper bound on the fitting time:  86%|████████▌ | 858/1000 [01:27<00:09, 15.12it/s]Upper bound on the fitting time:  86%|████████▌ | 860/1000 [01:27<00:09, 15.08it/s]Upper bound on the fitting time:  86%|████████▌ | 862/1000 [01:27<00:09, 15.07it/s]Upper bound on the fitting time:  86%|████████▋ | 864/1000 [01:27<00:09, 15.00it/s]Upper bound on the fitting time:  87%|████████▋ | 866/1000 [01:27<00:08, 15.02it/s]Upper bound on the fitting time:  87%|████████▋ | 868/1000 [01:27<00:08, 15.15it/s]Upper bound on the fitting time:  87%|████████▋ | 870/1000 [01:28<00:08, 15.24it/s]Upper bound on the fitting time:  87%|████████▋ | 872/1000 [01:28<00:08, 15.12it/s]Upper bound on the fitting time:  87%|████████▋ | 874/1000 [01:28<00:08, 15.03it/s]Upper bound on the fitting time:  88%|████████▊ | 876/1000 [01:28<00:08, 15.11it/s]Upper bound on the fitting time:  88%|████████▊ | 878/1000 [01:28<00:08, 15.17it/s]Upper bound on the fitting time:  88%|████████▊ | 880/1000 [01:28<00:07, 15.10it/s]Upper bound on the fitting time:  88%|████████▊ | 882/1000 [01:28<00:07, 15.11it/s]Upper bound on the fitting time:  88%|████████▊ | 884/1000 [01:28<00:07, 15.26it/s]Upper bound on the fitting time:  89%|████████▊ | 886/1000 [01:29<00:07, 15.16it/s]Upper bound on the fitting time:  89%|████████▉ | 888/1000 [01:29<00:07, 15.26it/s]Upper bound on the fitting time:  89%|████████▉ | 890/1000 [01:29<00:07, 15.18it/s]Upper bound on the fitting time:  89%|████████▉ | 892/1000 [01:29<00:07, 15.33it/s]Upper bound on the fitting time:  89%|████████▉ | 894/1000 [01:29<00:06, 15.42it/s]Upper bound on the fitting time:  90%|████████▉ | 896/1000 [01:29<00:06, 15.36it/s]Upper bound on the fitting time:  90%|████████▉ | 898/1000 [01:29<00:06, 15.16it/s]Upper bound on the fitting time:  90%|█████████ | 900/1000 [01:30<00:06, 15.21it/s]Upper bound on the fitting time:  90%|█████████ | 902/1000 [01:30<00:06, 15.21it/s]Upper bound on the fitting time:  90%|█████████ | 904/1000 [01:30<00:06, 15.12it/s]Upper bound on the fitting time:  91%|█████████ | 906/1000 [01:30<00:06, 15.16it/s]Upper bound on the fitting time:  91%|█████████ | 908/1000 [01:30<00:06, 14.99it/s]Upper bound on the fitting time:  91%|█████████ | 910/1000 [01:30<00:05, 15.12it/s]Upper bound on the fitting time:  91%|█████████ | 912/1000 [01:30<00:05, 15.19it/s]Upper bound on the fitting time:  91%|█████████▏| 914/1000 [01:30<00:05, 15.34it/s]Upper bound on the fitting time:  92%|█████████▏| 916/1000 [01:31<00:05, 15.38it/s]Upper bound on the fitting time:  92%|█████████▏| 918/1000 [01:31<00:05, 15.01it/s]Upper bound on the fitting time:  92%|█████████▏| 920/1000 [01:31<00:05, 15.12it/s]Upper bound on the fitting time:  92%|█████████▏| 922/1000 [01:31<00:05, 14.97it/s]Upper bound on the fitting time:  92%|█████████▏| 924/1000 [01:31<00:05, 15.05it/s]Upper bound on the fitting time:  93%|█████████▎| 926/1000 [01:31<00:04, 14.88it/s]Upper bound on the fitting time:  93%|█████████▎| 928/1000 [01:31<00:04, 15.07it/s]Upper bound on the fitting time:  93%|█████████▎| 930/1000 [01:31<00:04, 15.23it/s]Upper bound on the fitting time:  93%|█████████▎| 932/1000 [01:32<00:04, 15.30it/s]Upper bound on the fitting time:  93%|█████████▎| 934/1000 [01:32<00:04, 15.28it/s]Upper bound on the fitting time:  94%|█████████▎| 936/1000 [01:32<00:04, 15.22it/s]Upper bound on the fitting time:  94%|█████████▍| 938/1000 [01:32<00:04, 15.05it/s]Upper bound on the fitting time:  94%|█████████▍| 940/1000 [01:32<00:03, 15.12it/s]Upper bound on the fitting time:  94%|█████████▍| 942/1000 [01:32<00:03, 15.05it/s]Upper bound on the fitting time:  94%|█████████▍| 944/1000 [01:32<00:03, 14.75it/s]Upper bound on the fitting time:  95%|█████████▍| 946/1000 [01:33<00:03, 14.85it/s]Upper bound on the fitting time:  95%|█████████▍| 948/1000 [01:33<00:03, 14.74it/s]Upper bound on the fitting time:  95%|█████████▌| 950/1000 [01:33<00:03, 14.84it/s]Upper bound on the fitting time:  95%|█████████▌| 952/1000 [01:33<00:03, 14.75it/s]Upper bound on the fitting time:  95%|█████████▌| 954/1000 [01:33<00:03, 14.90it/s]Upper bound on the fitting time:  96%|█████████▌| 956/1000 [01:33<00:02, 14.69it/s]Upper bound on the fitting time:  96%|█████████▌| 958/1000 [01:33<00:02, 14.76it/s]Upper bound on the fitting time:  96%|█████████▌| 960/1000 [01:34<00:02, 14.96it/s]Upper bound on the fitting time:  96%|█████████▌| 962/1000 [01:34<00:02, 15.03it/s]Upper bound on the fitting time:  96%|█████████▋| 964/1000 [01:34<00:02, 15.14it/s]Upper bound on the fitting time:  97%|█████████▋| 966/1000 [01:34<00:02, 15.17it/s]Upper bound on the fitting time:  97%|█████████▋| 968/1000 [01:34<00:02, 15.27it/s]Upper bound on the fitting time:  97%|█████████▋| 970/1000 [01:34<00:01, 15.33it/s]Upper bound on the fitting time:  97%|█████████▋| 972/1000 [01:34<00:01, 15.25it/s]Upper bound on the fitting time:  97%|█████████▋| 974/1000 [01:34<00:01, 14.90it/s]Upper bound on the fitting time:  98%|█████████▊| 976/1000 [01:35<00:01, 14.99it/s]Upper bound on the fitting time:  98%|█████████▊| 978/1000 [01:35<00:01, 14.96it/s]Upper bound on the fitting time:  98%|█████████▊| 980/1000 [01:35<00:01, 15.09it/s]Upper bound on the fitting time:  98%|█████████▊| 982/1000 [01:35<00:01, 15.28it/s]Upper bound on the fitting time:  98%|█████████▊| 984/1000 [01:35<00:01, 15.39it/s]Upper bound on the fitting time:  99%|█████████▊| 986/1000 [01:35<00:00, 15.47it/s]Upper bound on the fitting time:  99%|█████████▉| 988/1000 [01:35<00:00, 15.53it/s]Upper bound on the fitting time:  99%|█████████▉| 990/1000 [01:35<00:00, 15.39it/s]Upper bound on the fitting time:  99%|█████████▉| 992/1000 [01:36<00:00, 15.43it/s]Upper bound on the fitting time:  99%|█████████▉| 994/1000 [01:36<00:00, 15.47it/s]Upper bound on the fitting time: 100%|█████████▉| 996/1000 [01:36<00:00, 15.33it/s]Upper bound on the fitting time: 100%|█████████▉| 998/1000 [01:36<00:00, 14.88it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [01:36<00:00, 14.71it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [01:36<00:00, 10.35it/s]
    -Upper bound on the fitting time:   0%|          | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time:   0%|          | 2/1000 [00:00<01:04, 15.45it/s]Upper bound on the fitting time:   0%|          | 4/1000 [00:00<01:04, 15.38it/s]Upper bound on the fitting time:   1%|          | 6/1000 [00:00<01:04, 15.39it/s]Upper bound on the fitting time:   1%|          | 8/1000 [00:00<01:05, 15.17it/s]Upper bound on the fitting time:   1%|          | 10/1000 [00:00<01:07, 14.66it/s]Upper bound on the fitting time:   1%|          | 12/1000 [00:00<01:06, 14.84it/s]Upper bound on the fitting time:   1%|▏         | 14/1000 [00:00<01:05, 15.04it/s]Upper bound on the fitting time:   2%|▏         | 16/1000 [00:01<01:05, 15.09it/s]Upper bound on the fitting time:   2%|▏         | 18/1000 [00:01<01:05, 15.11it/s]Upper bound on the fitting time:   2%|▏         | 20/1000 [00:01<01:05, 15.04it/s]Upper bound on the fitting time:   2%|▏         | 22/1000 [00:01<01:05, 14.92it/s]Upper bound on the fitting time:   2%|▏         | 24/1000 [00:01<01:05, 14.95it/s]Upper bound on the fitting time:   3%|▎         | 26/1000 [00:01<01:04, 15.01it/s]Upper bound on the fitting time:   3%|▎         | 28/1000 [00:01<01:04, 15.01it/s]Upper bound on the fitting time:   3%|▎         | 30/1000 [00:01<01:04, 14.98it/s]Upper bound on the fitting time:   3%|▎         | 32/1000 [00:02<01:05, 14.69it/s]Upper bound on the fitting time:   3%|▎         | 34/1000 [00:02<01:05, 14.76it/s]Upper bound on the fitting time:   4%|▎         | 36/1000 [00:02<01:04, 14.93it/s]Upper bound on the fitting time:   4%|▍         | 38/1000 [00:02<01:05, 14.61it/s]Upper bound on the fitting time:   4%|▍         | 40/1000 [00:02<01:05, 14.60it/s]Upper bound on the fitting time:   4%|▍         | 42/1000 [00:02<01:07, 14.26it/s]Upper bound on the fitting time:   4%|▍         | 44/1000 [00:02<01:06, 14.38it/s]Upper bound on the fitting time:   5%|▍         | 46/1000 [00:03<01:05, 14.55it/s]Upper bound on the fitting time:   5%|▍         | 48/1000 [00:03<01:04, 14.76it/s]Upper bound on the fitting time:   5%|▌         | 50/1000 [00:03<01:04, 14.84it/s]Upper bound on the fitting time:   5%|▌         | 52/1000 [00:03<01:05, 14.54it/s]Upper bound on the fitting time:   5%|▌         | 54/1000 [00:03<01:04, 14.75it/s]Upper bound on the fitting time:   6%|▌         | 56/1000 [00:03<01:04, 14.72it/s]Upper bound on the fitting time:   6%|▌         | 58/1000 [00:03<01:02, 14.97it/s]Upper bound on the fitting time:   6%|▌         | 60/1000 [00:04<01:02, 15.07it/s]Upper bound on the fitting time:   6%|▌         | 62/1000 [00:04<01:01, 15.14it/s]Upper bound on the fitting time:   6%|▋         | 64/1000 [00:04<01:01, 15.19it/s]Upper bound on the fitting time:   7%|▋         | 66/1000 [00:04<01:01, 15.26it/s]Upper bound on the fitting time:   7%|▋         | 68/1000 [00:04<01:00, 15.35it/s]Upper bound on the fitting time:   7%|▋         | 70/1000 [00:04<01:01, 15.16it/s]Upper bound on the fitting time:   7%|▋         | 72/1000 [00:04<01:02, 14.95it/s]Upper bound on the fitting time:   7%|▋         | 74/1000 [00:04<01:01, 14.98it/s]Upper bound on the fitting time:   8%|▊         | 76/1000 [00:05<01:04, 14.34it/s]Upper bound on the fitting time:   8%|▊         | 78/1000 [00:05<01:06, 13.95it/s]Upper bound on the fitting time:   8%|▊         | 80/1000 [00:05<01:04, 14.33it/s]Upper bound on the fitting time:   8%|▊         | 82/1000 [00:05<01:03, 14.43it/s]Upper bound on the fitting time:   8%|▊         | 84/1000 [00:05<01:02, 14.73it/s]Upper bound on the fitting time:   9%|▊         | 86/1000 [00:05<01:01, 14.86it/s]Upper bound on the fitting time:   9%|▉         | 88/1000 [00:05<01:01, 14.94it/s]Upper bound on the fitting time:   9%|▉         | 90/1000 [00:06<01:00, 15.13it/s]Upper bound on the fitting time:   9%|▉         | 92/1000 [00:06<01:00, 14.99it/s]Upper bound on the fitting time:   9%|▉         | 94/1000 [00:06<01:00, 15.03it/s]Upper bound on the fitting time:  10%|▉         | 96/1000 [00:06<01:00, 15.02it/s]Upper bound on the fitting time:  10%|▉         | 98/1000 [00:06<00:59, 15.05it/s]Upper bound on the fitting time:  10%|█         | 100/1000 [00:06<01:00, 14.96it/s]Upper bound on the fitting time:  10%|█         | 102/1000 [00:06<01:00, 14.79it/s]Upper bound on the fitting time:  10%|█         | 104/1000 [00:06<00:59, 15.03it/s]Upper bound on the fitting time:  11%|█         | 106/1000 [00:07<00:59, 15.10it/s]Upper bound on the fitting time:  11%|█         | 108/1000 [00:07<00:59, 15.10it/s]Upper bound on the fitting time:  11%|█         | 110/1000 [00:07<00:59, 15.08it/s]Upper bound on the fitting time:  11%|█         | 112/1000 [00:07<00:58, 15.25it/s]Upper bound on the fitting time:  11%|█▏        | 114/1000 [00:07<00:59, 14.80it/s]Upper bound on the fitting time:  12%|█▏        | 116/1000 [00:07<00:59, 14.98it/s]Upper bound on the fitting time:  12%|█▏        | 118/1000 [00:07<00:59, 14.90it/s]Upper bound on the fitting time:  12%|█▏        | 120/1000 [00:08<00:58, 14.99it/s]Upper bound on the fitting time:  12%|█▏        | 122/1000 [00:08<00:58, 15.01it/s]Upper bound on the fitting time:  12%|█▏        | 124/1000 [00:08<00:58, 15.03it/s]Upper bound on the fitting time:  13%|█▎        | 126/1000 [00:08<01:00, 14.39it/s]Upper bound on the fitting time:  13%|█▎        | 128/1000 [00:08<01:04, 13.46it/s]Upper bound on the fitting time:  13%|█▎        | 130/1000 [00:08<01:07, 12.90it/s]Upper bound on the fitting time:  13%|█▎        | 132/1000 [00:08<01:08, 12.66it/s]Upper bound on the fitting time:  13%|█▎        | 134/1000 [00:09<01:08, 12.71it/s]Upper bound on the fitting time:  14%|█▎        | 136/1000 [00:09<01:07, 12.77it/s]Upper bound on the fitting time:  14%|█▍        | 138/1000 [00:09<01:07, 12.77it/s]Upper bound on the fitting time:  14%|█▍        | 140/1000 [00:09<01:06, 12.95it/s]Upper bound on the fitting time:  14%|█▍        | 142/1000 [00:09<01:05, 13.11it/s]Upper bound on the fitting time:  14%|█▍        | 144/1000 [00:09<01:05, 13.09it/s]Upper bound on the fitting time:  15%|█▍        | 146/1000 [00:10<01:04, 13.32it/s]Upper bound on the fitting time:  15%|█▍        | 148/1000 [00:10<01:03, 13.42it/s]Upper bound on the fitting time:  15%|█▌        | 150/1000 [00:10<01:04, 13.26it/s]Upper bound on the fitting time:  15%|█▌        | 152/1000 [00:10<01:03, 13.40it/s]Upper bound on the fitting time:  15%|█▌        | 154/1000 [00:10<01:02, 13.44it/s]Upper bound on the fitting time:  16%|█▌        | 156/1000 [00:10<01:02, 13.44it/s]Upper bound on the fitting time:  16%|█▌        | 158/1000 [00:10<01:04, 13.10it/s]Upper bound on the fitting time:  16%|█▌        | 160/1000 [00:11<01:03, 13.22it/s]Upper bound on the fitting time:  16%|█▌        | 162/1000 [00:11<01:02, 13.32it/s]Upper bound on the fitting time:  16%|█▋        | 164/1000 [00:11<01:02, 13.31it/s]Upper bound on the fitting time:  17%|█▋        | 166/1000 [00:11<01:04, 12.96it/s]Upper bound on the fitting time:  17%|█▋        | 168/1000 [00:11<01:04, 12.86it/s]Upper bound on the fitting time:  17%|█▋        | 170/1000 [00:11<01:03, 13.02it/s]Upper bound on the fitting time:  17%|█▋        | 172/1000 [00:12<01:04, 12.87it/s]Upper bound on the fitting time:  17%|█▋        | 174/1000 [00:12<01:05, 12.66it/s]Upper bound on the fitting time:  18%|█▊        | 176/1000 [00:12<01:04, 12.76it/s]Upper bound on the fitting time:  18%|█▊        | 178/1000 [00:12<01:04, 12.70it/s]Upper bound on the fitting time:  18%|█▊        | 180/1000 [00:12<01:04, 12.73it/s]Upper bound on the fitting time:  18%|█▊        | 182/1000 [00:12<01:05, 12.42it/s]Upper bound on the fitting time:  18%|█▊        | 184/1000 [00:12<01:05, 12.41it/s]Upper bound on the fitting time:  19%|█▊        | 186/1000 [00:13<01:05, 12.51it/s]Upper bound on the fitting time:  19%|█▉        | 188/1000 [00:13<01:06, 12.29it/s]Upper bound on the fitting time:  19%|█▉        | 190/1000 [00:13<01:06, 12.11it/s]Upper bound on the fitting time:  19%|█▉        | 192/1000 [00:13<01:07, 11.98it/s]Upper bound on the fitting time:  19%|█▉        | 194/1000 [00:13<01:06, 12.04it/s]Upper bound on the fitting time:  20%|█▉        | 196/1000 [00:13<01:06, 12.10it/s]Upper bound on the fitting time:  20%|█▉        | 198/1000 [00:14<01:05, 12.27it/s]Upper bound on the fitting time:  20%|██        | 200/1000 [00:14<01:04, 12.31it/s]Upper bound on the fitting time:  20%|██        | 202/1000 [00:14<01:05, 12.15it/s]Upper bound on the fitting time:  20%|██        | 204/1000 [00:14<01:06, 12.01it/s]Upper bound on the fitting time:  21%|██        | 206/1000 [00:14<01:06, 11.96it/s]Upper bound on the fitting time:  21%|██        | 208/1000 [00:14<01:04, 12.29it/s]Upper bound on the fitting time:  21%|██        | 210/1000 [00:15<01:03, 12.43it/s]Upper bound on the fitting time:  21%|██        | 212/1000 [00:15<01:03, 12.50it/s]Upper bound on the fitting time:  21%|██▏       | 214/1000 [00:15<01:02, 12.54it/s]Upper bound on the fitting time:  22%|██▏       | 216/1000 [00:15<01:04, 12.18it/s]Upper bound on the fitting time:  22%|██▏       | 218/1000 [00:15<01:03, 12.30it/s]Upper bound on the fitting time:  22%|██▏       | 220/1000 [00:15<01:03, 12.33it/s]Upper bound on the fitting time:  22%|██▏       | 222/1000 [00:16<01:02, 12.45it/s]Upper bound on the fitting time:  22%|██▏       | 224/1000 [00:16<01:01, 12.53it/s]Upper bound on the fitting time:  23%|██▎       | 226/1000 [00:16<01:01, 12.57it/s]Upper bound on the fitting time:  23%|██▎       | 228/1000 [00:16<01:01, 12.52it/s]Upper bound on the fitting time:  23%|██▎       | 230/1000 [00:16<01:01, 12.56it/s]Upper bound on the fitting time:  23%|██▎       | 232/1000 [00:16<01:01, 12.50it/s]Upper bound on the fitting time:  23%|██▎       | 234/1000 [00:17<01:01, 12.45it/s]Upper bound on the fitting time:  24%|██▎       | 236/1000 [00:17<01:00, 12.57it/s]Upper bound on the fitting time:  24%|██▍       | 238/1000 [00:17<01:00, 12.60it/s]Upper bound on the fitting time:  24%|██▍       | 240/1000 [00:17<01:00, 12.50it/s]Upper bound on the fitting time:  24%|██▍       | 242/1000 [00:17<01:01, 12.37it/s]Upper bound on the fitting time:  24%|██▍       | 244/1000 [00:17<01:01, 12.26it/s]Upper bound on the fitting time:  25%|██▍       | 246/1000 [00:18<01:01, 12.32it/s]Upper bound on the fitting time:  25%|██▍       | 248/1000 [00:18<01:00, 12.41it/s]Upper bound on the fitting time:  25%|██▌       | 250/1000 [00:18<01:00, 12.31it/s]Upper bound on the fitting time:  25%|██▌       | 252/1000 [00:18<01:01, 12.22it/s]Upper bound on the fitting time:  25%|██▌       | 254/1000 [00:18<01:01, 12.21it/s]Upper bound on the fitting time:  26%|██▌       | 256/1000 [00:18<01:01, 12.10it/s]Upper bound on the fitting time:  26%|██▌       | 258/1000 [00:19<01:01, 12.07it/s]Upper bound on the fitting time:  26%|██▌       | 260/1000 [00:19<01:01, 11.99it/s]Upper bound on the fitting time:  26%|██▌       | 262/1000 [00:19<01:01, 11.90it/s]Upper bound on the fitting time:  26%|██▋       | 264/1000 [00:19<01:01, 12.03it/s]Upper bound on the fitting time:  27%|██▋       | 266/1000 [00:19<01:00, 12.21it/s]Upper bound on the fitting time:  27%|██▋       | 268/1000 [00:19<00:58, 12.42it/s]Upper bound on the fitting time:  27%|██▋       | 270/1000 [00:19<00:58, 12.38it/s]Upper bound on the fitting time:  27%|██▋       | 272/1000 [00:20<00:58, 12.39it/s]Upper bound on the fitting time:  27%|██▋       | 274/1000 [00:20<00:58, 12.46it/s]Upper bound on the fitting time:  28%|██▊       | 276/1000 [00:20<00:58, 12.40it/s]Upper bound on the fitting time:  28%|██▊       | 278/1000 [00:20<00:58, 12.32it/s]Upper bound on the fitting time:  28%|██▊       | 280/1000 [00:20<00:58, 12.29it/s]Upper bound on the fitting time:  28%|██▊       | 282/1000 [00:20<00:58, 12.37it/s]Upper bound on the fitting time:  28%|██▊       | 284/1000 [00:21<00:58, 12.29it/s]Upper bound on the fitting time:  29%|██▊       | 286/1000 [00:21<00:58, 12.18it/s]Upper bound on the fitting time:  29%|██▉       | 288/1000 [00:21<00:58, 12.08it/s]Upper bound on the fitting time:  29%|██▉       | 290/1000 [00:21<00:58, 12.04it/s]Upper bound on the fitting time:  29%|██▉       | 292/1000 [00:21<00:58, 12.02it/s]Upper bound on the fitting time:  29%|██▉       | 294/1000 [00:21<00:56, 12.58it/s]Upper bound on the fitting time:  30%|██▉       | 296/1000 [00:22<00:53, 13.24it/s]Upper bound on the fitting time:  30%|██▉       | 298/1000 [00:22<00:53, 13.07it/s]Upper bound on the fitting time:  30%|███       | 300/1000 [00:22<00:54, 12.82it/s]Upper bound on the fitting time:  30%|███       | 302/1000 [00:22<00:54, 12.69it/s]Upper bound on the fitting time:  30%|███       | 304/1000 [00:22<00:54, 12.70it/s]Upper bound on the fitting time:  31%|███       | 306/1000 [00:22<00:54, 12.69it/s]Upper bound on the fitting time:  31%|███       | 308/1000 [00:23<00:53, 12.97it/s]Upper bound on the fitting time:  31%|███       | 310/1000 [00:23<00:53, 12.91it/s]Upper bound on the fitting time:  31%|███       | 312/1000 [00:23<00:54, 12.63it/s]Upper bound on the fitting time:  31%|███▏      | 314/1000 [00:23<00:55, 12.39it/s]Upper bound on the fitting time:  32%|███▏      | 316/1000 [00:23<00:56, 12.17it/s]Upper bound on the fitting time:  32%|███▏      | 318/1000 [00:23<00:54, 12.56it/s]Upper bound on the fitting time:  32%|███▏      | 320/1000 [00:23<00:51, 13.28it/s]Upper bound on the fitting time:  32%|███▏      | 322/1000 [00:24<00:48, 13.87it/s]Upper bound on the fitting time:  32%|███▏      | 324/1000 [00:24<00:48, 13.99it/s]Upper bound on the fitting time:  33%|███▎      | 326/1000 [00:24<00:46, 14.35it/s]Upper bound on the fitting time:  33%|███▎      | 328/1000 [00:24<00:46, 14.50it/s]Upper bound on the fitting time:  33%|███▎      | 330/1000 [00:24<00:46, 14.55it/s]Upper bound on the fitting time:  33%|███▎      | 332/1000 [00:24<00:47, 14.12it/s]Upper bound on the fitting time:  33%|███▎      | 334/1000 [00:24<00:48, 13.74it/s]Upper bound on the fitting time:  34%|███▎      | 336/1000 [00:25<00:50, 13.22it/s]Upper bound on the fitting time:  34%|███▍      | 338/1000 [00:25<00:52, 12.67it/s]Upper bound on the fitting time:  34%|███▍      | 340/1000 [00:25<00:53, 12.38it/s]Upper bound on the fitting time:  34%|███▍      | 342/1000 [00:25<00:52, 12.46it/s]Upper bound on the fitting time:  34%|███▍      | 344/1000 [00:25<00:52, 12.55it/s]Upper bound on the fitting time:  35%|███▍      | 346/1000 [00:25<00:51, 12.68it/s]Upper bound on the fitting time:  35%|███▍      | 348/1000 [00:26<00:52, 12.52it/s]Upper bound on the fitting time:  35%|███▌      | 350/1000 [00:26<00:51, 12.62it/s]Upper bound on the fitting time:  35%|███▌      | 352/1000 [00:26<00:49, 12.99it/s]Upper bound on the fitting time:  35%|███▌      | 354/1000 [00:26<00:47, 13.49it/s]Upper bound on the fitting time:  36%|███▌      | 356/1000 [00:26<00:46, 13.90it/s]Upper bound on the fitting time:  36%|███▌      | 358/1000 [00:26<00:45, 14.15it/s]Upper bound on the fitting time:  36%|███▌      | 360/1000 [00:26<00:44, 14.37it/s]Upper bound on the fitting time:  36%|███▌      | 362/1000 [00:27<00:44, 14.47it/s]Upper bound on the fitting time:  36%|███▋      | 364/1000 [00:27<00:47, 13.40it/s]Upper bound on the fitting time:  37%|███▋      | 366/1000 [00:27<00:48, 13.13it/s]Upper bound on the fitting time:  37%|███▋      | 368/1000 [00:27<00:47, 13.40it/s]Upper bound on the fitting time:  37%|███▋      | 370/1000 [00:27<00:45, 13.79it/s]Upper bound on the fitting time:  37%|███▋      | 372/1000 [00:27<00:44, 14.06it/s]Upper bound on the fitting time:  37%|███▋      | 374/1000 [00:27<00:43, 14.32it/s]Upper bound on the fitting time:  38%|███▊      | 376/1000 [00:28<00:42, 14.54it/s]Upper bound on the fitting time:  38%|███▊      | 378/1000 [00:28<00:42, 14.71it/s]Upper bound on the fitting time:  38%|███▊      | 380/1000 [00:28<00:41, 14.91it/s]Upper bound on the fitting time:  38%|███▊      | 382/1000 [00:28<00:41, 14.85it/s]Upper bound on the fitting time:  38%|███▊      | 384/1000 [00:28<00:40, 15.10it/s]Upper bound on the fitting time:  39%|███▊      | 386/1000 [00:28<00:40, 15.16it/s]Upper bound on the fitting time:  39%|███▉      | 388/1000 [00:28<00:40, 15.11it/s]Upper bound on the fitting time:  39%|███▉      | 390/1000 [00:28<00:40, 14.93it/s]Upper bound on the fitting time:  39%|███▉      | 392/1000 [00:29<00:40, 15.07it/s]Upper bound on the fitting time:  39%|███▉      | 394/1000 [00:29<00:40, 15.07it/s]Upper bound on the fitting time:  40%|███▉      | 396/1000 [00:29<00:40, 15.09it/s]Upper bound on the fitting time:  40%|███▉      | 398/1000 [00:29<00:39, 15.06it/s]Upper bound on the fitting time:  40%|████      | 400/1000 [00:29<00:39, 15.03it/s]Upper bound on the fitting time:  40%|████      | 402/1000 [00:29<00:40, 14.74it/s]Upper bound on the fitting time:  40%|████      | 404/1000 [00:29<00:39, 14.92it/s]Upper bound on the fitting time:  41%|████      | 406/1000 [00:30<00:39, 15.00it/s]Upper bound on the fitting time:  41%|████      | 408/1000 [00:30<00:39, 15.05it/s]Upper bound on the fitting time:  41%|████      | 410/1000 [00:30<00:39, 15.03it/s]Upper bound on the fitting time:  41%|████      | 412/1000 [00:30<00:39, 14.97it/s]Upper bound on the fitting time:  41%|████▏     | 414/1000 [00:30<00:39, 14.98it/s]Upper bound on the fitting time:  42%|████▏     | 416/1000 [00:30<00:39, 14.95it/s]Upper bound on the fitting time:  42%|████▏     | 418/1000 [00:30<00:39, 14.83it/s]Upper bound on the fitting time:  42%|████▏     | 420/1000 [00:30<00:38, 14.94it/s]Upper bound on the fitting time:  42%|████▏     | 422/1000 [00:31<00:38, 14.92it/s]Upper bound on the fitting time:  42%|████▏     | 424/1000 [00:31<00:38, 14.82it/s]Upper bound on the fitting time:  43%|████▎     | 426/1000 [00:31<00:38, 14.76it/s]Upper bound on the fitting time:  43%|████▎     | 428/1000 [00:31<00:38, 14.85it/s]Upper bound on the fitting time:  43%|████▎     | 430/1000 [00:31<00:39, 14.59it/s]Upper bound on the fitting time:  43%|████▎     | 432/1000 [00:31<00:39, 14.30it/s]Upper bound on the fitting time:  43%|████▎     | 434/1000 [00:31<00:38, 14.54it/s]Upper bound on the fitting time:  44%|████▎     | 436/1000 [00:32<00:38, 14.57it/s]Upper bound on the fitting time:  44%|████▍     | 438/1000 [00:32<00:38, 14.68it/s]Upper bound on the fitting time:  44%|████▍     | 440/1000 [00:32<00:37, 14.79it/s]Upper bound on the fitting time:  44%|████▍     | 442/1000 [00:32<00:37, 14.84it/s]Upper bound on the fitting time:  44%|████▍     | 444/1000 [00:32<00:37, 14.69it/s]Upper bound on the fitting time:  45%|████▍     | 446/1000 [00:32<00:37, 14.63it/s]Upper bound on the fitting time:  45%|████▍     | 448/1000 [00:32<00:37, 14.71it/s]Upper bound on the fitting time:  45%|████▌     | 450/1000 [00:33<00:37, 14.77it/s]Upper bound on the fitting time:  45%|████▌     | 452/1000 [00:33<00:36, 14.86it/s]Upper bound on the fitting time:  45%|████▌     | 454/1000 [00:33<00:36, 14.80it/s]Upper bound on the fitting time:  46%|████▌     | 456/1000 [00:33<00:36, 14.73it/s]Upper bound on the fitting time:  46%|████▌     | 458/1000 [00:33<00:36, 14.90it/s]Upper bound on the fitting time:  46%|████▌     | 460/1000 [00:33<00:35, 15.08it/s]Upper bound on the fitting time:  46%|████▌     | 462/1000 [00:33<00:35, 15.20it/s]Upper bound on the fitting time:  46%|████▋     | 464/1000 [00:33<00:34, 15.32it/s]Upper bound on the fitting time:  47%|████▋     | 466/1000 [00:34<00:35, 15.24it/s]Upper bound on the fitting time:  47%|████▋     | 468/1000 [00:34<00:34, 15.22it/s]Upper bound on the fitting time:  47%|████▋     | 470/1000 [00:34<00:34, 15.15it/s]Upper bound on the fitting time:  47%|████▋     | 472/1000 [00:34<00:34, 15.14it/s]Upper bound on the fitting time:  47%|████▋     | 474/1000 [00:34<00:34, 15.23it/s]Upper bound on the fitting time:  48%|████▊     | 476/1000 [00:34<00:34, 15.02it/s]Upper bound on the fitting time:  48%|████▊     | 478/1000 [00:34<00:34, 15.13it/s]Upper bound on the fitting time:  48%|████▊     | 480/1000 [00:35<00:34, 15.19it/s]Upper bound on the fitting time:  48%|████▊     | 482/1000 [00:35<00:34, 15.15it/s]Upper bound on the fitting time:  48%|████▊     | 484/1000 [00:35<00:34, 15.10it/s]Upper bound on the fitting time:  49%|████▊     | 486/1000 [00:35<00:34, 14.97it/s]Upper bound on the fitting time:  49%|████▉     | 488/1000 [00:35<00:33, 15.15it/s]Upper bound on the fitting time:  49%|████▉     | 490/1000 [00:35<00:33, 15.13it/s]Upper bound on the fitting time:  49%|████▉     | 492/1000 [00:35<00:33, 15.21it/s]Upper bound on the fitting time:  49%|████▉     | 494/1000 [00:35<00:33, 15.32it/s]Upper bound on the fitting time:  50%|████▉     | 496/1000 [00:36<00:33, 15.18it/s]Upper bound on the fitting time:  50%|████▉     | 498/1000 [00:36<00:34, 14.75it/s]Upper bound on the fitting time:  50%|█████     | 500/1000 [00:36<00:33, 14.79it/s]Upper bound on the fitting time:  50%|█████     | 502/1000 [00:36<00:33, 14.93it/s]Upper bound on the fitting time:  50%|█████     | 504/1000 [00:36<00:33, 15.00it/s]Upper bound on the fitting time:  51%|█████     | 506/1000 [00:36<00:33, 14.86it/s]Upper bound on the fitting time:  51%|█████     | 508/1000 [00:36<00:33, 14.89it/s]Upper bound on the fitting time:  51%|█████     | 510/1000 [00:37<00:32, 14.97it/s]Upper bound on the fitting time:  51%|█████     | 512/1000 [00:37<00:32, 15.04it/s]Upper bound on the fitting time:  51%|█████▏    | 514/1000 [00:37<00:33, 14.71it/s]Upper bound on the fitting time:  52%|█████▏    | 516/1000 [00:37<00:32, 14.91it/s]Upper bound on the fitting time:  52%|█████▏    | 518/1000 [00:37<00:31, 15.17it/s]Upper bound on the fitting time:  52%|█████▏    | 520/1000 [00:37<00:31, 15.11it/s]Upper bound on the fitting time:  52%|█████▏    | 522/1000 [00:37<00:31, 15.03it/s]Upper bound on the fitting time:  52%|█████▏    | 524/1000 [00:37<00:31, 15.01it/s]Upper bound on the fitting time:  53%|█████▎    | 526/1000 [00:38<00:31, 14.94it/s]Upper bound on the fitting time:  53%|█████▎    | 528/1000 [00:38<00:31, 15.10it/s]Upper bound on the fitting time:  53%|█████▎    | 530/1000 [00:38<00:31, 15.16it/s]Upper bound on the fitting time:  53%|█████▎    | 532/1000 [00:38<00:31, 14.99it/s]Upper bound on the fitting time:  53%|█████▎    | 534/1000 [00:38<00:30, 15.04it/s]Upper bound on the fitting time:  54%|█████▎    | 536/1000 [00:38<00:31, 14.71it/s]Upper bound on the fitting time:  54%|█████▍    | 538/1000 [00:38<00:31, 14.80it/s]Upper bound on the fitting time:  54%|█████▍    | 540/1000 [00:39<00:31, 14.51it/s]Upper bound on the fitting time:  54%|█████▍    | 542/1000 [00:39<00:30, 14.77it/s]Upper bound on the fitting time:  54%|█████▍    | 544/1000 [00:39<00:30, 14.92it/s]Upper bound on the fitting time:  55%|█████▍    | 546/1000 [00:39<00:30, 14.65it/s]Upper bound on the fitting time:  55%|█████▍    | 548/1000 [00:39<00:30, 14.84it/s]Upper bound on the fitting time:  55%|█████▌    | 550/1000 [00:39<00:30, 14.92it/s]Upper bound on the fitting time:  55%|█████▌    | 552/1000 [00:39<00:30, 14.89it/s]Upper bound on the fitting time:  55%|█████▌    | 554/1000 [00:39<00:29, 14.91it/s]Upper bound on the fitting time:  56%|█████▌    | 556/1000 [00:40<00:29, 15.06it/s]Upper bound on the fitting time:  56%|█████▌    | 558/1000 [00:40<00:29, 15.00it/s]Upper bound on the fitting time:  56%|█████▌    | 560/1000 [00:40<00:29, 15.13it/s]Upper bound on the fitting time:  56%|█████▌    | 562/1000 [00:40<00:28, 15.19it/s]Upper bound on the fitting time:  56%|█████▋    | 564/1000 [00:40<00:28, 15.25it/s]Upper bound on the fitting time:  57%|█████▋    | 566/1000 [00:40<00:29, 14.83it/s]Upper bound on the fitting time:  57%|█████▋    | 568/1000 [00:40<00:29, 14.46it/s]Upper bound on the fitting time:  57%|█████▋    | 570/1000 [00:41<00:29, 14.65it/s]Upper bound on the fitting time:  57%|█████▋    | 572/1000 [00:41<00:28, 14.78it/s]Upper bound on the fitting time:  57%|█████▋    | 574/1000 [00:41<00:29, 14.28it/s]Upper bound on the fitting time:  58%|█████▊    | 576/1000 [00:41<00:30, 13.79it/s]Upper bound on the fitting time:  58%|█████▊    | 578/1000 [00:41<00:30, 13.76it/s]Upper bound on the fitting time:  58%|█████▊    | 580/1000 [00:41<00:30, 13.90it/s]Upper bound on the fitting time:  58%|█████▊    | 582/1000 [00:41<00:30, 13.91it/s]Upper bound on the fitting time:  58%|█████▊    | 584/1000 [00:42<00:29, 13.91it/s]Upper bound on the fitting time:  59%|█████▊    | 586/1000 [00:42<00:29, 13.87it/s]Upper bound on the fitting time:  59%|█████▉    | 588/1000 [00:42<00:30, 13.73it/s]Upper bound on the fitting time:  59%|█████▉    | 590/1000 [00:42<00:29, 13.73it/s]Upper bound on the fitting time:  59%|█████▉    | 592/1000 [00:42<00:28, 14.19it/s]Upper bound on the fitting time:  59%|█████▉    | 594/1000 [00:42<00:28, 14.44it/s]Upper bound on the fitting time:  60%|█████▉    | 596/1000 [00:42<00:28, 14.04it/s]Upper bound on the fitting time:  60%|█████▉    | 598/1000 [00:43<00:30, 13.39it/s]Upper bound on the fitting time:  60%|██████    | 600/1000 [00:43<00:28, 13.92it/s]Upper bound on the fitting time:  60%|██████    | 602/1000 [00:43<00:27, 14.34it/s]Upper bound on the fitting time:  60%|██████    | 604/1000 [00:43<00:26, 14.71it/s]Upper bound on the fitting time:  61%|██████    | 606/1000 [00:43<00:27, 14.55it/s]Upper bound on the fitting time:  61%|██████    | 608/1000 [00:43<00:26, 14.90it/s]Upper bound on the fitting time:  61%|██████    | 610/1000 [00:43<00:25, 15.04it/s]Upper bound on the fitting time:  61%|██████    | 612/1000 [00:43<00:25, 15.09it/s]Upper bound on the fitting time:  61%|██████▏   | 614/1000 [00:44<00:25, 14.90it/s]Upper bound on the fitting time:  62%|██████▏   | 616/1000 [00:44<00:25, 14.90it/s]Upper bound on the fitting time:  62%|██████▏   | 618/1000 [00:44<00:25, 14.92it/s]Upper bound on the fitting time:  62%|██████▏   | 620/1000 [00:44<00:25, 14.91it/s]Upper bound on the fitting time:  62%|██████▏   | 622/1000 [00:44<00:25, 14.85it/s]Upper bound on the fitting time:  62%|██████▏   | 624/1000 [00:44<00:25, 14.81it/s]Upper bound on the fitting time:  63%|██████▎   | 626/1000 [00:44<00:25, 14.82it/s]Upper bound on the fitting time:  63%|██████▎   | 628/1000 [00:45<00:25, 14.83it/s]Upper bound on the fitting time:  63%|██████▎   | 630/1000 [00:45<00:24, 14.87it/s]Upper bound on the fitting time:  63%|██████▎   | 632/1000 [00:45<00:24, 14.93it/s]Upper bound on the fitting time:  63%|██████▎   | 634/1000 [00:45<00:24, 14.80it/s]Upper bound on the fitting time:  64%|██████▎   | 636/1000 [00:45<00:24, 14.85it/s]Upper bound on the fitting time:  64%|██████▍   | 638/1000 [00:45<00:24, 14.94it/s]Upper bound on the fitting time:  64%|██████▍   | 640/1000 [00:45<00:24, 14.69it/s]Upper bound on the fitting time:  64%|██████▍   | 642/1000 [00:46<00:24, 14.68it/s]Upper bound on the fitting time:  64%|██████▍   | 644/1000 [00:46<00:24, 14.78it/s]Upper bound on the fitting time:  65%|██████▍   | 646/1000 [00:46<00:23, 14.90it/s]Upper bound on the fitting time:  65%|██████▍   | 648/1000 [00:46<00:23, 14.97it/s]Upper bound on the fitting time:  65%|██████▌   | 650/1000 [00:46<00:23, 15.05it/s]Upper bound on the fitting time:  65%|██████▌   | 652/1000 [00:46<00:23, 14.63it/s]Upper bound on the fitting time:  65%|██████▌   | 654/1000 [00:46<00:24, 14.24it/s]Upper bound on the fitting time:  66%|██████▌   | 656/1000 [00:46<00:24, 13.99it/s]Upper bound on the fitting time:  66%|██████▌   | 658/1000 [00:47<00:24, 13.79it/s]Upper bound on the fitting time:  66%|██████▌   | 660/1000 [00:47<00:25, 13.45it/s]Upper bound on the fitting time:  66%|██████▌   | 662/1000 [00:47<00:24, 13.90it/s]Upper bound on the fitting time:  66%|██████▋   | 664/1000 [00:47<00:23, 14.27it/s]Upper bound on the fitting time:  67%|██████▋   | 666/1000 [00:47<00:22, 14.54it/s]Upper bound on the fitting time:  67%|██████▋   | 668/1000 [00:47<00:22, 14.64it/s]Upper bound on the fitting time:  67%|██████▋   | 670/1000 [00:47<00:22, 14.79it/s]Upper bound on the fitting time:  67%|██████▋   | 672/1000 [00:48<00:22, 14.83it/s]Upper bound on the fitting time:  67%|██████▋   | 674/1000 [00:48<00:21, 14.98it/s]Upper bound on the fitting time:  68%|██████▊   | 676/1000 [00:48<00:21, 15.06it/s]Upper bound on the fitting time:  68%|██████▊   | 678/1000 [00:48<00:21, 15.13it/s]Upper bound on the fitting time:  68%|██████▊   | 680/1000 [00:48<00:21, 15.15it/s]Upper bound on the fitting time:  68%|██████▊   | 682/1000 [00:48<00:21, 14.97it/s]Upper bound on the fitting time:  68%|██████▊   | 684/1000 [00:48<00:21, 14.89it/s]Upper bound on the fitting time:  69%|██████▊   | 686/1000 [00:49<00:21, 14.95it/s]Upper bound on the fitting time:  69%|██████▉   | 688/1000 [00:49<00:21, 14.83it/s]Upper bound on the fitting time:  69%|██████▉   | 690/1000 [00:49<00:20, 14.88it/s]Upper bound on the fitting time:  69%|██████▉   | 692/1000 [00:49<00:20, 14.87it/s]Upper bound on the fitting time:  69%|██████▉   | 694/1000 [00:49<00:20, 14.98it/s]Upper bound on the fitting time:  70%|██████▉   | 696/1000 [00:49<00:20, 14.94it/s]Upper bound on the fitting time:  70%|██████▉   | 698/1000 [00:49<00:20, 15.00it/s]Upper bound on the fitting time:  70%|███████   | 700/1000 [00:49<00:19, 15.02it/s]Upper bound on the fitting time:  70%|███████   | 702/1000 [00:50<00:19, 14.96it/s]Upper bound on the fitting time:  70%|███████   | 704/1000 [00:50<00:19, 14.93it/s]Upper bound on the fitting time:  71%|███████   | 706/1000 [00:50<00:19, 14.96it/s]Upper bound on the fitting time:  71%|███████   | 708/1000 [00:50<00:19, 14.83it/s]Upper bound on the fitting time:  71%|███████   | 710/1000 [00:50<00:19, 14.92it/s]Upper bound on the fitting time:  71%|███████   | 712/1000 [00:50<00:19, 14.78it/s]Upper bound on the fitting time:  71%|███████▏  | 714/1000 [00:50<00:19, 14.94it/s]Upper bound on the fitting time:  72%|███████▏  | 716/1000 [00:51<00:18, 14.97it/s]Upper bound on the fitting time:  72%|███████▏  | 718/1000 [00:51<00:18, 15.00it/s]Upper bound on the fitting time:  72%|███████▏  | 720/1000 [00:51<00:18, 14.98it/s]Upper bound on the fitting time:  72%|███████▏  | 722/1000 [00:51<00:18, 15.14it/s]Upper bound on the fitting time:  72%|███████▏  | 724/1000 [00:51<00:18, 14.53it/s]Upper bound on the fitting time:  73%|███████▎  | 726/1000 [00:51<00:18, 14.74it/s]Upper bound on the fitting time:  73%|███████▎  | 728/1000 [00:51<00:18, 14.65it/s]Upper bound on the fitting time:  73%|███████▎  | 730/1000 [00:51<00:18, 14.59it/s]Upper bound on the fitting time:  73%|███████▎  | 732/1000 [00:52<00:18, 14.82it/s]Upper bound on the fitting time:  73%|███████▎  | 734/1000 [00:52<00:17, 14.90it/s]Upper bound on the fitting time:  74%|███████▎  | 736/1000 [00:52<00:17, 14.90it/s]Upper bound on the fitting time:  74%|███████▍  | 738/1000 [00:52<00:17, 14.98it/s]Upper bound on the fitting time:  74%|███████▍  | 740/1000 [00:52<00:17, 15.11it/s]Upper bound on the fitting time:  74%|███████▍  | 742/1000 [00:52<00:17, 15.18it/s]Upper bound on the fitting time:  74%|███████▍  | 744/1000 [00:52<00:16, 15.17it/s]Upper bound on the fitting time:  75%|███████▍  | 746/1000 [00:53<00:16, 15.20it/s]Upper bound on the fitting time:  75%|███████▍  | 748/1000 [00:53<00:16, 15.15it/s]Upper bound on the fitting time:  75%|███████▌  | 750/1000 [00:53<00:16, 14.93it/s]Upper bound on the fitting time:  75%|███████▌  | 752/1000 [00:53<00:16, 14.94it/s]Upper bound on the fitting time:  75%|███████▌  | 754/1000 [00:53<00:16, 14.98it/s]Upper bound on the fitting time:  76%|███████▌  | 756/1000 [00:53<00:16, 15.04it/s]Upper bound on the fitting time:  76%|███████▌  | 758/1000 [00:53<00:16, 15.09it/s]Upper bound on the fitting time:  76%|███████▌  | 760/1000 [00:53<00:15, 15.03it/s]Upper bound on the fitting time:  76%|███████▌  | 762/1000 [00:54<00:15, 14.97it/s]Upper bound on the fitting time:  76%|███████▋  | 764/1000 [00:54<00:15, 15.10it/s]Upper bound on the fitting time:  77%|███████▋  | 766/1000 [00:54<00:15, 15.07it/s]Upper bound on the fitting time:  77%|███████▋  | 768/1000 [00:54<00:15, 14.96it/s]Upper bound on the fitting time:  77%|███████▋  | 770/1000 [00:54<00:15, 15.03it/s]Upper bound on the fitting time:  77%|███████▋  | 772/1000 [00:54<00:15, 14.91it/s]Upper bound on the fitting time:  77%|███████▋  | 774/1000 [00:54<00:15, 14.91it/s]Upper bound on the fitting time:  78%|███████▊  | 776/1000 [00:55<00:14, 14.95it/s]Upper bound on the fitting time:  78%|███████▊  | 778/1000 [00:55<00:14, 15.00it/s]Upper bound on the fitting time:  78%|███████▊  | 780/1000 [00:55<00:14, 14.97it/s]Upper bound on the fitting time:  78%|███████▊  | 782/1000 [00:55<00:14, 14.73it/s]Upper bound on the fitting time:  78%|███████▊  | 784/1000 [00:55<00:14, 14.91it/s]Upper bound on the fitting time:  79%|███████▊  | 786/1000 [00:55<00:14, 15.01it/s]Upper bound on the fitting time:  79%|███████▉  | 788/1000 [00:55<00:14, 15.08it/s]Upper bound on the fitting time:  79%|███████▉  | 790/1000 [00:56<00:14, 14.49it/s]Upper bound on the fitting time:  79%|███████▉  | 792/1000 [00:56<00:14, 14.74it/s]Upper bound on the fitting time:  79%|███████▉  | 794/1000 [00:56<00:14, 14.50it/s]Upper bound on the fitting time:  80%|███████▉  | 796/1000 [00:56<00:15, 13.53it/s]Upper bound on the fitting time:  80%|███████▉  | 798/1000 [00:56<00:15, 13.23it/s]Upper bound on the fitting time:  80%|████████  | 800/1000 [00:56<00:15, 12.61it/s]Upper bound on the fitting time:  80%|████████  | 802/1000 [00:56<00:15, 12.82it/s]Upper bound on the fitting time:  80%|████████  | 804/1000 [00:57<00:14, 13.13it/s]Upper bound on the fitting time:  81%|████████  | 806/1000 [00:57<00:14, 13.03it/s]Upper bound on the fitting time:  81%|████████  | 808/1000 [00:57<00:14, 12.95it/s]Upper bound on the fitting time:  81%|████████  | 810/1000 [00:57<00:14, 13.16it/s]Upper bound on the fitting time:  81%|████████  | 812/1000 [00:57<00:14, 13.22it/s]Upper bound on the fitting time:  81%|████████▏ | 814/1000 [00:57<00:13, 13.31it/s]Upper bound on the fitting time:  82%|████████▏ | 816/1000 [00:57<00:13, 13.47it/s]Upper bound on the fitting time:  82%|████████▏ | 818/1000 [00:58<00:13, 13.59it/s]Upper bound on the fitting time:  82%|████████▏ | 820/1000 [00:58<00:13, 13.67it/s]Upper bound on the fitting time:  82%|████████▏ | 822/1000 [00:58<00:13, 13.54it/s]Upper bound on the fitting time:  82%|████████▏ | 824/1000 [00:58<00:12, 13.56it/s]Upper bound on the fitting time:  83%|████████▎ | 826/1000 [00:58<00:12, 13.59it/s]Upper bound on the fitting time:  83%|████████▎ | 828/1000 [00:58<00:13, 13.20it/s]Upper bound on the fitting time:  83%|████████▎ | 830/1000 [00:59<00:12, 13.20it/s]Upper bound on the fitting time:  83%|████████▎ | 832/1000 [00:59<00:12, 13.26it/s]Upper bound on the fitting time:  83%|████████▎ | 834/1000 [00:59<00:12, 13.23it/s]Upper bound on the fitting time:  84%|████████▎ | 836/1000 [00:59<00:12, 13.07it/s]Upper bound on the fitting time:  84%|████████▍ | 838/1000 [00:59<00:12, 13.07it/s]Upper bound on the fitting time:  84%|████████▍ | 840/1000 [00:59<00:12, 13.22it/s]Upper bound on the fitting time:  84%|████████▍ | 842/1000 [00:59<00:11, 13.23it/s]Upper bound on the fitting time:  84%|████████▍ | 844/1000 [01:00<00:11, 13.22it/s]Upper bound on the fitting time:  85%|████████▍ | 846/1000 [01:00<00:11, 13.28it/s]Upper bound on the fitting time:  85%|████████▍ | 848/1000 [01:00<00:11, 13.27it/s]Upper bound on the fitting time:  85%|████████▌ | 850/1000 [01:00<00:11, 13.33it/s]Upper bound on the fitting time:  85%|████████▌ | 852/1000 [01:00<00:11, 13.32it/s]Upper bound on the fitting time:  85%|████████▌ | 854/1000 [01:00<00:11, 13.19it/s]Upper bound on the fitting time:  86%|████████▌ | 856/1000 [01:00<00:10, 13.19it/s]Upper bound on the fitting time:  86%|████████▌ | 858/1000 [01:01<00:10, 13.20it/s]Upper bound on the fitting time:  86%|████████▌ | 860/1000 [01:01<00:10, 13.21it/s]Upper bound on the fitting time:  86%|████████▌ | 862/1000 [01:01<00:10, 13.21it/s]Upper bound on the fitting time:  86%|████████▋ | 864/1000 [01:01<00:10, 13.08it/s]Upper bound on the fitting time:  87%|████████▋ | 866/1000 [01:01<00:10, 13.19it/s]Upper bound on the fitting time:  87%|████████▋ | 868/1000 [01:01<00:10, 13.17it/s]Upper bound on the fitting time:  87%|████████▋ | 870/1000 [01:02<00:09, 13.29it/s]Upper bound on the fitting time:  87%|████████▋ | 872/1000 [01:02<00:09, 13.29it/s]Upper bound on the fitting time:  87%|████████▋ | 874/1000 [01:02<00:09, 13.06it/s]Upper bound on the fitting time:  88%|████████▊ | 876/1000 [01:02<00:09, 12.90it/s]Upper bound on the fitting time:  88%|████████▊ | 878/1000 [01:02<00:09, 13.11it/s]Upper bound on the fitting time:  88%|████████▊ | 880/1000 [01:02<00:09, 12.73it/s]Upper bound on the fitting time:  88%|████████▊ | 882/1000 [01:02<00:09, 12.77it/s]Upper bound on the fitting time:  88%|████████▊ | 884/1000 [01:03<00:09, 12.74it/s]Upper bound on the fitting time:  89%|████████▊ | 886/1000 [01:03<00:08, 12.71it/s]Upper bound on the fitting time:  89%|████████▉ | 888/1000 [01:03<00:08, 12.46it/s]Upper bound on the fitting time:  89%|████████▉ | 890/1000 [01:03<00:08, 12.40it/s]Upper bound on the fitting time:  89%|████████▉ | 892/1000 [01:03<00:08, 12.26it/s]Upper bound on the fitting time:  89%|████████▉ | 894/1000 [01:03<00:08, 12.19it/s]Upper bound on the fitting time:  90%|████████▉ | 896/1000 [01:04<00:08, 12.21it/s]Upper bound on the fitting time:  90%|████████▉ | 898/1000 [01:04<00:08, 12.24it/s]Upper bound on the fitting time:  90%|█████████ | 900/1000 [01:04<00:08, 12.20it/s]Upper bound on the fitting time:  90%|█████████ | 902/1000 [01:04<00:08, 12.24it/s]Upper bound on the fitting time:  90%|█████████ | 904/1000 [01:04<00:07, 12.21it/s]Upper bound on the fitting time:  91%|█████████ | 906/1000 [01:04<00:07, 12.24it/s]Upper bound on the fitting time:  91%|█████████ | 908/1000 [01:05<00:07, 12.30it/s]Upper bound on the fitting time:  91%|█████████ | 910/1000 [01:05<00:07, 12.27it/s]Upper bound on the fitting time:  91%|█████████ | 912/1000 [01:05<00:07, 12.21it/s]Upper bound on the fitting time:  91%|█████████▏| 914/1000 [01:05<00:07, 12.16it/s]Upper bound on the fitting time:  92%|█████████▏| 916/1000 [01:05<00:06, 12.22it/s]Upper bound on the fitting time:  92%|█████████▏| 918/1000 [01:05<00:06, 12.20it/s]Upper bound on the fitting time:  92%|█████████▏| 920/1000 [01:06<00:06, 12.39it/s]Upper bound on the fitting time:  92%|█████████▏| 922/1000 [01:06<00:06, 12.65it/s]Upper bound on the fitting time:  92%|█████████▏| 924/1000 [01:06<00:06, 12.60it/s]Upper bound on the fitting time:  93%|█████████▎| 926/1000 [01:06<00:05, 12.72it/s]Upper bound on the fitting time:  93%|█████████▎| 928/1000 [01:06<00:05, 12.87it/s]Upper bound on the fitting time:  93%|█████████▎| 930/1000 [01:06<00:05, 12.90it/s]Upper bound on the fitting time:  93%|█████████▎| 932/1000 [01:07<00:05, 13.12it/s]Upper bound on the fitting time:  93%|█████████▎| 934/1000 [01:07<00:05, 13.19it/s]Upper bound on the fitting time:  94%|█████████▎| 936/1000 [01:07<00:04, 13.30it/s]Upper bound on the fitting time:  94%|█████████▍| 938/1000 [01:07<00:04, 13.22it/s]Upper bound on the fitting time:  94%|█████████▍| 940/1000 [01:07<00:04, 13.28it/s]Upper bound on the fitting time:  94%|█████████▍| 942/1000 [01:07<00:04, 13.29it/s]Upper bound on the fitting time:  94%|█████████▍| 944/1000 [01:07<00:04, 13.39it/s]Upper bound on the fitting time:  95%|█████████▍| 946/1000 [01:08<00:04, 13.45it/s]Upper bound on the fitting time:  95%|█████████▍| 948/1000 [01:08<00:03, 13.24it/s]Upper bound on the fitting time:  95%|█████████▌| 950/1000 [01:08<00:03, 13.28it/s]Upper bound on the fitting time:  95%|█████████▌| 952/1000 [01:08<00:03, 13.28it/s]Upper bound on the fitting time:  95%|█████████▌| 954/1000 [01:08<00:03, 13.35it/s]Upper bound on the fitting time:  96%|█████████▌| 956/1000 [01:08<00:03, 13.28it/s]Upper bound on the fitting time:  96%|█████████▌| 958/1000 [01:08<00:03, 13.40it/s]Upper bound on the fitting time:  96%|█████████▌| 960/1000 [01:09<00:02, 13.50it/s]Upper bound on the fitting time:  96%|█████████▌| 962/1000 [01:09<00:02, 13.45it/s]Upper bound on the fitting time:  96%|█████████▋| 964/1000 [01:09<00:02, 13.57it/s]Upper bound on the fitting time:  97%|█████████▋| 966/1000 [01:09<00:02, 13.33it/s]Upper bound on the fitting time:  97%|█████████▋| 968/1000 [01:09<00:02, 13.23it/s]Upper bound on the fitting time:  97%|█████████▋| 970/1000 [01:09<00:02, 13.36it/s]Upper bound on the fitting time:  97%|█████████▋| 972/1000 [01:09<00:02, 13.45it/s]Upper bound on the fitting time:  97%|█████████▋| 974/1000 [01:10<00:01, 13.45it/s]Upper bound on the fitting time:  98%|█████████▊| 976/1000 [01:10<00:01, 13.25it/s]Upper bound on the fitting time:  98%|█████████▊| 978/1000 [01:10<00:01, 12.99it/s]Upper bound on the fitting time:  98%|█████████▊| 980/1000 [01:10<00:01, 12.96it/s]Upper bound on the fitting time:  98%|█████████▊| 982/1000 [01:10<00:01, 12.91it/s]Upper bound on the fitting time:  98%|█████████▊| 984/1000 [01:10<00:01, 12.97it/s]Upper bound on the fitting time:  99%|█████████▊| 986/1000 [01:11<00:01, 12.92it/s]Upper bound on the fitting time:  99%|█████████▉| 988/1000 [01:11<00:00, 12.42it/s]Upper bound on the fitting time:  99%|█████████▉| 990/1000 [01:11<00:00, 12.19it/s]Upper bound on the fitting time:  99%|█████████▉| 992/1000 [01:11<00:00, 12.12it/s]Upper bound on the fitting time:  99%|█████████▉| 994/1000 [01:11<00:00, 12.36it/s]Upper bound on the fitting time: 100%|█████████▉| 996/1000 [01:11<00:00, 12.65it/s]Upper bound on the fitting time: 100%|█████████▉| 998/1000 [01:12<00:00, 12.64it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [01:12<00:00, 12.61it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [01:12<00:00, 13.85it/s]
    -Upper bound on the fitting time:   0%|          | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time:   0%|          | 2/1000 [00:00<01:21, 12.25it/s]Upper bound on the fitting time:   0%|          | 4/1000 [00:00<01:21, 12.19it/s]Upper bound on the fitting time:   1%|          | 6/1000 [00:00<01:20, 12.28it/s]Upper bound on the fitting time:   1%|          | 8/1000 [00:00<01:16, 12.95it/s]Upper bound on the fitting time:   1%|          | 10/1000 [00:00<01:13, 13.45it/s]Upper bound on the fitting time:   1%|          | 12/1000 [00:00<01:10, 13.93it/s]Upper bound on the fitting time:   1%|▏         | 14/1000 [00:01<01:09, 14.29it/s]Upper bound on the fitting time:   2%|▏         | 16/1000 [00:01<01:07, 14.56it/s]Upper bound on the fitting time:   2%|▏         | 18/1000 [00:01<01:07, 14.64it/s]Upper bound on the fitting time:   2%|▏         | 20/1000 [00:01<01:06, 14.77it/s]Upper bound on the fitting time:   2%|▏         | 22/1000 [00:01<01:07, 14.59it/s]Upper bound on the fitting time:   2%|▏         | 24/1000 [00:01<01:08, 14.32it/s]Upper bound on the fitting time:   3%|▎         | 26/1000 [00:01<01:09, 14.01it/s]Upper bound on the fitting time:   3%|▎         | 28/1000 [00:02<01:08, 14.28it/s]Upper bound on the fitting time:   3%|▎         | 30/1000 [00:02<01:08, 14.07it/s]Upper bound on the fitting time:   3%|▎         | 32/1000 [00:02<01:07, 14.31it/s]Upper bound on the fitting time:   3%|▎         | 34/1000 [00:02<01:06, 14.46it/s]Upper bound on the fitting time:   4%|▎         | 36/1000 [00:02<01:07, 14.37it/s]Upper bound on the fitting time:   4%|▍         | 38/1000 [00:02<01:06, 14.36it/s]Upper bound on the fitting time:   4%|▍         | 40/1000 [00:02<01:06, 14.51it/s]Upper bound on the fitting time:   4%|▍         | 42/1000 [00:02<01:05, 14.58it/s]Upper bound on the fitting time:   4%|▍         | 44/1000 [00:03<01:05, 14.64it/s]Upper bound on the fitting time:   5%|▍         | 46/1000 [00:03<01:04, 14.80it/s]Upper bound on the fitting time:   5%|▍         | 48/1000 [00:03<01:03, 14.89it/s]Upper bound on the fitting time:   5%|▌         | 50/1000 [00:03<01:03, 14.85it/s]Upper bound on the fitting time:   5%|▌         | 52/1000 [00:03<01:08, 13.76it/s]Upper bound on the fitting time:   5%|▌         | 54/1000 [00:03<01:10, 13.49it/s]Upper bound on the fitting time:   6%|▌         | 56/1000 [00:03<01:12, 13.10it/s]Upper bound on the fitting time:   6%|▌         | 58/1000 [00:04<01:15, 12.50it/s]Upper bound on the fitting time:   6%|▌         | 60/1000 [00:04<01:15, 12.40it/s]Upper bound on the fitting time:   6%|▌         | 62/1000 [00:04<01:14, 12.61it/s]Upper bound on the fitting time:   6%|▋         | 64/1000 [00:04<01:13, 12.75it/s]Upper bound on the fitting time:   7%|▋         | 66/1000 [00:04<01:13, 12.72it/s]Upper bound on the fitting time:   7%|▋         | 68/1000 [00:04<01:13, 12.65it/s]Upper bound on the fitting time:   7%|▋         | 70/1000 [00:05<01:12, 12.87it/s]Upper bound on the fitting time:   7%|▋         | 72/1000 [00:05<01:12, 12.86it/s]Upper bound on the fitting time:   7%|▋         | 74/1000 [00:05<01:10, 13.05it/s]Upper bound on the fitting time:   8%|▊         | 76/1000 [00:05<01:10, 13.15it/s]Upper bound on the fitting time:   8%|▊         | 78/1000 [00:05<01:09, 13.30it/s]Upper bound on the fitting time:   8%|▊         | 80/1000 [00:05<01:07, 13.71it/s]Upper bound on the fitting time:   8%|▊         | 82/1000 [00:05<01:05, 14.08it/s]Upper bound on the fitting time:   8%|▊         | 84/1000 [00:06<01:04, 14.13it/s]Upper bound on the fitting time:   9%|▊         | 86/1000 [00:06<01:03, 14.36it/s]Upper bound on the fitting time:   9%|▉         | 88/1000 [00:06<01:02, 14.57it/s]Upper bound on the fitting time:   9%|▉         | 90/1000 [00:06<01:02, 14.54it/s]Upper bound on the fitting time:   9%|▉         | 92/1000 [00:06<01:03, 14.23it/s]Upper bound on the fitting time:   9%|▉         | 94/1000 [00:06<01:03, 14.34it/s]Upper bound on the fitting time:  10%|▉         | 96/1000 [00:06<01:02, 14.51it/s]Upper bound on the fitting time:  10%|▉         | 98/1000 [00:07<01:01, 14.68it/s]Upper bound on the fitting time:  10%|█         | 100/1000 [00:07<01:00, 14.86it/s]Upper bound on the fitting time:  10%|█         | 102/1000 [00:07<01:00, 14.85it/s]Upper bound on the fitting time:  10%|█         | 104/1000 [00:07<01:00, 14.78it/s]Upper bound on the fitting time:  11%|█         | 106/1000 [00:07<01:00, 14.78it/s]Upper bound on the fitting time:  11%|█         | 108/1000 [00:07<01:00, 14.69it/s]Upper bound on the fitting time:  11%|█         | 110/1000 [00:07<01:00, 14.75it/s]Upper bound on the fitting time:  11%|█         | 112/1000 [00:08<01:00, 14.77it/s]Upper bound on the fitting time:  11%|█▏        | 114/1000 [00:08<01:00, 14.62it/s]Upper bound on the fitting time:  12%|█▏        | 116/1000 [00:08<00:59, 14.74it/s]Upper bound on the fitting time:  12%|█▏        | 118/1000 [00:08<01:05, 13.45it/s]Upper bound on the fitting time:  12%|█▏        | 120/1000 [00:08<01:07, 13.10it/s]Upper bound on the fitting time:  12%|█▏        | 122/1000 [00:08<01:06, 13.11it/s]Upper bound on the fitting time:  12%|█▏        | 124/1000 [00:08<01:05, 13.31it/s]Upper bound on the fitting time:  13%|█▎        | 126/1000 [00:09<01:04, 13.51it/s]Upper bound on the fitting time:  13%|█▎        | 128/1000 [00:09<01:03, 13.79it/s]Upper bound on the fitting time:  13%|█▎        | 130/1000 [00:09<01:01, 14.14it/s]Upper bound on the fitting time:  13%|█▎        | 132/1000 [00:09<01:00, 14.38it/s]Upper bound on the fitting time:  13%|█▎        | 134/1000 [00:09<00:59, 14.60it/s]Upper bound on the fitting time:  14%|█▎        | 136/1000 [00:09<00:59, 14.55it/s]Upper bound on the fitting time:  14%|█▍        | 138/1000 [00:09<00:58, 14.66it/s]Upper bound on the fitting time:  14%|█▍        | 140/1000 [00:10<00:58, 14.73it/s]Upper bound on the fitting time:  14%|█▍        | 142/1000 [00:10<00:58, 14.66it/s]Upper bound on the fitting time:  14%|█▍        | 144/1000 [00:10<00:58, 14.59it/s]Upper bound on the fitting time:  15%|█▍        | 146/1000 [00:10<00:58, 14.68it/s]Upper bound on the fitting time:  15%|█▍        | 148/1000 [00:10<00:58, 14.52it/s]Upper bound on the fitting time:  15%|█▌        | 150/1000 [00:10<00:58, 14.57it/s]Upper bound on the fitting time:  15%|█▌        | 152/1000 [00:10<00:58, 14.46it/s]Upper bound on the fitting time:  15%|█▌        | 154/1000 [00:10<01:00, 14.08it/s]Upper bound on the fitting time:  16%|█▌        | 156/1000 [00:11<00:59, 14.21it/s]Upper bound on the fitting time:  16%|█▌        | 158/1000 [00:11<00:58, 14.35it/s]Upper bound on the fitting time:  16%|█▌        | 160/1000 [00:11<00:57, 14.61it/s]Upper bound on the fitting time:  16%|█▌        | 162/1000 [00:11<00:56, 14.72it/s]Upper bound on the fitting time:  16%|█▋        | 164/1000 [00:11<00:56, 14.79it/s]Upper bound on the fitting time:  17%|█▋        | 166/1000 [00:11<00:56, 14.76it/s]Upper bound on the fitting time:  17%|█▋        | 168/1000 [00:11<00:56, 14.61it/s]Upper bound on the fitting time:  17%|█▋        | 170/1000 [00:12<00:57, 14.32it/s]Upper bound on the fitting time:  17%|█▋        | 172/1000 [00:12<00:57, 14.52it/s]Upper bound on the fitting time:  17%|█▋        | 174/1000 [00:12<00:55, 14.76it/s]Upper bound on the fitting time:  18%|█▊        | 176/1000 [00:12<00:56, 14.69it/s]Upper bound on the fitting time:  18%|█▊        | 178/1000 [00:12<00:56, 14.60it/s]Upper bound on the fitting time:  18%|█▊        | 180/1000 [00:12<00:55, 14.65it/s]Upper bound on the fitting time:  18%|█▊        | 182/1000 [00:12<00:55, 14.66it/s]Upper bound on the fitting time:  18%|█▊        | 184/1000 [00:13<00:55, 14.71it/s]Upper bound on the fitting time:  19%|█▊        | 186/1000 [00:13<00:55, 14.79it/s]Upper bound on the fitting time:  19%|█▉        | 188/1000 [00:13<00:54, 14.82it/s]Upper bound on the fitting time:  19%|█▉        | 190/1000 [00:13<00:54, 14.84it/s]Upper bound on the fitting time:  19%|█▉        | 192/1000 [00:13<00:55, 14.69it/s]Upper bound on the fitting time:  19%|█▉        | 194/1000 [00:13<00:58, 13.82it/s]Upper bound on the fitting time:  20%|█▉        | 196/1000 [00:13<00:57, 13.88it/s]Upper bound on the fitting time:  20%|█▉        | 198/1000 [00:14<00:56, 14.20it/s]Upper bound on the fitting time:  20%|██        | 200/1000 [00:14<00:57, 14.02it/s]Upper bound on the fitting time:  20%|██        | 202/1000 [00:14<00:55, 14.28it/s]Upper bound on the fitting time:  20%|██        | 204/1000 [00:14<00:54, 14.51it/s]Upper bound on the fitting time:  21%|██        | 206/1000 [00:14<00:54, 14.47it/s]Upper bound on the fitting time:  21%|██        | 208/1000 [00:14<00:53, 14.71it/s]Upper bound on the fitting time:  21%|██        | 210/1000 [00:14<00:53, 14.82it/s]Upper bound on the fitting time:  21%|██        | 212/1000 [00:14<00:52, 14.96it/s]Upper bound on the fitting time:  21%|██▏       | 214/1000 [00:15<00:52, 14.89it/s]Upper bound on the fitting time:  22%|██▏       | 216/1000 [00:15<00:52, 14.92it/s]Upper bound on the fitting time:  22%|██▏       | 218/1000 [00:15<00:53, 14.71it/s]Upper bound on the fitting time:  22%|██▏       | 220/1000 [00:15<00:52, 14.90it/s]Upper bound on the fitting time:  22%|██▏       | 222/1000 [00:15<00:52, 14.83it/s]Upper bound on the fitting time:  22%|██▏       | 224/1000 [00:15<00:51, 14.96it/s]Upper bound on the fitting time:  23%|██▎       | 226/1000 [00:15<00:51, 15.06it/s]Upper bound on the fitting time:  23%|██▎       | 228/1000 [00:16<00:52, 14.74it/s]Upper bound on the fitting time:  23%|██▎       | 230/1000 [00:16<00:52, 14.74it/s]Upper bound on the fitting time:  23%|██▎       | 232/1000 [00:16<00:51, 14.85it/s]Upper bound on the fitting time:  23%|██▎       | 234/1000 [00:16<00:51, 14.98it/s]Upper bound on the fitting time:  24%|██▎       | 236/1000 [00:16<00:51, 14.93it/s]Upper bound on the fitting time:  24%|██▍       | 238/1000 [00:16<00:51, 14.88it/s]Upper bound on the fitting time:  24%|██▍       | 240/1000 [00:16<00:51, 14.89it/s]Upper bound on the fitting time:  24%|██▍       | 242/1000 [00:16<00:50, 14.89it/s]Upper bound on the fitting time:  24%|██▍       | 244/1000 [00:17<00:50, 14.85it/s]Upper bound on the fitting time:  25%|██▍       | 246/1000 [00:17<00:50, 14.81it/s]Upper bound on the fitting time:  25%|██▍       | 248/1000 [00:17<00:50, 14.95it/s]Upper bound on the fitting time:  25%|██▌       | 250/1000 [00:17<00:51, 14.67it/s]Upper bound on the fitting time:  25%|██▌       | 252/1000 [00:17<00:50, 14.73it/s]Upper bound on the fitting time:  25%|██▌       | 254/1000 [00:17<00:50, 14.78it/s]Upper bound on the fitting time:  26%|██▌       | 256/1000 [00:17<00:49, 14.94it/s]Upper bound on the fitting time:  26%|██▌       | 258/1000 [00:18<00:49, 15.09it/s]Upper bound on the fitting time:  26%|██▌       | 260/1000 [00:18<00:48, 15.11it/s]Upper bound on the fitting time:  26%|██▌       | 262/1000 [00:18<00:48, 15.12it/s]Upper bound on the fitting time:  26%|██▋       | 264/1000 [00:18<00:49, 14.89it/s]Upper bound on the fitting time:  27%|██▋       | 266/1000 [00:18<00:49, 14.87it/s]Upper bound on the fitting time:  27%|██▋       | 268/1000 [00:18<00:49, 14.85it/s]Upper bound on the fitting time:  27%|██▋       | 270/1000 [00:18<00:49, 14.73it/s]Upper bound on the fitting time:  27%|██▋       | 272/1000 [00:19<00:49, 14.64it/s]Upper bound on the fitting time:  27%|██▋       | 274/1000 [00:19<00:49, 14.72it/s]Upper bound on the fitting time:  28%|██▊       | 276/1000 [00:19<00:49, 14.69it/s]Upper bound on the fitting time:  28%|██▊       | 278/1000 [00:19<00:48, 14.75it/s]Upper bound on the fitting time:  28%|██▊       | 280/1000 [00:19<00:48, 14.74it/s]Upper bound on the fitting time:  28%|██▊       | 282/1000 [00:19<00:48, 14.67it/s]Upper bound on the fitting time:  28%|██▊       | 284/1000 [00:19<00:48, 14.64it/s]Upper bound on the fitting time:  29%|██▊       | 286/1000 [00:19<00:48, 14.75it/s]Upper bound on the fitting time:  29%|██▉       | 288/1000 [00:20<00:48, 14.76it/s]Upper bound on the fitting time:  29%|██▉       | 290/1000 [00:20<00:47, 14.81it/s]Upper bound on the fitting time:  29%|██▉       | 292/1000 [00:20<00:47, 14.91it/s]Upper bound on the fitting time:  29%|██▉       | 294/1000 [00:20<00:47, 14.90it/s]Upper bound on the fitting time:  30%|██▉       | 296/1000 [00:20<00:46, 15.01it/s]Upper bound on the fitting time:  30%|██▉       | 298/1000 [00:20<00:46, 14.94it/s]Upper bound on the fitting time:  30%|███       | 300/1000 [00:20<00:46, 14.89it/s]Upper bound on the fitting time:  30%|███       | 302/1000 [00:21<00:46, 14.87it/s]Upper bound on the fitting time:  30%|███       | 304/1000 [00:21<00:46, 14.86it/s]Upper bound on the fitting time:  31%|███       | 306/1000 [00:21<00:46, 14.81it/s]Upper bound on the fitting time:  31%|███       | 308/1000 [00:21<00:46, 14.75it/s]Upper bound on the fitting time:  31%|███       | 310/1000 [00:21<00:46, 14.85it/s]Upper bound on the fitting time:  31%|███       | 312/1000 [00:21<00:46, 14.89it/s]Upper bound on the fitting time:  31%|███▏      | 314/1000 [00:21<00:46, 14.85it/s]Upper bound on the fitting time:  32%|███▏      | 316/1000 [00:21<00:45, 14.91it/s]Upper bound on the fitting time:  32%|███▏      | 318/1000 [00:22<00:45, 14.95it/s]Upper bound on the fitting time:  32%|███▏      | 320/1000 [00:22<00:45, 14.94it/s]Upper bound on the fitting time:  32%|███▏      | 322/1000 [00:22<00:45, 15.01it/s]Upper bound on the fitting time:  32%|███▏      | 324/1000 [00:22<00:46, 14.44it/s]Upper bound on the fitting time:  33%|███▎      | 326/1000 [00:22<00:49, 13.67it/s]Upper bound on the fitting time:  33%|███▎      | 328/1000 [00:22<00:47, 14.04it/s]Upper bound on the fitting time:  33%|███▎      | 330/1000 [00:22<00:46, 14.30it/s]Upper bound on the fitting time:  33%|███▎      | 332/1000 [00:23<00:46, 14.41it/s]Upper bound on the fitting time:  33%|███▎      | 334/1000 [00:23<00:47, 14.09it/s]Upper bound on the fitting time:  34%|███▎      | 336/1000 [00:23<00:45, 14.45it/s]Upper bound on the fitting time:  34%|███▍      | 338/1000 [00:23<00:45, 14.45it/s]Upper bound on the fitting time:  34%|███▍      | 340/1000 [00:23<00:47, 13.86it/s]Upper bound on the fitting time:  34%|███▍      | 342/1000 [00:23<00:46, 14.21it/s]Upper bound on the fitting time:  34%|███▍      | 344/1000 [00:23<00:45, 14.36it/s]Upper bound on the fitting time:  35%|███▍      | 346/1000 [00:24<00:45, 14.43it/s]Upper bound on the fitting time:  35%|███▍      | 348/1000 [00:24<00:44, 14.54it/s]Upper bound on the fitting time:  35%|███▌      | 350/1000 [00:24<00:44, 14.59it/s]Upper bound on the fitting time:  35%|███▌      | 352/1000 [00:24<00:44, 14.55it/s]Upper bound on the fitting time:  35%|███▌      | 354/1000 [00:24<00:44, 14.64it/s]Upper bound on the fitting time:  36%|███▌      | 356/1000 [00:24<00:43, 14.67it/s]Upper bound on the fitting time:  36%|███▌      | 358/1000 [00:24<00:43, 14.74it/s]Upper bound on the fitting time:  36%|███▌      | 360/1000 [00:25<00:43, 14.86it/s]Upper bound on the fitting time:  36%|███▌      | 362/1000 [00:25<00:42, 14.89it/s]Upper bound on the fitting time:  36%|███▋      | 364/1000 [00:25<00:42, 14.85it/s]Upper bound on the fitting time:  37%|███▋      | 366/1000 [00:25<00:43, 14.58it/s]Upper bound on the fitting time:  37%|███▋      | 368/1000 [00:25<00:43, 14.59it/s]Upper bound on the fitting time:  37%|███▋      | 370/1000 [00:25<00:42, 14.73it/s]Upper bound on the fitting time:  37%|███▋      | 372/1000 [00:25<00:42, 14.71it/s]Upper bound on the fitting time:  37%|███▋      | 374/1000 [00:25<00:42, 14.66it/s]Upper bound on the fitting time:  38%|███▊      | 376/1000 [00:26<00:43, 14.48it/s]Upper bound on the fitting time:  38%|███▊      | 378/1000 [00:26<00:42, 14.55it/s]Upper bound on the fitting time:  38%|███▊      | 380/1000 [00:26<00:42, 14.62it/s]Upper bound on the fitting time:  38%|███▊      | 382/1000 [00:26<00:42, 14.67it/s]Upper bound on the fitting time:  38%|███▊      | 384/1000 [00:26<00:43, 14.14it/s]Upper bound on the fitting time:  39%|███▊      | 386/1000 [00:26<00:44, 13.79it/s]Upper bound on the fitting time:  39%|███▉      | 388/1000 [00:26<00:43, 14.15it/s]Upper bound on the fitting time:  39%|███▉      | 390/1000 [00:27<00:42, 14.43it/s]Upper bound on the fitting time:  39%|███▉      | 392/1000 [00:27<00:41, 14.56it/s]Upper bound on the fitting time:  39%|███▉      | 394/1000 [00:27<00:41, 14.67it/s]Upper bound on the fitting time:  40%|███▉      | 396/1000 [00:27<00:41, 14.71it/s]Upper bound on the fitting time:  40%|███▉      | 398/1000 [00:27<00:40, 14.75it/s]Upper bound on the fitting time:  40%|████      | 400/1000 [00:27<00:40, 14.84it/s]Upper bound on the fitting time:  40%|████      | 402/1000 [00:27<00:40, 14.76it/s]Upper bound on the fitting time:  40%|████      | 404/1000 [00:28<00:40, 14.70it/s]Upper bound on the fitting time:  41%|████      | 406/1000 [00:28<00:40, 14.80it/s]Upper bound on the fitting time:  41%|████      | 408/1000 [00:28<00:39, 14.90it/s]Upper bound on the fitting time:  41%|████      | 410/1000 [00:28<00:39, 14.98it/s]Upper bound on the fitting time:  41%|████      | 412/1000 [00:28<00:40, 14.50it/s]Upper bound on the fitting time:  41%|████▏     | 414/1000 [00:28<00:41, 14.08it/s]Upper bound on the fitting time:  42%|████▏     | 416/1000 [00:28<00:42, 13.85it/s]Upper bound on the fitting time:  42%|████▏     | 418/1000 [00:29<00:42, 13.71it/s]Upper bound on the fitting time:  42%|████▏     | 420/1000 [00:29<00:42, 13.49it/s]Upper bound on the fitting time:  42%|████▏     | 422/1000 [00:29<00:43, 13.41it/s]Upper bound on the fitting time:  42%|████▏     | 424/1000 [00:29<00:43, 13.36it/s]Upper bound on the fitting time:  43%|████▎     | 426/1000 [00:29<00:41, 13.81it/s]Upper bound on the fitting time:  43%|████▎     | 428/1000 [00:29<00:40, 14.03it/s]Upper bound on the fitting time:  43%|████▎     | 430/1000 [00:29<00:39, 14.32it/s]Upper bound on the fitting time:  43%|████▎     | 432/1000 [00:30<00:39, 14.52it/s]Upper bound on the fitting time:  43%|████▎     | 434/1000 [00:30<00:39, 14.37it/s]Upper bound on the fitting time:  44%|████▎     | 436/1000 [00:30<00:39, 14.14it/s]Upper bound on the fitting time:  44%|████▍     | 438/1000 [00:30<00:41, 13.60it/s]Upper bound on the fitting time:  44%|████▍     | 440/1000 [00:30<00:40, 13.97it/s]Upper bound on the fitting time:  44%|████▍     | 442/1000 [00:30<00:39, 14.02it/s]Upper bound on the fitting time:  44%|████▍     | 444/1000 [00:30<00:40, 13.69it/s]Upper bound on the fitting time:  45%|████▍     | 446/1000 [00:31<00:40, 13.71it/s]Upper bound on the fitting time:  45%|████▍     | 448/1000 [00:31<00:39, 14.11it/s]Upper bound on the fitting time:  45%|████▌     | 450/1000 [00:31<00:38, 14.35it/s]Upper bound on the fitting time:  45%|████▌     | 452/1000 [00:31<00:38, 14.06it/s]Upper bound on the fitting time:  45%|████▌     | 454/1000 [00:31<00:39, 13.96it/s]Upper bound on the fitting time:  46%|████▌     | 456/1000 [00:31<00:38, 14.26it/s]Upper bound on the fitting time:  46%|████▌     | 458/1000 [00:31<00:37, 14.46it/s]Upper bound on the fitting time:  46%|████▌     | 460/1000 [00:32<00:37, 14.38it/s]Upper bound on the fitting time:  46%|████▌     | 462/1000 [00:32<00:37, 14.40it/s]Upper bound on the fitting time:  46%|████▋     | 464/1000 [00:32<00:36, 14.57it/s]Upper bound on the fitting time:  47%|████▋     | 466/1000 [00:32<00:36, 14.70it/s]Upper bound on the fitting time:  47%|████▋     | 468/1000 [00:32<00:36, 14.77it/s]Upper bound on the fitting time:  47%|████▋     | 470/1000 [00:32<00:35, 14.87it/s]Upper bound on the fitting time:  47%|████▋     | 472/1000 [00:32<00:36, 14.55it/s]Upper bound on the fitting time:  47%|████▋     | 474/1000 [00:32<00:35, 14.73it/s]Upper bound on the fitting time:  48%|████▊     | 476/1000 [00:33<00:35, 14.72it/s]Upper bound on the fitting time:  48%|████▊     | 478/1000 [00:33<00:35, 14.77it/s]Upper bound on the fitting time:  48%|████▊     | 480/1000 [00:33<00:35, 14.45it/s]Upper bound on the fitting time:  48%|████▊     | 482/1000 [00:33<00:36, 14.12it/s]Upper bound on the fitting time:  48%|████▊     | 484/1000 [00:33<00:35, 14.51it/s]Upper bound on the fitting time:  49%|████▊     | 486/1000 [00:33<00:35, 14.45it/s]Upper bound on the fitting time:  49%|████▉     | 488/1000 [00:33<00:35, 14.63it/s]Upper bound on the fitting time:  49%|████▉     | 490/1000 [00:34<00:35, 14.34it/s]Upper bound on the fitting time:  49%|████▉     | 492/1000 [00:34<00:35, 14.45it/s]Upper bound on the fitting time:  49%|████▉     | 494/1000 [00:34<00:34, 14.58it/s]Upper bound on the fitting time:  50%|████▉     | 496/1000 [00:34<00:34, 14.76it/s]Upper bound on the fitting time:  50%|████▉     | 498/1000 [00:34<00:34, 14.38it/s]Upper bound on the fitting time:  50%|█████     | 500/1000 [00:34<00:34, 14.64it/s]Upper bound on the fitting time:  50%|█████     | 502/1000 [00:34<00:33, 14.81it/s]Upper bound on the fitting time:  50%|█████     | 504/1000 [00:35<00:33, 14.85it/s]Upper bound on the fitting time:  51%|█████     | 506/1000 [00:35<00:33, 14.90it/s]Upper bound on the fitting time:  51%|█████     | 508/1000 [00:35<00:32, 15.01it/s]Upper bound on the fitting time:  51%|█████     | 510/1000 [00:35<00:32, 14.99it/s]Upper bound on the fitting time:  51%|█████     | 512/1000 [00:35<00:32, 15.10it/s]Upper bound on the fitting time:  51%|█████▏    | 514/1000 [00:35<00:32, 15.11it/s]Upper bound on the fitting time:  52%|█████▏    | 516/1000 [00:35<00:31, 15.13it/s]Upper bound on the fitting time:  52%|█████▏    | 518/1000 [00:35<00:31, 15.07it/s]Upper bound on the fitting time:  52%|█████▏    | 520/1000 [00:36<00:32, 14.96it/s]Upper bound on the fitting time:  52%|█████▏    | 522/1000 [00:36<00:31, 15.04it/s]Upper bound on the fitting time:  52%|█████▏    | 524/1000 [00:36<00:31, 14.89it/s]Upper bound on the fitting time:  53%|█████▎    | 526/1000 [00:36<00:32, 14.73it/s]Upper bound on the fitting time:  53%|█████▎    | 528/1000 [00:36<00:32, 14.48it/s]Upper bound on the fitting time:  53%|█████▎    | 530/1000 [00:36<00:32, 14.45it/s]Upper bound on the fitting time:  53%|█████▎    | 532/1000 [00:36<00:31, 14.66it/s]Upper bound on the fitting time:  53%|█████▎    | 534/1000 [00:37<00:31, 14.70it/s]Upper bound on the fitting time:  54%|█████▎    | 536/1000 [00:37<00:31, 14.87it/s]Upper bound on the fitting time:  54%|█████▍    | 538/1000 [00:37<00:31, 14.75it/s]Upper bound on the fitting time:  54%|█████▍    | 540/1000 [00:37<00:30, 14.86it/s]Upper bound on the fitting time:  54%|█████▍    | 542/1000 [00:37<00:30, 14.85it/s]Upper bound on the fitting time:  54%|█████▍    | 544/1000 [00:37<00:30, 14.90it/s]Upper bound on the fitting time:  55%|█████▍    | 546/1000 [00:37<00:30, 14.82it/s]Upper bound on the fitting time:  55%|█████▍    | 548/1000 [00:37<00:30, 14.89it/s]Upper bound on the fitting time:  55%|█████▌    | 550/1000 [00:38<00:30, 14.84it/s]Upper bound on the fitting time:  55%|█████▌    | 552/1000 [00:38<00:30, 14.82it/s]Upper bound on the fitting time:  55%|█████▌    | 554/1000 [00:38<00:29, 14.91it/s]Upper bound on the fitting time:  56%|█████▌    | 556/1000 [00:38<00:29, 14.94it/s]Upper bound on the fitting time:  56%|█████▌    | 558/1000 [00:38<00:29, 14.92it/s]Upper bound on the fitting time:  56%|█████▌    | 560/1000 [00:38<00:29, 14.92it/s]Upper bound on the fitting time:  56%|█████▌    | 562/1000 [00:38<00:29, 15.10it/s]Upper bound on the fitting time:  56%|█████▋    | 564/1000 [00:39<00:28, 15.09it/s]Upper bound on the fitting time:  57%|█████▋    | 566/1000 [00:39<00:28, 15.16it/s]Upper bound on the fitting time:  57%|█████▋    | 568/1000 [00:39<00:28, 14.97it/s]Upper bound on the fitting time:  57%|█████▋    | 570/1000 [00:39<00:28, 14.83it/s]Upper bound on the fitting time:  57%|█████▋    | 572/1000 [00:39<00:28, 14.94it/s]Upper bound on the fitting time:  57%|█████▋    | 574/1000 [00:39<00:28, 14.94it/s]Upper bound on the fitting time:  58%|█████▊    | 576/1000 [00:39<00:28, 14.91it/s]Upper bound on the fitting time:  58%|█████▊    | 578/1000 [00:39<00:28, 15.00it/s]Upper bound on the fitting time:  58%|█████▊    | 580/1000 [00:40<00:28, 14.79it/s]Upper bound on the fitting time:  58%|█████▊    | 582/1000 [00:40<00:28, 14.91it/s]Upper bound on the fitting time:  58%|█████▊    | 584/1000 [00:40<00:28, 14.55it/s]Upper bound on the fitting time:  59%|█████▊    | 586/1000 [00:40<00:28, 14.36it/s]Upper bound on the fitting time:  59%|█████▉    | 588/1000 [00:40<00:28, 14.57it/s]Upper bound on the fitting time:  59%|█████▉    | 590/1000 [00:40<00:27, 14.64it/s]Upper bound on the fitting time:  59%|█████▉    | 592/1000 [00:40<00:28, 14.47it/s]Upper bound on the fitting time:  59%|█████▉    | 594/1000 [00:41<00:27, 14.59it/s]Upper bound on the fitting time:  60%|█████▉    | 596/1000 [00:41<00:27, 14.65it/s]Upper bound on the fitting time:  60%|█████▉    | 598/1000 [00:41<00:27, 14.67it/s]Upper bound on the fitting time:  60%|██████    | 600/1000 [00:41<00:27, 14.71it/s]Upper bound on the fitting time:  60%|██████    | 602/1000 [00:41<00:27, 14.61it/s]Upper bound on the fitting time:  60%|██████    | 604/1000 [00:41<00:26, 14.67it/s]Upper bound on the fitting time:  61%|██████    | 606/1000 [00:41<00:26, 14.71it/s]Upper bound on the fitting time:  61%|██████    | 608/1000 [00:42<00:27, 14.51it/s]Upper bound on the fitting time:  61%|██████    | 610/1000 [00:42<00:26, 14.65it/s]Upper bound on the fitting time:  61%|██████    | 612/1000 [00:42<00:26, 14.75it/s]Upper bound on the fitting time:  61%|██████▏   | 614/1000 [00:42<00:26, 14.82it/s]Upper bound on the fitting time:  62%|██████▏   | 616/1000 [00:42<00:25, 14.92it/s]Upper bound on the fitting time:  62%|██████▏   | 618/1000 [00:42<00:25, 14.90it/s]Upper bound on the fitting time:  62%|██████▏   | 620/1000 [00:42<00:25, 14.80it/s]Upper bound on the fitting time:  62%|██████▏   | 622/1000 [00:42<00:25, 14.78it/s]Upper bound on the fitting time:  62%|██████▏   | 624/1000 [00:43<00:25, 14.82it/s]Upper bound on the fitting time:  63%|██████▎   | 626/1000 [00:43<00:25, 14.87it/s]Upper bound on the fitting time:  63%|██████▎   | 628/1000 [00:43<00:24, 14.97it/s]Upper bound on the fitting time:  63%|██████▎   | 630/1000 [00:43<00:24, 15.05it/s]Upper bound on the fitting time:  63%|██████▎   | 632/1000 [00:43<00:25, 14.52it/s]Upper bound on the fitting time:  63%|██████▎   | 634/1000 [00:43<00:24, 14.71it/s]Upper bound on the fitting time:  64%|██████▎   | 636/1000 [00:43<00:24, 14.85it/s]Upper bound on the fitting time:  64%|██████▍   | 638/1000 [00:44<00:24, 14.65it/s]Upper bound on the fitting time:  64%|██████▍   | 640/1000 [00:44<00:24, 14.75it/s]Upper bound on the fitting time:  64%|██████▍   | 642/1000 [00:44<00:24, 14.82it/s]Upper bound on the fitting time:  64%|██████▍   | 644/1000 [00:44<00:23, 14.95it/s]Upper bound on the fitting time:  65%|██████▍   | 646/1000 [00:44<00:23, 14.99it/s]Upper bound on the fitting time:  65%|██████▍   | 648/1000 [00:44<00:23, 14.90it/s]Upper bound on the fitting time:  65%|██████▌   | 650/1000 [00:44<00:23, 14.94it/s]Upper bound on the fitting time:  65%|██████▌   | 652/1000 [00:45<00:23, 14.86it/s]Upper bound on the fitting time:  65%|██████▌   | 654/1000 [00:45<00:24, 14.06it/s]Upper bound on the fitting time:  66%|██████▌   | 656/1000 [00:45<00:23, 14.42it/s]Upper bound on the fitting time:  66%|██████▌   | 658/1000 [00:45<00:23, 14.58it/s]Upper bound on the fitting time:  66%|██████▌   | 660/1000 [00:45<00:23, 14.65it/s]Upper bound on the fitting time:  66%|██████▌   | 662/1000 [00:45<00:22, 14.74it/s]Upper bound on the fitting time:  66%|██████▋   | 664/1000 [00:45<00:22, 14.91it/s]Upper bound on the fitting time:  67%|██████▋   | 666/1000 [00:45<00:22, 14.65it/s]Upper bound on the fitting time:  67%|██████▋   | 668/1000 [00:46<00:22, 14.46it/s]Upper bound on the fitting time:  67%|██████▋   | 670/1000 [00:46<00:22, 14.64it/s]Upper bound on the fitting time:  67%|██████▋   | 672/1000 [00:46<00:22, 14.60it/s]Upper bound on the fitting time:  67%|██████▋   | 674/1000 [00:46<00:22, 14.77it/s]Upper bound on the fitting time:  68%|██████▊   | 676/1000 [00:46<00:21, 14.93it/s]Upper bound on the fitting time:  68%|██████▊   | 678/1000 [00:46<00:21, 15.04it/s]Upper bound on the fitting time:  68%|██████▊   | 680/1000 [00:46<00:21, 15.07it/s]Upper bound on the fitting time:  68%|██████▊   | 682/1000 [00:47<00:21, 14.67it/s]Upper bound on the fitting time:  68%|██████▊   | 684/1000 [00:47<00:22, 14.19it/s]Upper bound on the fitting time:  69%|██████▊   | 686/1000 [00:47<00:23, 13.45it/s]Upper bound on the fitting time:  69%|██████▉   | 688/1000 [00:47<00:22, 13.98it/s]Upper bound on the fitting time:  69%|██████▉   | 690/1000 [00:47<00:21, 14.31it/s]Upper bound on the fitting time:  69%|██████▉   | 692/1000 [00:47<00:21, 14.49it/s]Upper bound on the fitting time:  69%|██████▉   | 694/1000 [00:47<00:20, 14.59it/s]Upper bound on the fitting time:  70%|██████▉   | 696/1000 [00:48<00:20, 14.53it/s]Upper bound on the fitting time:  70%|██████▉   | 698/1000 [00:48<00:20, 14.63it/s]Upper bound on the fitting time:  70%|███████   | 700/1000 [00:48<00:20, 14.83it/s]Upper bound on the fitting time:  70%|███████   | 702/1000 [00:48<00:20, 14.88it/s]Upper bound on the fitting time:  70%|███████   | 704/1000 [00:48<00:19, 14.87it/s]Upper bound on the fitting time:  71%|███████   | 706/1000 [00:48<00:19, 14.89it/s]Upper bound on the fitting time:  71%|███████   | 708/1000 [00:48<00:19, 14.90it/s]Upper bound on the fitting time:  71%|███████   | 710/1000 [00:48<00:19, 14.84it/s]Upper bound on the fitting time:  71%|███████   | 712/1000 [00:49<00:19, 14.89it/s]Upper bound on the fitting time:  71%|███████▏  | 714/1000 [00:49<00:19, 14.91it/s]Upper bound on the fitting time:  72%|███████▏  | 716/1000 [00:49<00:18, 15.04it/s]Upper bound on the fitting time:  72%|███████▏  | 718/1000 [00:49<00:18, 15.05it/s]Upper bound on the fitting time:  72%|███████▏  | 720/1000 [00:49<00:18, 15.05it/s]Upper bound on the fitting time:  72%|███████▏  | 722/1000 [00:49<00:18, 15.01it/s]Upper bound on the fitting time:  72%|███████▏  | 724/1000 [00:49<00:18, 15.02it/s]Upper bound on the fitting time:  73%|███████▎  | 726/1000 [00:50<00:18, 14.67it/s]Upper bound on the fitting time:  73%|███████▎  | 728/1000 [00:50<00:18, 14.85it/s]Upper bound on the fitting time:  73%|███████▎  | 730/1000 [00:50<00:18, 14.99it/s]Upper bound on the fitting time:  73%|███████▎  | 732/1000 [00:50<00:17, 15.05it/s]Upper bound on the fitting time:  73%|███████▎  | 734/1000 [00:50<00:18, 14.60it/s]Upper bound on the fitting time:  74%|███████▎  | 736/1000 [00:50<00:18, 14.46it/s]Upper bound on the fitting time:  74%|███████▍  | 738/1000 [00:50<00:17, 14.80it/s]Upper bound on the fitting time:  74%|███████▍  | 740/1000 [00:50<00:17, 15.00it/s]Upper bound on the fitting time:  74%|███████▍  | 742/1000 [00:51<00:17, 15.07it/s]Upper bound on the fitting time:  74%|███████▍  | 744/1000 [00:51<00:16, 15.15it/s]Upper bound on the fitting time:  75%|███████▍  | 746/1000 [00:51<00:16, 15.20it/s]Upper bound on the fitting time:  75%|███████▍  | 748/1000 [00:51<00:16, 15.35it/s]Upper bound on the fitting time:  75%|███████▌  | 750/1000 [00:51<00:17, 14.20it/s]Upper bound on the fitting time:  75%|███████▌  | 752/1000 [00:51<00:17, 13.98it/s]Upper bound on the fitting time:  75%|███████▌  | 754/1000 [00:51<00:17, 14.19it/s]Upper bound on the fitting time:  76%|███████▌  | 756/1000 [00:52<00:16, 14.39it/s]Upper bound on the fitting time:  76%|███████▌  | 758/1000 [00:52<00:16, 14.42it/s]Upper bound on the fitting time:  76%|███████▌  | 760/1000 [00:52<00:16, 14.65it/s]Upper bound on the fitting time:  76%|███████▌  | 762/1000 [00:52<00:16, 14.49it/s]Upper bound on the fitting time:  76%|███████▋  | 764/1000 [00:52<00:17, 13.26it/s]Upper bound on the fitting time:  77%|███████▋  | 766/1000 [00:52<00:17, 13.25it/s]Upper bound on the fitting time:  77%|███████▋  | 768/1000 [00:53<00:18, 12.64it/s]Upper bound on the fitting time:  77%|███████▋  | 770/1000 [00:53<00:17, 12.80it/s]Upper bound on the fitting time:  77%|███████▋  | 772/1000 [00:53<00:18, 12.24it/s]Upper bound on the fitting time:  77%|███████▋  | 774/1000 [00:53<00:19, 11.83it/s]Upper bound on the fitting time:  78%|███████▊  | 776/1000 [00:53<00:18, 12.04it/s]Upper bound on the fitting time:  78%|███████▊  | 778/1000 [00:53<00:17, 12.36it/s]Upper bound on the fitting time:  78%|███████▊  | 780/1000 [00:53<00:17, 12.59it/s]Upper bound on the fitting time:  78%|███████▊  | 782/1000 [00:54<00:17, 12.66it/s]Upper bound on the fitting time:  78%|███████▊  | 784/1000 [00:54<00:16, 12.84it/s]Upper bound on the fitting time:  79%|███████▊  | 786/1000 [00:54<00:16, 13.04it/s]Upper bound on the fitting time:  79%|███████▉  | 788/1000 [00:54<00:16, 13.10it/s]Upper bound on the fitting time:  79%|███████▉  | 790/1000 [00:54<00:16, 13.02it/s]Upper bound on the fitting time:  79%|███████▉  | 792/1000 [00:54<00:15, 13.01it/s]Upper bound on the fitting time:  79%|███████▉  | 794/1000 [00:55<00:16, 12.87it/s]Upper bound on the fitting time:  80%|███████▉  | 796/1000 [00:55<00:16, 12.60it/s]Upper bound on the fitting time:  80%|███████▉  | 798/1000 [00:55<00:16, 12.50it/s]Upper bound on the fitting time:  80%|████████  | 800/1000 [00:55<00:16, 12.35it/s]Upper bound on the fitting time:  80%|████████  | 802/1000 [00:55<00:16, 12.34it/s]Upper bound on the fitting time:  80%|████████  | 804/1000 [00:55<00:15, 12.36it/s]Upper bound on the fitting time:  81%|████████  | 806/1000 [00:56<00:15, 12.22it/s]Upper bound on the fitting time:  81%|████████  | 808/1000 [00:56<00:15, 12.37it/s]Upper bound on the fitting time:  81%|████████  | 810/1000 [00:56<00:15, 12.46it/s]Upper bound on the fitting time:  81%|████████  | 812/1000 [00:56<00:15, 12.46it/s]Upper bound on the fitting time:  81%|████████▏ | 814/1000 [00:56<00:15, 12.34it/s]Upper bound on the fitting time:  82%|████████▏ | 816/1000 [00:56<00:15, 12.20it/s]Upper bound on the fitting time:  82%|████████▏ | 818/1000 [00:57<00:14, 12.14it/s]Upper bound on the fitting time:  82%|████████▏ | 820/1000 [00:57<00:14, 12.40it/s]Upper bound on the fitting time:  82%|████████▏ | 822/1000 [00:57<00:14, 12.38it/s]Upper bound on the fitting time:  82%|████████▏ | 824/1000 [00:57<00:14, 12.34it/s]Upper bound on the fitting time:  83%|████████▎ | 826/1000 [00:57<00:14, 12.28it/s]Upper bound on the fitting time:  83%|████████▎ | 828/1000 [00:57<00:13, 12.31it/s]Upper bound on the fitting time:  83%|████████▎ | 830/1000 [00:58<00:13, 12.17it/s]Upper bound on the fitting time:  83%|████████▎ | 832/1000 [00:58<00:13, 12.11it/s]Upper bound on the fitting time:  83%|████████▎ | 834/1000 [00:58<00:13, 12.27it/s]Upper bound on the fitting time:  84%|████████▎ | 836/1000 [00:58<00:13, 12.39it/s]Upper bound on the fitting time:  84%|████████▍ | 838/1000 [00:58<00:13, 12.29it/s]Upper bound on the fitting time:  84%|████████▍ | 840/1000 [00:58<00:13, 12.15it/s]Upper bound on the fitting time:  84%|████████▍ | 842/1000 [00:58<00:13, 12.08it/s]Upper bound on the fitting time:  84%|████████▍ | 844/1000 [00:59<00:12, 12.11it/s]Upper bound on the fitting time:  85%|████████▍ | 846/1000 [00:59<00:12, 12.17it/s]Upper bound on the fitting time:  85%|████████▍ | 848/1000 [00:59<00:12, 12.16it/s]Upper bound on the fitting time:  85%|████████▌ | 850/1000 [00:59<00:12, 12.23it/s]Upper bound on the fitting time:  85%|████████▌ | 852/1000 [00:59<00:12, 12.19it/s]Upper bound on the fitting time:  85%|████████▌ | 854/1000 [00:59<00:12, 11.97it/s]Upper bound on the fitting time:  86%|████████▌ | 856/1000 [01:00<00:12, 11.78it/s]Upper bound on the fitting time:  86%|████████▌ | 858/1000 [01:00<00:11, 12.04it/s]Upper bound on the fitting time:  86%|████████▌ | 860/1000 [01:00<00:11, 12.31it/s]Upper bound on the fitting time:  86%|████████▌ | 862/1000 [01:00<00:11, 12.30it/s]Upper bound on the fitting time:  86%|████████▋ | 864/1000 [01:00<00:10, 12.37it/s]Upper bound on the fitting time:  87%|████████▋ | 866/1000 [01:00<00:10, 12.22it/s]Upper bound on the fitting time:  87%|████████▋ | 868/1000 [01:01<00:10, 12.34it/s]Upper bound on the fitting time:  87%|████████▋ | 870/1000 [01:01<00:10, 12.45it/s]Upper bound on the fitting time:  87%|████████▋ | 872/1000 [01:01<00:10, 12.51it/s]Upper bound on the fitting time:  87%|████████▋ | 874/1000 [01:01<00:10, 12.36it/s]Upper bound on the fitting time:  88%|████████▊ | 876/1000 [01:01<00:09, 12.41it/s]Upper bound on the fitting time:  88%|████████▊ | 878/1000 [01:01<00:09, 12.28it/s]Upper bound on the fitting time:  88%|████████▊ | 880/1000 [01:02<00:10, 11.26it/s]Upper bound on the fitting time:  88%|████████▊ | 882/1000 [01:02<00:10, 10.78it/s]Upper bound on the fitting time:  88%|████████▊ | 884/1000 [01:02<00:10, 10.75it/s]Upper bound on the fitting time:  89%|████████▊ | 886/1000 [01:02<00:10, 10.80it/s]Upper bound on the fitting time:  89%|████████▉ | 888/1000 [01:02<00:10, 11.09it/s]Upper bound on the fitting time:  89%|████████▉ | 890/1000 [01:03<00:09, 11.39it/s]Upper bound on the fitting time:  89%|████████▉ | 892/1000 [01:03<00:09, 11.60it/s]Upper bound on the fitting time:  89%|████████▉ | 894/1000 [01:03<00:08, 12.00it/s]Upper bound on the fitting time:  90%|████████▉ | 896/1000 [01:03<00:08, 12.32it/s]Upper bound on the fitting time:  90%|████████▉ | 898/1000 [01:03<00:08, 12.47it/s]Upper bound on the fitting time:  90%|█████████ | 900/1000 [01:03<00:07, 12.68it/s]Upper bound on the fitting time:  90%|█████████ | 902/1000 [01:03<00:07, 12.83it/s]Upper bound on the fitting time:  90%|█████████ | 904/1000 [01:04<00:07, 12.58it/s]Upper bound on the fitting time:  91%|█████████ | 906/1000 [01:04<00:07, 12.58it/s]Upper bound on the fitting time:  91%|█████████ | 908/1000 [01:04<00:07, 12.70it/s]Upper bound on the fitting time:  91%|█████████ | 910/1000 [01:04<00:07, 12.80it/s]Upper bound on the fitting time:  91%|█████████ | 912/1000 [01:04<00:06, 12.59it/s]Upper bound on the fitting time:  91%|█████████▏| 914/1000 [01:04<00:06, 12.42it/s]Upper bound on the fitting time:  92%|█████████▏| 916/1000 [01:05<00:06, 12.37it/s]Upper bound on the fitting time:  92%|█████████▏| 918/1000 [01:05<00:06, 12.31it/s]Upper bound on the fitting time:  92%|█████████▏| 920/1000 [01:05<00:06, 12.38it/s]Upper bound on the fitting time:  92%|█████████▏| 922/1000 [01:05<00:06, 12.42it/s]Upper bound on the fitting time:  92%|█████████▏| 924/1000 [01:05<00:06, 12.36it/s]Upper bound on the fitting time:  93%|█████████▎| 926/1000 [01:05<00:06, 12.13it/s]Upper bound on the fitting time:  93%|█████████▎| 928/1000 [01:06<00:05, 12.11it/s]Upper bound on the fitting time:  93%|█████████▎| 930/1000 [01:06<00:05, 12.04it/s]Upper bound on the fitting time:  93%|█████████▎| 932/1000 [01:06<00:05, 11.91it/s]Upper bound on the fitting time:  93%|█████████▎| 934/1000 [01:06<00:05, 11.82it/s]Upper bound on the fitting time:  94%|█████████▎| 936/1000 [01:06<00:05, 11.81it/s]Upper bound on the fitting time:  94%|█████████▍| 938/1000 [01:06<00:05, 11.76it/s]Upper bound on the fitting time:  94%|█████████▍| 940/1000 [01:07<00:05, 11.78it/s]Upper bound on the fitting time:  94%|█████████▍| 942/1000 [01:07<00:04, 11.68it/s]Upper bound on the fitting time:  94%|█████████▍| 944/1000 [01:07<00:04, 11.86it/s]Upper bound on the fitting time:  95%|█████████▍| 946/1000 [01:07<00:04, 12.25it/s]Upper bound on the fitting time:  95%|█████████▍| 948/1000 [01:07<00:04, 12.43it/s]Upper bound on the fitting time:  95%|█████████▌| 950/1000 [01:07<00:04, 12.47it/s]Upper bound on the fitting time:  95%|█████████▌| 952/1000 [01:08<00:03, 12.41it/s]Upper bound on the fitting time:  95%|█████████▌| 954/1000 [01:08<00:03, 12.50it/s]Upper bound on the fitting time:  96%|█████████▌| 956/1000 [01:08<00:03, 12.82it/s]Upper bound on the fitting time:  96%|█████████▌| 958/1000 [01:08<00:03, 12.87it/s]Upper bound on the fitting time:  96%|█████████▌| 960/1000 [01:08<00:03, 12.92it/s]Upper bound on the fitting time:  96%|█████████▌| 962/1000 [01:08<00:02, 13.22it/s]Upper bound on the fitting time:  96%|█████████▋| 964/1000 [01:08<00:02, 13.64it/s]Upper bound on the fitting time:  97%|█████████▋| 966/1000 [01:09<00:02, 13.92it/s]Upper bound on the fitting time:  97%|█████████▋| 968/1000 [01:09<00:02, 14.23it/s]Upper bound on the fitting time:  97%|█████████▋| 970/1000 [01:09<00:02, 14.52it/s]Upper bound on the fitting time:  97%|█████████▋| 972/1000 [01:09<00:01, 14.67it/s]Upper bound on the fitting time:  97%|█████████▋| 974/1000 [01:09<00:01, 14.84it/s]Upper bound on the fitting time:  98%|█████████▊| 976/1000 [01:09<00:01, 14.94it/s]Upper bound on the fitting time:  98%|█████████▊| 978/1000 [01:09<00:01, 14.93it/s]Upper bound on the fitting time:  98%|█████████▊| 980/1000 [01:10<00:01, 14.84it/s]Upper bound on the fitting time:  98%|█████████▊| 982/1000 [01:10<00:01, 14.96it/s]Upper bound on the fitting time:  98%|█████████▊| 984/1000 [01:10<00:01, 14.96it/s]Upper bound on the fitting time:  99%|█████████▊| 986/1000 [01:10<00:00, 15.04it/s]Upper bound on the fitting time:  99%|█████████▉| 988/1000 [01:10<00:00, 15.05it/s]Upper bound on the fitting time:  99%|█████████▉| 990/1000 [01:10<00:00, 15.12it/s]Upper bound on the fitting time:  99%|█████████▉| 992/1000 [01:10<00:00, 15.27it/s]Upper bound on the fitting time:  99%|█████████▉| 994/1000 [01:10<00:00, 15.23it/s]Upper bound on the fitting time: 100%|█████████▉| 996/1000 [01:11<00:00, 14.71it/s]Upper bound on the fitting time: 100%|█████████▉| 998/1000 [01:11<00:00, 14.53it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [01:11<00:00, 14.70it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [01:11<00:00, 14.01it/s]
    +
    /home/bastien/These/redesign/pyPLNmodels/pyPLNmodels/utils/_data_handler.py:431: UserWarning:
    +
    +The (4) following (index) variables contain only zeros and are removed: [144 267 268 364].
    +
    `exog_inflation` and `exog` are set to the same array. If you need different `exog_inflation`, specify it with a pipe: '|' like in the following: endog ~ 1 + x | x + y
    @@ -5053,24 +4588,44 @@ 

    +
    Upper bound on the fitting time:   0%|          | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time:   1%|          | 9/1000 [00:00<00:11, 88.48it/s]Upper bound on the fitting time:   2%|▏         | 18/1000 [00:00<00:11, 88.93it/s]Upper bound on the fitting time:   3%|▎         | 27/1000 [00:00<00:11, 87.60it/s]Upper bound on the fitting time:   4%|▎         | 36/1000 [00:00<00:11, 84.53it/s]Upper bound on the fitting time:   4%|▍         | 45/1000 [00:00<00:11, 84.80it/s]Upper bound on the fitting time:   5%|▌         | 54/1000 [00:00<00:11, 85.45it/s]Upper bound on the fitting time:   6%|▋         | 63/1000 [00:00<00:10, 85.40it/s]Upper bound on the fitting time:   7%|▋         | 72/1000 [00:00<00:10, 85.08it/s]Upper bound on the fitting time:   8%|▊         | 81/1000 [00:00<00:11, 82.91it/s]Upper bound on the fitting time:   9%|▉         | 90/1000 [00:01<00:11, 81.29it/s]Upper bound on the fitting time:  10%|▉         | 99/1000 [00:01<00:11, 80.82it/s]Upper bound on the fitting time:  11%|█         | 108/1000 [00:01<00:11, 80.74it/s]Upper bound on the fitting time:  12%|█▏        | 117/1000 [00:01<00:10, 81.53it/s]Upper bound on the fitting time:  13%|█▎        | 126/1000 [00:01<00:10, 82.80it/s]Upper bound on the fitting time:  14%|█▎        | 135/1000 [00:01<00:10, 83.02it/s]Upper bound on the fitting time:  14%|█▍        | 144/1000 [00:01<00:10, 81.96it/s]Upper bound on the fitting time:  15%|█▌        | 153/1000 [00:01<00:10, 81.49it/s]Upper bound on the fitting time:  16%|█▌        | 162/1000 [00:01<00:10, 82.36it/s]Upper bound on the fitting time:  17%|█▋        | 171/1000 [00:02<00:10, 81.93it/s]Upper bound on the fitting time:  18%|█▊        | 180/1000 [00:02<00:09, 82.74it/s]Upper bound on the fitting time:  19%|█▉        | 189/1000 [00:02<00:09, 82.86it/s]Upper bound on the fitting time:  20%|█▉        | 198/1000 [00:02<00:09, 80.25it/s]Upper bound on the fitting time:  21%|██        | 207/1000 [00:02<00:09, 79.43it/s]Upper bound on the fitting time:  22%|██▏       | 216/1000 [00:02<00:09, 81.88it/s]Upper bound on the fitting time:  22%|██▎       | 225/1000 [00:02<00:09, 83.20it/s]Upper bound on the fitting time:  23%|██▎       | 234/1000 [00:02<00:09, 85.07it/s]Upper bound on the fitting time:  24%|██▍       | 243/1000 [00:02<00:08, 85.78it/s]Upper bound on the fitting time:  25%|██▌       | 252/1000 [00:03<00:08, 85.77it/s]Upper bound on the fitting time:  26%|██▌       | 261/1000 [00:03<00:08, 85.85it/s]Upper bound on the fitting time:  27%|██▋       | 270/1000 [00:03<00:08, 84.82it/s]Upper bound on the fitting time:  28%|██▊       | 279/1000 [00:03<00:08, 85.79it/s]Upper bound on the fitting time:  29%|██▉       | 288/1000 [00:03<00:08, 83.32it/s]Upper bound on the fitting time:  30%|██▉       | 297/1000 [00:03<00:08, 84.47it/s]Upper bound on the fitting time:  31%|███       | 306/1000 [00:03<00:08, 84.84it/s]Upper bound on the fitting time:  32%|███▏      | 315/1000 [00:03<00:08, 84.98it/s]Upper bound on the fitting time:  32%|███▏      | 324/1000 [00:03<00:07, 85.37it/s]Upper bound on the fitting time:  33%|███▎      | 333/1000 [00:03<00:07, 86.58it/s]Upper bound on the fitting time:  34%|███▍      | 342/1000 [00:04<00:07, 87.38it/s]Upper bound on the fitting time:  35%|███▌      | 352/1000 [00:04<00:07, 88.39it/s]Upper bound on the fitting time:  36%|███▌      | 362/1000 [00:04<00:07, 88.96it/s]Upper bound on the fitting time:  37%|███▋      | 371/1000 [00:04<00:07, 87.96it/s]Upper bound on the fitting time:  38%|███▊      | 380/1000 [00:04<00:07, 87.79it/s]Upper bound on the fitting time:  39%|███▉      | 389/1000 [00:04<00:06, 88.24it/s]Upper bound on the fitting time:  40%|███▉      | 398/1000 [00:04<00:06, 88.57it/s]Upper bound on the fitting time:  41%|████      | 407/1000 [00:04<00:06, 88.88it/s]Upper bound on the fitting time:  42%|████▏     | 416/1000 [00:04<00:06, 89.00it/s]Upper bound on the fitting time:  42%|████▎     | 425/1000 [00:05<00:06, 88.92it/s]Upper bound on the fitting time:  43%|████▎     | 434/1000 [00:05<00:06, 88.78it/s]Upper bound on the fitting time:  44%|████▍     | 443/1000 [00:05<00:06, 89.13it/s]Upper bound on the fitting time:  45%|████▌     | 452/1000 [00:05<00:06, 89.01it/s]Upper bound on the fitting time:  46%|████▌     | 461/1000 [00:05<00:06, 88.64it/s]Upper bound on the fitting time:  47%|████▋     | 470/1000 [00:05<00:06, 88.28it/s]Upper bound on the fitting time:  48%|████▊     | 479/1000 [00:05<00:06, 86.08it/s]Upper bound on the fitting time:  49%|████▉     | 488/1000 [00:05<00:05, 86.81it/s]Upper bound on the fitting time:  50%|████▉     | 497/1000 [00:05<00:05, 87.69it/s]Upper bound on the fitting time:  51%|█████     | 506/1000 [00:05<00:05, 88.06it/s]Upper bound on the fitting time:  52%|█████▏    | 516/1000 [00:06<00:05, 88.75it/s]Upper bound on the fitting time:  52%|█████▎    | 525/1000 [00:06<00:05, 88.84it/s]Upper bound on the fitting time:  53%|█████▎    | 534/1000 [00:06<00:05, 89.02it/s]Upper bound on the fitting time:  54%|█████▍    | 544/1000 [00:06<00:05, 89.46it/s]Upper bound on the fitting time:  55%|█████▌    | 553/1000 [00:06<00:05, 89.31it/s]Upper bound on the fitting time:  56%|█████▌    | 562/1000 [00:06<00:05, 85.82it/s]Upper bound on the fitting time:  57%|█████▋    | 571/1000 [00:06<00:05, 82.76it/s]Upper bound on the fitting time:  58%|█████▊    | 580/1000 [00:06<00:05, 83.37it/s]Upper bound on the fitting time:  59%|█████▉    | 589/1000 [00:06<00:04, 83.35it/s]Upper bound on the fitting time:  60%|█████▉    | 598/1000 [00:07<00:04, 83.73it/s]Upper bound on the fitting time:  61%|██████    | 607/1000 [00:07<00:04, 84.10it/s]Upper bound on the fitting time:  62%|██████▏   | 616/1000 [00:07<00:04, 84.13it/s]Upper bound on the fitting time:  62%|██████▎   | 625/1000 [00:07<00:04, 84.37it/s]Upper bound on the fitting time:  63%|██████▎   | 634/1000 [00:07<00:04, 84.34it/s]Upper bound on the fitting time:  64%|██████▍   | 643/1000 [00:07<00:04, 83.34it/s]Upper bound on the fitting time:  65%|██████▌   | 652/1000 [00:07<00:04, 84.52it/s]Upper bound on the fitting time:  66%|██████▌   | 661/1000 [00:07<00:03, 85.65it/s]Upper bound on the fitting time:  67%|██████▋   | 670/1000 [00:07<00:03, 84.93it/s]Upper bound on the fitting time:  68%|██████▊   | 679/1000 [00:07<00:03, 85.69it/s]Upper bound on the fitting time:  69%|██████▉   | 688/1000 [00:08<00:03, 86.01it/s]Upper bound on the fitting time:  70%|██████▉   | 697/1000 [00:08<00:03, 86.46it/s]Upper bound on the fitting time:  71%|███████   | 706/1000 [00:08<00:03, 86.55it/s]Upper bound on the fitting time:  72%|███████▏  | 715/1000 [00:08<00:03, 86.11it/s]Upper bound on the fitting time:  72%|███████▏  | 724/1000 [00:08<00:03, 85.92it/s]Upper bound on the fitting time:  73%|███████▎  | 733/1000 [00:08<00:03, 82.89it/s]Upper bound on the fitting time:  74%|███████▍  | 742/1000 [00:08<00:03, 82.16it/s]Upper bound on the fitting time:  75%|███████▌  | 751/1000 [00:08<00:03, 81.26it/s]Upper bound on the fitting time:  76%|███████▌  | 760/1000 [00:08<00:02, 82.32it/s]Upper bound on the fitting time:  77%|███████▋  | 769/1000 [00:09<00:02, 81.82it/s]Upper bound on the fitting time:  78%|███████▊  | 778/1000 [00:09<00:02, 81.48it/s]Upper bound on the fitting time:  79%|███████▊  | 787/1000 [00:09<00:02, 82.32it/s]Upper bound on the fitting time:  80%|███████▉  | 796/1000 [00:09<00:02, 82.31it/s]Upper bound on the fitting time:  80%|████████  | 805/1000 [00:09<00:02, 82.71it/s]Upper bound on the fitting time:  81%|████████▏ | 814/1000 [00:09<00:02, 82.85it/s]Upper bound on the fitting time:  82%|████████▏ | 823/1000 [00:09<00:02, 83.44it/s]Upper bound on the fitting time:  83%|████████▎ | 832/1000 [00:09<00:02, 83.80it/s]Upper bound on the fitting time:  84%|████████▍ | 841/1000 [00:09<00:01, 83.90it/s]Upper bound on the fitting time:  85%|████████▌ | 850/1000 [00:10<00:01, 83.65it/s]Upper bound on the fitting time:  86%|████████▌ | 859/1000 [00:10<00:01, 81.10it/s]Upper bound on the fitting time:  87%|████████▋ | 868/1000 [00:10<00:01, 80.50it/s]Upper bound on the fitting time:  88%|████████▊ | 877/1000 [00:10<00:01, 82.36it/s]Upper bound on the fitting time:  89%|████████▊ | 886/1000 [00:10<00:01, 82.89it/s]Upper bound on the fitting time:  90%|████████▉ | 895/1000 [00:10<00:01, 84.22it/s]Upper bound on the fitting time:  90%|█████████ | 904/1000 [00:10<00:01, 84.93it/s]Upper bound on the fitting time:  91%|█████████▏| 913/1000 [00:10<00:01, 85.29it/s]Upper bound on the fitting time:  92%|█████████▏| 922/1000 [00:10<00:00, 85.04it/s]Upper bound on the fitting time:  93%|█████████▎| 931/1000 [00:10<00:00, 86.33it/s]Upper bound on the fitting time:  94%|█████████▍| 940/1000 [00:11<00:00, 84.29it/s]Upper bound on the fitting time:  95%|█████████▍| 949/1000 [00:11<00:00, 79.45it/s]Upper bound on the fitting time:  96%|█████████▌| 958/1000 [00:11<00:00, 81.08it/s]Upper bound on the fitting time:  97%|█████████▋| 967/1000 [00:11<00:00, 81.85it/s]Upper bound on the fitting time:  98%|█████████▊| 976/1000 [00:11<00:00, 83.50it/s]Upper bound on the fitting time:  98%|█████████▊| 985/1000 [00:11<00:00, 84.11it/s]Upper bound on the fitting time:  99%|█████████▉| 994/1000 [00:11<00:00, 84.49it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [00:11<00:00, 84.65it/s]
    +

    +
    +
    Maximum number of iterations (1000)  reached in 12.4 seconds.
    +Last  criterion = 6.5e-07 . Required tolerance = 9.999999999999999e-10
     Fitting a ZIPlnPCA model with 5 principal components.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (1000)  reached in 97.1 seconds.
    -Last  criterion = 2.17e-06 . Required tolerance = 9.999999999999999e-10
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time:   1%|          | 8/1000 [00:00<00:12, 79.30it/s]Upper bound on the fitting time:   2%|▏         | 16/1000 [00:00<00:12, 79.62it/s]Upper bound on the fitting time:   2%|▏         | 24/1000 [00:00<00:12, 78.98it/s]Upper bound on the fitting time:   3%|▎         | 33/1000 [00:00<00:12, 80.30it/s]Upper bound on the fitting time:   4%|▍         | 42/1000 [00:00<00:11, 80.59it/s]Upper bound on the fitting time:   5%|▌         | 51/1000 [00:00<00:11, 81.26it/s]Upper bound on the fitting time:   6%|▌         | 60/1000 [00:00<00:11, 79.97it/s]Upper bound on the fitting time:   7%|▋         | 69/1000 [00:00<00:11, 79.15it/s]Upper bound on the fitting time:   8%|▊         | 77/1000 [00:00<00:11, 78.80it/s]Upper bound on the fitting time:   9%|▊         | 86/1000 [00:01<00:11, 79.32it/s]Upper bound on the fitting time:   9%|▉         | 94/1000 [00:01<00:11, 79.04it/s]Upper bound on the fitting time:  10%|█         | 102/1000 [00:01<00:11, 75.68it/s]Upper bound on the fitting time:  11%|█         | 110/1000 [00:01<00:12, 71.54it/s]Upper bound on the fitting time:  12%|█▏        | 118/1000 [00:01<00:12, 72.29it/s]Upper bound on the fitting time:  13%|█▎        | 126/1000 [00:01<00:11, 73.90it/s]Upper bound on the fitting time:  13%|█▎        | 134/1000 [00:01<00:11, 75.44it/s]Upper bound on the fitting time:  14%|█▍        | 142/1000 [00:01<00:11, 76.24it/s]Upper bound on the fitting time:  15%|█▌        | 150/1000 [00:01<00:11, 76.51it/s]Upper bound on the fitting time:  16%|█▌        | 158/1000 [00:02<00:11, 76.49it/s]Upper bound on the fitting time:  17%|█▋        | 166/1000 [00:02<00:10, 77.23it/s]Upper bound on the fitting time:  18%|█▊        | 175/1000 [00:02<00:10, 78.28it/s]Upper bound on the fitting time:  18%|█▊        | 184/1000 [00:02<00:10, 79.55it/s]Upper bound on the fitting time:  19%|█▉        | 193/1000 [00:02<00:10, 80.27it/s]Upper bound on the fitting time:  20%|██        | 202/1000 [00:02<00:10, 72.86it/s]Upper bound on the fitting time:  21%|██        | 210/1000 [00:02<00:11, 69.55it/s]Upper bound on the fitting time:  22%|██▏       | 218/1000 [00:02<00:11, 70.03it/s]Upper bound on the fitting time:  23%|██▎       | 226/1000 [00:02<00:10, 72.07it/s]Upper bound on the fitting time:  23%|██▎       | 234/1000 [00:03<00:10, 73.03it/s]Upper bound on the fitting time:  24%|██▍       | 243/1000 [00:03<00:09, 76.21it/s]Upper bound on the fitting time:  25%|██▌       | 252/1000 [00:03<00:09, 78.63it/s]Upper bound on the fitting time:  26%|██▌       | 261/1000 [00:03<00:09, 80.37it/s]Upper bound on the fitting time:  27%|██▋       | 270/1000 [00:03<00:09, 80.56it/s]Upper bound on the fitting time:  28%|██▊       | 279/1000 [00:03<00:08, 80.54it/s]Upper bound on the fitting time:  29%|██▉       | 288/1000 [00:03<00:08, 81.27it/s]Upper bound on the fitting time:  30%|██▉       | 297/1000 [00:03<00:08, 82.14it/s]Upper bound on the fitting time:  31%|███       | 306/1000 [00:03<00:08, 82.68it/s]Upper bound on the fitting time:  32%|███▏      | 315/1000 [00:04<00:08, 83.92it/s]Upper bound on the fitting time:  32%|███▏      | 324/1000 [00:04<00:08, 81.65it/s]Upper bound on the fitting time:  33%|███▎      | 333/1000 [00:04<00:08, 83.18it/s]Upper bound on the fitting time:  34%|███▍      | 342/1000 [00:04<00:07, 83.83it/s]Upper bound on the fitting time:  35%|███▌      | 351/1000 [00:04<00:07, 82.37it/s]Upper bound on the fitting time:  36%|███▌      | 360/1000 [00:04<00:08, 75.84it/s]Upper bound on the fitting time:  37%|███▋      | 368/1000 [00:04<00:08, 72.61it/s]Upper bound on the fitting time:  38%|███▊      | 376/1000 [00:04<00:08, 71.06it/s]Upper bound on the fitting time:  38%|███▊      | 384/1000 [00:04<00:08, 69.95it/s]Upper bound on the fitting time:  39%|███▉      | 393/1000 [00:05<00:08, 73.04it/s]Upper bound on the fitting time:  40%|████      | 401/1000 [00:05<00:08, 74.56it/s]Upper bound on the fitting time:  41%|████      | 410/1000 [00:05<00:07, 76.47it/s]Upper bound on the fitting time:  42%|████▏     | 419/1000 [00:05<00:07, 77.67it/s]Upper bound on the fitting time:  43%|████▎     | 428/1000 [00:05<00:07, 78.80it/s]Upper bound on the fitting time:  44%|████▎     | 437/1000 [00:05<00:07, 79.90it/s]Upper bound on the fitting time:  45%|████▍     | 446/1000 [00:05<00:07, 78.50it/s]Upper bound on the fitting time:  45%|████▌     | 454/1000 [00:05<00:07, 76.71it/s]Upper bound on the fitting time:  46%|████▋     | 463/1000 [00:05<00:06, 79.11it/s]Upper bound on the fitting time:  47%|████▋     | 472/1000 [00:06<00:06, 81.55it/s]Upper bound on the fitting time:  48%|████▊     | 481/1000 [00:06<00:06, 83.01it/s]Upper bound on the fitting time:  49%|████▉     | 490/1000 [00:06<00:06, 83.36it/s]Upper bound on the fitting time:  50%|████▉     | 499/1000 [00:06<00:05, 83.90it/s]Upper bound on the fitting time:  51%|█████     | 508/1000 [00:06<00:05, 84.42it/s]Upper bound on the fitting time:  52%|█████▏    | 517/1000 [00:06<00:05, 85.15it/s]Upper bound on the fitting time:  53%|█████▎    | 526/1000 [00:06<00:05, 85.87it/s]Upper bound on the fitting time:  54%|█████▎    | 535/1000 [00:06<00:05, 85.86it/s]Upper bound on the fitting time:  54%|█████▍    | 544/1000 [00:06<00:05, 86.00it/s]Upper bound on the fitting time:  55%|█████▌    | 553/1000 [00:07<00:05, 86.28it/s]Upper bound on the fitting time:  56%|█████▌    | 562/1000 [00:07<00:05, 86.84it/s]Upper bound on the fitting time:  57%|█████▋    | 571/1000 [00:07<00:04, 87.22it/s]Upper bound on the fitting time:  58%|█████▊    | 580/1000 [00:07<00:04, 87.89it/s]Upper bound on the fitting time:  59%|█████▉    | 589/1000 [00:07<00:04, 88.31it/s]Upper bound on the fitting time:  60%|█████▉    | 598/1000 [00:07<00:04, 88.43it/s]Upper bound on the fitting time:  61%|██████    | 607/1000 [00:07<00:04, 87.49it/s]Upper bound on the fitting time:  62%|██████▏   | 616/1000 [00:07<00:04, 88.01it/s]Upper bound on the fitting time:  62%|██████▎   | 625/1000 [00:07<00:04, 85.09it/s]Upper bound on the fitting time:  63%|██████▎   | 634/1000 [00:07<00:04, 85.81it/s]Upper bound on the fitting time:  64%|██████▍   | 643/1000 [00:08<00:04, 86.38it/s]Upper bound on the fitting time:  65%|██████▌   | 652/1000 [00:08<00:04, 86.44it/s]Upper bound on the fitting time:  66%|██████▌   | 661/1000 [00:08<00:03, 86.38it/s]Upper bound on the fitting time:  67%|██████▋   | 670/1000 [00:08<00:03, 83.65it/s]Upper bound on the fitting time:  68%|██████▊   | 679/1000 [00:08<00:03, 85.20it/s]Upper bound on the fitting time:  69%|██████▉   | 688/1000 [00:08<00:03, 86.03it/s]Upper bound on the fitting time:  70%|██████▉   | 697/1000 [00:08<00:03, 86.43it/s]Upper bound on the fitting time:  71%|███████   | 706/1000 [00:08<00:03, 86.87it/s]Upper bound on the fitting time:  72%|███████▏  | 715/1000 [00:08<00:03, 87.51it/s]Upper bound on the fitting time:  72%|███████▎  | 725/1000 [00:08<00:03, 88.25it/s]Upper bound on the fitting time:  73%|███████▎  | 734/1000 [00:09<00:03, 88.23it/s]Upper bound on the fitting time:  74%|███████▍  | 743/1000 [00:09<00:02, 87.99it/s]Upper bound on the fitting time:  75%|███████▌  | 752/1000 [00:09<00:02, 88.21it/s]Upper bound on the fitting time:  76%|███████▌  | 761/1000 [00:09<00:02, 88.58it/s]Upper bound on the fitting time:  77%|███████▋  | 771/1000 [00:09<00:02, 89.19it/s]Upper bound on the fitting time:  78%|███████▊  | 780/1000 [00:09<00:02, 89.42it/s]Upper bound on the fitting time:  79%|███████▉  | 789/1000 [00:09<00:02, 88.16it/s]Upper bound on the fitting time:  80%|███████▉  | 798/1000 [00:09<00:02, 88.34it/s]Upper bound on the fitting time:  81%|████████  | 807/1000 [00:09<00:02, 88.11it/s]Upper bound on the fitting time:  82%|████████▏ | 816/1000 [00:10<00:02, 87.83it/s]Upper bound on the fitting time:  82%|████████▎ | 825/1000 [00:10<00:02, 85.51it/s]Upper bound on the fitting time:  83%|████████▎ | 834/1000 [00:10<00:01, 83.31it/s]Upper bound on the fitting time:  84%|████████▍ | 843/1000 [00:10<00:01, 82.11it/s]Upper bound on the fitting time:  85%|████████▌ | 852/1000 [00:10<00:01, 77.56it/s]Upper bound on the fitting time:  86%|████████▌ | 860/1000 [00:10<00:01, 74.30it/s]Upper bound on the fitting time:  87%|████████▋ | 868/1000 [00:10<00:01, 72.04it/s]Upper bound on the fitting time:  88%|████████▊ | 876/1000 [00:10<00:01, 70.56it/s]Upper bound on the fitting time:  88%|████████▊ | 884/1000 [00:10<00:01, 69.24it/s]Upper bound on the fitting time:  89%|████████▉ | 891/1000 [00:11<00:01, 66.48it/s]Upper bound on the fitting time:  90%|████████▉ | 898/1000 [00:11<00:01, 66.41it/s]Upper bound on the fitting time:  90%|█████████ | 905/1000 [00:11<00:01, 66.89it/s]Upper bound on the fitting time:  91%|█████████▏| 913/1000 [00:11<00:01, 68.02it/s]Upper bound on the fitting time:  92%|█████████▏| 920/1000 [00:11<00:01, 68.45it/s]Upper bound on the fitting time:  93%|█████████▎| 927/1000 [00:11<00:01, 67.71it/s]Upper bound on the fitting time:  93%|█████████▎| 934/1000 [00:11<00:00, 66.81it/s]Upper bound on the fitting time:  94%|█████████▍| 941/1000 [00:11<00:00, 66.44it/s]Upper bound on the fitting time:  95%|█████████▍| 948/1000 [00:11<00:00, 66.57it/s]Upper bound on the fitting time:  96%|█████████▌| 955/1000 [00:12<00:00, 66.12it/s]Upper bound on the fitting time:  96%|█████████▌| 962/1000 [00:12<00:00, 65.18it/s]Upper bound on the fitting time:  97%|█████████▋| 969/1000 [00:12<00:00, 65.13it/s]Upper bound on the fitting time:  98%|█████████▊| 976/1000 [00:12<00:00, 66.06it/s]Upper bound on the fitting time:  98%|█████████▊| 983/1000 [00:12<00:00, 66.93it/s]Upper bound on the fitting time:  99%|█████████▉| 992/1000 [00:12<00:00, 71.62it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [00:12<00:00, 78.86it/s]
    +
    +
    +
    Maximum number of iterations (1000)  reached in 12.7 seconds.
    +Last  criterion = 1.4e-07 . Required tolerance = 9.999999999999999e-10
     Fitting a ZIPlnPCA model with 10 principal components.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (1000)  reached in 72.6 seconds.
    -Last  criterion = 0.0 . Required tolerance = 9.999999999999999e-10
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time:   1%|          | 8/1000 [00:00<00:12, 79.05it/s]Upper bound on the fitting time:   2%|▏         | 16/1000 [00:00<00:12, 77.52it/s]Upper bound on the fitting time:   2%|▏         | 24/1000 [00:00<00:12, 78.51it/s]Upper bound on the fitting time:   3%|▎         | 33/1000 [00:00<00:12, 80.40it/s]Upper bound on the fitting time:   4%|▍         | 42/1000 [00:00<00:12, 76.62it/s]Upper bound on the fitting time:   5%|▌         | 50/1000 [00:00<00:13, 72.87it/s]Upper bound on the fitting time:   6%|▌         | 58/1000 [00:00<00:13, 70.87it/s]Upper bound on the fitting time:   7%|▋         | 66/1000 [00:00<00:13, 69.64it/s]Upper bound on the fitting time:   7%|▋         | 73/1000 [00:01<00:13, 68.72it/s]Upper bound on the fitting time:   8%|▊         | 80/1000 [00:01<00:13, 66.72it/s]Upper bound on the fitting time:   9%|▉         | 88/1000 [00:01<00:13, 69.45it/s]Upper bound on the fitting time:  10%|▉         | 97/1000 [00:01<00:12, 72.67it/s]Upper bound on the fitting time:  11%|█         | 106/1000 [00:01<00:11, 76.11it/s]Upper bound on the fitting time:  12%|█▏        | 115/1000 [00:01<00:11, 78.63it/s]Upper bound on the fitting time:  12%|█▏        | 124/1000 [00:01<00:10, 80.80it/s]Upper bound on the fitting time:  13%|█▎        | 133/1000 [00:01<00:10, 82.21it/s]Upper bound on the fitting time:  14%|█▍        | 142/1000 [00:01<00:10, 81.80it/s]Upper bound on the fitting time:  15%|█▌        | 151/1000 [00:01<00:10, 82.66it/s]Upper bound on the fitting time:  16%|█▌        | 160/1000 [00:02<00:10, 83.44it/s]Upper bound on the fitting time:  17%|█▋        | 169/1000 [00:02<00:09, 84.16it/s]Upper bound on the fitting time:  18%|█▊        | 178/1000 [00:02<00:09, 84.60it/s]Upper bound on the fitting time:  19%|█▊        | 187/1000 [00:02<00:09, 84.00it/s]Upper bound on the fitting time:  20%|█▉        | 196/1000 [00:02<00:09, 83.68it/s]Upper bound on the fitting time:  20%|██        | 205/1000 [00:02<00:09, 82.21it/s]Upper bound on the fitting time:  21%|██▏       | 214/1000 [00:02<00:09, 82.28it/s]Upper bound on the fitting time:  22%|██▏       | 223/1000 [00:02<00:09, 83.08it/s]Upper bound on the fitting time:  23%|██▎       | 232/1000 [00:02<00:09, 83.58it/s]Upper bound on the fitting time:  24%|██▍       | 241/1000 [00:03<00:09, 83.92it/s]Upper bound on the fitting time:  25%|██▌       | 250/1000 [00:03<00:08, 84.23it/s]Upper bound on the fitting time:  26%|██▌       | 259/1000 [00:03<00:08, 84.22it/s]Upper bound on the fitting time:  27%|██▋       | 268/1000 [00:03<00:08, 83.08it/s]Upper bound on the fitting time:  28%|██▊       | 277/1000 [00:03<00:09, 78.34it/s]Upper bound on the fitting time:  29%|██▊       | 286/1000 [00:03<00:08, 80.20it/s]Upper bound on the fitting time:  30%|██▉       | 295/1000 [00:03<00:08, 80.42it/s]Upper bound on the fitting time:  30%|███       | 304/1000 [00:03<00:08, 81.78it/s]Upper bound on the fitting time:  31%|███▏      | 313/1000 [00:03<00:08, 81.65it/s]Upper bound on the fitting time:  32%|███▏      | 322/1000 [00:04<00:08, 82.00it/s]Upper bound on the fitting time:  33%|███▎      | 331/1000 [00:04<00:08, 80.93it/s]Upper bound on the fitting time:  34%|███▍      | 340/1000 [00:04<00:08, 79.78it/s]Upper bound on the fitting time:  35%|███▍      | 349/1000 [00:04<00:08, 80.78it/s]Upper bound on the fitting time:  36%|███▌      | 358/1000 [00:04<00:07, 81.64it/s]Upper bound on the fitting time:  37%|███▋      | 367/1000 [00:04<00:07, 81.97it/s]Upper bound on the fitting time:  38%|███▊      | 376/1000 [00:04<00:07, 82.82it/s]Upper bound on the fitting time:  38%|███▊      | 385/1000 [00:04<00:07, 81.93it/s]Upper bound on the fitting time:  39%|███▉      | 394/1000 [00:04<00:07, 82.70it/s]Upper bound on the fitting time:  40%|████      | 403/1000 [00:05<00:07, 79.95it/s]Upper bound on the fitting time:  41%|████      | 412/1000 [00:05<00:07, 80.35it/s]Upper bound on the fitting time:  42%|████▏     | 421/1000 [00:05<00:07, 81.31it/s]Upper bound on the fitting time:  43%|████▎     | 430/1000 [00:05<00:07, 80.10it/s]Upper bound on the fitting time:  44%|████▍     | 439/1000 [00:05<00:06, 81.58it/s]Upper bound on the fitting time:  45%|████▍     | 448/1000 [00:05<00:06, 82.11it/s]Upper bound on the fitting time:  46%|████▌     | 457/1000 [00:05<00:06, 81.67it/s]Upper bound on the fitting time:  47%|████▋     | 466/1000 [00:05<00:06, 81.48it/s]Upper bound on the fitting time:  48%|████▊     | 475/1000 [00:05<00:06, 82.27it/s]Upper bound on the fitting time:  48%|████▊     | 484/1000 [00:06<00:06, 81.43it/s]Upper bound on the fitting time:  49%|████▉     | 493/1000 [00:06<00:06, 81.63it/s]Upper bound on the fitting time:  50%|█████     | 502/1000 [00:06<00:06, 80.85it/s]Upper bound on the fitting time:  51%|█████     | 511/1000 [00:06<00:06, 80.93it/s]Upper bound on the fitting time:  52%|█████▏    | 520/1000 [00:06<00:06, 79.01it/s]Upper bound on the fitting time:  53%|█████▎    | 529/1000 [00:06<00:05, 79.62it/s]Upper bound on the fitting time:  54%|█████▍    | 538/1000 [00:06<00:05, 80.01it/s]Upper bound on the fitting time:  55%|█████▍    | 547/1000 [00:06<00:05, 78.90it/s]Upper bound on the fitting time:  56%|█████▌    | 555/1000 [00:06<00:05, 79.09it/s]Upper bound on the fitting time:  56%|█████▋    | 563/1000 [00:07<00:05, 79.18it/s]Upper bound on the fitting time:  57%|█████▋    | 571/1000 [00:07<00:05, 76.77it/s]Upper bound on the fitting time:  58%|█████▊    | 579/1000 [00:07<00:05, 77.11it/s]Upper bound on the fitting time:  59%|█████▉    | 588/1000 [00:07<00:05, 78.30it/s]Upper bound on the fitting time:  60%|█████▉    | 596/1000 [00:07<00:05, 78.76it/s]Upper bound on the fitting time:  60%|██████    | 604/1000 [00:07<00:05, 78.48it/s]Upper bound on the fitting time:  61%|██████    | 612/1000 [00:07<00:04, 78.62it/s]Upper bound on the fitting time:  62%|██████▏   | 620/1000 [00:07<00:04, 77.83it/s]Upper bound on the fitting time:  63%|██████▎   | 629/1000 [00:07<00:04, 78.65it/s]Upper bound on the fitting time:  64%|██████▍   | 638/1000 [00:07<00:04, 79.82it/s]Upper bound on the fitting time:  65%|██████▍   | 646/1000 [00:08<00:04, 79.54it/s]Upper bound on the fitting time:  65%|██████▌   | 654/1000 [00:08<00:04, 78.49it/s]Upper bound on the fitting time:  66%|██████▌   | 662/1000 [00:08<00:04, 76.60it/s]Upper bound on the fitting time:  67%|██████▋   | 670/1000 [00:08<00:04, 74.51it/s]Upper bound on the fitting time:  68%|██████▊   | 678/1000 [00:08<00:04, 70.77it/s]Upper bound on the fitting time:  69%|██████▊   | 686/1000 [00:08<00:04, 71.38it/s]Upper bound on the fitting time:  69%|██████▉   | 694/1000 [00:08<00:04, 73.37it/s]Upper bound on the fitting time:  70%|███████   | 702/1000 [00:08<00:04, 73.54it/s]Upper bound on the fitting time:  71%|███████   | 710/1000 [00:08<00:03, 74.36it/s]Upper bound on the fitting time:  72%|███████▏  | 718/1000 [00:09<00:03, 75.20it/s]Upper bound on the fitting time:  73%|███████▎  | 726/1000 [00:09<00:03, 74.06it/s]Upper bound on the fitting time:  73%|███████▎  | 734/1000 [00:09<00:03, 75.20it/s]Upper bound on the fitting time:  74%|███████▍  | 743/1000 [00:09<00:03, 78.54it/s]Upper bound on the fitting time:  75%|███████▌  | 752/1000 [00:09<00:03, 80.52it/s]Upper bound on the fitting time:  76%|███████▌  | 761/1000 [00:09<00:02, 81.47it/s]Upper bound on the fitting time:  77%|███████▋  | 770/1000 [00:09<00:02, 81.81it/s]Upper bound on the fitting time:  78%|███████▊  | 779/1000 [00:09<00:02, 81.54it/s]Upper bound on the fitting time:  79%|███████▉  | 788/1000 [00:09<00:02, 81.94it/s]Upper bound on the fitting time:  80%|███████▉  | 797/1000 [00:10<00:02, 81.69it/s]Upper bound on the fitting time:  81%|████████  | 806/1000 [00:10<00:02, 82.26it/s]Upper bound on the fitting time:  82%|████████▏ | 815/1000 [00:10<00:02, 82.76it/s]Upper bound on the fitting time:  82%|████████▏ | 824/1000 [00:10<00:02, 82.02it/s]Upper bound on the fitting time:  83%|████████▎ | 833/1000 [00:10<00:02, 79.75it/s]Upper bound on the fitting time:  84%|████████▍ | 841/1000 [00:10<00:02, 78.46it/s]Upper bound on the fitting time:  85%|████████▍ | 849/1000 [00:10<00:01, 78.68it/s]Upper bound on the fitting time:  86%|████████▌ | 857/1000 [00:10<00:01, 78.84it/s]Upper bound on the fitting time:  86%|████████▋ | 865/1000 [00:10<00:01, 78.21it/s]Upper bound on the fitting time:  87%|████████▋ | 873/1000 [00:11<00:01, 76.71it/s]Upper bound on the fitting time:  88%|████████▊ | 882/1000 [00:11<00:01, 78.94it/s]Upper bound on the fitting time:  89%|████████▉ | 890/1000 [00:11<00:01, 79.21it/s]Upper bound on the fitting time:  90%|████████▉ | 899/1000 [00:11<00:01, 79.87it/s]Upper bound on the fitting time:  91%|█████████ | 908/1000 [00:11<00:01, 80.99it/s]Upper bound on the fitting time:  92%|█████████▏| 917/1000 [00:11<00:01, 80.90it/s]Upper bound on the fitting time:  93%|█████████▎| 926/1000 [00:11<00:00, 81.47it/s]Upper bound on the fitting time:  94%|█████████▎| 935/1000 [00:11<00:00, 80.97it/s]Upper bound on the fitting time:  94%|█████████▍| 944/1000 [00:11<00:00, 80.79it/s]Upper bound on the fitting time:  95%|█████████▌| 953/1000 [00:12<00:00, 80.26it/s]Upper bound on the fitting time:  96%|█████████▌| 962/1000 [00:12<00:00, 79.22it/s]Upper bound on the fitting time:  97%|█████████▋| 970/1000 [00:12<00:00, 78.46it/s]Upper bound on the fitting time:  98%|█████████▊| 978/1000 [00:12<00:00, 78.71it/s]Upper bound on the fitting time:  99%|█████████▊| 986/1000 [00:12<00:00, 78.43it/s]Upper bound on the fitting time:  99%|█████████▉| 994/1000 [00:12<00:00, 78.82it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [00:12<00:00, 79.32it/s]
    +
    +
    +
    Maximum number of iterations (1000)  reached in 12.7 seconds.
    +Last  criterion = 1.9e-07 . Required tolerance = 9.999999999999999e-10
     Fitting a ZIPlnPCA model with 15 principal components.
     Intializing parameters ...
    -Initialization finished.
    -Maximum number of iterations (1000)  reached in 71.9 seconds.
    -Last  criterion = 1e-08 . Required tolerance = 9.999999999999999e-10
    +Initialization finished.
    +
    +
    +
    Upper bound on the fitting time:   0%|          | 0/1000 [00:00<?, ?it/s]Upper bound on the fitting time:   1%|          | 9/1000 [00:00<00:11, 84.70it/s]Upper bound on the fitting time:   2%|▏         | 18/1000 [00:00<00:12, 80.29it/s]Upper bound on the fitting time:   3%|▎         | 27/1000 [00:00<00:12, 79.57it/s]Upper bound on the fitting time:   4%|▎         | 35/1000 [00:00<00:13, 70.85it/s]Upper bound on the fitting time:   4%|▍         | 43/1000 [00:00<00:13, 68.47it/s]Upper bound on the fitting time:   5%|▌         | 50/1000 [00:00<00:13, 68.85it/s]Upper bound on the fitting time:   6%|▌         | 57/1000 [00:00<00:14, 66.70it/s]Upper bound on the fitting time:   6%|▋         | 64/1000 [00:00<00:14, 66.10it/s]Upper bound on the fitting time:   7%|▋         | 72/1000 [00:01<00:13, 68.96it/s]Upper bound on the fitting time:   8%|▊         | 80/1000 [00:01<00:12, 71.70it/s]Upper bound on the fitting time:   9%|▉         | 88/1000 [00:01<00:12, 73.68it/s]Upper bound on the fitting time:  10%|▉         | 97/1000 [00:01<00:11, 76.36it/s]Upper bound on the fitting time:  11%|█         | 106/1000 [00:01<00:11, 77.96it/s]Upper bound on the fitting time:  11%|█▏        | 114/1000 [00:01<00:11, 77.46it/s]Upper bound on the fitting time:  12%|█▏        | 122/1000 [00:01<00:11, 76.70it/s]Upper bound on the fitting time:  13%|█▎        | 130/1000 [00:01<00:11, 76.92it/s]Upper bound on the fitting time:  14%|█▍        | 138/1000 [00:01<00:11, 77.58it/s]Upper bound on the fitting time:  15%|█▍        | 146/1000 [00:01<00:11, 76.82it/s]Upper bound on the fitting time:  15%|█▌        | 154/1000 [00:02<00:10, 77.38it/s]Upper bound on the fitting time:  16%|█▋        | 163/1000 [00:02<00:10, 78.91it/s]Upper bound on the fitting time:  17%|█▋        | 171/1000 [00:02<00:10, 77.77it/s]Upper bound on the fitting time:  18%|█▊        | 179/1000 [00:02<00:10, 75.83it/s]Upper bound on the fitting time:  19%|█▊        | 187/1000 [00:02<00:10, 76.70it/s]Upper bound on the fitting time:  20%|█▉        | 195/1000 [00:02<00:10, 77.17it/s]Upper bound on the fitting time:  20%|██        | 203/1000 [00:02<00:10, 76.82it/s]Upper bound on the fitting time:  21%|██        | 211/1000 [00:02<00:10, 77.41it/s]Upper bound on the fitting time:  22%|██▏       | 220/1000 [00:02<00:09, 78.56it/s]Upper bound on the fitting time:  23%|██▎       | 229/1000 [00:03<00:09, 80.47it/s]Upper bound on the fitting time:  24%|██▍       | 238/1000 [00:03<00:09, 81.77it/s]Upper bound on the fitting time:  25%|██▍       | 247/1000 [00:03<00:09, 82.31it/s]Upper bound on the fitting time:  26%|██▌       | 256/1000 [00:03<00:08, 83.65it/s]Upper bound on the fitting time:  26%|██▋       | 265/1000 [00:03<00:08, 84.41it/s]Upper bound on the fitting time:  27%|██▋       | 274/1000 [00:03<00:08, 84.33it/s]Upper bound on the fitting time:  28%|██▊       | 283/1000 [00:03<00:08, 85.18it/s]Upper bound on the fitting time:  29%|██▉       | 292/1000 [00:03<00:08, 86.23it/s]Upper bound on the fitting time:  30%|███       | 301/1000 [00:03<00:08, 83.24it/s]Upper bound on the fitting time:  31%|███       | 310/1000 [00:03<00:08, 80.02it/s]Upper bound on the fitting time:  32%|███▏      | 319/1000 [00:04<00:08, 77.97it/s]Upper bound on the fitting time:  33%|███▎      | 327/1000 [00:04<00:08, 75.52it/s]Upper bound on the fitting time:  34%|███▎      | 335/1000 [00:04<00:08, 73.96it/s]Upper bound on the fitting time:  34%|███▍      | 343/1000 [00:04<00:09, 72.46it/s]Upper bound on the fitting time:  35%|███▌      | 351/1000 [00:04<00:09, 71.44it/s]Upper bound on the fitting time:  36%|███▌      | 359/1000 [00:04<00:09, 70.90it/s]Upper bound on the fitting time:  37%|███▋      | 367/1000 [00:04<00:08, 71.77it/s]Upper bound on the fitting time:  38%|███▊      | 375/1000 [00:04<00:08, 71.34it/s]Upper bound on the fitting time:  38%|███▊      | 383/1000 [00:05<00:08, 70.67it/s]Upper bound on the fitting time:  39%|███▉      | 391/1000 [00:05<00:08, 70.20it/s]Upper bound on the fitting time:  40%|███▉      | 399/1000 [00:05<00:08, 71.29it/s]Upper bound on the fitting time:  41%|████      | 407/1000 [00:05<00:08, 71.96it/s]Upper bound on the fitting time:  42%|████▏     | 415/1000 [00:05<00:08, 72.12it/s]Upper bound on the fitting time:  42%|████▏     | 423/1000 [00:05<00:08, 70.54it/s]Upper bound on the fitting time:  43%|████▎     | 431/1000 [00:05<00:08, 70.34it/s]Upper bound on the fitting time:  44%|████▍     | 439/1000 [00:05<00:07, 71.54it/s]Upper bound on the fitting time:  45%|████▍     | 447/1000 [00:05<00:07, 72.46it/s]Upper bound on the fitting time:  46%|████▌     | 455/1000 [00:06<00:07, 73.21it/s]Upper bound on the fitting time:  46%|████▋     | 463/1000 [00:06<00:07, 73.32it/s]Upper bound on the fitting time:  47%|████▋     | 471/1000 [00:06<00:07, 72.53it/s]Upper bound on the fitting time:  48%|████▊     | 479/1000 [00:06<00:07, 69.47it/s]Upper bound on the fitting time:  49%|████▊     | 486/1000 [00:06<00:07, 69.23it/s]Upper bound on the fitting time:  49%|████▉     | 493/1000 [00:06<00:07, 67.34it/s]Upper bound on the fitting time:  50%|█████     | 500/1000 [00:06<00:07, 67.98it/s]Upper bound on the fitting time:  51%|█████     | 508/1000 [00:06<00:07, 69.01it/s]Upper bound on the fitting time:  52%|█████▏    | 516/1000 [00:06<00:06, 69.65it/s]Upper bound on the fitting time:  52%|█████▏    | 524/1000 [00:07<00:06, 70.34it/s]Upper bound on the fitting time:  53%|█████▎    | 532/1000 [00:07<00:06, 70.19it/s]Upper bound on the fitting time:  54%|█████▍    | 540/1000 [00:07<00:06, 71.73it/s]Upper bound on the fitting time:  55%|█████▍    | 548/1000 [00:07<00:06, 71.17it/s]Upper bound on the fitting time:  56%|█████▌    | 557/1000 [00:07<00:05, 74.08it/s]Upper bound on the fitting time:  56%|█████▋    | 565/1000 [00:07<00:05, 74.65it/s]Upper bound on the fitting time:  57%|█████▋    | 573/1000 [00:07<00:05, 74.03it/s]Upper bound on the fitting time:  58%|█████▊    | 581/1000 [00:07<00:05, 73.24it/s]Upper bound on the fitting time:  59%|█████▉    | 589/1000 [00:07<00:05, 71.11it/s]Upper bound on the fitting time:  60%|█████▉    | 597/1000 [00:08<00:05, 68.53it/s]Upper bound on the fitting time:  60%|██████    | 604/1000 [00:08<00:05, 68.35it/s]Upper bound on the fitting time:  61%|██████▏   | 613/1000 [00:08<00:05, 72.42it/s]Upper bound on the fitting time:  62%|██████▏   | 621/1000 [00:08<00:05, 73.90it/s]Upper bound on the fitting time:  63%|██████▎   | 630/1000 [00:08<00:04, 76.47it/s]Upper bound on the fitting time:  64%|██████▍   | 639/1000 [00:08<00:04, 77.70it/s]Upper bound on the fitting time:  65%|██████▍   | 647/1000 [00:08<00:04, 78.03it/s]Upper bound on the fitting time:  66%|██████▌   | 656/1000 [00:08<00:04, 79.74it/s]Upper bound on the fitting time:  66%|██████▋   | 665/1000 [00:08<00:04, 81.66it/s]Upper bound on the fitting time:  67%|██████▋   | 674/1000 [00:09<00:04, 81.27it/s]Upper bound on the fitting time:  68%|██████▊   | 683/1000 [00:09<00:03, 82.93it/s]Upper bound on the fitting time:  69%|██████▉   | 692/1000 [00:09<00:03, 83.76it/s]Upper bound on the fitting time:  70%|███████   | 701/1000 [00:09<00:03, 83.65it/s]Upper bound on the fitting time:  71%|███████   | 710/1000 [00:09<00:03, 77.36it/s]Upper bound on the fitting time:  72%|███████▏  | 718/1000 [00:09<00:03, 74.02it/s]Upper bound on the fitting time:  73%|███████▎  | 727/1000 [00:09<00:03, 75.98it/s]Upper bound on the fitting time:  74%|███████▎  | 736/1000 [00:09<00:03, 77.17it/s]Upper bound on the fitting time:  74%|███████▍  | 744/1000 [00:09<00:03, 77.86it/s]Upper bound on the fitting time:  75%|███████▌  | 753/1000 [00:10<00:03, 79.56it/s]Upper bound on the fitting time:  76%|███████▌  | 761/1000 [00:10<00:03, 78.38it/s]Upper bound on the fitting time:  77%|███████▋  | 770/1000 [00:10<00:02, 79.70it/s]Upper bound on the fitting time:  78%|███████▊  | 779/1000 [00:10<00:02, 79.63it/s]Upper bound on the fitting time:  79%|███████▊  | 787/1000 [00:10<00:02, 71.52it/s]Upper bound on the fitting time:  80%|███████▉  | 795/1000 [00:10<00:02, 69.71it/s]Upper bound on the fitting time:  80%|████████  | 803/1000 [00:10<00:02, 67.41it/s]Upper bound on the fitting time:  81%|████████  | 810/1000 [00:10<00:02, 66.82it/s]Upper bound on the fitting time:  82%|████████▏ | 817/1000 [00:10<00:02, 65.32it/s]Upper bound on the fitting time:  82%|████████▏ | 824/1000 [00:11<00:02, 63.04it/s]Upper bound on the fitting time:  83%|████████▎ | 831/1000 [00:11<00:02, 62.29it/s]Upper bound on the fitting time:  84%|████████▍ | 838/1000 [00:11<00:02, 61.02it/s]Upper bound on the fitting time:  84%|████████▍ | 845/1000 [00:11<00:02, 60.80it/s]Upper bound on the fitting time:  85%|████████▌ | 852/1000 [00:11<00:02, 60.11it/s]Upper bound on the fitting time:  86%|████████▌ | 859/1000 [00:11<00:02, 59.51it/s]Upper bound on the fitting time:  86%|████████▋ | 865/1000 [00:11<00:02, 59.18it/s]Upper bound on the fitting time:  87%|████████▋ | 872/1000 [00:11<00:02, 59.70it/s]Upper bound on the fitting time:  88%|████████▊ | 879/1000 [00:12<00:02, 59.86it/s]Upper bound on the fitting time:  89%|████████▊ | 886/1000 [00:12<00:01, 60.15it/s]Upper bound on the fitting time:  89%|████████▉ | 893/1000 [00:12<00:01, 60.40it/s]Upper bound on the fitting time:  90%|█████████ | 900/1000 [00:12<00:01, 60.67it/s]Upper bound on the fitting time:  91%|█████████ | 907/1000 [00:12<00:01, 60.71it/s]Upper bound on the fitting time:  91%|█████████▏| 914/1000 [00:12<00:01, 60.81it/s]Upper bound on the fitting time:  92%|█████████▏| 921/1000 [00:12<00:01, 60.49it/s]Upper bound on the fitting time:  93%|█████████▎| 928/1000 [00:12<00:01, 59.94it/s]Upper bound on the fitting time:  93%|█████████▎| 934/1000 [00:12<00:01, 59.39it/s]Upper bound on the fitting time:  94%|█████████▍| 940/1000 [00:13<00:01, 58.88it/s]Upper bound on the fitting time:  95%|█████████▍| 946/1000 [00:13<00:00, 58.71it/s]Upper bound on the fitting time:  95%|█████████▌| 952/1000 [00:13<00:00, 58.58it/s]Upper bound on the fitting time:  96%|█████████▌| 958/1000 [00:13<00:00, 58.59it/s]Upper bound on the fitting time:  96%|█████████▋| 964/1000 [00:13<00:00, 58.04it/s]Upper bound on the fitting time:  97%|█████████▋| 970/1000 [00:13<00:00, 58.05it/s]Upper bound on the fitting time:  98%|█████████▊| 977/1000 [00:13<00:00, 59.34it/s]Upper bound on the fitting time:  98%|█████████▊| 985/1000 [00:13<00:00, 63.11it/s]Upper bound on the fitting time:  99%|█████████▉| 992/1000 [00:13<00:00, 64.84it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [00:13<00:00, 67.48it/s]Upper bound on the fitting time: 100%|██████████| 1000/1000 [00:13<00:00, 71.56it/s]
    +
    +
    +
    Maximum number of iterations (1000)  reached in 14.1 seconds.
    +Last  criterion = 6e-08 . Required tolerance = 9.999999999999999e-10
     ======================================================================
     
     DONE!
    @@ -5080,19 +4635,22 @@ 

    +
    +

    7.2 Accessing the Best Model

    The best model can be selected using the .best_model() method, based on a chosen criterion (AIC, BIC, or ICL):

    -
    -
    best_zipca = zipcas.best_model(criterion="BIC")
    -print(best_zipca)
    +
    +
    best_zipca = zipcas.best_model(criterion="BIC")
    +print(best_zipca)
    A multivariate ZIPlnPCA with 15 principal components.
     ======================================================================
          Loglike   Dimension    Nb param         BIC         AIC         ICL
    -  -137508.91         496       11408   171684.22 148916.9062   162723.79
    +  -132633.48         496       11408 166808.7982 144041.4844    157865.3
     
     ======================================================================
     * Useful attributes
    @@ -5106,24 +4664,28 @@ 

    ⚠️ Note The best model might always correspond to the largest rank, which may not always be desirable. To better understand the trade-offs, you can visualize the criteria for all models using the .show() method:

    -
    -
    zipcas.show()
    +
    +
    zipcas.show()
    -

    +
    +
    +

    +
    +

    7.3 Accessing Individual Models

    All individual models in the collection can be accessed with the rank as the key:

    -
    -
    zipca_rank_5 = zipcas[5]
    -print(zipca_rank_5)
    +
    +
    zipca_rank_5 = zipcas[5]
    +print(zipca_rank_5)
    A multivariate ZIPlnPCA with 5 principal components.
     ======================================================================
          Loglike   Dimension    Nb param         BIC         AIC         ICL
    -  -232031.94         496        6448 251348.4192 238479.9375   248391.41
    +   -230638.8         496        6448 249955.2786 237086.7969   247013.27
     
     ======================================================================
     * Useful attributes
    @@ -5137,9 +4699,9 @@ 

    -
    for zipca in zipcas.values():
    -    print(zipca)
    +
    +
    for zipca in zipcas.values():
    +    print(zipca)

    @@ -5148,10 +4710,11 @@

    < +

    -

    References

    +

    References

    Batardière, Bastien, Julien Chiquet, François Gindraud, and Mahendra Mariadassou. 2024. “Zero-Inflation in the Multivariate Poisson Lognormal Family.” https://arxiv.org/abs/2405.14711.
    @@ -5163,240 +4726,407 @@

    <

    + }); +

    + diff --git a/docs/source/tutorials/zero_inflation.qmd b/docs/source/tutorials/zero_inflation.qmd index 28accf41..31f97f59 100644 --- a/docs/source/tutorials/zero_inflation.qmd +++ b/docs/source/tutorials/zero_inflation.qmd @@ -46,7 +46,7 @@ More details can be found in @zeroinflation. The input data includes: * $Y_{ij}$ (`endog`): the $j$-th count for the $i$-th observation * $X_i$ (`exog`): covariates for the $i$-th observation (if available, defaults to 1) * $X^0_i$ (`exog_inflation`): covariates for the $i$-th observation specific to the inflation component (if available, defaults to 1) -* $o_i$ (`offsets`): offset for the $i$-th observation (if available, defaults to a vector of 0's) +* $o_i$ (`offsets`): offset for the $i$-th observation (if available, defaults to a vector of 0s) The model parameters are: @@ -71,8 +71,8 @@ The `pyPLNmodels` package is designed to: * Visualize the latent variables and their correlations This is achieved using the input count matrix $Y$, along with optional covariate matrices $X$ -(defaulting to a vector of 1's) and $X^0$ (for zero-inflation, also defaulting to a vector of 1's), -as well as offsets $O$ (defaulting to a matrix of 0's). +(defaulting to a vector of 1) and $X^0$ (for zero-inflation, also defaulting to a vector of 1s), +as well as offsets $O$ (defaulting to a matrix of 0s). # Data Import diff --git a/pyPLNmodels/load_data/microcosm.py b/pyPLNmodels/load_data/microcosm.py index a09bcb57..9241698a 100644 --- a/pyPLNmodels/load_data/microcosm.py +++ b/pyPLNmodels/load_data/microcosm.py @@ -10,7 +10,8 @@ def load_microcosm( ): """ Get real count data from the microcosm - (https://www.ncbi.nlm.nih.gov/bioproject/?term=PRJNA875059) dataset. + (https://www.ncbi.nlm.nih.gov/bioproject/?term=PRJNA875059) dataset of the + bioproject PRJNA875059. References: "Microbiota members from body sites of dairy cows are largely shared within diff --git a/pyPLNmodels/models/base.py b/pyPLNmodels/models/base.py index 1944f491..dd37e6dd 100644 --- a/pyPLNmodels/models/base.py +++ b/pyPLNmodels/models/base.py @@ -33,6 +33,8 @@ DEFAULT_TOL = 1e-6 +DEVICE = "cuda" if torch.cuda.is_available() else "cpu" + class BaseModel( ABC @@ -74,11 +76,12 @@ def __init__( The covariate data. Defaults to `None`. offsets : Union[torch.Tensor, np.ndarray, pd.DataFrame], optional(keyword-only) The offsets data. Defaults to `None`. - compute_offsets_method : str, optional(keyword-only) + compute_offsets_method : str ("zero", "logsum"), optional(keyword-only) Method to compute offsets if not provided. Options are: - "zero" that will set the offsets to zero. - "logsum" that will take the logarithm of the sum (per line) of the counts. Overridden (useless) if `offsets` is not None. + Default is "zero". add_const: bool, optional(keyword-only) Whether to add a column of one in the `exog`. Defaults to `True`. """ diff --git a/pyPLNmodels/models/pln.py b/pyPLNmodels/models/pln.py index 01d0944c..d7be9bf9 100644 --- a/pyPLNmodels/models/pln.py +++ b/pyPLNmodels/models/pln.py @@ -22,9 +22,6 @@ from pyPLNmodels.utils._viz import _plot_forest_coef -DEVICE = "cuda" if torch.cuda.is_available() else "cpu" - - class Pln(BaseModel): # pylint: disable=too-many-public-methods """Simplest model, that is the original PLN model from Aitchison, J., and C. H. Ho. “The Multivariate Poisson-Log Normal Distribution.” Biometrika. diff --git a/pyPLNmodels/models/plnar.py b/pyPLNmodels/models/plnar.py index ecc9bfe1..9df37fc7 100644 --- a/pyPLNmodels/models/plnar.py +++ b/pyPLNmodels/models/plnar.py @@ -4,7 +4,7 @@ import pandas as pd import numpy as np -from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL +from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL, DEVICE from pyPLNmodels.calculations.elbos import ( elbo_plnar_diag_autoreg, elbo_plnar_scalar_autoreg, @@ -25,8 +25,6 @@ from pyPLNmodels.utils._viz import _viz_dims, ARModelViz from pyPLNmodels.utils._data_handler import _extract_data_from_formula -DEVICE = "cuda" if torch.cuda.is_available() else "cpu" - class PlnAR(BaseModel): # pylint: disable=too-many-instance-attributes """ diff --git a/pyPLNmodels/models/plnmixture.py b/pyPLNmodels/models/plnmixture.py index 08af7a12..e9048497 100644 --- a/pyPLNmodels/models/plnmixture.py +++ b/pyPLNmodels/models/plnmixture.py @@ -6,7 +6,7 @@ from numpy.typing import ArrayLike from sklearn.metrics import silhouette_score -from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL +from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL, DEVICE from pyPLNmodels.models.plndiag import PlnDiag from pyPLNmodels.utils._data_handler import ( _extract_data_from_formula, @@ -28,9 +28,6 @@ from pyPLNmodels.utils._viz import MixtureModelViz, _viz_variables -DEVICE = "cuda" if torch.cuda.is_available() else "cpu" - - class PlnMixture( BaseModel ): # pylint: disable=too-many-instance-attributes, too-many-public-methods diff --git a/pyPLNmodels/models/plnnetwork.py b/pyPLNmodels/models/plnnetwork.py index 94e047dc..429736d1 100644 --- a/pyPLNmodels/models/plnnetwork.py +++ b/pyPLNmodels/models/plnnetwork.py @@ -1,13 +1,20 @@ from typing import Optional, Union +import warnings import torch import numpy as np import pandas as pd -from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL +from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL, DEVICE from pyPLNmodels.calculations.elbos import elbo_pln -from pyPLNmodels.utils._utils import _add_doc, _get_two_dim_latent_variances +from pyPLNmodels.utils._utils import ( + _add_doc, + _get_two_dim_latent_variances, + _group_lasso_penalty, + _lasso_penalty, + _sparse_group_lasso_penalty, +) from pyPLNmodels.utils._viz import _viz_network, NetworkModelViz, _build_graph from pyPLNmodels.utils._data_handler import _extract_data_from_formula, _array2tensor from pyPLNmodels.calculations._closed_forms import _closed_formula_coef @@ -15,17 +22,21 @@ from pyPLNmodels.calculations._initialization import ( _init_components_prec, _init_latent_pln, + _init_coef, ) THRESHOLD = 1e-5 -class PlnNetwork(BaseModel): # pylint:disable=too-many-public-methods +class PlnNetwork( + BaseModel +): # pylint:disable=too-many-public-methods,too-many-instance-attributes """ Pln model with regularization on the number of parameters of the precision matrix (inverse covariance matrix) representing correlation - between variables. + between variables. A penalty can also be imposed on the coef + to have a sparse regression matrix. For more details, see: J. Chiquet, S. Robin, M. Mariadassou: "Variational Inference for sparse network @@ -44,7 +55,7 @@ class PlnNetwork(BaseModel): # pylint:disable=too-many-public-methods >>> from pyPLNmodels import PlnNetwork, load_scrna >>> data = load_scrna() - >>> net = PlnNetwork.from_formula("endog ~ 1 + labels", data=data, penalty = 200) + >>> net = PlnNetwork.from_formula("endog ~ 1 + labels", data=data, penalty = 200, penalty_coef = 10) #pylint: disable=line-too-long >>> net.fit() >>> print(net) >>> net.viz(colors=data["labels"]) @@ -52,10 +63,12 @@ class PlnNetwork(BaseModel): # pylint:disable=too-many-public-methods """ penalty: float + penalty_coef: float _components_prec: torch.Tensor _mask: torch.Tensor _ModelViz = NetworkModelViz + __coef: torch.Tensor @_add_doc( BaseModel, @@ -75,6 +88,22 @@ class PlnNetwork(BaseModel): # pylint:disable=too-many-public-methods :class:`pyPLNmodels.PlnMixture` :class:`pyPLNmodels.Pln` """, + params=""" + penalty: float + - The penalty parameter for the precision matrix. The larger the penalty, the larger the + sparsity of the precision matrix. + penalty_coef: float + - The penalty parameter for the coef matrix. The larger the penalty, the larger the + sparsity of the coef matrix. Default is 0 (no penalty). + penalty_coef_type: optional ("lasso", "group_lasso", "sparse_group_lasso") + - The penalty type for the `coef`. Useless if `penalty_coef` is 0. Can be either: + - "lasso": Enforces sparsity on each coefficient independently, encouraging + many coefficients to be exactly zero. + - "group_lasso": Enforces group sparsity, encouraging entire groups of + coefficients (e.g., corresponding to a covariate) to be zero. + - "sparse_group_lasso": Combines the effects of "lasso" and + "group_lasso", enforcing both individual and group sparsity. + """, ) def __init__( self, @@ -85,10 +114,12 @@ def __init__( offsets: Optional[Union[torch.Tensor, np.ndarray, pd.DataFrame]] = None, compute_offsets_method: {"zero", "logsum"} = "zero", add_const: bool = True, + penalty_coef: float = 0, + penalty_coef_type: {"lasso", "group_lasso", "sparse_group_lasso"} = "lasso", ): # pylint: disable=too-many-arguments - if penalty < 0: - raise AttributeError(f"Penalty should be positive. Got {penalty}") - self.penalty = penalty + self._set_penalty(penalty) + self._set_penalty_coef(penalty_coef) + self._set_penalty_coef_type(penalty_coef_type) super().__init__( endog, exog=exog, @@ -114,7 +145,23 @@ def __init__( see_also=""" :class:`pyPLNmodels.PlnNetwork` :func:`pyPLNmodels.PlnNetwork.__init__` - """, + """, + params=""" + penalty: float + - The penalty parameter for the precision matrix. The larger the penalty, the larger the + sparsity of the precision matrix. + penalty_coef: float + - The penalty parameter for the coef matrix. The larger the penalty, the larger the + sparsity of the coef matrix. Default is 0 (no penalty). + penalty_coef_type: optional ("lasso", "group_lasso", "sparse_group_lasso") + - The penalty type for the `coef`. Useless if `penalty_coef` is 0. Can be either: + - "lasso": Enforces sparsity on each coefficient independently, encouraging + many coefficients to be exactly zero. + - "group_lasso": Enforces group sparsity, encouraging entire groups of + coefficients (e.g., corresponding to a covariate) to be zero. + - "sparse_group_lasso": Combines the effects of "lasso" and + "group_lasso", enforcing both individual and group sparsity. + """, ) def from_formula( cls, @@ -123,7 +170,9 @@ def from_formula( *, penalty: float, compute_offsets_method: {"zero", "logsum"} = "zero", - ): # pylint: disable=arguments-differ + penalty_coef: float = 0, + penalty_coef_type: {"lasso", "group_lasso", "sparse_group_lasso"} = "lasso", + ): # pylint: disable=arguments-differ,too-many-arguments endog, exog, offsets = _extract_data_from_formula(formula, data) return cls( endog, @@ -132,6 +181,8 @@ def from_formula( offsets=offsets, compute_offsets_method=compute_offsets_method, add_const=False, + penalty_coef=penalty_coef, + penalty_coef_type=penalty_coef_type, ) @_add_doc( @@ -153,8 +204,19 @@ def from_formula( """, params=""" penalty: float - - The penalty parameter. The larger the penalty, the larger the + - The penalty parameter for the precision matrix. The larger the penalty, the larger the sparsity of the precision matrix. + penalty_coef: float + - The penalty parameter for the coef matrix. The larger the penalty, the larger the + sparsity of the coef matrix. Default is 0 (no penalty). + penalty_coef_type: optional ("lasso", "group_lasso", "sparse_group_lasso") + - The penalty type for the `coef`. Useless if `penalty_coef` is 0. Can be either: + - "lasso": Enforces sparsity on each coefficient independently, encouraging + many coefficients to be exactly zero. + - "group_lasso": Enforces group sparsity, encouraging entire groups of + coefficients (e.g., corresponding to a covariate) to be zero. + - "sparse_group_lasso": Combines the effects of "lasso" and + "group_lasso", enforcing both individual and group sparsity. """, returns=""" PlnNetwork object @@ -168,14 +230,65 @@ def fit( tol: float = DEFAULT_TOL, verbose: bool = False, penalty: float = None, + penalty_coef: float = None, + penalty_coef_type: {"lasso", "group_lasso", "sparse_group_lasso"} = None, ): # pylint: disable = too-many-arguments if penalty is not None: - if not isinstance(penalty, (int, float)): - raise ValueError("penalty must be a float.") - print(f"Changing penalty from {self.penalty} to : ", penalty, ".") - self.penalty = penalty + self._set_penalty(penalty) + print(f"Changing `penalty` from {self.penalty} to : ", penalty, ".") + if penalty_coef is not None: + if self.penalty_coef == 0 and penalty_coef > 0: + if self.nb_cov == 0: + self.__coef = None + else: + self.__coef = ( + _closed_formula_coef(self._exog, self._latent_mean) + .detach() + .requires_grad_(True) + ) + self._set_penalty_coef(penalty_coef) + print( + f"Changing `penalty_coef` from {self.penalty_coef} to : ", + penalty_coef, + ".", + ) + if penalty_coef_type is not None: + self._set_penalty_coef_type(penalty_coef_type) + print( + f"Changing `penalty_coef_type` from {self.penalty} to : ", penalty, "." + ) return super().fit(maxiter=maxiter, lr=lr, tol=tol, verbose=verbose) + def _set_penalty(self, penalty): + if not isinstance(penalty, (int, float)): + raise ValueError( + f"`penalty` must be a float, got {type(penalty).__name__}." + ) + if penalty < 0: + raise ValueError(f"`penalty` should be positive. Got {penalty}") + self.penalty = penalty + + def _set_penalty_coef(self, penalty_coef): + if not isinstance(penalty_coef, (int, float)): + raise ValueError( + f"`penalty_coef` must be a float, got {type(penalty_coef).__name__}." + ) + if penalty_coef < 0: + raise ValueError(f"`penalty_coef` should be positive. Got {penalty_coef}") + self.penalty_coef = penalty_coef + + def _set_penalty_coef_type(self, penalty_coef_type): + if penalty_coef_type not in ["lasso", "group_lasso", "sparse_group_lasso"]: + msg = "`penalty_coef_type` should be either 'lasso'," + msg += f"'group_lasso', or 'sparse_group_lasso', got {penalty_coef_type}" + raise ValueError(msg) + self.penalty_coef_type = penalty_coef_type + if self.penalty_coef == 0 and penalty_coef_type in [ + "group_lasso", + "sparse_group_lasso", + ]: + raise ValueError("`penalty_coef` is 0, no penalty can be imposed.") + @_add_doc( BaseModel, example=""" @@ -197,11 +310,26 @@ def compute_elbo(self): latent_sqrt_variance=self._latent_sqrt_variance, precision=precision, ) - return elbo_no_penalty - self.penalty * self._l1_penalty(precision) - - def _l1_penalty(self, precision): + elbo_penalty = elbo_no_penalty - self.penalty * self._l1_penalty_precision( + precision + ) + if self.nb_cov == 0: + return elbo_penalty + if self.penalty_coef > 0: + penalty_coef_value = self._get_penalty_coef_value() + elbo_penalty -= self.penalty_coef * penalty_coef_value + return elbo_penalty + + def _l1_penalty_precision(self, precision): return torch.norm(precision * self._mask, p=1) + def _get_penalty_coef_value(self): + if self.penalty_coef_type == "lasso": + return _lasso_penalty(self.__coef) + if self.penalty_coef_type == "group_lasso": + return _group_lasso_penalty(self.__coef) + return _sparse_group_lasso_penalty(self.__coef) + @property def _precision(self): return self._components_prec @ (self._components_prec.T) @@ -227,6 +355,19 @@ def nb_zeros_precision(self): def _init_model_parameters(self): if not hasattr(self, "_components_prec"): self._components_prec = _init_components_prec(self._endog) + if self.penalty_coef > 0: + # if penalty coef is positive, then no closed forms for the coef + if not hasattr(self, "__coef"): + coef = _init_coef( + endog=self._endog, exog=self._exog, offsets=self._offsets + ) + if coef is not None: + self.__coef = coef.detach().to(DEVICE) + else: + self.__coef = None + warnings.warn( + "No covariates in the model, `penalty_coef` is useless." + ) @property @_add_doc(BaseModel) @@ -236,6 +377,8 @@ def list_of_parameters_needing_gradient(self): self._latent_sqrt_variance, self._components_prec, ] + if self.penalty_coef > 0 and self.__coef is not None: + list_params.append(self.__coef) return list_params def viz_network(self, ax=None): @@ -253,11 +396,24 @@ def viz_network(self, ax=None): >>> net.viz_network() """ _viz_network( - self.precision * (torch.abs(self.precision) > THRESHOLD), + self.precision, ax=ax, node_labels=self.column_names_endog, ) + @property + def precision(self): + """ + Property representing the precision of the model, that is the inverse covariance matrix. + + Returns + ------- + torch.Tensor + The precision matrix of size (dim, dim). + """ + precision = self._precision + return (precision * (torch.abs(precision) > THRESHOLD)).detach().cpu() + @property def network(self): """ @@ -273,7 +429,7 @@ def network(self): >>> print(net.network) """ _, connections = _build_graph( - self.precision * (torch.abs(self.precision) > THRESHOLD), + self.precision, node_labels=self.column_names_endog, ) return connections @@ -290,6 +446,8 @@ def dict_latent_parameters(self): @property def _coef(self): + if self.penalty_coef > 0: + return self.__coef return _closed_formula_coef(self._exog, self._latent_mean) @property @@ -484,7 +642,9 @@ def nb_links(self): @property def _description(self): - return f" penalty {self.penalty}." + descr = f"penalty {self.penalty} on the precision matrix and {self.penalty_coef_type}" + descr += f" penalty {self.penalty_coef} on the regression coefficients." + return descr def _init_latent_parameters(self): if not hasattr(self, "_latent_mean") or not hasattr( @@ -534,3 +694,19 @@ def components_prec( @_add_doc(BaseModel) def entropy(self): return entropy_gaussian(self._latent_sqrt_variance**2).detach().cpu().item() + + @property + def coef(self): + """ + Property representing the regression coefficients of size (`nb_cov`, `dim`). + If no exogenous (`exog`) is available, returns `None`. + + Returns + ------- + torch.Tensor or None + The coefficients or `None` if no coefficients are given in the model. + """ + if self._coef is not None: + coef_thresholded = (torch.abs(self._coef) > THRESHOLD) * self._coef + return coef_thresholded.detach().cpu() + return None diff --git a/pyPLNmodels/models/plnnetworkcollection.py b/pyPLNmodels/models/plnnetworkcollection.py index 202be366..c21440b9 100644 --- a/pyPLNmodels/models/plnnetworkcollection.py +++ b/pyPLNmodels/models/plnnetworkcollection.py @@ -20,6 +20,8 @@ class PlnNetworkCollection(Collection): J. Chiquet, S. Robin, M. Mariadassou: "Variational Inference for sparse network reconstruction from count data" + Unlike the PlnNetwork, the penalty coef can not be changed at fitting time. + Examples -------- >>> from pyPLNmodels import PlnNetworkCollection, load_scrna @@ -50,6 +52,17 @@ class PlnNetworkCollection(Collection): params=""" penalties : Iterable[float], optional(keyword-only) The range of penalties, by default `(1, 10, 100, 1000)`. + penalty_coef: float + - The penalty parameter for the coef matrix. The larger the penalty, the larger the + sparsity of the coef matrix. Default is 0 (no penalty). + penalty_coef_type: optional ("lasso", "group_lasso", "sparse_group_lasso") + - The penalty type for the `coef`. Useless if `penalty_coef` is 0. Can be either: + - "lasso": Enforces sparsity on each coefficient independently, encouraging + many coefficients to be exactly zero. + - "group_lasso": Enforces group sparsity, encouraging entire groups of + coefficients (e.g., corresponding to a covariate) to be zero. + - "sparse_group_lasso": Combines the effects of "lasso" and + "group_lasso", enforcing both individual and group sparsity. """, example=""" >>> from pyPLNmodels import PlnNetworkCollection, load_scrna @@ -74,7 +87,11 @@ def __init__( compute_offsets_method: {"zero", "logsum"} = "zero", add_const: bool = True, penalties: Optional[Iterable[float]] = (1, 10, 100, 1000), + penalty_coef: float = 0, + penalty_coef_type: {"lasso", "group_lasso", "sparse_group_lasso"} = "lasso", ): # pylint: disable=too-many-arguments + self.penalty_coef = penalty_coef + self.penalty_coef_type = penalty_coef_type super().__init__( endog=endog, grid=penalties, @@ -91,6 +108,17 @@ def __init__( penalties : Iterable[float], optional(keyword-only) The penalties that needs to be tested. By default (1, 10, 100, 1000). + penalty_coef: float + The penalty parameter for the coef matrix. The larger the penalty, the larger the + sparsity of the coef matrix. Default is 0 (no penalty). + penalty_coef_type: optional ("lasso", "group_lasso", "sparse_group_lasso") + The penalty type for the `coef`. Useless if `penalty_coef` is 0. Can be either: + - "lasso": Enforces sparsity on each coefficient independently, encouraging + many coefficients to be exactly zero. + - "group_lasso": Enforces group sparsity, encouraging entire groups of + coefficients (e.g., corresponding to a covariate) to be zero. + - "sparse_group_lasso": Combines the effects of "lasso" and + "group_lasso", enforcing both individual and group sparsity. """, ) def from_formula( @@ -100,7 +128,9 @@ def from_formula( *, compute_offsets_method: {"zero", "logsum"} = "zero", penalties: Optional[Iterable[int]] = (1, 10, 100, 1000), - ): # pylint: disable=missing-function-docstring, arguments-differ + penalty_coef: float = 0, + penalty_coef_type: {"lasso", "group_lasso", "sparse_group_lasso"} = "lasso", + ): # pylint: disable=missing-function-docstring, arguments-differ, too-many-arguments endog, exog, offsets = _extract_data_from_formula(formula, data) return cls( endog=endog, @@ -109,6 +139,8 @@ def from_formula( compute_offsets_method=compute_offsets_method, penalties=penalties, add_const=False, + penalty_coef=penalty_coef, + penalty_coef_type=penalty_coef_type, ) def _instantiate_model(self, grid_value): @@ -118,6 +150,8 @@ def _instantiate_model(self, grid_value): offsets=self._offsets, penalty=grid_value, add_const=False, + penalty_coef=self.penalty_coef, + penalty_coef_type=self.penalty_coef_type, ) def _is_right_instance(self, grid_value): @@ -175,7 +209,7 @@ def fit( lr: float = 0.01, tol: float = DEFAULT_TOL, verbose: bool = False, - ): + ): # pylint: disable = too-many-arguments return super().fit(maxiter=maxiter, lr=lr, tol=tol, verbose=verbose) @property diff --git a/pyPLNmodels/models/plnpca.py b/pyPLNmodels/models/plnpca.py index 15d18b7c..98daf43b 100644 --- a/pyPLNmodels/models/plnpca.py +++ b/pyPLNmodels/models/plnpca.py @@ -3,7 +3,7 @@ import numpy as np import pandas as pd -from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL +from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL, DEVICE from pyPLNmodels.calculations.elbos import elbo_plnpca from pyPLNmodels.calculations._initialization import ( _init_coef, @@ -21,9 +21,6 @@ from pyPLNmodels.utils._viz import PCAModelViz -DEVICE = "cuda" if torch.cuda.is_available() else "cpu" - - class PlnPCA(BaseModel): """Principal Component Analysis on top of a PLN model, that is a PLN model with low-rank covariance, adapted to datasets with lots of features. diff --git a/pyPLNmodels/models/plnpcacollection.py b/pyPLNmodels/models/plnpcacollection.py index 47d12b13..ed16d357 100644 --- a/pyPLNmodels/models/plnpcacollection.py +++ b/pyPLNmodels/models/plnpcacollection.py @@ -11,8 +11,6 @@ from pyPLNmodels.utils._data_handler import _extract_data_from_formula from pyPLNmodels.utils._viz import _show_collection_and_explained_variance -DEVICE = "cuda" if torch.cuda.is_available() else "cpu" - class PlnPCACollection(Collection): """ diff --git a/pyPLNmodels/models/zipln.py b/pyPLNmodels/models/zipln.py index a5a6ac7c..e17de8aa 100644 --- a/pyPLNmodels/models/zipln.py +++ b/pyPLNmodels/models/zipln.py @@ -4,7 +4,7 @@ import numpy as np import pandas as pd -from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL +from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL, DEVICE from pyPLNmodels.calculations._initialization import _init_coef_coef_inflation from pyPLNmodels.calculations._closed_forms import ( _closed_formula_coef, @@ -21,7 +21,6 @@ _extract_data_inflation_from_formula, ) -DEVICE = "cuda" if torch.cuda.is_available() else "cpu" NULL_TENSOR = torch.tensor([0], device=DEVICE) diff --git a/pyPLNmodels/models/ziplnpca.py b/pyPLNmodels/models/ziplnpca.py index 19aa47f7..e31e9c64 100644 --- a/pyPLNmodels/models/ziplnpca.py +++ b/pyPLNmodels/models/ziplnpca.py @@ -3,7 +3,7 @@ import numpy as np import pandas as pd -from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL +from pyPLNmodels.models.base import BaseModel, DEFAULT_TOL, DEVICE from pyPLNmodels.models.zipln import ZIPln from pyPLNmodels.calculations.elbos import elbo_ziplnpca from pyPLNmodels.calculations._initialization import ( @@ -21,8 +21,6 @@ from pyPLNmodels.utils._utils import _add_doc, _check_array_size from pyPLNmodels.utils._viz import ZIPCAModelViz -DEVICE = "cuda" if torch.cuda.is_available() else "cpu" - REGULARIZATION = 0.0001 diff --git a/pyPLNmodels/utils/_utils.py b/pyPLNmodels/utils/_utils.py index 02d35b9b..a3c53f2c 100644 --- a/pyPLNmodels/utils/_utils.py +++ b/pyPLNmodels/utils/_utils.py @@ -387,3 +387,18 @@ def _get_uncumsum(eigenvalues): diff_diag_cov[0] = torch.sqrt(eigenvalues[0]) diff_diag_cov[1:] = torch.sqrt(eigenvalues[1:] - eigenvalues[:-1]) return diff_diag_cov + + +def _lasso_penalty(coef): + return torch.sum(torch.abs(coef)) + + +def _group_lasso_penalty(coef): + return torch.sum(torch.norm(coef, p=2, dim=0)) + + +def _sparse_group_lasso_penalty(coef, alpha=0.5): + l1_penalty = torch.sum(torch.abs(coef)) + group_norms = torch.norm(coef, p=2, dim=0) + group_lasso_penalty = torch.sum(group_norms) + return alpha * l1_penalty + (1 - alpha) * group_lasso_penalty diff --git a/tests/_init_functions.py b/tests/_init_functions.py index d55697f3..32ccaaa1 100644 --- a/tests/_init_functions.py +++ b/tests/_init_functions.py @@ -15,6 +15,7 @@ ) PENALTY = 200 +PENALTY_COEF = 10 PENALTIES = [1, 100] RANKS = [3, 6] N_CLUSTERS = [2, 3] @@ -150,11 +151,15 @@ def _PlnNetwork_init(init_method, **kwargs): offsets=offsets, add_const=add_const, penalty=PENALTY, + penalty_coef=PENALTY_COEF, + penalty_coef_type="group_lasso", ) if init_method == "formula": data = kwargs.get("data", None) formula = kwargs.get("formula", None) - return PlnNetwork.from_formula(formula, data=data, penalty=PENALTY) + return PlnNetwork.from_formula( + formula, data=data, penalty=PENALTY, penalty_coef=0 + ) raise ValueError('init_method must be "explicit" or "formula"') @@ -274,11 +279,16 @@ def _PlnNetworkCollection_init(init_method, **kwargs): offsets=offsets, add_const=add_const, penalties=PENALTIES, + penalty_coef=0, ) if init_method == "formula": data = kwargs.get("data", None) formula = kwargs.get("formula", None) return PlnNetworkCollection.from_formula( - formula, data=data, penalties=PENALTIES + formula, + data=data, + penalties=PENALTIES, + penalty_coef=PENALTY_COEF, + penalty_coef_type="sparse_group_lasso", ) raise ValueError('init_method must be "explicit" or "formula"') diff --git a/tests/test_network.py b/tests/test_network.py new file mode 100644 index 00000000..d6088d00 --- /dev/null +++ b/tests/test_network.py @@ -0,0 +1,90 @@ +# pylint: skip-file +import pytest +from pyPLNmodels import PlnNetwork, load_scrna, PlnNetworkCollection + + +data = load_scrna() + + +def test_penalty_coef_network(): + _ = PlnNetwork.from_formula( + "endog ~ 1 + labels", data=data, penalty=10, penalty_coef=1 + ).fit(maxiter=10) + _ = PlnNetwork.from_formula( + "endog ~ 1 + labels", data=data, penalty=10, penalty_coef=0 + ).fit(maxiter=10) + with pytest.raises(ValueError): + _ = PlnNetwork.from_formula( + "endog ~ 1 + labels", + data=data, + penalty=10, + penalty_coef=0, + penalty_coef_type="group_lasso", + ) + with pytest.raises(ValueError): + _ = PlnNetwork.from_formula( + "endog ~ 1 + labels", + data=data, + penalty=10, + penalty_coef=-1, + penalty_coef_type="group_lasso", + ) + net = PlnNetwork.from_formula( + "endog ~ 1 + labels", + data=data, + penalty=10, + penalty_coef=1, + penalty_coef_type="sparse_group_lasso", + ) + net.fit(penalty_coef=10) + net.fit(penalty_coef=0, penalty_coef_type="lasso") + net.fit(penalty_coef_type="group_lasso", maxiter=10, penalty_coef=10) + net.fit(penalty_coef_type="sparse_group_lasso", maxiter=10, penalty_coef=5) + with pytest.raises(ValueError): + net.fit(penalty_coef=-10) + with pytest.raises(ValueError): + _ = PlnNetwork.from_formula( + "endog ~ 1 + labels", + data=data, + penalty=10, + penalty_coef=1, + penalty_coef_type="dumb", + ) + + _ = PlnNetwork.from_formula("endog ~ 0", data=data, penalty=10, penalty_coef=1).fit( + maxiter=10, penalty_coef=5 + ) + net = PlnNetwork.from_formula( + "endog ~ 1 + labels", + data=data, + penalty=1, + penalty_coef=1, + penalty_coef_type="sparse_group_lasso", + ).fit(maxiter=10) + with pytest.raises(ValueError): + net.components_prec = net._components_prec[:3] + + +def test_penalty_coef_network_collection(): + _ = PlnNetworkCollection.from_formula( + "endog ~ 1 + labels", data=data, penalties=[1, 10], penalty_coef=1 + ).fit(maxiter=10) + _ = PlnNetworkCollection.from_formula( + "endog ~ 1 + labels", data=data, penalties=[1, 10], penalty_coef=0 + ).fit(maxiter=10) + with pytest.raises(ValueError): + _ = PlnNetworkCollection.from_formula( + "endog ~ 1 + labels", + data=data, + penalties=[1, 10], + penalty_coef=0, + penalty_coef_type="group_lasso", + ) + with pytest.raises(ValueError): + _ = PlnNetworkCollection.from_formula( + "endog ~ 1 + labels", + data=data, + penalties=[1, 10], + penalty_coef=-1, + penalty_coef_type="group_lasso", + ) diff --git a/tests/test_plnpca.py b/tests/test_wrong_grid.py similarity index 63% rename from tests/test_plnpca.py rename to tests/test_wrong_grid.py index a2025d51..30c28681 100644 --- a/tests/test_plnpca.py +++ b/tests/test_wrong_grid.py @@ -24,5 +24,12 @@ def test_wrong_grid_value(): with pytest.raises(AttributeError): pca = PlnMixture(data["endog"], n_cluster=-1) - with pytest.raises(AttributeError): - pca = PlnNetwork(data["endog"], penalty=-1) + with pytest.raises(ValueError): + net = PlnNetwork(data["endog"], penalty=-1) + + with pytest.raises(ValueError): + net = PlnNetwork(data["endog"], penalty=-1, penalty_coef=2) + with pytest.raises(ValueError): + net = PlnNetwork(data["endog"], penalty="dumb", penalty_coef=2) + with pytest.raises(ValueError): + net = PlnNetwork(data["endog"], penalty=1, penalty_coef="dumb")