-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
400 lines (352 loc) · 39.4 KB
/
Copy pathindex.html
File metadata and controls
400 lines (352 loc) · 39.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<!DOCTYPE html>
<html class="writer-html5" lang="English" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SKADA: SciKit Adaptation — SKADA: Scikit Adaptation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=9edc463e" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=4ae1632d" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery.css?v=fd6457a4" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-binder.css?v=f4aeca0c" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-dataframe.css?v=2082cf3c" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-rendered-html.css?v=1277b6f3" />
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=db0e1f0c"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/sg-tags.js?v=d80f6fa4"></script>
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="How to use SKADA" href="auto_examples/plot_how_to_use_skada.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="#" class="icon icon-home">
SKADA
<img src="_static/skada_logo_full_white.svg" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">SKADA: SciKit Adaptation</a></li>
<li class="toctree-l1"><a class="reference internal" href="auto_examples/plot_how_to_use_skada.html">How to use SKADA</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Users Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="all.html">API and modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="auto_examples/index.html">Examples gallery</a></li>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Release of SKADA</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing to SKADA</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="#">SKADA</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="#" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">SKADA: SciKit Adaptation</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/index.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="skada-scikit-adaptation">
<h1>SKADA: SciKit Adaptation<a class="headerlink" href="#skada-scikit-adaptation" title="Link to this heading"></a></h1>
<a class="reference internal image-reference" href="_images/skada_logo_full.svg"><img alt="SKADA Logo" src="_images/skada_logo_full.svg" style="width: 600px;" />
</a>
<section id="contents">
<h2>Contents<a class="headerlink" href="#contents" title="Link to this heading"></a></h2>
<div class="toctree-wrapper compound">
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">SKADA: SciKit Adaptation</a></li>
<li class="toctree-l1"><a class="reference internal" href="auto_examples/plot_how_to_use_skada.html">How to use SKADA</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Users Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="all.html">API and modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="auto_examples/index.html">Examples gallery</a></li>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Release of SKADA</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing to SKADA</a></li>
</ul>
</div>
<section id="skada-domain-adaptation-with-scikit-learn-and-pytorch">
<h3>SKADA - Domain Adaptation with scikit-learn and PyTorch<a class="headerlink" href="#skada-domain-adaptation-with-scikit-learn-and-pytorch" title="Link to this heading"></a></h3>
<p><a class="reference external" href="https://badge.fury.io/py/skada"><img alt="PyPI version" src="https://badge.fury.io/py/skada.svg" /></a>
<a class="reference external" href="https://github.com/scikit-adaptation/skada/actions"><img alt="Build Status" src="https://github.com/scikit-adaptation/skada/actions/workflows/testing.yml/badge.svg" /></a>
<a class="reference external" href="https://codecov.io/gh/scikit-adaptation/skada"><img alt="Codecov Status" src="https://codecov.io/gh/scikit-adaptation/skada/branch/main/graph/badge.svg" /></a>
<a class="reference external" href="https://opensource.org/licenses/BSD-3-Clause"><img alt="License" src="https://img.shields.io/badge/License-BSD_3--Clause-blue.svg" /></a>
<a class="reference external" href="https://doi.org/10.5281/zenodo.12666838"><img alt="DOI" src="https://zenodo.org/badge/DOI/10.5281/zenodo.12666838.svg" /></a></p>
<p>SKADA is a library for domain adaptation (DA) with a scikit-learn and PyTorch/skorch
compatible API with the following features:</p>
<ul class="simple">
<li><p>DA estimators and transformers with a scikit-learn compatible API (fit, transform, predict).</p></li>
<li><p>PyTorch/skorch API for deep learning DA algorithms.</p></li>
<li><p>Classifier/Regressor and data Adapter DA algorithms compatible with scikit-learn pipelines.</p></li>
<li><p>Compatible with scikit-learn validation loops (cross_val_score, GridSearchCV, etc).</p></li>
</ul>
<p><strong>Citation</strong>: If you use this library in your research, please cite the following reference:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="n">Gnassounou</span> <span class="n">T</span><span class="o">.</span><span class="p">,</span> <span class="n">Kachaiev</span> <span class="n">O</span><span class="o">.</span><span class="p">,</span> <span class="n">Flamary</span> <span class="n">R</span><span class="o">.</span><span class="p">,</span> <span class="n">Collas</span> <span class="n">A</span><span class="o">.</span><span class="p">,</span> <span class="n">Lalou</span> <span class="n">Y</span><span class="o">.</span><span class="p">,</span> <span class="n">de</span> <span class="n">Mathelin</span> <span class="n">A</span><span class="o">.</span><span class="p">,</span> <span class="n">Gramfort</span> <span class="n">A</span><span class="o">.</span><span class="p">,</span> <span class="n">Bueno</span> <span class="n">R</span><span class="o">.</span><span class="p">,</span> <span class="n">Michel</span> <span class="n">F</span><span class="o">.</span><span class="p">,</span> <span class="n">Mellot</span> <span class="n">A</span><span class="o">.</span><span class="p">,</span> <span class="n">Loison</span> <span class="n">V</span><span class="o">.</span><span class="p">,</span> <span class="n">Odonnat</span> <span class="n">A</span><span class="o">.</span><span class="p">,</span> <span class="n">Moreau</span> <span class="n">T</span><span class="o">.</span> <span class="p">(</span><span class="mi">2024</span><span class="p">)</span><span class="o">.</span> <span class="n">SKADA</span> <span class="p">:</span> <span class="n">Scikit</span> <span class="n">Adaptation</span> <span class="p">(</span><span class="n">version</span> <span class="mf">0.3.0</span><span class="p">)</span><span class="o">.</span> <span class="n">URL</span><span class="p">:</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">scikit</span><span class="o">-</span><span class="n">adaptation</span><span class="o">.</span><span class="n">github</span><span class="o">.</span><span class="n">io</span><span class="o">/</span>
</pre></div>
</div>
<p>or in Bibtex format :</p>
<div class="highlight-bibtex notranslate"><div class="highlight"><pre><span></span><span class="nc">@misc</span><span class="p">{</span><span class="nl">gnassounou2024skada</span><span class="p">,</span>
<span class="na">author</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{Gnassounou, Théo and Kachaiev, Oleksii and Flamary, Rémi and Collas, Antoine and Lalou, Yanis and de Mathelin, Antoine and Gramfort, Alexandre and Bueno, Ruben and Michel, Florent and Mellot, Apolline and Loison, Virginie and Odonnat, Ambroise and Moreau, Thomas}</span><span class="p">,</span>
<span class="na">month</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{7}</span><span class="p">,</span>
<span class="na">title</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{SKADA : Scikit Adaptation}</span><span class="p">,</span>
<span class="na">url</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{https://scikit-adaptation.github.io/}</span><span class="p">,</span>
<span class="na">year</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{2024}</span>
<span class="p">}</span>
</pre></div>
</div>
<section id="implemented-algorithms">
<h4>Implemented algorithms<a class="headerlink" href="#implemented-algorithms" title="Link to this heading"></a></h4>
<p>The following algorithms are currently implemented.</p>
<section id="domain-adaptation-algorithms">
<h5>Domain adaptation algorithms<a class="headerlink" href="#domain-adaptation-algorithms" title="Link to this heading"></a></h5>
<ul class="simple">
<li><p>Sample reweighting methods (Gaussian [1], Discriminant [2], KLIEPReweight [3],
DensityRatio [4], TarS [21], KMMReweight [23])</p></li>
<li><p>Sample mapping methods (CORAL [5], Optimal Transport DA OTDA [6], LinearMonge [7], LS-ConS [21])</p></li>
<li><p>Subspace methods (SubspaceAlignment [8], TCA [9], Transfer Subspace Learning [27])</p></li>
<li><p>Other methods (JDOT [10], DASVM [11], OT Label Propagation [28])</p></li>
</ul>
<p>Any methods that can be cast as an adaptation of the input data can be used in one of two ways:</p>
<ul class="simple">
<li><p>a scikit-learn transformer (Adapter) which provides both a full Classifier/Regressor estimator</p></li>
<li><p>or an <code class="docutils literal notranslate"><span class="pre">Adapter</span></code> that can be used in a DA pipeline with <code class="docutils literal notranslate"><span class="pre">make_da_pipeline</span></code>.
Refer to the examples below and visit <a class="reference external" href="https://scikit-adaptation.github.io/auto_examples/index.html">the gallery</a>for more details.</p></li>
</ul>
</section>
<section id="deep-learning-domain-adaptation-algorithms">
<h5>Deep learning domain adaptation algorithms<a class="headerlink" href="#deep-learning-domain-adaptation-algorithms" title="Link to this heading"></a></h5>
<ul class="simple">
<li><p>Deep Correlation alignment (DeepCORAL [12])</p></li>
<li><p>Deep joint distribution optimal (DeepJDOT [13])</p></li>
<li><p>Divergence minimization (MMD/DAN [14])</p></li>
<li><p>Adversarial/discriminator based DA (DANN [15], CDAN [16])</p></li>
</ul>
</section>
<section id="da-metrics">
<h5>DA metrics<a class="headerlink" href="#da-metrics" title="Link to this heading"></a></h5>
<ul class="simple">
<li><p>Importance Weighted [17]</p></li>
<li><p>Prediction entropy [18]</p></li>
<li><p>Soft neighborhood density [19]</p></li>
<li><p>Deep Embedded Validation (DEV) [20]</p></li>
<li><p>Circular Validation [11]</p></li>
</ul>
</section>
</section>
<section id="installation">
<h4>Installation<a class="headerlink" href="#installation" title="Link to this heading"></a></h4>
<p>The library is not yet available on PyPI. You can install it from the source code.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">git</span><span class="o">+</span><span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">scikit</span><span class="o">-</span><span class="n">adaptation</span><span class="o">/</span><span class="n">skada</span>
</pre></div>
</div>
</section>
<section id="short-examples">
<h4>Short examples<a class="headerlink" href="#short-examples" title="Link to this heading"></a></h4>
<p>We provide here a few examples to illustrate the use of the library. For more
details, please refer to this <a class="reference external" href="https://scikit-adaptation.github.io/auto_examples/plot_how_to_use_skada.html">example</a>, the <a class="reference external" href="https://scikit-adaptation.github.io/quickstart.html">quick start guide</a> and the <a class="reference external" href="https://scikit-adaptation.github.io/auto_examples/index.html">gallery</a>.</p>
<p>First, the DA data in the SKADA API is stored in the following format:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">sample_domain</span>
</pre></div>
</div>
<p>Where <code class="docutils literal notranslate"><span class="pre">X</span></code> is the input data, <code class="docutils literal notranslate"><span class="pre">y</span></code> is the target labels and <code class="docutils literal notranslate"><span class="pre">sample_domain</span></code> is the
domain labels (positive for source and negative for target domains). We provide
below an example ho how to fit a DA estimator:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span><span class="w"> </span><span class="nn">skada</span><span class="w"> </span><span class="kn">import</span> <span class="n">CORAL</span>
<span class="n">da</span> <span class="o">=</span> <span class="n">CORAL</span><span class="p">()</span>
<span class="n">da</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">sample_domain</span><span class="o">=</span><span class="n">sample_domain</span><span class="p">)</span> <span class="c1"># sample_domain passed by name</span>
<span class="n">ypred</span> <span class="o">=</span> <span class="n">da</span><span class="o">.</span><span class="n">predict</span><span class="p">(</span><span class="n">Xt</span><span class="p">)</span> <span class="c1"># predict on test data</span>
</pre></div>
</div>
<p>One can also use <code class="docutils literal notranslate"><span class="pre">Adapter</span></code> classes to create a full pipeline with DA:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span><span class="w"> </span><span class="nn">skada</span><span class="w"> </span><span class="kn">import</span> <span class="n">CORALAdapter</span><span class="p">,</span> <span class="n">make_da_pipeline</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">sklearn.preprocessing</span><span class="w"> </span><span class="kn">import</span> <span class="n">StandardScaler</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">sklearn.linear_model</span><span class="w"> </span><span class="kn">import</span> <span class="n">LogisticRegression</span>
<span class="n">pipe</span> <span class="o">=</span> <span class="n">make_da_pipeline</span><span class="p">(</span><span class="n">StandardScaler</span><span class="p">(),</span> <span class="n">CORALAdapter</span><span class="p">(),</span> <span class="n">LogisticRegression</span><span class="p">())</span>
<span class="n">pipe</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">sample_domain</span><span class="o">=</span><span class="n">sample_domain</span><span class="p">)</span> <span class="c1"># sample_domain passed by name</span>
</pre></div>
</div>
<p>Please note that for <code class="docutils literal notranslate"><span class="pre">Adapter</span></code> classes that implement sample reweighting, the
subsequent classifier/regressor must require sample_weights as input. This is
done with the <code class="docutils literal notranslate"><span class="pre">set_fit_requires</span></code> method. For instance, with <code class="docutils literal notranslate"><span class="pre">LogisticRegression</span></code>, you
would use <code class="docutils literal notranslate"><span class="pre">LogisticRegression().set_fit_requires('sample_weight')</span></code>:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span><span class="w"> </span><span class="nn">skada</span><span class="w"> </span><span class="kn">import</span> <span class="n">GaussianReweightAdapter</span><span class="p">,</span> <span class="n">make_da_pipeline</span>
<span class="n">pipe</span> <span class="o">=</span> <span class="n">make_da_pipeline</span><span class="p">(</span><span class="n">GaussianReweightAdapter</span><span class="p">(),</span>
<span class="n">LogisticRegression</span><span class="p">()</span><span class="o">.</span><span class="n">set_fit_request</span><span class="p">(</span><span class="n">sample_weight</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
</pre></div>
</div>
<p>Finally SKADA can be used for cross validation scores estimation and hyperparameter
selection :</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span><span class="w"> </span><span class="nn">sklearn.model_selection</span><span class="w"> </span><span class="kn">import</span> <span class="n">cross_val_score</span><span class="p">,</span> <span class="n">GridSearchCV</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">sklearn.preprocessing</span><span class="w"> </span><span class="kn">import</span> <span class="n">StandardScaler</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">sklearn.linear_model</span><span class="w"> </span><span class="kn">import</span> <span class="n">LogisticRegression</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">skada</span><span class="w"> </span><span class="kn">import</span> <span class="n">CORALAdapter</span><span class="p">,</span> <span class="n">make_da_pipeline</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">skada.model_selection</span><span class="w"> </span><span class="kn">import</span> <span class="n">SourceTargetShuffleSplit</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">skada.metrics</span><span class="w"> </span><span class="kn">import</span> <span class="n">PredictionEntropyScorer</span>
<span class="c1"># make pipeline</span>
<span class="n">pipe</span> <span class="o">=</span> <span class="n">make_da_pipeline</span><span class="p">(</span><span class="n">StandardScaler</span><span class="p">(),</span> <span class="n">CORALAdapter</span><span class="p">(),</span> <span class="n">LogisticRegression</span><span class="p">())</span>
<span class="c1"># split and score</span>
<span class="n">cv</span> <span class="o">=</span> <span class="n">SourceTargetShuffleSplit</span><span class="p">()</span>
<span class="n">scorer</span> <span class="o">=</span> <span class="n">PredictionEntropyScorer</span><span class="p">()</span>
<span class="c1"># cross val score</span>
<span class="n">scores</span> <span class="o">=</span> <span class="n">cross_val_score</span><span class="p">(</span><span class="n">pipe</span><span class="p">,</span> <span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="p">{</span><span class="s1">'sample_domain'</span><span class="p">:</span> <span class="n">sample_domain</span><span class="p">},</span>
<span class="n">cv</span><span class="o">=</span><span class="n">cv</span><span class="p">,</span> <span class="n">scoring</span><span class="o">=</span><span class="n">scorer</span><span class="p">)</span>
<span class="c1"># grid search</span>
<span class="n">param_grid</span> <span class="o">=</span> <span class="p">{</span><span class="s1">'coraladapter__reg'</span><span class="p">:</span> <span class="p">[</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.9</span><span class="p">]}</span>
<span class="n">grid_search</span> <span class="o">=</span> <span class="n">GridSearchCV</span><span class="p">(</span><span class="n">estimator</span><span class="o">=</span><span class="n">pipe</span><span class="p">,</span>
<span class="n">param_grid</span><span class="o">=</span><span class="n">param_grid</span><span class="p">,</span>
<span class="n">cv</span><span class="o">=</span><span class="n">cv</span><span class="p">,</span> <span class="n">scoring</span><span class="o">=</span><span class="n">scorer</span><span class="p">)</span>
<span class="n">grid_search</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">sample_domain</span><span class="o">=</span><span class="n">sample_domain</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="acknowledgements">
<h4>Acknowledgements<a class="headerlink" href="#acknowledgements" title="Link to this heading"></a></h4>
<p>This toolbox has been created and is maintained by the SKADA team that includes the following members:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://tgnassou.github.io/">Théo Gnassounou</a></p></li>
<li><p><a class="reference external" href="https://kachayev.github.io/talks/">Oleksii Kachaiev</a></p></li>
<li><p><a class="reference external" href="https://remi.flamary.com/">Rémi Flamary</a></p></li>
<li><p><a class="reference external" href="https://www.antoinecollas.fr/">Antoine Collas</a></p></li>
<li><p><a class="reference external" href="https://github.com/YanisLalou">Yanis Lalou</a></p></li>
<li><p><a class="reference external" href="https://scholar.google.com/citations?user=h79bffAAAAAJ&amp;hl=fr">Antoine de Mathelin</a></p></li>
<li><p><a class="reference internal" href="#"><span class="xref myst">Ruben Bueno</span></a></p></li>
</ul>
<p>SKADA has benefited from the financing or manpower from the following partners:</p>
<img src="https://scikit-adaptation.github.io/dev/_static/images/logo_anr.jpg" alt="ANR" style="height:60px;"/>
<img src="https://scikit-adaptation.github.io/dev/_static/images/logo_hiparis.png" alt="Hi!PARIS" style="height:60px;"/>
<img src="https://scikit-adaptation.github.io/dev/_static/images/logo_elias.png" alt="ELIAS European project" style="height:60px;"/>
</section>
<section id="license">
<h4>License<a class="headerlink" href="#license" title="Link to this heading"></a></h4>
<p>The library is distributed under the 3-Clause BSD license.</p>
</section>
<section id="references">
<h4>References<a class="headerlink" href="#references" title="Link to this heading"></a></h4>
<p>[1] Shimodaira Hidetoshi. <a class="reference external" href="https://citeseerx.ist.psu.edu/document?repid=rep1&amp;type=pdf&amp;doi=235723a15c86c369c99a42e7b666dfe156ad2cba">"Improving predictive inference under covariate shift by weighting the log-likelihood function."</a> Journal of statistical planning and inference 90, no. 2 (2000): 227-244.</p>
<p>[2] Sugiyama Masashi, Taiji Suzuki, and Takafumi Kanamori. <a class="reference external" href="https://citeseerx.ist.psu.edu/document?repid=rep1&amp;type=pdf&amp;doi=f1467208a75def8b2e52a447ab83644db66445ea">"Density-ratio matching under the Bregman divergence: a unified framework of density-ratio estimation."</a> Annals of the Institute of Statistical Mathematics 64 (2012): 1009-1044.</p>
<p>[3] Sugiyama Masashi, Taiji Suzuki, Shinichi Nakajima, Hisashi Kashima, Paul Von Bünau, and Motoaki Kawanabe. <a class="reference external" href="https://citeseerx.ist.psu.edu/document?repid=rep1&amp;type=pdf&amp;doi=af14e09a9f829b9f0952eac244b0ac0c8bda2ca8">"Direct importance estimation for covariate shift adaptation."</a> Annals of the Institute of Statistical Mathematics 60 (2008): 699-746.</p>
<p>[4] Sugiyama Masashi, and Klaus-Robert Müller. <a class="reference external" href="https://web.archive.org/web/20070221112234id_/http://sugiyama-www.cs.titech.ac.jp:80/~sugi/2005/IWSIC.pdf">"Input-dependent estimation of generalization error under covariate shift."</a> (2005): 249-279.</p>
<p>[5] Sun Baochen, Jiashi Feng, and Kate Saenko. <a class="reference external" href="https://arxiv.org/pdf/1612.01939.pdf">"Correlation alignment for unsupervised domain adaptation."</a> Domain adaptation in computer vision applications (2017): 153-171.</p>
<p>[6] Courty Nicolas, Flamary Rémi, Tuia Devis, and Alain Rakotomamonjy. <a class="reference external" href="https://arxiv.org/pdf/1507.00504.pdf">"Optimal transport for domain adaptation."</a> IEEE Trans. Pattern Anal. Mach. Intell 1, no. 1-40 (2016): 2.</p>
<p>[7] Flamary, R., Lounici, K., & Ferrari, A. (2019). <a class="reference external" href="https://arxiv.org/pdf/1905.10155.pdf">Concentration bounds for linear monge mapping estimation and optimal transport domain adaptation</a>. arXiv preprint arXiv:1905.10155.</p>
<p>[8] Fernando, B., Habrard, A., Sebban, M., & Tuytelaars, T. (2013). <a class="reference external" href="https://openaccess.thecvf.com/content_iccv_2013/papers/Fernando_Unsupervised_Visual_Domain_2013_ICCV_paper.pdf">Unsupervised visual domain adaptation using subspace alignment</a>. In Proceedings of the IEEE international conference on computer vision (pp. 2960-2967).</p>
<p>[9] Pan, S. J., Tsang, I. W., Kwok, J. T., & Yang, Q. (2010). <a class="reference external" href="https://citeseerx.ist.psu.edu/document?repid=rep1&amp;type=pdf&amp;doi=4823e52161ec339d4d3526099a5477321f6a9a0f">Domain adaptation via transfer component analysis</a>. IEEE transactions on neural networks, 22(2), 199-210.</p>
<p>[10] Courty, N., Flamary, R., Habrard, A., & Rakotomamonjy, A. (2017). <a class="reference external" href="https://proceedings.neurips.cc/paper_files/paper/2017/file/0070d23b06b1486a538c0eaa45dd167a-Paper.pdf">Joint distribution optimal transportation for domain adaptation</a>. Advances in neural information processing systems, 30.</p>
<p>[11] Bruzzone, L., & Marconcini, M. (2009). <a class="reference external" href="https://rslab.disi.unitn.it/papers/R82-PAMI.pdf">Domain adaptation problems: A DASVM classification technique and a circular validation strategy.</a> IEEE transactions on pattern analysis and machine intelligence, 32(5), 770-787.</p>
<p>[12] Sun, B., & Saenko, K. (2016). <a class="reference external" href="https://arxiv.org/pdf/1607.01719.pdf">Deep coral: Correlation alignment for deep domain adaptation</a>. In Computer Vision–ECCV 2016 Workshops: Amsterdam, The Netherlands, October 8-10 and 15-16, 2016, Proceedings, Part III 14 (pp. 443-450). Springer International Publishing.</p>
<p>[13] Damodaran, B. B., Kellenberger, B., Flamary, R., Tuia, D., & Courty, N. (2018). <a class="reference external" href="https://openaccess.thecvf.com/content_ECCV_2018/papers/Bharath_Bhushan_Damodaran_DeepJDOT_Deep_Joint_ECCV_2018_paper.pdf">Deepjdot: Deep joint distribution optimal transport for unsupervised domain adaptation</a>. In Proceedings of the European conference on computer vision (ECCV) (pp. 447-463).</p>
<p>[14] Long, M., Cao, Y., Wang, J., & Jordan, M. (2015, June). <a class="reference external" href="https://proceedings.mlr.press/v37/long15.pdf">Learning transferable features with deep adaptation networks</a>. In International conference on machine learning (pp. 97-105). PMLR.</p>
<p>[15] Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., ... & Lempitsky, V. (2016). <a class="reference external" href="https://www.jmlr.org/papers/volume17/15-239/15-239.pdf">Domain-adversarial training of neural networks</a>. Journal of machine learning research, 17(59), 1-35.</p>
<p>[16] Long, M., Cao, Z., Wang, J., & Jordan, M. I. (2018). <a class="reference external" href="https://proceedings.neurips.cc/paper_files/paper/2018/file/ab88b15733f543179858600245108dd8-Paper.pdf">Conditional adversarial domain adaptation</a>. Advances in neural information processing systems, 31.</p>
<p>[17] Sugiyama, M., Krauledat, M., & Müller, K. R. (2007). <a class="reference external" href="https://www.jmlr.org/papers/volume8/sugiyama07a/sugiyama07a.pdf">Covariate shift adaptation by importance weighted cross validation</a>. Journal of Machine Learning Research, 8(5).</p>
<p>[18] Morerio, P., Cavazza, J., & Murino, V. (2017).<a class="reference external" href="https://arxiv.org/pdf/1711.10288.pdf"> Minimal-entropy correlation alignment for unsupervised deep domain adaptation</a>. arXiv preprint arXiv:1711.10288.</p>
<p>[19] Saito, K., Kim, D., Teterwak, P., Sclaroff, S., Darrell, T., & Saenko, K. (2021). <a class="reference external" href="https://openaccess.thecvf.com/content/ICCV2021/papers/Saito_Tune_It_the_Right_Way_Unsupervised_Validation_of_Domain_Adaptation_ICCV_2021_paper.pdf">Tune it the right way: Unsupervised validation of domain adaptation via soft neighborhood density</a>. In Proceedings of the IEEE/CVF International Conference on Computer Vision (pp. 9184-9193).</p>
<p>[20] You, K., Wang, X., Long, M., & Jordan, M. (2019, May). <a class="reference external" href="https://proceedings.mlr.press/v97/you19a/you19a.pdf">Towards accurate model selection in deep unsupervised domain adaptation</a>. In International Conference on Machine Learning (pp. 7124-7133). PMLR.</p>
<p>[21] Zhang, K., Schölkopf, B., Muandet, K., Wang, Z. (2013). <a class="reference external" href="http://proceedings.mlr.press/v28/zhang13d.pdf">Domain Adaptation under Target and Conditional Shift</a>. In International Conference on Machine Learning (pp. 819-827). PMLR.</p>
<p>[22] Loog, M. (2012). Nearest neighbor-based importance weighting. In 2012 IEEE International Workshop on Machine Learning for Signal Processing, pages 1–6. IEEE (https://arxiv.org/pdf/2102.02291.pdf)</p>
<p>[23] Domain Adaptation Problems: A DASVM ClassificationTechnique and a Circular Validation StrategyLorenzo Bruzzone, Fellow, IEEE, and Mattia Marconcini, Member, IEEE (https://rslab.disi.unitn.it/papers/R82-PAMI.pdf)</p>
<p>[24] Loog, M. (2012). Nearest neighbor-based importance weighting. In 2012 IEEE International Workshop on Machine Learning for Signal Processing, pages 1–6. IEEE (https://arxiv.org/pdf/2102.02291.pdf)</p>
<p>[25] J. Huang, A. Gretton, K. Borgwardt, B. Schölkopf and A. J. Smola. Correcting sample selection bias by unlabeled data. In NIPS, 2007. (https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=07117994f0971b2fc2df95adb373c31c3d313442)</p>
<p>[26] Long, M., Wang, J., Ding, G., Sun, J., and Yu, P. (2014). <a class="reference external" href="https://citeseerx.ist.psu.edu/document?repid=rep1&amp;type=pdf&amp;doi=a279f53f386ac78345b67e13c1808880c718efdf">Transfer joint matching for unsupervised domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1410–1417</a></p>
<p>[27] S. Si, D. Tao and B. Geng. In IEEE Transactions on Knowledge and Data Engineering, (2010) <a class="reference external" href="https://citeseerx.ist.psu.edu/document?repid=rep1&amp;type=pdf&amp;doi=4118b4fc7d61068b9b448fd499876d139baeec81">Bregman Divergence-Based Regularization for Transfer Subspace Learning</a></p>
<p>[28] Solomon, J., Rustamov, R., Guibas, L., & Butscher, A. (2014, January). <a class="reference external" href="https://proceedings.mlr.press/v32/solomon14.pdf">Wasserstein propagation for semi-supervised learning</a>. In International Conference on Machine Learning (pp. 306-314). PMLR.</p>
<p>[29] Montesuma, Eduardo Fernandes, and Fred Maurice Ngole Mboula. <a class="reference external" href="https://openaccess.thecvf.com/content/CVPR2021/papers/Montesuma_Wasserstein_Barycenter_for_Multi-Source_Domain_Adaptation_CVPR_2021_paper.pdf">"Wasserstein barycenter for multi-source domain adaptation."</a> In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 16785-16793. 2021.</p>
<p>[30] Gnassounou, Theo, Rémi Flamary, and Alexandre Gramfort. <a class="reference external" href="https://proceedings.neurips.cc/paper_files/paper/2023/file/21718991f6acf19a42376b5c7a8668c5-Paper-Conference.pdf">"Convolution Monge Mapping Normalization for learning on sleep data."</a> Advances in Neural Information Processing Systems 36 (2024).</p>
<p>[31] Redko, Ievgen, Nicolas Courty, Rémi Flamary, and Devis Tuia.<a class="reference external" href="https://proceedings.mlr.press/v89/redko19a/redko19a.pdf"> "Optimal transport for multi-source domain adaptation under target shift."</a> In The 22nd International Conference on artificial intelligence and statistics, pp. 849-858. PMLR, 2019.</p>
<p>[32] Hu, D., Liang, J., Liew, J. H., Xue, C., Bai, S., & Wang, X. (2023). <a class="reference external" href="https://proceedings.neurips.cc/paper_files/paper/2023/file/7721f1fea280e9ffae528dc78c732576-Paper-Conference.pdf">Mixed Samples as Probes for Unsupervised Model Selection in Domain Adaptation</a>. Advances in Neural Information Processing Systems 36 (2024).</p>
<p>[33] Kang, G., Jiang, L., Yang, Y., & Hauptmann, A. G. (2019). <a class="reference external" href="https://arxiv.org/abs/1901.00976">Contrastive Adaptation Network for Unsupervised Domain Adaptation</a>. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 4893-4902).</p>
<p>[34] Jin, Ying, Wang, Ximei, Long, Mingsheng, Wang, Jianmin. <a class="reference external" href="https://arxiv.org/pdf/1912.03699">Minimum Class Confusion for Versatile Domain Adaptation</a>. ECCV, 2020.</p>
<p>[35] Zhang, Y., Liu, T., Long, M., & Jordan, M. I. (2019). <a class="reference external" href="https://arxiv.org/abs/1904.05801">Bridging Theory and Algorithm for Domain Adaptation</a>. In Proceedings of the 36th International Conference on Machine Learning, (pp. 7404-7413).</p>
<p>[36] Xiao, Zhiqing, Wang, Haobo, Jin, Ying, Feng, Lei, Chen, Gang, Huang, Fei, Zhao, Junbo.<a class="reference external" href="https://arxiv.org/pdf/2310.17594">SPA: A Graph Spectral Alignment Perspective for Domain Adaptation</a>. In Neurips, 2023.</p>
<p>[37] Xie, Renchunzi, Odonnat, Ambroise, Feofanov, Vasilii, Deng, Weijian, Zhang, Jianfeng and An, Bo. <a class="reference external" href="https://arxiv.org/pdf/2405.18979">MaNo: Exploiting Matrix Norm for Unsupervised Accuracy Estimation Under Distribution Shifts</a>. In NeurIPS, 2024.</p>
<p>[38] Y. He, H. Wang, B. Li, H. Zhao. <a class="reference external" href="https://arxiv.org/pdf/2310.13852">Gradual Domain Adaptation: Theory and Algorithms</a>. In Journal of Machine Learning Research, 2024.</p>
</section>
</section>
</section>
</section>
<section id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Link to this heading"></a></h1>
<ul class="simple">
<li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
<li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li>
<li><p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p></li>
</ul>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="auto_examples/plot_how_to_use_skada.html" class="btn btn-neutral float-right" title="How to use SKADA" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2023, The SKADA team.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" data-toggle="rst-versions" role="note"
aria-label="versions">
<!-- add shift_up to the class for force viewing ,
data-toggle="rst-current-version" -->
<span class="rst-current-version" style="margin-bottom:1mm;">
<span class="fa fa-book"> SKADA: SciKit-ADAptation</span> 0.6.0
<hr style="margin-bottom:1.5mm;margin-top:5mm;">
<!-- versions
<span class="fa fa-caret-down"></span>-->
<span class="rst-current-version" style="display: inline-block;padding:
0px;color:#fcfcfcab;float:left;font-size: 100%;">
Versions:
<a href="https://scikit-adaptation.github.io/"
style="padding: 3px;color:#fcfcfc;font-size: 100%;">Release</a>
<a href="https://scikit-adaptation.github.io/dev"
style="padding: 3px;color:#fcfcfc;font-size: 100%;">Development</a>
<a href="https://github.com/scikit-adaptation/skada"
style="padding: 3px;color:#fcfcfc;font-size: 100%;">Code</a>
</span>
</span>
<!--
<div class="rst-other-versions">
<div class="injected">
<dl>
<dt>Versions</dt>
<dd><a href="https://pythonot.github.io/">Release</a></dd>
<dd><a href="https://pythonot.github.io/master">Development</a></dd>
<dt><a href="https://github.com/PythonOT/POT">Code on Github</a></dt>
</dl>
<hr>
</div>
</div>-->
</div><script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>