8000 Failure in Low Dimensional case for MinCovDet() · Issue #1127 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
Failure in Low Dimensional case for MinCovDet() #1127
Closed
@kyleabeauchamp

Description

@kyleabeauchamp

What are the minimum number of samples (n0) and features (n1) required to use MinCovDet? To me, this method should be feasible for n0 >= 3. However, I get an exception for (n0,n1) = (3,1). The error does not occur for (3,2) or for (4,1). I suspect this issue has to do with an array being autocast to a lower-rank object.

import numpy as np
import sklearn.covariance

n0,n1 = (3,1)
x = np.random.normal(size=(n0,n1))

model = sklearn.covariance.outlier_detection.MinCovDet()
model.fit(x)

Yields the following error:
robust_covariance.pyc in fast_mcd(X, support_fraction, cov_computation_method, random_state)
--> 337 halves_start = np.where(diff == np.min(diff))[0]
ValueError: zero-size array to minimum.reduce without identity

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0