Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /olaflaitinen_Promethium /src /promethium /signal /reconstruction /base.py
| from abc import ABC, abstractmethod | |
| import numpy as np | |
| from typing import Optional, Dict, Any | |
| class RecoveryAlgorithm(ABC): | |
| """ | |
| Abstract base class for all recovery/reconstruction algorithms. | |
| """ | |
| def __init__(self, params: Dict[str, Any] = None): | |
| self.params = params or {} | |
| def fit(self, data: np.ndarray, mask: Optional[np.ndarray] = None) -> 'RecoveryAlgorithm': | |
| """ | |
| Fit the model to the data (observed). | |
| Args: | |
| data: Input data array (e.g., Gather). | |
| mask: Binary mask (1=observed, 0=missing). | |
| """ | |
| pass | |
| def transform(self, data: np.ndarray, mask: Optional[np.ndarray] = None) -> np.ndarray: | |
| """ | |
| Reconstruct the missing data. | |
| Returns: | |
| Reconstructed full data. | |
| """ | |
| pass | |
| def fit_transform(self, data: np.ndarray, mask: Optional[np.ndarray] = None) -> np.ndarray: | |
| return self.fit(data, mask).transform(data, mask) | |
Xet Storage Details
- Size:
- 1.04 kB
- Xet hash:
- c3c7b72ca1f824baa764c106b6993bf098b22e677e595d1af0e85d6977d57280
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.