Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement of NCH #255

Merged
merged 18 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions examples/ERP/classify_P300_nch.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
n_hulls_per_class=1,
n_samples_per_hull=3,
n_jobs=12,
hull_type="random-hull",
subsampling="random",
quantum=False,
),
)
Expand All @@ -97,7 +97,7 @@
n_hulls_per_class=1,
n_samples_per_hull=3,
n_jobs=12,
hull_type="min-hull",
subsampling="min",
quantum=False,
),
)
Expand Down
4 changes: 3 additions & 1 deletion pyriemann_qiskit/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ def _predict_distances(self, X):
elif self.subsampling == "random":
self._process_sample = self._process_sample_random_hull
else:
raise Exception("Error: Unknown subsampling type.")
raise ValueError(f"Unknown subsampling type {self.subsampling}.")

parallel = self.n_jobs > 1

Expand All @@ -922,6 +922,8 @@ def _predict_distances(self, X):
dist = self._process_sample(x)
dists.append(dist)

dists = np.concatenate(dists, axis=1)
qbarthelemy marked this conversation as resolved.
Show resolved Hide resolved

return dists

def predict(self, X):
Expand Down
Loading