Ok this is extremely weird, can someone run this code and see if it crashes with that error?
import pandas as pd
import numpy as np
from sklearn.covariance import MinCovDet
clf=MinCovDet()
dataF=np.array([0.5, 0.1, 0.1, 0.1, 0.957, 0.1, 0.1, 0.1, 0.4285, 0.1])
manual=pd.DataFrame(data=dataF)
clf.fit(manual)
If I change the array to this
# Working
dataF=np.array([0.5, 0.11, 0.1, 0.1, 0.957, 0.1, 0.1, 0.1, 0.4285, 0.1])
it runs fine. But it seems to crash with any array where there are too many of the same values. This array crashes as well.
# Not working
dataF = np.array([0.5, 0.3, 0.3, 0.3, 0.957, 0.3, 0.3, 0.3, 0.4285, 0.3])
I already checked for NANs and everything, there's nothing.
Runtime Warning: divide by zero encountered in true_divide
and another oneRuntimeWarning: invalid value encountered in true_divide
and so on. Working through the error message might be useful for finding the reason for thisValueError
. $\endgroup$