Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

c2st fails when one feature is constant #1204

Closed
Labels
bugSomething isn't working
@Baschdl

Description

@Baschdl

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):

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp