Skip to content

Commit

Permalink
feat: added author name; minor adaption in variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
MothNik committed May 20, 2024
1 parent e78823e commit 78610f4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
14 changes: 12 additions & 2 deletions chemotools/baseline/_air_pls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,28 @@
"""

# Authors:
# Pau Cabaneros
# Niklas Zell <nik.zoe@web.de>


### Imports ###


import logging
from typing import Union

import numpy as np
from sklearn.base import BaseEstimator, OneToOneFeatureMixin, TransformerMixin
from sklearn.utils.validation import check_is_fitted

from chemotools.utils.check_inputs import check_input
from chemotools.utils._whittaker_base import WhittakerLikeSolver
from chemotools.utils.check_inputs import check_input

logger = logging.getLogger(__name__)

### Main Class ###


# TODO: is polynomial_order actually differences and if so, is the description correct?
class AirPls(
Expand Down Expand Up @@ -187,7 +197,7 @@ def _calculate_air_pls(self, x):
# FIXME: work on full Arrays and use internal loop of ``whittaker_solve``
for i in range(0, self.nr_iterations - 1):
# the baseline is fitted using the Whittaker smoother framework
z, _ = self._solve_single_b_fixed_lam(b=x, w=w)
z, _ = self._solve_single_b_fixed_lam(rhs_b=x, weights=w)
d = x - z
dssn = np.abs(d[d < 0].sum())

Expand Down
13 changes: 11 additions & 2 deletions chemotools/baseline/_ar_pls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
"""

# Authors:
# Pau Cabaneros
# Niklas Zell <nik.zoe@web.de>


### Imports ###

import logging
from numbers import Integral
from typing import Union
Expand All @@ -26,11 +33,13 @@
from sklearn.base import BaseEstimator, OneToOneFeatureMixin, TransformerMixin
from sklearn.utils.validation import check_is_fitted, check_scalar

from chemotools.utils.check_inputs import check_input
from chemotools.utils._whittaker_base import WhittakerLikeSolver
from chemotools.utils.check_inputs import check_input

logger = logging.getLogger(__name__)

### Main Class ###


class ArPls(
OneToOneFeatureMixin,
Expand Down Expand Up @@ -194,7 +203,7 @@ def _calculate_ar_pls(self, x):
# FIXME: work on full Arrays and use internal loop of ``whittaker_solve``
for _ in range(self.nr_iterations):
# the baseline is fitted using the Whittaker smoother framework
z, _ = self._solve_single_b_fixed_lam(b=x, w=w)
z, _ = self._solve_single_b_fixed_lam(rhs_b=x, weights=w)
d = x - z

# if there is no data point below the baseline, the baseline is considered
Expand Down

0 comments on commit 78610f4

Please sign in to comment.