Skip to content

Commit ddd2c89

Browse files
АнгелинаАнгелина
authored andcommitted
refactor: Rename member functions algorithm to compute
1 parent 62fa25f commit ddd2c89

File tree

15 files changed

+28
-28
lines changed

15 files changed

+28
-28
lines changed

src/estimators/abstract_estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from numpy import _typing
44

5-
from src.algorithms import ALGORITHM_REGISTRY
5+
from src.procedures import ALGORITHM_REGISTRY
66
from src.estimators.estimate_result import EstimateResult
77
from src.register.algorithm_purpose import AlgorithmPurpose
88

src/mixtures/nm_mixture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from scipy.stats import norm, rv_continuous
88
from scipy.stats.distributions import rv_frozen
99

10-
from src.algorithms.support_algorithms.log_rqmc import LogRQMC
11-
from src.algorithms.support_algorithms.rqmc import RQMC
10+
from src.procedures.support.log_rqmc import LogRQMC
11+
from src.procedures.support.rqmc import RQMC
1212
from src.mixtures.abstract_mixture import AbstractMixtures
1313

1414

src/mixtures/nmv_mixture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from scipy.stats import geninvgauss, norm, rv_continuous
88
from scipy.stats.distributions import rv_frozen
99

10-
from src.algorithms.support_algorithms.log_rqmc import LogRQMC
11-
from src.algorithms.support_algorithms.rqmc import RQMC
10+
from src.procedures.support.log_rqmc import LogRQMC
11+
from src.procedures.support.rqmc import RQMC
1212
from src.mixtures.abstract_mixture import AbstractMixtures
1313

1414

src/mixtures/nv_mixture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from scipy.stats import norm, rv_continuous
88
from scipy.stats.distributions import rv_frozen
99

10-
from src.algorithms.support_algorithms.log_rqmc import LogRQMC
11-
from src.algorithms.support_algorithms.rqmc import RQMC
10+
from src.procedures.support.log_rqmc import LogRQMC
11+
from src.procedures.support.rqmc import RQMC
1212
from src.mixtures.abstract_mixture import AbstractMixtures
1313

1414

src/procedures/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
from src.algorithms.semiparam_algorithms.nm_semi_param_algorithms.g_estimation_convolution import (
1+
from src.procedures.semiparametric.nm_semi_param_algorithms.g_estimation_convolution import (
22
NMSemiParametricGEstimation,
33
)
4-
from src.algorithms.semiparam_algorithms.nm_semi_param_algorithms.sigma_estimation_eigenvalue_based import (
4+
from src.procedures.semiparametric.nm_semi_param_algorithms.sigma_estimation_eigenvalue_based import (
55
SemiParametricMeanSigmaEstimationEigenvalueBased,
66
)
7-
from src.algorithms.semiparam_algorithms.nm_semi_param_algorithms.sigma_estimation_empirical import (
7+
from src.procedures.semiparametric.nm_semi_param_algorithms.sigma_estimation_empirical import (
88
SemiParametricMeanSigmaEstimationEmpirical,
99
)
10-
from src.algorithms.semiparam_algorithms.nv_semi_param_algorithms.g_estimation_given_mu import (
10+
from src.procedures.semiparametric.nv_semi_param_algorithms.g_estimation_given_mu import (
1111
SemiParametricNVEstimation,
1212
)
13-
from src.algorithms.semiparam_algorithms.nv_semi_param_algorithms.g_estimation_post_widder import (
13+
from src.procedures.semiparametric.nv_semi_param_algorithms.g_estimation_post_widder import (
1414
NVSemiParametricGEstimationPostWidder,
1515
)
16-
from src.algorithms.semiparam_algorithms.nvm_semi_param_algorithms.g_estimation_given_mu import (
16+
from src.procedures.semiparametric.nvm_semi_param_algorithms.g_estimation_given_mu import (
1717
SemiParametricGEstimationGivenMu,
1818
)
19-
from src.algorithms.semiparam_algorithms.nvm_semi_param_algorithms.g_estimation_given_mu_rqmc_based import (
19+
from src.procedures.semiparametric.nvm_semi_param_algorithms.g_estimation_given_mu_rqmc_based import (
2020
SemiParametricGEstimationGivenMuRQMCBased,
2121
)
22-
from src.algorithms.semiparam_algorithms.nvm_semi_param_algorithms.g_estimation_post_widder import (
22+
from src.procedures.semiparametric.nvm_semi_param_algorithms.g_estimation_post_widder import (
2323
SemiParametricGEstimationPostWidder,
2424
)
25-
from src.algorithms.semiparam_algorithms.nvm_semi_param_algorithms.mu_estimation import SemiParametricMuEstimation
25+
from src.procedures.semiparametric.nvm_semi_param_algorithms.mu_estimation import (SemiParametricMuEstimation)
2626
from src.register.algorithm_purpose import AlgorithmPurpose
2727
from src.register.register import Registry
2828

src/procedures/semiparametric/nm_semi_param_algorithms/g_estimation_convolution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def cdf(self, X: np.ndarray) -> np.ndarray:
9393

9494
return F_x.real
9595

96-
def algorithm(self, sample: _typing.NDArray[np.float64]) -> EstimateResult:
96+
def compute(self, sample: _typing.NDArray[np.float64]) -> EstimateResult:
9797
inv = self.BohmanA(N=self.bohman_n, delta=self.bohman_delta)
9898
inv.fit(self.characteristic_function_xi)
9999
x_data_array = np.array(self.x_data, dtype=np.float64)

src/procedures/semiparametric/nm_semi_param_algorithms/sigma_estimation_eigenvalue_based.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _build_matrix(self, tau: float) -> np.ndarray:
8686
matrix[i, j] = self._alpha(t[i] - t[j], tau)
8787
return matrix
8888

89-
def algorithm(self, sample: np.ndarray) -> EstimateResult:
89+
def compute(self, sample: np.ndarray) -> EstimateResult:
9090
"""Estimate sigma.
9191
9292
Args:

src/procedures/semiparametric/nm_semi_param_algorithms/sigma_estimation_empirical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _validate_kwargs(**kwargs: ParamsAnnotation) -> float:
5151
raise ValueError("Expected a positive float as parameter `t`.")
5252
return t
5353

54-
def algorithm(self, sample: np.ndarray) -> EstimateResult:
54+
def compute(self, sample: np.ndarray) -> EstimateResult:
5555
"""Estimate the sigma parameter.
5656
5757
Args:

src/procedures/semiparametric/nv_semi_param_algorithms/g_estimation_given_mu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,6 @@ def compute_integrals_for_x(self, x: float) -> float:
173173
total = np.sum(first_integral + second_integral) / self.denominator
174174
return max(0.0, total.real)
175175

176-
def algorithm(self, sample: _typing.NDArray[np.float64]) -> EstimateResult:
176+
def compute(self, sample: _typing.NDArray[np.float64]) -> EstimateResult:
177177
y_data = [self.compute_integrals_for_x(x) for x in self.x_data]
178178
return EstimateResult(list_value=y_data, success=True)

src/procedures/semiparametric/nv_semi_param_algorithms/g_estimation_post_widder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def p_x_estimation(self, x: float) -> float:
7777
)
7878
return result.real
7979

80-
def algorithm(self, sample: np._typing.NDArray) -> EstimateResult:
80+
def compute(self, sample: np._typing.NDArray) -> EstimateResult:
8181
"""Estimate g(x)
8282
8383
Args:

0 commit comments

Comments
 (0)