|
14 | 14 | # limitations under the License.
|
15 | 15 | # ==============================================================================
|
16 | 16 |
|
17 |
| -import numpy as np |
18 |
| - |
19 |
| -from daal4py.sklearn._utils import get_dtype |
20 |
| - |
21 | 17 | from ...covariance import (
|
22 | 18 | IncrementalEmpiricalCovariance as base_IncrementalEmpiricalCovariance,
|
23 | 19 | )
|
24 |
| -from ...datatypes import to_table |
25 |
| -from ...utils import _check_array |
26 | 20 | from .._base import BaseEstimatorSPMD
|
27 | 21 |
|
28 | 22 |
|
29 | 23 | class IncrementalEmpiricalCovariance(
|
30 | 24 | BaseEstimatorSPMD, base_IncrementalEmpiricalCovariance
|
31 | 25 | ):
|
32 |
| - def _reset(self): |
33 |
| - self._need_to_finalize = False |
34 |
| - self._partial_result = super( |
35 |
| - base_IncrementalEmpiricalCovariance, self |
36 |
| - )._get_backend("covariance", None, "partial_compute_result") |
37 |
| - |
38 |
| - def partial_fit(self, X, y=None, queue=None): |
39 |
| - """ |
40 |
| - Computes partial data for the covariance matrix |
41 |
| - from data batch X and saves it to `_partial_result`. |
42 |
| -
|
43 |
| - Parameters |
44 |
| - ---------- |
45 |
| - X : array-like of shape (n_samples, n_features) |
46 |
| - Training data batch, where `n_samples` is the number of samples |
47 |
| - in the batch, and `n_features` is the number of features. |
48 |
| -
|
49 |
| - y : Ignored |
50 |
| - Not used, present for API consistency by convention. |
51 |
| -
|
52 |
| - queue : dpctl.SyclQueue |
53 |
| - If not None, use this queue for computations. |
54 |
| -
|
55 |
| - Returns |
56 |
| - ------- |
57 |
| - self : object |
58 |
| - Returns the instance itself. |
59 |
| - """ |
60 |
| - X = _check_array(X, dtype=[np.float64, np.float32], ensure_2d=True) |
61 |
| - |
62 |
| - self._queue = queue |
63 |
| - |
64 |
| - policy = super(base_IncrementalEmpiricalCovariance, self)._get_policy(queue, X) |
65 |
| - |
66 |
| - X_table = to_table(X, queue=queue) |
67 |
| - |
68 |
| - if not hasattr(self, "_dtype"): |
69 |
| - self._dtype = X_table.dtype |
70 |
| - |
71 |
| - params = self._get_onedal_params(self._dtype) |
72 |
| - self._partial_result = super( |
73 |
| - base_IncrementalEmpiricalCovariance, self |
74 |
| - )._get_backend( |
75 |
| - "covariance", |
76 |
| - None, |
77 |
| - "partial_compute", |
78 |
| - policy, |
79 |
| - params, |
80 |
| - self._partial_result, |
81 |
| - X_table, |
82 |
| - ) |
83 |
| - self._need_to_finalize = True |
| 26 | + pass |
0 commit comments