Skip to content

[WIP] Beginners guide by mbarneche#301

Open
mbarneche wants to merge 21 commits intoscikit-adaptation:mainfrom
mbarneche:new-mbarneche-beginners-guide
Open

[WIP] Beginners guide by mbarneche#301
mbarneche wants to merge 21 commits intoscikit-adaptation:mainfrom
mbarneche:new-mbarneche-beginners-guide

Conversation

@mbarneche
Copy link
Copy Markdown
Contributor

Creation of a beginners guide for SKADA.
Small changes to the "how to" file so that it displays properly with sphinx.

from skada.utils import extract_source_indices

# sphinx_gallery_start_ignore
fig_size = (8, 4)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you try to choose a fig_size to have squared plot ?

Comment thread examples/plot_beginners_guide.py Outdated
):
Xs, Xt, ys, yt = skada.source_target_split(X, y, sample_domain=sample_domain)

plt.subplot(1, 2, 1)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe here you can use set_box_aspect to have squared plot

Comment thread examples/plot_beginners_guide.py Outdated
X, y, sd = make_shifted_datasets(20, 20, random_state=42)
Xs, Xt, ys, yt = skada.source_target_split(X, y, sample_domain=sd)

plt.subplot(4, 5, 1)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For the summary plot I would remove the first columns. And maybe just have one line for source, one line for target, one line for train without adaptation and one last line for training with adaptation

Comment thread examples/plot_beginners_guide.py Outdated
T = T / T.max()

plt.figure(9)
plot_full_data(Xs, ys, "Mapping source (orange, blue) to target (yellow, purple)")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe you can change all the plot to have circle for source and square for target for example. The plot will be better without new color

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you mean changing this plot only or changing all the other plots as well ?

Comment thread examples/plot_beginners_guide.py Outdated

clf = skada.TransferJointMatching(SVC(), n_components=1)
clf.fit(X, y, sample_domain=sample_domain)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm wondering if it is the best to put this plot here. Not sure

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The idea was that the reader would have a feel of what the projection looks like

#
# Here is a summary of the different shifts and the domain adaptation methods used.

# sphinx_gallery_start_ignore
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you have a grey box here

@antoinecollas
Copy link
Copy Markdown
Collaborator

What's the status of this PR? @mbarneche do you still need to do something?

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.45%. Comparing base (141b409) to head (20957be).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #301      +/-   ##
==========================================
- Coverage   96.64%   96.45%   -0.19%     
==========================================
  Files          63       63              
  Lines        6910     6910              
==========================================
- Hits         6678     6665      -13     
- Misses        232      245      +13     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants