File tree 3 files changed +94
-0
lines changed
Filter options
themes/scikit-learn-modern/static/css 3 files changed +94
-0
lines changed
Original file line number Diff line number Diff line change 299
299
# Not showing the search summary makes the search page load faster.
300
300
html_show_search_summary = False
301
301
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
+
302
322
# -- Options for LaTeX output ------------------------------------------------
303
323
latex_elements = {
304
324
# The paper size ('letterpaper' or 'a4paper').
Original file line number Diff line number Diff line change @@ -162,6 +162,12 @@ the :func:`fbeta_score` function::
162
162
>>> grid = GridSearchCV(LinearSVC(dual="auto"), param_grid={'C': [1, 10]},
163
163
... scoring=ftwo_scorer, cv=5)
164
164
165
+
166
+ |details-start |
167
+ **Custom scorer objects **
168
+ |details-split |
169
+
170
+
165
171
The second use case is to build a completely custom scorer object
166
172
from a simple python function using :func: `make_scorer `, which can
167
173
take several parameters:
@@ -202,13 +208,21 @@ Here is an example of building custom scorers, and of using the
202
208
>>> score(clf, X, y)
203
209
-0.69...
204
210
211
+ |details-end |
205
212
206
213
.. _diy_scoring :
207
214
208
215
Implementing your own scoring object
209
216
------------------------------------
217
+
210
218
You can generate even more flexible model scorers by constructing your own
211
219
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
+
212
226
For a callable to be a scorer, it needs to meet the protocol specified by
213
227
the following two rules:
214
228
@@ -249,6 +263,8 @@ the following two rules:
249
263
... cv=5,
250
264
... n_jobs=-1) # doctest: +SKIP
251
265
266
+ |details-end |
267
+
252
268
.. _multimetric_scoring :
253
269
254
270
Using multiple metric evaluation
Original file line number Diff line number Diff line change @@ -147,6 +147,61 @@ div.clearer {
147
147
clear : both;
148
148
}
149
149
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
+
150
205
/* Button */
151
206
152
207
.sk-btn-primary {
@@ -606,6 +661,7 @@ div.sk-sidebar-global-toc ul ul {
606
661
div .sk-page-content h1 {
607
662
background-color : # cde8ef ;
608
663
padding : 0.5rem ;
664
+ margin-top : calc (max (2.5rem , 1vh ));
609
665
border-radius : 0 1rem ;
610
666
text-align : center;
611
667
font-size : 2rem ;
@@ -617,6 +673,7 @@ div.sk-page-content h2 {
617
673
background-color : # BED4EB ;
618
674
border-radius : 0.3rem ;
619
675
font-size : 1.5rem ;
676
+ margin-top : calc (max (2rem , .7vh ));
620
677
margin-bottom : 1rem ;
621
678
word-wrap : break-word;
622
679
}
@@ -627,6 +684,7 @@ div.sk-page-content h3 {
627
684
border-radius : 0.3rem ;
628
685
font-size : 1.2rem ;
629
686
word-wrap : break-word;
687
+ margin-top : 1.5rem ;
630
688
}
631
689
632
690
div .sk-page-content h4 {
You can’t perform that action at this time.
0 commit comments