Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 55c99f2

Browse filesBrowse files
GaelVaroquauxREDVM
authored andcommitted
DOC a simple implementation of folding (scikit-learn#26625)
1 parent ad97c69 commit 55c99f2
Copy full SHA for 55c99f2

File tree

3 files changed

+94
-0
lines changed
Filter options

3 files changed

+94
-0
lines changed

‎doc/conf.py

Copy file name to clipboardExpand all lines: doc/conf.py
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,26 @@
299299
# Not showing the search summary makes the search page load faster.
300300
html_show_search_summary = False
301301

302+
303+
rst_prolog = """
304+
.. |details-start| raw:: html
305+
306+
<details>
307+
<summary class="btn btn-light">
308+
309+
.. |details-split| raw:: html
310+
311+
<span class="tooltiptext">Click for more details</span>
312+
</summary>
313+
<div class="card">
314+
315+
.. |details-end| raw:: html
316+
317+
</div>
318+
</details>
319+
320+
"""
321+
302322
# -- Options for LaTeX output ------------------------------------------------
303323
latex_elements = {
304324
# The paper size ('letterpaper' or 'a4paper').

‎doc/modules/model_evaluation.rst

Copy file name to clipboardExpand all lines: doc/modules/model_evaluation.rst
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ the :func:`fbeta_score` function::
162162
>>> grid = GridSearchCV(LinearSVC(dual="auto"), param_grid={'C': [1, 10]},
163163
... scoring=ftwo_scorer, cv=5)
164164

165+
166+
|details-start|
167+
**Custom scorer objects**
168+
|details-split|
169+
170+
165171
The second use case is to build a completely custom scorer object
166172
from a simple python function using :func:`make_scorer`, which can
167173
take several parameters:
@@ -202,13 +208,21 @@ Here is an example of building custom scorers, and of using the
202208
>>> score(clf, X, y)
203209
-0.69...
204210

211+
|details-end|
205212

206213
.. _diy_scoring:
207214

208215
Implementing your own scoring object
209216
------------------------------------
217+
210218
You can generate even more flexible model scorers by constructing your own
211219
scoring object from scratch, without using the :func:`make_scorer` factory.
220+
221+
222+
|details-start|
223+
**How to build a scorer from scratch**
224+
|details-split|
225+
212226
For a callable to be a scorer, it needs to meet the protocol specified by
213227
the following two rules:
214228

@@ -249,6 +263,8 @@ the following two rules:
249263
... cv=5,
250264
... n_jobs=-1) # doctest: +SKIP
251265

266+
|details-end|
267+
252268
.. _multimetric_scoring:
253269

254270
Using multiple metric evaluation

‎doc/themes/scikit-learn-modern/static/css/theme.css

Copy file name to clipboardExpand all lines: doc/themes/scikit-learn-modern/static/css/theme.css
+58Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,61 @@ div.clearer {
147147
clear: both;
148148
}
149149

150+
/* details / summary */
151+
152+
div.sk-page-content details {
153+
margin: 4ex 0pt;
154+
}
155+
156+
div.sk-page-content summary.btn {
157+
display: list-item;
158+
padding: 6px 20px;
159+
border: 1pt solid #999;
160+
}
161+
162+
div.sk-page-content details div.card {
163+
padding: 0pt .5ex;
164+
margin: 1ex 0pt;
165+
border: 1px solid #e9ecef;
166+
border-left-width: .25rem;
167+
border-radius: .25rem;
168+
background: rgb(250, 252, 253)
169+
}
170+
171+
div.sk-page-content summary {
172+
position: relative; /* Needed for the tooltips */
173+
}
174+
175+
div.sk-page-content summary .tooltiptext {
176+
visibility: hidden;
177+
width: 120px;
178+
background-color: black;
179+
color: #fff;
180+
text-align: center;
181+
border-radius: 6px;
182+
padding: 5px 0;
183+
position: absolute;
184+
z-index: 1;
185+
bottom: 150%;
186+
left: 50%;
187+
margin-left: -60px;
188+
}
189+
190+
div.sk-page-content summary .tooltiptext::after {
191+
content: "";
192+
position: absolute;
193+
top: 100%;
194+
left: 50%;
195+
margin-left: -5px;
196+
border-width: 5px;
197+
border-style: solid;
198+
border-color: black transparent transparent transparent;
199+
}
200+
201+
div.sk-page-content summary:hover .tooltiptext {
202+
visibility: visible;
203+
}
204+
150205
/* Button */
151206

152207
.sk-btn-primary {
@@ -606,6 +661,7 @@ div.sk-sidebar-global-toc ul ul {
606661
div.sk-page-content h1 {
607662
background-color: #cde8ef;
608663
padding: 0.5rem;
664+
margin-top: calc(max(2.5rem, 1vh));
609665
border-radius: 0 1rem;
610666
text-align: center;
611667
font-size: 2rem;
@@ -617,6 +673,7 @@ div.sk-page-content h2 {
617673
background-color: #BED4EB;
618674
border-radius: 0.3rem;
619675
font-size: 1.5rem;
676+
margin-top: calc(max(2rem, .7vh));
620677
margin-bottom: 1rem;
621678
word-wrap: break-word;
622679
}
@@ -627,6 +684,7 @@ div.sk-page-content h3 {
627684
border-radius: 0.3rem;
628685
font-size: 1.2rem;
629686
word-wrap: break-word;
687+
margin-top: 1.5rem;
630688
}
631689

632690
div.sk-page-content h4 {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.