`ICA` does not surface whether the decomposition converged

Đã đóng
#14,335 7 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@aslansd đang làm issue này rồi.

Từ ngày 1/10/2026.

  • #14370 của @aslansd — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
68/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
machine-learning

Hướng nghiên cứu

Start at the ICA _fit entry point and trace the fastica, infomax, and picard paths, then inspect how save() serializes fitted state. Confirm how convergence is currently reported and identify the persistence and test locations. Done means fitted ICA objects expose the result and retain it after saving and loading, including when fitting stops at max_iter.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

After ica.fit(), ica.n_iter_ holds the iteration count and ica.max_iter
the limit, but there is no attribute saying whether fitting converged or
stopped at the limit. A user has to know to compare the two.

Why it matters

These are different results and they are not distinguishable in saved output.
An ICA that hit max_iter produces components that are still used to pick
ica.exclude, and the exclusions are then applied to the data. Nothing
downstream — not the cleaned Raw, not a saved -ica.fif — records that the
decomposition was truncated.

ica = mne.preprocessing.ICA(n_components=4, method='fastica',
                            random_state=97, max_iter=200)
ica.fit(raw)
ica.n_iter_ == ica.max_iter    # the only way to know, and easy not to check

MNE does warn at fit time, but a warning is not part of the object and does not
survive ica.save().

Suggestion

A converged_ boolean set during _fit, and included in what save() writes,
would make this checkable after the fact. Happy to open a PR if that would be
welcome, including for the infomax and picard paths.

Context

Noticed while writing an MNE adapter for
daftar. I am raising the same point with
three other packages that have the same pattern, so please read this as a
question about a shared convention rather than a complaint about MNE.

Ngôn ngữ chính
Python
Star
3.6k
Fork
1.6k
Merge trung bình
1 ngày 18 giờ
Pull request đã merge (30 ngày)
74

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của mne-tools/mne-python

Tất cả issue của mne-tools/mne-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.