Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mne/decoding/receptive_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def _delay_time_series(X, tmin, tmax, sfreq, newaxis=0, axis=0,
fill_value = X.mean(axis=axis, keepdims=True)
if epoch_axis is not None:
fill_value = np.mean(fill_value, axis=epoch_axis, keepdims=True)
delayed[...] = fill_value
delayed[...] = fill_value
for ii, ix_delay in enumerate(delays):
take = [slice(None)] * X.ndim
put = [slice(None)] * X.ndim
Expand Down
6 changes: 6 additions & 0 deletions mne/decoding/tests/test_receptive_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ def test_receptive_field():
rf.fit(X, y)
assert_array_equal(rf.delays_, np.arange(tmin, tmax + 1))

# Testing fill mean
rf = ReceptiveField(tmin, tmax, 1, feature_names, fill_mean=True,
estimator=mod)
rf.fit(X, y)
assert_array_equal(rf.delays_, np.arange(tmin, tmax + 1))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't test that fill_value actually does anything. Can you add a test that fails in master but passes here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more over, fill_value is not in ReceptiveField's signature here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fill_value isn't really meant to be public

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is not referring to ReceptiveField's signature?
img

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah you're right, didn't see it was in __init__ -- it's also not supposed to be publicly exposed, so this is the wrong way to check it


y_pred = rf.predict(X)
assert_allclose(y[rf.valid_samples_], y_pred[rf.valid_samples_], atol=1e-2)
scores = rf.score(X, y)
Expand Down