- Notifications
You must be signed in to change notification settings - Fork180
Closed
Description
Describe the bug
Runningc2st
/c2st_scores
with the defaultz_scores=True
when at least one feature is constant (all data points have the same value for this feature) fails withValueError: Input X contains NaN. RandomForestClassifier does not accept missing values encoded as NaN natively...
.
This is caused by dividing the data by the standard deviation of this feature (which is zero):
Lines 161 to 165 in83e122a
ifz_score: | |
X_mean=torch.mean(X,dim=0) | |
X_std=torch.std(X,dim=0) | |
X= (X-X_mean)/X_std | |
Y= (Y-X_mean)/X_std |
To Reproduce
fromsbi.utils.metricsimportc2stimporttorchX,Y=torch.ones(5,2),torch.zeros(5,2)c2st(X,Y)