Shared task
adding length function to pipeline.py
PR #13439 ↗ · scikit-learn/scikit-learn · · merged Mar 16, 2019 · +11 −0 · base a62775e99f2a
what a new run launched now would send
Pipeline should implement __len__
#### Description
With the new indexing support `pipe[:len(pipe)]` raises an error.
#### Steps/Code to Reproduce
```python
from sklearn import svm
from sklearn.datasets import samples_generator
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import f_regression
from sklearn.pipeline import Pipeline
# generate some data to play with
X, y = samples_generator.make_classification(
n_informative=5, n_redundant=0, random_state=42)
anova_filter = SelectKBest(f_regression, k=5)
clf = svm.SVC(kernel='linear')
pipe = Pipeline([('anova', anova_filter), ('svc', clf)])
len(pipe)
```
#### Versions
```
System:
python: 3.6.7 | packaged by conda-forge | (default, Feb 19 2019, 18:37:23) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
executable: /Users/krisz/.conda/envs/arrow36/bin/python
machine: Darwin-18.2.0-x86_64-i386-64bit
BLAS:
macros: HAVE_CBLAS=None
lib_dirs: /Users/krisz/.conda/envs/arrow36/lib
cblas_libs: openblas, openblas
Python deps:
pip: 19.0.3
setuptools: 40.8.0
sklearn: 0.21.dev0
numpy: 1.16.2
scipy: 1.2.1
Cython: 0.29.6
pandas: 0.24.1
```
Work only inside this repository checkout. Make the code change the task
describes, keeping the diff focused — no drive-by refactors.
When you are done, leave your changes committed or in the working tree;
they are collected automatically.
Stay on this snapshot checkout (`task/ycb_scikit-learn_pr13439`). Never checkout, pull, or rebase onto `main`. That branch is a README-only orphan.
Stay on this HEAD. Do not fetch another default branch. Push only on the Cursor-created `crazy-cursor/…` side branch from this HEAD.Some past runs of this task were launched with a different prompt (the prompt template changed since, or those runs predate this benchmark's stored prompt). Each run persists the exact prompt it sent at launch — that per-launch record is the audit trail; this page shows only the current one.
| Run | Model | Verdict |
|---|---|---|
| Aug 21, 12:31 UTC · completed | composer-2.5 | PASS |
| Aug 21, 12:31 UTC · completed | grok-4.6 | PASS |
| Aug 21, 12:31 UTC · completed | grok-4.6-low |
Powered by YourCodingBench — benchmark coding models on your own repo's commits. sign in
| Aug 21, 12:31 UTC · completed | grok-4.6-medium | PASS |
| Aug 21, 12:31 UTC · completed | grok-4.6-xhigh | PASS |
Binary verdicts from the pinned judge (D27). Full attempt detail — candidate diff, transcript, timings — lives on each run page's score matrix.