Numeric interval#
- numeric_component(X: ndarray, Y: ndarray, numeric_indices: list[int], ranges: ndarray, h: ndarray, missing_strategy: str = 'ignore', weights: ndarray | None = None, scale_window: str | None = None) tuple[ndarray, ndarray][source]#
Compute range-scaled Gower component for interval-scale (numeric) features. The same logic as in ratio scale.
- Parameters:
X (np.ndarray) – array of shape (n_x, n_features)
Y (np.ndarray) – array of shape (n_y, n_features)
numeric_indices (list[int]) – indices of numeric-interval columns
ranges (np.ndarray) – 1D array of ranges for each numeric-interval column
h (np.ndarray) – optional 1D array of bandwidths for KDE scaling
missing_strategy (str) – one of “ignore”, “max_dist”, “raise_error”
weights (Optional[np.ndarray]) – optional 1D array of same length as numeric_indices
scale_window (Optional[str]) – optional scaling window method
- Returns:
sum_diff: matrix (n_x, n_y) weighted sum of per-feature distances
count_present: matrix (n_x, n_y) number of non-missing pairs per feature
- Return type:
tuple[np.ndarray, np.ndarray]