instance_id
stringlengths
21
53
repo
stringclasses
188 values
language
stringclasses
1 value
pull_number
int64
20
148k
title
stringlengths
6
144
body
stringlengths
0
83.4k
created_at
stringdate
2015-09-25 03:17:17
2025-07-10 16:50:35
problem_statement
stringlengths
188
240k
hints_text
stringlengths
0
145k
resolved_issues
listlengths
1
6
base_commit
stringlengths
40
40
commit_to_review
dict
reference_review_comments
listlengths
1
62
merged_commit
stringlengths
40
40
merged_patch
stringlengths
297
9.87M
metadata
dict
psf__black-2526@b821ed8
psf/black
Python
2,526
Enhance `--verbose`
### Description Black would now echo the location that it determined as the root path for the project if `--verbose` is enabled by the user, according to which it chooses the SRC paths, i.e. the absolute path of the project: `{root}/{src}`. ![Screenshot from 2021-10-07 13-40-59](https://user-images.githubusercont...
2021-10-07T08:13:05Z
`--verbose` mode should print location of project root **Describe the bug** A clear and concise description of what the bug is. Black 20.8b1 does not respect skip-string-normalization = true in the pyproject.toml **To Reproduce** Steps to reproduce the behavior: 1. pyproject.toml ``` [tool.black] target-ver...
Thanks for reporting, but hmm I cannot reproduce: ```console ichard26@acer-ubuntu:~/programming/testing$ mkdir black1880 ichard26@acer-ubuntu:~/programming/testing$ cd black1880/ ichard26@acer-ubuntu:~/programming/testing/black1880$ python -m virtualenv env/ ichard26@acer-ubuntu:~/programming/testing/black1880$ ...
[ { "body": "**Describe the bug** A clear and concise description of what the bug is.\r\n\r\nBlack 20.8b1 does not respect skip-string-normalization = true in the pyproject.toml\r\n\r\n**To Reproduce** Steps to reproduce the behavior:\r\n\r\n1. pyproject.toml\r\n```\r\n[tool.black]\r\ntarget-version = ['py36']\r\...
e401b6bb1e1c0ed534bba59d9dc908caf7ba898c
{ "head_commit": "b821ed860f4893beab315ae86ebaf19a55286a9e", "head_commit_message": "Remove quotes from project root verbose statement", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex b454a73edab..39ec9c3059a 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -1,5 +1,12 @@\n # Change Log\n \n+## Unre...
[ { "diff_hunk": "@@ -10,6 +13,12 @@\n from black.output import out, err\n \n \n+def root_relative(path: Path, root: Optional[Path]) -> Path:\n+ if not root:\n+ return path\n+ return Path(os.path.relpath(path, start=Path(f\"{root}/../\")))", "line": null, "original_line": 19, "original_st...
c02122a48d42c3fc74c6ca5d762cacf48d4a99ce
diff --git a/CHANGES.md b/CHANGES.md index bfee1b6f259..f6e8343ed00 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,8 @@ `values: Tuple[int, ...] = 1, 2, 3`) now implies 3.8+ (#2708) - For stubs, one blank line between class attributes and methods is now kept if there's at least one pre-existing blank line...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
psf__black-2005@ab9345c
psf/black
Python
2,005
Add --extend-exclude parameter
Adding the `--extend-exclude` parameter to add additional exclude regexes on top of the `--exclude` regexes. This is especially useful if you want to specify _additional_ files/directories on top of the very useful default ones (as demonstrated by the change to our own `pyproject.toml`). The parameter name also matc...
2021-02-24T21:30:54Z
Please offer a way to exclude dirs *in addition to the default exclusions* **Is your feature request related to a problem? Please describe.** I needed to exclude one auto-generated file so I naively specified `--exclude thefile.py`. Unfortunately that disabled the useful standard exclusions, which I did not realize ...
For comparison, Flake8 does this, named `--extend-exclude=<patterns>` https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-extend-exclude I'd be supportive of doing this, using the `--extend-exclude` name. I can take a stab at it, with `--extend-exclude`.
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\n\r\nI needed to exclude one auto-generated file so I naively specified `--exclude thefile.py`. Unfortunately that disabled the useful standard exclusions, which I did not realize until it broke a unit test running on Jenkins.\r\n\r...
b06cd15666e5d766347cda0434dc6c828a96c74a
{ "head_commit": "ab9345ca5b1801073b2fb6a2f4a54523df25d0ec", "head_commit_message": "Fix flake8 issues", "patch_to_review": "diff --git a/README.md b/README.md\nindex 178f763c32d..df21d2b1f00 100644\n--- a/README.md\n+++ b/README.md\n@@ -135,11 +135,17 @@ Options:\n hg|\\.mypy_ca...
[ { "diff_hunk": "@@ -1433,6 +1443,35 @@ def test_get_sources_with_stdin_filename_and_exclude(self) -> None:\n verbose=False,\n include=include,\n exclude=exclude,\n+ extend_exclude=None,\n+ force_exclude=None,\n+ report=...
3a8f4beee1de321d12f7fdc4dd39dd808673bc6a
diff --git a/README.md b/README.md index 178f763c32d..5f8b52cb823 100644 --- a/README.md +++ b/README.md @@ -135,11 +135,17 @@ Options: hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_bu ild|buck-out|build|dist)/] + --extend-exclude TEXT Like ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
psf__black-1915@0aa6927
psf/black
Python
1,915
Update Contributing Docs
- Update docs with all new tox hotness - Test running docs build: - `sphinx-build -a -b html -W docs/ docs/_build/` Fixes #1907
2021-01-10T23:18:50Z
Update contributing The correct way to run tests seems to be `tox -e py` (as run on CI) and not `python -m unittest` (that doesn’t even work due to parametrized not being in the Pipfile!) as advised currently. We should also ask contributors to run `tox -e fuzz` too maybe.
[ { "body": "The correct way to run tests seems to be `tox -e py` (as run on CI) and not `python -m unittest` (that doesn’t even work due to parametrized not being in the Pipfile!) as advised currently. We should also ask contributors to run `tox -e fuzz` too maybe.", "number": 1907, "title": "Update cont...
a81702ce027ef6792955d5db02aad60a34c7ec44
{ "head_commit": "0aa69275c104e480989d518cfe34e6c5ef4bf214", "head_commit_message": "Remove autogenerated copy pasta", "patch_to_review": "diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md\nindex a4250f78718..c42d266327e 100644\n--- a/CONTRIBUTING.md\n+++ b/CONTRIBUTING.md\n@@ -34,14 +34,39 @@ If you haven't used `p...
[ { "diff_hunk": "@@ -34,14 +34,39 @@ If you haven't used `pipenv` before but are comfortable with virtualenvs, just r\n `pip install pipenv` in the virtualenv you're already using and invoke the command above\n from the cloned _Black_ repo. It will do the correct thing.\n \n-Before submitting pull requests, run ...
025c321d3ec292275b3e57f7cff69784220d985f
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a4250f78718..571d870452b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,14 +34,40 @@ If you haven't used `pipenv` before but are comfortable with virtualenvs, just r `pip install pipenv` in the virtualenv you're already using and invoke the command above ...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
psf__black-2208@e3bbe53
psf/black
Python
2,208
Cover more in the usage docs
I had this laying around so why not use it :) Resolves GH-2004.
2021-05-08T19:52:31Z
Mention that "-" is how one specifies standard input Mention somewhere in --help that "-" is how one specifies standard input. (No, /dev/stdin etc. won't work.) Else one thinks --pyi is how one does it. ``` --pyi Format all input files like typing stubs ...
[ { "body": "Mention somewhere in --help that \"-\" is how one specifies standard\r\ninput. (No, /dev/stdin etc. won't work.) Else one thinks --pyi is how one does it.\r\n```\r\n --pyi Format all input files like typing stubs\r\n regardless of file exten...
1bedc176d19f0e71c24149c696c5a2a71f21e941
{ "head_commit": "e3bbe53f767f6c50d871f097f58642faf974c52e", "head_commit_message": "Minor fixes", "patch_to_review": "diff --git a/docs/usage_and_configuration/the_basics.md b/docs/usage_and_configuration/the_basics.md\nindex 6fd8769b591..1bafb3fe0a8 100644\n--- a/docs/usage_and_configuration/the_basics.md\n+++ ...
[ { "diff_hunk": "@@ -124,6 +124,148 @@ running `black --help`.\n \n </details>\n \n+### Code input alternatives\n+\n+#### Standard Input\n+\n+_Black_ supports formatting code via stdin, with the result being printed to stdin. Just", "line": null, "original_line": 131, "original_start_line": null, ...
9a8adab6c0d4b3743ce4e073f5e2256a58c712c3
diff --git a/docs/usage_and_configuration/the_basics.md b/docs/usage_and_configuration/the_basics.md index 6fd8769b591..4b7aaf30591 100644 --- a/docs/usage_and_configuration/the_basics.md +++ b/docs/usage_and_configuration/the_basics.md @@ -124,6 +124,149 @@ running `black --help`. </details> +### Code input alter...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
psf__black-2472@895695b
psf/black
Python
2,472
Treat functions/classes in blocks as if they're nested
### Description One curveball is that we still want two preceding newlines before blocks that are probably logically disconnected. In other words: if condition: def foo(): return "hi" # <- aside: this is the goal of this commit else: def f...
2021-09-02T18:03:01Z
Inconsistent spacing around top level functions Operating system: macOS 10.14.2 Python version: 3.7.1 *Black* version: 18.9b0 Does also happen on master: yes --- I have a bit of OS-specific code that looks like this (when formatted by black): ```py import os if os.name == "posix": import termios ...
This is indeed the case: https://black.now.sh/?version=stable&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4AFlAKtdAD2IimZxl1N_WlwxRhR7MSgE-ANVlfGy-Pf-urovcUul06DGIKtNJ_PI3I6sH4UsuvCCJK3cSn3O4qbqqEoVdC4RVidtOakKqE1C2PRTK-dEU4CIhv140rXetsz6FlHHNcogH0t3yNeHxqr6iAwuCmSu430fNaT3oxW598BtIbDYmvw9WdVHpVPmNBsa5a2N64u1JlxqaEp3vqccXdLe...
[ { "body": "Operating system: macOS 10.14.2\r\nPython version: 3.7.1\r\n*Black* version: 18.9b0\r\nDoes also happen on master: yes\r\n\r\n---\r\n\r\nI have a bit of OS-specific code that looks like this (when formatted by black):\r\n\r\n```py\r\nimport os\r\n\r\nif os.name == \"posix\":\r\n import termios\r\n...
f1813e31b6deed0901c8a7fb1f102b9af53de351
{ "head_commit": "895695b87cf0e953ffd42d715efba8a31e3ae4fc", "head_commit_message": "Treat functions/classes in blocks as if they're nested\n\nOne curveball is that we still want two preceding newlines before blocks\nthat are probably logically disconnected. In other words:\n\n if condition:\n\n def foo()...
[ { "diff_hunk": "@@ -447,11 +447,30 @@ def _maybe_empty_lines(self, current_line: Line) -> Tuple[int, int]:\n before = 0\n depth = current_line.depth\n while self.previous_defs and self.previous_defs[-1] >= depth:\n- self.previous_defs.pop()\n if self.is_pyi:\n ...
4253c26094980962120e866607de3039c6045fe0
diff --git a/CHANGES.md b/CHANGES.md index 5b648225ad7..59042914174 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ - Add `flake8-simplify` and `flake8-comprehensions` plugins (#2653) - Fix determination of f-string expression spans (#2654) - Fix parser error location on invalid syntax in a `match` statem...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Code Style, Linting, Formatting Fixes" }
psf__black-1780@c2ddf0a
psf/black
Python
1,780
Provide a stdin-filename to allow stdin to respect force-exclude rules
Fix #1776
2020-10-22T20:10:34Z
Provide a --stdin-display-name option like flake8 I'm trying to use `black` as a fixer on ale on vim. It works fine and my config file is respected, except for the `exclude` and `force-exclude` files/folders. The problem is that the tool calls black passing the code through stdin, and thus, black doesn't know the fi...
[ { "body": "I'm trying to use `black` as a fixer on ale on vim. It works fine and my config file is respected, except for the `exclude` and `force-exclude` files/folders.\r\n\r\nThe problem is that the tool calls black passing the code through stdin, and thus, black doesn't know the filename that is being parsed...
407052724fa1c97ee8bcd4e96de650def00be03e
{ "head_commit": "c2ddf0adaa23cd4f8ac154af97f1763cea44d604", "head_commit_message": "Provide a stdin-filename to allow stdin to respect exclude/force-exclude rules\n\nThis will allow automatic tools to enforce the project's\nexclude/force-exclude rules even if they pass the file through stdin to\nupdate its buffer....
[ { "diff_hunk": "@@ -626,8 +644,6 @@ def get_sources(\n gitignore,\n )\n )\n- elif s == \"-\":\n- sources.add(p)\n elif p.is_file():", "line": null, "original_line": 647, "original_start_line": null, "path": "src/black/__in...
7320a10ec942fd8256192f0714e6db9f8d304aa6
diff --git a/README.md b/README.md index 47472810114..0615ba6aa3a 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,11 @@ Options: matching this regex will be excluded even when they are passed explicitly as arguments. + --stdin-filename TEXT ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
psf__black-2343@fc40194
psf/black
Python
2,343
Fix bad formatting of error messages about EOF in multi-line statements
Closes #2317
2021-06-20T14:57:09Z
Bad formatting of error messages about EOF in multi-line statements **Describe the bug** "EOF in multi-line statement" error is shown to the user as the raw tuple it was returned as, rather than in a nicely formatted message. **To Reproduce** For example: 1. Take this (invalid) file: ```py print( ``` 2....
Many thanks for reporting! It appears to be about `TokenError` (and potentially also `IndentationError`) exception leaking out from `lib2to3_parse()` call. Should the `lib2to3_parse()` function just be updated to handle these 2 errors or is there some other solution that would be preferred here? Eh, it seems to be just...
[ { "body": "**Describe the bug**\r\n\r\n\"EOF in multi-line statement\" error is shown to the user as the raw tuple it was returned as, rather than in a nicely formatted message.\r\n\r\n**To Reproduce**\r\n\r\nFor example:\r\n1. Take this (invalid) file:\r\n```py\r\nprint(\r\n\r\n```\r\n2. Run _Black_ on it with...
136930fccb99320865622e12ffc21bdd45fd7501
{ "head_commit": "fc40194c38aa540c020b3ae31e29167558333d5b", "head_commit_message": "Changing message for TokenError", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex 6714a9d9eb2..15eac739e66 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -44,6 +44,7 @@\n - Fix regression where `R` prefixes would ...
[ { "diff_hunk": "@@ -92,6 +93,12 @@ def lib2to3_parse(src_txt: str, target_versions: Iterable[TargetVersion] = ()) -\n except IndexError:\n faulty_line = \"<line number missing in source>\"\n exc = InvalidInput(f\"Cannot parse: {lineno}:{column}: {faulty_line}\")\n+\n+ ...
339a1738e22dbd7d36a04aaa0620a31700d6a9d4
diff --git a/CHANGES.md b/CHANGES.md index e5f4a1fdf82..5d89c71f580 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,7 @@ - Add `flake8-simplify` and `flake8-comprehensions` plugins (#2653) - Fix determination of f-string expression spans (#2654) - Fix parser error location on invalid syntax in a `match` statem...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
psf__black-1940@55a46b8
psf/black
Python
1,940
Add `version` to github action (and rewrite the whole thing while at it)
Allows setting the exact black version use with the github action. This is useful to be able to avoid needing to deal with black formatting changes introduced in new black versions in unrelated pull-requests.
2021-01-22T23:51:53Z
Allow picking a specific black version in the github action Sometimes we want to stick with the formatting rules of a specific black version for a little while until we've concluded large PRs to avoid merge conflicts. The Github action currently does not support picking a specific version of black though. Suggested...
Sounds good, a PR would be welcome.
[ { "body": "Sometimes we want to stick with the formatting rules of a specific black version for a little while until we've concluded large PRs to avoid merge conflicts.\r\nThe Github action currently does not support picking a specific version of black though.\r\n\r\nSuggested solution: Add a parameter for the ...
519f807f879350704449e424c5c5b7e049e582b3
{ "head_commit": "55a46b85e7aaccc8dd56c350f2875d3267831698", "head_commit_message": "Add black_version to github action", "patch_to_review": "diff --git a/CHANGES.md b/CHANGES.md\nindex 97a3be33c93..82903ef0a6b 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -45,6 +45,8 @@\n - PR #2053: Python 2 support is now opt...
[ { "diff_hunk": "@@ -6,9 +6,20 @@ inputs:\n description: \"Black input arguments.\"\n required: false\n default: \"\"\n+ black_version:\n+ description: 'Version of black to use. E.g \"==20.8b1\"'", "line": null, "original_line": 10, "original_start_line": null, "path": "action.yml...
2e40c836bb3142718a3b42967fbce2c31fa5d9e6
diff --git a/CHANGES.md b/CHANGES.md index d9800a6979c..8569b5d487f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,7 +16,12 @@ - Add a lower bound for the `aiohttp-cors` dependency. Only 0.4.0 or higher is supported. (#2231) -### _Packaging_ +### Integrations + +- The official Black action now supports choosing ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
psf__black-948@1084e90
psf/black
Python
948
Fix unstable format involving backslash + whitespace at beginning of file
This PR fixes #922 - an unstable sort involve Python line continuation with `\`. The issue describes the problem pretty well. To my knowledge, there should be no situation where Black outputs a file formatted with empty lines at the beginning. By performing this check in the format function, we fix the above issue...
2019-07-28T21:59:41Z
Black produced different code on the second pass of the formatter: Explicit line join in the first line Operating system: macOS Mojave 10.14.5 (18F132) Python version: Python 3.7.3 *Black* version: 19.3b0 (f3bb22a828) Does also happen on master: yes Minified reproducer: ```python \ pass ``` Black diff:...
[ { "body": "Operating system: macOS Mojave 10.14.5 (18F132)\r\nPython version: Python 3.7.3\r\n*Black* version: 19.3b0 (f3bb22a828)\r\nDoes also happen on master: yes\r\n\r\nMinified reproducer:\r\n```python\r\n\\\r\n\r\n\r\npass\r\n```\r\n\r\nBlack diff:\r\n```diff\r\n--- source\r\n+++ first pass\r\n@@ -1,5 +1,...
e66451761fab864cce9077a3ee72999543b8ef65
{ "head_commit": "1084e90ccf9cc63d62e09c14d73a3bce1fe6b69e", "head_commit_message": "Add newline to end of test data file", "patch_to_review": "diff --git a/black.py b/black.py\nindex 910a0ed1e37..c3e449aa96d 100644\n--- a/black.py\n+++ b/black.py\n@@ -736,8 +736,11 @@ def format_str(src_contents: str, *, mode: F...
[ { "diff_hunk": "@@ -736,8 +736,11 @@ def format_str(src_contents: str, *, mode: FileMode) -> FileContent:\n for _ in range(after):\n dst_contents.append(str(empty_line))\n before, after = elt.maybe_empty_lines(current_line)\n- for _ in range(before):\n- dst_contents...
fbc4e60f8324d907afbc88086cc3491f1acbd574
diff --git a/black.py b/black.py index 910a0ed1e37..1a6e6ca3671 100644 --- a/black.py +++ b/black.py @@ -1480,7 +1480,13 @@ def maybe_empty_lines(self, current_line: Line) -> Tuple[int, int]: lines (two on module-level). """ before, after = self._maybe_empty_lines(current_line) - befor...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Style, Linting, Formatting Fixes" }
spotify__luigi-2813@daeb295
spotify/luigi
Python
2,813
Add pod_creation_wait_interal
<!--- This template is optional. Please use it as a starting point to help guide PRs --> <!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes --> Add pod_creation_wait_interal property to give Kubernetes cluster some time to create pods for Job. ##...
2019-10-28T21:07:42Z
KubernetesJobTask "No pod scheduled" error I often see the following error when using `KubernetesJobTask`: ``` [28:luigi-interface:224@18:33] [ERROR] [pid 28] Worker Worker(salt=476402868, workers=20, host=something-host-1541289600-zntd7, username=root, pid=1) failed Something(local_execution=Falser) Traceback (m...
I have same issues. @keisuke-umezawa I've managed to fix it with the code above. Just create a custom `KubernetesJobTask` class with an overridden `__verify_job_has_started` method. @StasDeep Thanks! Do you have example how to override `__verify_job_has_started`? Yep. Something like that: ``` class MyKubernetesJobT...
[ { "body": "I often see the following error when using `KubernetesJobTask`:\r\n```\r\n[28:luigi-interface:224@18:33] [ERROR] [pid 28] Worker Worker(salt=476402868, workers=20, host=something-host-1541289600-zntd7, username=root, pid=1) failed Something(local_execution=Falser)\r\nTraceback (most recent call la...
db8ff63f8cd4418be91fa6bfb75b23102a5fae2f
{ "head_commit": "daeb295ed115af02af9a256d53defa4e12c0726a", "head_commit_message": "Add pod_creation_wait_interal", "patch_to_review": "diff --git a/luigi/contrib/kubernetes.py b/luigi/contrib/kubernetes.py\nindex c1c7afce65..13db2dbe94 100644\n--- a/luigi/contrib/kubernetes.py\n+++ b/luigi/contrib/kubernetes.py...
[ { "diff_hunk": "@@ -213,10 +213,15 @@ def poll_interval(self):\n \"\"\"How often to poll Kubernetes for job status, in seconds.\"\"\"\n return self.__DEFAULT_POLL_INTERVAL\n \n+ @property\n+ def pod_creation_wait_interal(self):\n+ \"\"\"Delay for initial pod creation for just submit...
87d64d22dd2b992ee2d16b7864dba6edbf3a47de
diff --git a/luigi/contrib/kubernetes.py b/luigi/contrib/kubernetes.py index c1c7afce65..c913a33cdd 100644 --- a/luigi/contrib/kubernetes.py +++ b/luigi/contrib/kubernetes.py @@ -66,6 +66,7 @@ class kubernetes(luigi.Config): class KubernetesJobTask(luigi.Task): __DEFAULT_POLL_INTERVAL = 5 # see __track_job + ...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
spotify__luigi-2779@ea97908
spotify/luigi
Python
2,779
PySparkTask: handle special characters in name (#2778)
Fixes #2778 ## Description It cleans _name_ property before it is used to derive _run_path_ and _run_pickle_ properties. ## Motivation and Context If name property contains some special characters PySparkTask fails: #2778 ## Have you tested this? If so, how? Unit test is included
2019-09-09T22:19:46Z
PySparkTask fails if name contains invalid characters PySparkTask derives run_path and run_pickle from name property, but it do not escape special characters: 1. '/' in name causes FileNotFoundError raised by mkdtemp 2. ',' is separator of files in spark-submit '--files' arg, and run_pickle is passed to 'files' arg i...
[ { "body": "PySparkTask derives run_path and run_pickle from name property, but it do not escape special characters:\r\n1. '/' in name causes FileNotFoundError raised by mkdtemp\r\n2. ',' is separator of files in spark-submit '--files' arg, and run_pickle is passed to 'files' arg in cluster mode.\r\n3. ':' cause...
1e99e6b68a51653553fc5cb26a4009fa58444331
{ "head_commit": "ea97908903497c29ff0f076fffbc9251827e0370", "head_commit_message": "PySparkTask: special characters in name (#2778)", "patch_to_review": "diff --git a/luigi/contrib/spark.py b/luigi/contrib/spark.py\nindex d84d08312c..bb9b0d400c 100644\n--- a/luigi/contrib/spark.py\n+++ b/luigi/contrib/spark.py\n...
[ { "diff_hunk": "@@ -298,8 +299,9 @@ def app_command(self):\n return [self.app, pickle_loc] + self.app_options()\n \n def run(self):\n- self.run_path = tempfile.mkdtemp(prefix=self.name)\n- self.run_pickle = os.path.join(self.run_path, '.'.join([self.name.replace(' ', '_'), 'pickle']))\...
962c12c3497b34f1f6b4a8c780e477926fc26853
diff --git a/luigi/contrib/spark.py b/luigi/contrib/spark.py index d84d08312c..3282b61bfa 100644 --- a/luigi/contrib/spark.py +++ b/luigi/contrib/spark.py @@ -17,6 +17,7 @@ import logging import os +import re import sys import tempfile import shutil @@ -298,8 +299,9 @@ def app_command(self): return [sel...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
psf__black-679@7360c01
psf/black
Python
679
Wrap `loop.run_in_executor` up in `asyncio.ensure_future` for reliable cross-platform berhavior.
Closes #494 Task completion should also remove the task from `pending`. Only replicates on some platforms. (eg. Can replicate on Python 3.7+, with either Windows or whatever default Linux distro Travis uses.)
2019-01-23T10:26:09Z
Black is not formatting code on Python 3.7 on some platform configurations (Windows, Ubuntu) Howdy! Sorry you're having trouble. To expedite your experience, provide some basics for me: Operating system: Windows 10 64bit Python version: Python 3.7.0 (32Bit) *Black* version: 18.6b4 Does also happen on master: Yes...
Interesting, some related tests indeed fail on a 32bit 3.7.0, but not 3.6.5. I'll look into this. Sounds like an issue with asyncio. Just confirming this issue here too. The traceback I see for it is... ```python Traceback (most recent call last): File "/home/travis/virtualenv/python3.7-dev/bin/black", line 11, ...
[ { "body": "Howdy! Sorry you're having trouble. To expedite your experience,\r\nprovide some basics for me:\r\n\r\nOperating system: Windows 10 64bit\r\nPython version: Python 3.7.0 (32Bit)\r\n*Black* version: 18.6b4\r\nDoes also happen on master: Yes\r\n\r\nWhen running black for directory it fails without any ...
ea55ff28782f7e3b481c99faaf9f57e88597bdde
{ "head_commit": "7360c013875c66c897bf69062f431908d2c54a34", "head_commit_message": "Ensure that 'tasks.keys()' are always Task instances", "patch_to_review": "diff --git a/black.py b/black.py\nindex 32693227ed2..b0a9a32a40f 100644\n--- a/black.py\n+++ b/black.py\n@@ -464,15 +464,17 @@ async def schedule_formatti...
[ { "diff_hunk": "@@ -464,15 +464,17 @@ def reformat_one(\n manager = Manager()\n lock = manager.Lock()\n tasks = {\n- loop.run_in_executor(\n- executor,\n- format_file_in_place,\n- src,\n- line_length,\n- fast,\n- write_...
6406f35c9cf60abd5fa14f833ada0176b9d7d61d
diff --git a/black.py b/black.py index 34bd59eacdd..84f1942a0be 100644 --- a/black.py +++ b/black.py @@ -519,12 +519,14 @@ async def schedule_formatting( manager = Manager() lock = manager.Lock() tasks = { - loop.run_in_executor( - executor, format_file_in_place, src, fast, mode...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
spotify__luigi-2487@868a122
spotify/luigi
Python
2,487
Added optional choice for hdfs clients
## Description Added optional choice for hdfs clients. Previously only InsecureClient was supported. This PR adds KerberosClient and TokenClient. ## Motivation and Context Some hdfs work with kerberos authentication. Mine does... This adds support for those clusters. This fixes #2481. ## Have you tested th...
2018-08-10T18:52:03Z
Use of KerberosClient with webhdfs Currently webhdfs uses InsecureClient by default. However, the hdfs package also has an KerberosClient which can be used to do authenticated requests. Our hdfs system uses Kerberos and I would like it if KerberosClient is added as an option. The KerberosClient does not need an...
I, personally, do not use the HDFS/Hadoop side of Luigi. But so long as your suggested PR doesn't change the default behavior, please feel free to submit for review! > Are you willing to accept a pull request for this? Yep, for sure.
[ { "body": "Currently webhdfs uses InsecureClient by default. However, the hdfs package also has an KerberosClient which can be used to do authenticated requests. \r\n\r\nOur hdfs system uses Kerberos and I would like it if KerberosClient is added as an option. \r\n\r\nThe KerberosClient does not need any additi...
de4629a4c7c562b53fee2045aabd84189f897593
{ "head_commit": "868a122c2b6f1c275beda8105b7b4e060f4359a8", "head_commit_message": "Added documentation for the new client_type and token parameter of the webhdfs config documentation section", "patch_to_review": "diff --git a/doc/configuration.rst b/doc/configuration.rst\nindex dec55c3679..7305d1756d 100644\n--...
[ { "diff_hunk": "@@ -43,6 +43,9 @@ class webhdfs(luigi.Config):\n description='Port for webhdfs')\n user = luigi.Parameter(default='', description='Defaults to $USER envvar',\n config_path=dict(section='hdfs', name='user'))\n+ client_type = luigi.Pa...
19e5d69145d6f51799e536418257ac597e6f9655
diff --git a/doc/configuration.rst b/doc/configuration.rst index dec55c3679..d152855ca9 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -922,11 +922,17 @@ summary-length port The port to use for webhdfs. The normal namenode port is probably on a different port from this one. + user Perform ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-31528@a2e89ea
scikit-learn/scikit-learn
Python
31,528
FIX fix comparison between array-like parameters when detecting non-default params for HTML representation
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2025-06-12T06:55:34Z
Issue with the `RidgeCV` diagram representation with non-default alphas It seems that we introduced a regression in the HTML representation. The following code is failing: ```python import numpy as np from sklearn.linear_model import RidgeCV RidgeCV(np.logspace(-3, 3, num=10) ``` leads to the following error: ```py...
My guess here is that `param_value != init_default_params[param_name]` compare 2 numpy arrays: ```python np.array([1, 2, 3]) != np.array([1, 2, 3, 4]) ``` ```pytb --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cel...
[ { "body": "It seems that we introduced a regression in the HTML representation. The following code is failing:\n\n```python\nimport numpy as np\nfrom sklearn.linear_model import RidgeCV\n\nRidgeCV(np.logspace(-3, 3, num=10)\n```\n\nleads to the following error:\n\n```pytb\n--------------------------------------...
dab084231912cb8bbb70bae52872b06bf6d2ee0f
{ "head_commit": "a2e89eaf5311723373fabfbe17bb12de549495c1", "head_commit_message": "added array vs scalar", "patch_to_review": "diff --git a/doc/whats_new/upcoming_changes/sklearn.base/31528.fix.rst b/doc/whats_new/upcoming_changes/sklearn.base/31528.fix.rst\nnew file mode 100644\nindex 0000000000000..25bf0404c6...
[ { "diff_hunk": "@@ -1000,3 +1001,46 @@ def test_get_params_html():\n \n assert est._get_params_html() == {\"l1\": 0, \"empty\": \"test\"}\n assert est._get_params_html().non_default == (\"empty\",)\n+\n+\n+# non regression test see github issue #31525\n+def test_get_params_html_ridgecv():\n+ est = Ri...
c774f2c6a2e96055c05beccf0e0d0244b87f56bd
diff --git a/doc/whats_new/upcoming_changes/sklearn.base/31528.fix.rst b/doc/whats_new/upcoming_changes/sklearn.base/31528.fix.rst new file mode 100644 index 0000000000000..312c8318eadcd --- /dev/null +++ b/doc/whats_new/upcoming_changes/sklearn.base/31528.fix.rst @@ -0,0 +1,3 @@ +- Fix regression in HTML representatio...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-5022@3dc1033
reflex-dev/reflex
Python
5,022
expose socket constants
fixes #3081
2025-03-25T01:34:11Z
Entering more than 999775 characters breaks text_area **Describe the bug** Entering more than 999775 characters breaks rx.text_area. If you enter more than 999775 characters into a text area you will have to refresh the page for the text_area to work again. **To Reproduce** Steps to reproduce the behavior: ``` ...
Hi! This error happens because the size of a message sent from browser to backend by default is limited to ~1Mb, you can see this limitation [here](https://github.com/reflex-dev/reflex/blob/0a8aaea599f95bb6c4730c743f6c4b636134ca6a/reflex/app.py#L234) in code. In `reflex.App` you can pass your custom socket engine ...
[ { "body": "**Describe the bug**\r\nEntering more than 999775 characters breaks rx.text_area. If you enter more than 999775 characters into a text area you will have to refresh the page for the text_area to work again.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n\r\n```\r\nimport reflex as rx\...
c6e2707b343b07f6a33ab63d22e9ea91de8aefdf
{ "head_commit": "3dc1033e98b7dac9e813d2ebc7dc165ddee6adf6", "head_commit_message": "expose socket constants", "patch_to_review": "diff --git a/reflex/app.py b/reflex/app.py\nindex 2c823ec1e4b..3c05b1b1496 100644\n--- a/reflex/app.py\n+++ b/reflex/app.py\n@@ -498,9 +498,9 @@ def _setup_state(self) -> None:\n ...
[ { "diff_hunk": "@@ -498,9 +498,9 @@ def _setup_state(self) -> None:\n else config.cors_allowed_origins\n ),\n cors_credentials=True,\n- max_http_buffer_size=constants.POLLING_MAX_HTTP_BUFFER_SIZE,\n- ping_interval=constants.Ping.I...
5443e85dbe1d7c4f14523ea68cd868bd08b4f5b8
diff --git a/reflex/app.py b/reflex/app.py index 2c823ec1e4b..a1e98500df0 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -498,9 +498,9 @@ def _setup_state(self) -> None: else config.cors_allowed_origins ), cors_credentials=True, - max_http_buffer_...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-4862@d3c22c9
reflex-dev/reflex
Python
4,862
opt for powershell as opposed to wmic
Fixes #4198
2025-02-22T17:55:23Z
wmic cpu get addresswidth,caption,manufacturer /FORMAT:csv **Describe the bug** The command `wmic cpu get addresswidth,caption,manufacturer /FORMAT:csv` failed with error: Command 'wmic cpu get addresswidth,caption,manufacturer /FORMAT:csv' returned non-zero exit status 1.. This will return None. AND infinity relo...
<p><a href="https://linear.app/reflex-dev/issue/ENG-3962/wmic-cpu-get-addresswidthcaptionmanufacturer-formatcsv">ENG-3962 wmic cpu get addresswidth,caption,manufacturer /FORMAT:csv</a></p> is this a regression from 0.6.2? > [ENG-3962 wmic cpu get addresswidth,caption,manufacturer /FORMAT:csv](https://linear.app/reflex-...
[ { "body": "**Describe the bug**\r\nThe command `wmic cpu get addresswidth,caption,manufacturer /FORMAT:csv` failed with error: Command 'wmic cpu get\r\naddresswidth,caption,manufacturer /FORMAT:csv' returned non-zero exit status 1.. This will return None.\r\n\r\nAND infinity reloading local server!\r\n\r\n\r\n*...
98f50811f97639bbf2015bacf0f4b0b3b843fbc8
{ "head_commit": "d3c22c95570fd025421fc455426a242ee5fc39f6", "head_commit_message": "mkdir of parents", "patch_to_review": "diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py\nindex 8afa706be5b..d3d8bd6ab49 100644\n--- a/reflex/utils/prerequisites.py\n+++ b/reflex/utils/prerequisites.py\n@...
[ { "diff_hunk": "@@ -1925,12 +1925,11 @@ def format_address_width(address_width: str | None) -> int | None:\n return None\n \n \n-@functools.lru_cache(maxsize=None)\n-def get_cpu_info() -> CpuInfo | None:\n- \"\"\"Get the CPU info of the underlining host.\n+def _load_cpu_info() -> CpuInfo | None:\n+ ...
7137ef522374853f16c704bac2c047bde998f39b
diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index 5474ae82a0c..e3fe315b2cc 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -524,17 +524,12 @@ def output_system_info(): fnm_info = f"[FNM {prerequisites.get_fnm_version()} (Expected: {constants.Fnm.VERSION}) (PATH: {constants.Fnm.EXE})]...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-30819@f872efb
scikit-learn/scikit-learn
Python
30,819
FIX Add input array check to `randomized_range_finder`
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2025-02-12T20:23:02Z
`randomized_svd` incorrect for complex valued matrices ### Describe the bug The `randomized_svd` utility function accepts complex valued inputs without error, but the result is inconsistent with `scipy.linalg.svd`. ### Steps/Code to Reproduce ```python import numpy as np from scipy import linalg from sklearn.utils.e...
[ { "body": "### Describe the bug\n\nThe `randomized_svd` utility function accepts complex valued inputs without error, but the result is inconsistent with `scipy.linalg.svd`.\n\n### Steps/Code to Reproduce\n\n```python\nimport numpy as np\nfrom scipy import linalg\nfrom sklearn.utils.extmath import randomized_sv...
e47b7c0f49450cbbcdb5abcc198cf07719567f34
{ "head_commit": "f872efbde4c25b437dc1bdfe113bc622f67eaf2f", "head_commit_message": "iter", "patch_to_review": "diff --git a/doc/whats_new/upcoming_changes/array-api/30819.feature.rst b/doc/whats_new/upcoming_changes/array-api/30819.feature.rst\nnew file mode 100644\nindex 0000000000000..40c4fc306a90c\n--- /dev/n...
[ { "diff_hunk": "@@ -274,6 +274,7 @@ def randomized_range_finder(\n [-0.82..., -0.38...]])\n \"\"\"\n xp, is_array_api_compliant = get_namespace(A)\n+ A = check_array(A, accept_sparse=True)", "line": 276, "original_line": 277, "original_start_line": null, "path": "sklearn/ut...
d0324464fc3ace1c72d76d9d93e1d041aa21db75
diff --git a/doc/whats_new/upcoming_changes/array-api/30819.feature.rst b/doc/whats_new/upcoming_changes/array-api/30819.feature.rst new file mode 100644 index 0000000000000..fac6d32b00375 --- /dev/null +++ b/doc/whats_new/upcoming_changes/array-api/30819.feature.rst @@ -0,0 +1,2 @@ +- :func:`sklearn.utils.extmath.rand...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-4406@5ec2c11
reflex-dev/reflex
Python
4,406
add datetime var comparison operations
Closes #4304
2024-11-20T22:15:24Z
Unable to compare `date` objects **Describe the bug** I'm getting an error when trying to compare two `date` objects and one of them is a `State var` (see code below) **To Reproduce** Here's a code example ``` rx.flex( rx.cond( datetime.now(pytz.utc).date() <= competition.end_date, ...
<p><a href="https://linear.app/reflex-dev/issue/ENG-4048/unable-to-compare-date-objects">ENG-4048 Unable to compare `date` objects</a></p>
[ { "body": "**Describe the bug**\r\nI'm getting an error when trying to compare two `date` objects and one of them is a `State var` (see code below)\r\n\r\n**To Reproduce**\r\nHere's a code example\r\n ```\r\nrx.flex(\r\n rx.cond(\r\n datetime.now(pytz.utc).date() <= competition.end_date,\r\n ...
681b61600025c67e1438c2252917ff078ff0db2c
{ "head_commit": "5ec2c119365d5fe5353cc7ca30fd96527e1e995a", "head_commit_message": "add future annotations", "patch_to_review": "diff --git a/reflex/vars/__init__.py b/reflex/vars/__init__.py\nindex 1a4cebe19a3..cb02319bc6a 100644\n--- a/reflex/vars/__init__.py\n+++ b/reflex/vars/__init__.py\n@@ -9,6 +9,7 @@\n f...
[ { "diff_hunk": "@@ -0,0 +1,184 @@\n+\"\"\"Immutable datetime and date vars.\"\"\"\n+\n+from __future__ import annotations\n+\n+from datetime import date, datetime\n+from typing import Any, NoReturn, TypeVar, Union, overload\n+\n+from reflex.utils.exceptions import VarTypeError\n+from reflex.vars.number import B...
c757788c0b2a5bce3c6ef9333784e74dbc4c7f71
diff --git a/reflex/vars/__init__.py b/reflex/vars/__init__.py index 1a4cebe19a3..cb02319bc6a 100644 --- a/reflex/vars/__init__.py +++ b/reflex/vars/__init__.py @@ -9,6 +9,7 @@ from .base import get_uuid_string_var as get_uuid_string_var from .base import var_operation as var_operation from .base import var_operatio...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-4347@a91f89a
reflex-dev/reflex
Python
4,347
fix: do not allow instantiation of State mixins
Closes #4343
2024-11-10T19:55:13Z
Testing `rx.ComponentState` by direct initialization broken in `v0.6.2+` (SetUndefinedStateVarError) **Describe the bug** Before v0.6.2, it was possible to directly initialize `ComponentState` for testing purposes (same as directly initializing `State` instances), but since `v0.6.2` I get an error: ``` reflex.utils....
<p><a href="https://linear.app/reflex-dev/issue/ENG-4086/testing-rxcomponentstate-by-direct-initialization-broken-in-v062">ENG-4086 Testing `rx.ComponentState` by direct initialization broken in `v0.6.2+` (SetUndefinedStateVarError)</a></p> @TimChild i suggest adjusting the test to smth like this: ```python from ty...
[ { "body": "**Describe the bug**\r\nBefore v0.6.2, it was possible to directly initialize `ComponentState` for testing purposes (same as directly initializing `State` instances), but since `v0.6.2` I get an error:\r\n```\r\nreflex.utils.exceptions.SetUndefinedStateVarError: The state variable 'some_var' has not ...
34c11fdf108395fcacbe2488655969fef5c7958c
{ "head_commit": "a91f89aade92d8a67956ea7aa49b019b327f7f51", "head_commit_message": "improve error message for ComponentState mixins", "patch_to_review": "diff --git a/reflex/state.py b/reflex/state.py\nindex 66b1e3cabfa..1cbac53ce2c 100644\n--- a/reflex/state.py\n+++ b/reflex/state.py\n@@ -86,6 +86,7 @@\n Im...
[ { "diff_hunk": "@@ -2361,6 +2366,23 @@ def get_component(cls, **props):\n # The number of components created from this class.\n _per_component_state_instance_count: ClassVar[int] = 0\n \n+ def __init__(self, *args, **kwargs):\n+ \"\"\"Do not allow direct initialization of the ComponentState.\n...
99dd4c6e6ba8b648a64edfee6aac8e420d4c3841
diff --git a/reflex/state.py b/reflex/state.py index 719ff43b3d1..9ff6f0ea8fb 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -87,6 +87,7 @@ ImmutableStateError, InvalidStateManagerMode, LockExpiredError, + ReflexRuntimeError, SetUndefinedStateVarError, StateSchemaMismatchError, ) @@ ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-3548@a6cc8ec
reflex-dev/reflex
Python
3,548
[REF-2588]Clear color mode local storage for dev mode
Sometimes an app's `appearance` value(`rx.App(theme=rx.theme(appearance="dark"))`) does not persist correctly in the local storage(as `chakra-ui-color-mode`). Eg, if you manipulate the local storage value and restart the app, the app's theme/color-mode is not respected. This is typically annoying in dev mode. We want...
2024-06-24T16:59:15Z
Dev Mode Clear Dark Cookie During dev mode sometimes when you are on another app and running dark mode stop that app and go to a new one the cookie for local host is cached, and your other app has dark mode. On every run dev, we should clear this cookie
[ { "body": "During dev mode sometimes when you are on another app and running dark mode stop that app and go to a new one the cookie for local host is cached, and your other app has dark mode. On every run dev, we should clear this cookie", "number": 2047, "title": "Dev Mode Clear Dark Cookie" } ]
44233c9cd111f282f574b890d51ccc226a47e019
{ "head_commit": "a6cc8ec9526e2143def89535659ebc7d511224ea", "head_commit_message": "fix CI", "patch_to_review": "diff --git a/integration/test_client_storage.py b/integration/test_client_storage.py\nindex 393ea104410..03dbd168147 100644\n--- a/integration/test_client_storage.py\n+++ b/integration/test_client_sto...
[ { "diff_hunk": "@@ -1,13 +1,31 @@\n import { useTheme } from \"next-themes\";\n import { useEffect, useState } from \"react\";\n-import { ColorModeContext, defaultColorMode } from \"/utils/context.js\";\n+import {\n+ ColorModeContext,\n+ defaultColorMode,\n+ isDevMode,\n+} from \"/utils/context.js\";\n+impor...
8b041a5a4d48e589a3fe8157e5bf3b067cb6a8f3
diff --git a/integration/test_client_storage.py b/integration/test_client_storage.py index 393ea104410..03dbd168147 100644 --- a/integration/test_client_storage.py +++ b/integration/test_client_storage.py @@ -311,6 +311,7 @@ def set_sub_sub(var: str, value: str): assert not driver.get_cookies() local_storage_...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-31065@03f618d
scikit-learn/scikit-learn
Python
31,065
FIX Fix adjusted_mutual_info_score numerical issue
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2025-03-24T21:27:12Z
Potential Problem in the Computation of Adjusted Mutual Info Score ### Describe the bug It seems to me that for clusters of size 2 and 4, the AMI yields unexpected results of 0 instead of 1, if all items belong to different clusters. ### Steps/Code to Reproduce Sample Code to Reproduce: ```python >>> from sklear...
Weird, it seems like a real bug, although probably not that important in practice? I guess someone needs to investigate in more details? Yes, it occurs only if you stubbornly try to determine how these methods react on different clusters. That's what I did. But it leaves some general suspicion to the method, right? Spe...
[ { "body": "### Describe the bug\n\nIt seems to me that for clusters of size 2 and 4, the AMI yields unexpected results of 0 instead of 1, if all items belong to different clusters. \n\n\n\n### Steps/Code to Reproduce\n\nSample Code to Reproduce:\n\n```python\n>>> from sklearn.metrics.cluster import adjusted_mut...
812ff67e6725a8ca207a37f5ed4bfeafc5d1265d
{ "head_commit": "03f618d940173d6653a6ee9b61ce4833b209bbbd", "head_commit_message": "Merge branch 'main' into adj-mi-bugfix", "patch_to_review": "diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/31065.fix.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/31065.fix.rst\nnew file mode 100644\nindex 00...
[ { "diff_hunk": "@@ -1033,12 +1033,16 @@ def adjusted_mutual_info_score(\n or classes.shape[0] == clusters.shape[0] == 0\n ):\n return 1.0\n+ # if there is only one class or one cluster return 0.0.\n+ elif classes.shape[0] == 1 or clusters.shape[0] == 1:\n+ return 0.0\n \n co...
0b408299147c1506f0dc89e85f0f723b8cadb27b
diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/31065.fix.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/31065.fix.rst new file mode 100644 index 0000000000000..82126da7852cc --- /dev/null +++ b/doc/whats_new/upcoming_changes/sklearn.metrics/31065.fix.rst @@ -0,0 +1,3 @@ +- Fix :func:`metrics.adjusted...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-30516@c27046d
scikit-learn/scikit-learn
Python
30,516
FIX warn if an estimator does have a concrete __sklearn_tags__ implementation
closes #30479 Catch the error in the case that there is no `__sklearn_tags__` implementation in the MRO. We return the default tags and request to inherit from `BaseEstimator` that implements it.
2024-12-20T18:25:08Z
Version 1.6.X: ClassifierMixIn failing with new __sklearn_tags__ function ### Describe the bug Hi, we are using Sklearn in our projects for different classification training methods on production level. In the dev stage we upgraded to the latest release and our Training failed due to changes in the ClassifierMixI...
@DaMuBo According to [the official documentation](https://scikit-learn.org/1.5/developers/develop.html#rolling-your-own-estimator), I think your `MyEstimator` should inherit from `BaseEstimator` as well. ```python import numpy as np from sklearn.base import BaseEstimator, ClassifierMixin class MyEstimator(Class...
[ { "body": "### Describe the bug\r\n\r\nHi,\r\n\r\nwe are using Sklearn in our projects for different classification training methods on production level. In the dev stage we upgraded to the latest release and our Training failed due to changes in the ClassifierMixIn Class. We use it in combination with a sklear...
72b35a46684c0ecf4182500d3320836607d1f17c
{ "head_commit": "c27046db4f4da2c0edb2d466d993393a224481e4", "head_commit_message": "Update doc/whats_new/upcoming_changes/sklearn.utils/30516.fix.rst\n\nCo-authored-by: Adrin Jalali <adrin.jalali@gmail.com>", "patch_to_review": "diff --git a/doc/whats_new/upcoming_changes/sklearn.utils/30516.fix.rst b/doc/whats_...
[ { "diff_hunk": "@@ -0,0 +1,4 @@\n+- Raise a `FutureWarning` when there is no concrete implementation of `__sklearn_tags__`", "line": null, "original_line": 1, "original_start_line": null, "path": "doc/whats_new/upcoming_changes/sklearn.utils/30516.fix.rst", "start_line": null, "text": "@...
1e0a0a6dc30526df1e3b9eda4357632cdcfd916b
diff --git a/doc/whats_new/upcoming_changes/sklearn.utils/30516.fix.rst b/doc/whats_new/upcoming_changes/sklearn.utils/30516.fix.rst new file mode 100644 index 0000000000000..6e008f3beeb3c --- /dev/null +++ b/doc/whats_new/upcoming_changes/sklearn.utils/30516.fix.rst @@ -0,0 +1,4 @@ +- Raise a `DeprecationWarning` when...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-3895@603bf40
reflex-dev/reflex
Python
3,895
Fix type propagation in ToStringOperation
### Type of change - [X] Bug fix (non-breaking change which fixes an issue) - [X] Does your submission pass the tests? closes #3890
2024-09-05T20:24:01Z
`ImmutableVar.guess_type()` hides the original var type on fields derived from integral types **Describe the bug** In the example below you can see my problem, currently the bottom assertion fails. **To Reproduce** ```python class Email(str): ... # validation and stuff ... class State(rx.State): em...
Or maybe ```python var_type = ( original_var._var_type if original_var is not None and isclass(original_var._var_type) and issubclass(original_var._var_type, str) else str ) Failing test: ```python def test_to_string_operation():...
[ { "body": "**Describe the bug**\r\nIn the example below you can see my problem, currently the bottom assertion fails.\r\n\r\n**To Reproduce**\r\n```python\r\nclass Email(str):\r\n ... # validation and stuff ...\r\n \r\nclass State(rx.State):\r\n email: Email = Email(\"someone@reflex.dev\")\r\n\r\nassert ...
0810bd843cf8baf5e84a03ef588dbb339301c787
{ "head_commit": "603bf406a137cfb5a531fc7a8de6fb32a92cfb23", "head_commit_message": "fix: Added test that fails without the fix.", "patch_to_review": "diff --git a/reflex/ivars/base.py b/reflex/ivars/base.py\nindex 4cd3550ddf7..1b65449d269 100644\n--- a/reflex/ivars/base.py\n+++ b/reflex/ivars/base.py\n@@ -1043,6...
[ { "diff_hunk": "@@ -1043,6 +1043,27 @@ def unionize(*args: Type) -> Type:\n return Union[first, unionize(*rest)]\n \n \n+def original_var_type_or_target_type(original_var: Var, target_type: type) -> type:\n+ \"\"\"Inherit the original var type if possible, i.e. the original var is a subclass of the targe...
e8602bd6cfae828ffdf21d59e19553952c744fa8
diff --git a/reflex/ivars/base.py b/reflex/ivars/base.py index 27c4828afb8..8bb7957c494 100644 --- a/reflex/ivars/base.py +++ b/reflex/ivars/base.py @@ -416,7 +416,7 @@ def to( return ToArrayOperation.create(self, var_type or list) if issubclass(output, StringVar): - return ToStringOp...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-2837@c5b8a90
reflex-dev/reflex
Python
2,837
ruff-format: unify Black with Ruff `v0.1`
### All Submissions: - [x] Have you followed the guidelines stated in [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md) file? - [x] Have you checked to ensure there aren't any other open [Pull Requests](https://github.com/reflex-dev/reflex/pulls ) for the desired changed? <!-- You...
2024-03-12T00:07:02Z
Fully Migrate off Black to Ruff Reflex is already using Ruff for linting and formatting. Yet their is still a legacy dependency on the black formatter. At this point, Ruff seems to be on course to completely take over as industry standard and the sooner Reflex standardizes the better. I see that the file `scripts/pyi_g...
Hi @dapomeranz thanks for pointing this out. We do have plans of fully migrating to Ruff at some point. The team is currently focused on other high-priority issues at the moment. However, we're open to receiving a PR regarding this from the community. Noting that there is a related PR #2837 Relevant Discord Conversat...
[ { "body": "Reflex is already using Ruff for linting and formatting. Yet their is still a legacy dependency on the black formatter. At this point, Ruff seems to be on course to completely take over as industry standard and the sooner Reflex standardizes the better. I see that the file `scripts/pyi_generator.py` ...
25b84107da014ab16c9b615f884fe5c8d66c8a57
{ "head_commit": "c5b8a904fc2ba2ec301fb1d5264b04b7fefaf431", "head_commit_message": "Fix or\n\nCo-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>", "patch_to_review": "diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml\nindex 560598e9e06..e36cbdfe631 100644\n--- a/.pre-commit-config.yaml\n+++...
[ { "diff_hunk": "@@ -1082,7 +1082,7 @@ class CodeBlock(Component):\n on_unmount: Optional[\n Union[EventHandler, EventSpec, list, function, BaseVar]\n ] = None,\n- **props\n+ **props,", "line": null, "original_line": 1085, "original_start_line": null, "pa...
9fe484ae5b2a5ee42c31443b5e55b9aad1bba101
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 560598e9e06..e36cbdfe631 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,14 @@ fail_fast: true repos: - - repo: https://github.com/psf/black - rev: 22.10.0 - hooks: - - id: black - args: [integrati...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Style, Linting, Formatting Fixes" }
reflex-dev__reflex-3170@cdafb49
reflex-dev/reflex
Python
3,170
Fixed unused kwargs in reflex.App
### Type of change - [x] Bug fix (non-breaking change which fixes an issue) Fixed kwargs `sio` and `socket_app` are not used during reflex.App initialization Closes #3081
2024-04-26T08:34:12Z
Entering more than 999775 characters breaks text_area **Describe the bug** Entering more than 999775 characters breaks rx.text_area. If you enter more than 999775 characters into a text area you will have to refresh the page for the text_area to work again. **To Reproduce** Steps to reproduce the behavior: ``` ...
[ { "body": "**Describe the bug**\r\nEntering more than 999775 characters breaks rx.text_area. If you enter more than 999775 characters into a text area you will have to refresh the page for the text_area to work again.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n\r\n```\r\nimport reflex as rx\...
0a8aaea599f95bb6c4730c743f6c4b636134ca6a
{ "head_commit": "cdafb4942d6c56dfa6fd618b61b0ef032ca0003d", "head_commit_message": "Fixed unused kwargs in reflex.App", "patch_to_review": "diff --git a/reflex/app.py b/reflex/app.py\nindex c47077d0ef8..dcd7ef742a1 100644\n--- a/reflex/app.py\n+++ b/reflex/app.py\n@@ -223,21 +223,24 @@ def setup_state(self) -> N...
[ { "diff_hunk": "@@ -223,21 +223,24 @@ def setup_state(self) -> None:\n self._state_manager = StateManager.create(state=self.state)\n \n # Set up the Socket.IO AsyncServer.\n- self.sio = AsyncServer(\n- async_mode=\"asgi\",\n- cors_allowed_origins=(\n- ...
fbb527056591284174dc56ca442d6b2aaed5a5d3
diff --git a/reflex/app.py b/reflex/app.py index c47077d0ef8..95c9de2c615 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -116,9 +116,6 @@ class App(Base): # The Socket.IO AsyncServer. sio: Optional[AsyncServer] = None - # The socket app. - socket_app: Optional[ASGIApp] = None - # The state cla...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-30268@02b8599
scikit-learn/scikit-learn
Python
30,268
MNT Tags: quality of life improvements
Fixes https://github.com/scikit-learn/scikit-learn/issues/30011 This adds tests, and makes it more clear on how to extend tags. It also does the right check on whether `_more_tags` is implemented but `__sklearn_tags__` is missing. cc @glemaitre @thomasjpfan
2024-11-12T15:53:50Z
Extending tags infrastructure is not easy anymore In the context of bringing `imbalanced-learn` compatible with changes done in `scikit-learn` 1.6, I could see that now this is quite difficult to extend the tags infrastructure. For instance, we added a `"dataframe"` entry to the previous `X_type` to check whether or...
The idea is that you need to subclass and add an attribute that way. But we haven't tested this OK so I'll give a try. So I'm playing with the tag in `imbalanced-learn`. Right now, I would like to extend `Tags` such that it contains a `SamplerTags`. There is two problems: - I cannot subclass `Tags` and add `Sampler...
[ { "body": "In the context of bringing `imbalanced-learn` compatible with changes done in `scikit-learn` 1.6, I could see that now this is quite difficult to extend the tags infrastructure.\r\n\r\nFor instance, we added a `\"dataframe\"` entry to the previous `X_type` to check whether or not we should run our ow...
b21452450c5e679568882eacd78c2ec48e5f354b
{ "head_commit": "02b8599c5bc2819b9016175e59f32b5c042a1808", "head_commit_message": "add imports to doc", "patch_to_review": "diff --git a/doc/developers/develop.rst b/doc/developers/develop.rst\nindex ace3fbbcfa9c6..1e4d82c8d0425 100644\n--- a/doc/developers/develop.rst\n+++ b/doc/developers/develop.rst\n@@ -519...
[ { "diff_hunk": "@@ -1,11 +1,18 @@\n+from dataclasses import asdict, dataclass\n+\n import pytest\n \n from sklearn.base import (\n BaseEstimator,\n RegressorMixin,\n TransformerMixin,\n )\n+from sklearn.utils import Tags\n from sklearn.utils._tags import get_tags", "line": null, "original_li...
ee76a507b653651149ee1fe08ee64d2aa844f30c
diff --git a/doc/developers/develop.rst b/doc/developers/develop.rst index ace3fbbcfa9c6..3b8a455c75228 100644 --- a/doc/developers/develop.rst +++ b/doc/developers/develop.rst @@ -519,7 +519,26 @@ which returns the new values for your estimator's tags. For example:: return tags You can create a new sub...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Code Refactoring / Architectural Improvement" }
reflex-dev__reflex-2827@769323f
reflex-dev/reflex
Python
2,827
added name of Var to error message
- Added the name of the Var to the error message for ```TypeError(f"No JSON serializer found for var {value} of type {type(value)}.")``` closes #2826 ### All Submissions: - [x] Have you followed the guidelines stated in [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md) fi...
2024-03-10T17:33:11Z
include the name of the Var so it's easier to track down `No JSON serializer` error It will be nice to also include the name of the Var causing the ```TypeError(f"No JSON serializer found for var {value} of type {type(value)}.")``` so it's easier for a user to track down and maybe convert the Var to a string
[ { "body": "It will be nice to also include the name of the Var causing the ```TypeError(f\"No JSON serializer found for var {value} of type {type(value)}.\")``` so it's easier for a user to track down and maybe convert the Var to a string", "number": 2826, "title": "include the name of the Var so it's ...
7b43b923b81cf2b59ac9f3f19973459b1dd79f22
{ "head_commit": "769323f9aa0e4c0c95a4aef4066e1094e7121a38", "head_commit_message": "added name of Var to error message", "patch_to_review": "diff --git a/reflex/utils/format.py b/reflex/utils/format.py\nindex 53b55d0ebdf..dd79be132d0 100644\n--- a/reflex/utils/format.py\n+++ b/reflex/utils/format.py\n@@ -2,9 +2,...
[ { "diff_hunk": "@@ -598,7 +600,14 @@ def format_state(value: Any) -> Any:\n \"\"\"\n # Handle dicts.\n if isinstance(value, dict):\n- return {k: format_state(v) for k, v in value.items()}\n+ result = {}\n+ for k, v in value.items():\n+ if isinstance(v, (pathlib.PosixP...
289d68e696cdfe0cf42aba2ad634b8a2f5a1cf7f
diff --git a/reflex/utils/format.py b/reflex/utils/format.py index 0e57ca9efcb..5f39349c85d 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -6,7 +6,7 @@ import json import os import re -from typing import TYPE_CHECKING, Any, List, Union +from typing import TYPE_CHECKING, Any, List, Optional, Unio...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-2291@202dba8
reflex-dev/reflex
Python
2,291
apps should no longer call "app.compile()"
Closes #2293. Two main tricks: * To handle backend running, `gunicorn` or `uvicorn` to load a special shim `app_module_for_backend.py`, instead of the real app (e.g. `counter.py`). * A new `get_compiled_app` function, which essentially does `get_app() + compile` - to account for the fact that `get_app()` will now ...
2023-12-14T05:45:00Z
Remove `app.compile()` boilerplate line in apps. **Describe the bug** Reflex apps require `app.compile()` line. It would be better to not require that. **To Reproduce** Any existing reflex app in the wild. **Expected behavior** All existing reflex functionality works as usual, without `app.compile()` in apps.
[ { "body": "**Describe the bug**\r\nReflex apps require `app.compile()` line. It would be better to not require that.\r\n\r\n**To Reproduce**\r\nAny existing reflex app in the wild.\r\n\r\n**Expected behavior**\r\nAll existing reflex functionality works as usual, without `app.compile()` in apps.\r\n", "numb...
e245b6b6a0f90f71c8aba6e0299f4bcc31638330
{ "head_commit": "202dba88ddc56d40bc8ada56c9339e4cfdaefd8e", "head_commit_message": "get_compiled_app", "patch_to_review": "diff --git a/README.md b/README.md\nindex 0b301ea0d01..874c2de9216 100644\n--- a/README.md\n+++ b/README.md\n@@ -123,7 +123,6 @@ def index():\n # Add state and page to the app.\n app = rx.Ap...
[ { "diff_hunk": "@@ -619,6 +619,24 @@ def _should_compile(self) -> bool:\n return True\n \n def compile(self):\n+ \"\"\"App modules no longer need to call this.\n+\n+ Reflex framework will perform compile_() as needed.\n+\n+ Existing call sites will get a deprecation message.\n+\...
e896b43cc21e64c943af40ca9afe601f7dd45663
diff --git a/README.md b/README.md index 0b301ea0d01..874c2de9216 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,6 @@ def index(): # Add state and page to the app. app = rx.App() app.add_page(index, title="reflex:DALL·E") -app.compile() ``` ## Let's break this down. diff --git a/docs/es/README.md b/docs/e...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-30122@0e41007
scikit-learn/scikit-learn
Python
30,122
ENH move estimator type to tags
Closes https://github.com/scikit-learn/scikit-learn/issues/16469 Moving `_estimator_tpye` to tags. Right now this doesn't work.
2024-10-21T07:42:21Z
Deprecate _estimator_type, replace by estimator tag I think we should deprecate ``_estimator_type`` which predates ``estimator_tags``. It's private but we should probably still deprecate it as it can lead to weird errors downstream. If we change it and downstream is not updating it, it would lead to classifiers using K...
Should we do the same with _pairwise? I think so. Not against it. Another not directly related question: since we are integrating such tag, do we intend (or allow third-party) to use it outside of the common tests? That was my intention. Right now both the ``_pairwise`` and ``_estimator_type`` are already used in t...
[ { "body": "I think we should deprecate ``_estimator_type`` which predates ``estimator_tags``. It's private but we should probably still deprecate it as it can lead to weird errors downstream. If we change it and downstream is not updating it, it would lead to classifiers using KFold cross-validation, which can ...
e887583b933a50063081c2c012661ff13968adc3
{ "head_commit": "0e410077b925a606bd8ab13787a037124cccad46", "head_commit_message": "use method instead of operator", "patch_to_review": "diff --git a/doc/api_reference.py b/doc/api_reference.py\nindex 86fa072d3ed25..b3e658bd22120 100644\n--- a/doc/api_reference.py\n+++ b/doc/api_reference.py\n@@ -1176,7 +1176,6 ...
[ { "diff_hunk": "@@ -197,6 +198,52 @@ def score(self, X, y, *args, **kwargs):\n )\n \n \n+def _get_instance_with_pipeline(meta_estimator, init_params):\n+ \"\"\"Given a single meta-estimator instance, generate an instance with a pipeline\"\"\"\n+ if {\"estimator\", \"base_estimator\", \"regress...
216f442fbc8bf0ab043a857fcec489c252648c36
diff --git a/doc/api_reference.py b/doc/api_reference.py index 86fa072d3ed25..b3e658bd22120 100644 --- a/doc/api_reference.py +++ b/doc/api_reference.py @@ -1176,7 +1176,6 @@ def _get_submodule(module_name, submodule_name): "ClassifierTags", "RegressorTags", ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Code Refactoring / Architectural Improvement" }
scikit-learn__scikit-learn-29874@f45d62f
scikit-learn/scikit-learn
Python
29,874
TST check that binary only classifiers fail on multiclass data
Fixes https://github.com/scikit-learn/scikit-learn/issues/18005 Checks that if the estimator has `tags.classifier_tags.multi_class=False`, then it actually fails. I would be happier if we had a better error message telling people how to fix their issue though. Not sure what to put there. cc @chkoar @glemaitre
2024-09-17T15:02:22Z
check_estimator and binary_only tag Shouldn't the `check_estimator` check if you pass a non binary problem for a binary classifier? I mean, if you have an untagged binary estimator that raises an exception the `check_estimator` will fail. On the other hand, if you have a tagged estimator as `binary_only` the `check_es...
`check_estimator` does not take data as input. It will internally generate data based on the estimator tags. Yes. I know that. I would expect that it will test a tagged binary classifier that will raise an exception on a non-binary test case. Currently, if a classifier is tagged binary, it will only be passed binary pr...
[ { "body": "Shouldn't the `check_estimator` check if you pass a non binary problem for a binary classifier? I mean, if you have an untagged binary estimator that raises an exception the `check_estimator` will fail. On the other hand, if you have a tagged estimator as `binary_only` the `check_estimator` will pas...
325930e0151b67f6ddcd155d47a7b2a320f30ea7
{ "head_commit": "f45d62f794820bdf3ed76217da4808aebd9f1ad6", "head_commit_message": "Merge branch 'tests/tag-multiclass-false' of github.com:adrinjalali/scikit-learn into tests/tag-multiclass-false", "patch_to_review": "diff --git a/doc/whats_new/v1.6.rst b/doc/whats_new/v1.6.rst\nindex 0c4bf127c0b43..0cb7ac296d2...
[ { "diff_hunk": "@@ -298,6 +304,17 @@ def type_of_target(y, input_name=\"\"):\n 'multilabel-indicator'\n \"\"\"\n xp, is_array_api_compliant = get_namespace(y)\n+\n+ def _raise_or_return():\n+ \"\"\"Depending on the value of raise_unknown, either raise an error or return\n+ 'unknown'...
0f4289b0a8a0d3eff8d463e7bf76b9ab85232f4e
diff --git a/doc/whats_new/upcoming_changes/sklearn.utils/29874.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.utils/29874.enhancement.rst new file mode 100644 index 0000000000000..58f3919af7c2c --- /dev/null +++ b/doc/whats_new/upcoming_changes/sklearn.utils/29874.enhancement.rst @@ -0,0 +1,5 @@ +- :func:`~s...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-1984@313058a
reflex-dev/reflex
Python
1,984
fix serialization as a whole for list/dict/Base containing custom items to serialize
Improve the serialization logic to handle the case where we want to serialize a list of custom objects. Before PR, a datetime can be serialized, but not a list of datetime or a dict containing datetime as value. After PR, they can all be serialized. Include the changes suggested by @ElijahAhianyo in #1977. C...
2023-10-17T12:42:26Z
Need for custom json serializer During compile time, any non-serializable object encountered during the JSON serialization process is treated as a list, This means the code below: ```python import reflex as rx from datetime import datetime from sqlmodel import Field class User(rx.Model, table=True): fir...
[ { "body": "During compile time, any non-serializable object encountered during the JSON serialization process is treated as a list, This means the code below:\r\n\r\n```python\r\nimport reflex as rx\r\nfrom datetime import datetime\r\nfrom sqlmodel import Field\r\n\r\nclass User(rx.Model, table=True):\r\n ...
864a66b20d9c26bbb4fbf674171857e288ab455a
{ "head_commit": "313058a370f4736912bc12e981f63d0538b02d83", "head_commit_message": "serialization is fixed", "patch_to_review": "diff --git a/reflex/base.py b/reflex/base.py\nindex 53510786b36..6a8d9cac158 100644\n--- a/reflex/base.py\n+++ b/reflex/base.py\n@@ -30,7 +30,9 @@ def json(self) -> str:\n Retu...
[ { "diff_hunk": "@@ -93,6 +95,31 @@ def serialize_foo(value: Foo) -> str:\n assert not serializers.has_serializer(Foo)\n \n \n+class TestEnum(str, Enum):\n+ \"\"\"TestEnum.\"\"\"\n+\n+ FOO = \"foo\"\n+ BAR = \"bar\"\n+\n+\n+class TestEnum2(Enum):", "line": null, "original_line": 105, "or...
364b9def0219a6e389d605c65d010f8c10d05997
diff --git a/reflex/base.py b/reflex/base.py index 53510786b36..6a8d9cac158 100644 --- a/reflex/base.py +++ b/reflex/base.py @@ -30,7 +30,9 @@ def json(self) -> str: Returns: The object as a json string. """ - return self.__config__.json_dumps(self.dict(), default=list) + fr...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-29842@af1847d
scikit-learn/scikit-learn
Python
29,842
FIX scoring != None for RidgeCV should used unscaled y for evaluation
closes https://github.com/scikit-learn/scikit-learn/issues/13998 closes https://github.com/scikit-learn/scikit-learn/pull/15648 While discussing with @jeromedockes, we recall to have observed something weird in the `RidgeCV` code. I check a bit closer and I open this PR to highlight what is the potential problem. ...
2024-09-13T16:59:59Z
`RidgeCV` `cv_values_` are for preprocessed data: centered and scaled by sample weights. when `store_cv_values=True`, `RidgeCV` stores the leave-one-out squared errors, when `scoring=None`, or the leave-one-out predictions, when `scoring` is provided by the user, in its `cv_values_` attribute. However, when `scori...
ping @agramfort yes `cv_values_` should be put in native space and fixed when using a custom scoring.
[ { "body": "when `store_cv_values=True`, `RidgeCV` stores the leave-one-out squared errors,\r\nwhen `scoring=None`, or the leave-one-out predictions, when `scoring` is\r\nprovided by the user, in its `cv_values_` attribute.\r\n\r\nHowever, when `scoring` is not `None`, it stores the predictions for the\r\nprepro...
25bc29ab9703e1c7dba2af29943c9cf616124290
{ "head_commit": "af1847dc8fcc1308f7b268e5172743dcb789bb8b", "head_commit_message": "address thomas review + n_target test", "patch_to_review": "diff --git a/doc/whats_new/v1.6.rst b/doc/whats_new/v1.6.rst\nindex 22a0d7acfd24e..bf141b582b365 100644\n--- a/doc/whats_new/v1.6.rst\n+++ b/doc/whats_new/v1.6.rst\n@@ -...
[ { "diff_hunk": "@@ -2178,13 +2179,20 @@ def fit(self, X, y, sample_weight=None, score_params=None):\n self.cv_results_[:, i] = squared_errors.ravel()\n else:\n predictions = y - (c / G_inverse_diag)\n+ # represent the predictions in the original sca...
e9bd7784b041a59c8f862b3e8883489316b3ce65
diff --git a/doc/whats_new/v1.6.rst b/doc/whats_new/v1.6.rst index 22a0d7acfd24e..2a7211ca368b5 100644 --- a/doc/whats_new/v1.6.rst +++ b/doc/whats_new/v1.6.rst @@ -257,6 +257,15 @@ Changelog for the calculation of test scores. :pr:`29419` by :user:`Shruti Nath <snath-xoc>`. +- |Fix| :class:`linear_model.RidgeC...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Code Refactoring / Architectural Improvement" }
scikit-learn__scikit-learn-30616@586d89a
scikit-learn/scikit-learn
Python
30,616
Fixes API Deprecate n_alphas in LinearModelCV
Fixes #30467 Updated LinearModelCV and derived classes LassoCV, ElasticNetCV, MultiTaskElasticNetCV, MultiTaskLassoCV to remove `n_alphas` parameter from the constructor. `alphas` parameter is updated to support an integer or array-like argument. Functionality of `n_alphas` is preserved by passing an integer to `alp...
2025-01-09T17:48:13Z
API Deprecate n_alphas in LinearModelCV In LassoCV, ElasticNetCV, ... we have two parameters, `alphas` and `n_alphas`, that have the same purpose, i.e. determine the alpha values to test. I'd be in favor of deprecating `n_alphas` and make `alphas` accept either an int or an array-like, filling both roles. I chose...
Hi, can I take a shot at refactoring? sure ! You can take a look at the [contributing guide](https://scikit-learn.org/dev/developers/contributing.html) and especially the [deprecation section](https://scikit-learn.org/dev/developers/contributing.html#deprecation) to get started.
[ { "body": "In LassoCV, ElasticNetCV, ... we have two parameters, `alphas` and `n_alphas`, that have the same purpose, i.e. determine the alpha values to test.\r\n\r\nI'd be in favor of deprecating `n_alphas` and make `alphas` accept either an int or an array-like, filling both roles.\r\n\r\nI chose to keep `alp...
eec4449e2b36f051baabfb6d20c097fc9e83bf65
{ "head_commit": "586d89a8c47a7e9fe96c6af78aa6f8aba46ddec6", "head_commit_message": "Merge branch 'main' into LinearModelCV_api_refactor", "patch_to_review": "diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/30616.api.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/30616.api.rst\nnew fil...
[ { "diff_hunk": "@@ -1691,39 +1700,61 @@ def fit(self, X, y, sample_weight=None, **params):\n l1_ratios = [\n 1,\n ]\n+\n path_params.pop(\"cv\", None)\n path_params.pop(\"n_jobs\", None)\n \n- alphas = self.alphas\n+ alphas = None\n n...
40077003563784b90ea2505ee03d479218177237
diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/30616.api.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/30616.api.rst new file mode 100644 index 0000000000000..8d0a032fd284f --- /dev/null +++ b/doc/whats_new/upcoming_changes/sklearn.linear_model/30616.api.rst @@ -0,0 +1,9 @@ +The parameter ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-30187@f73913f
scikit-learn/scikit-learn
Python
30,187
FIX Check and correct the input_tags.sparse flag
#### Reference Issues/PRs Fixes #30139 #### What does this implement/fix? Explain your changes. The test `check_estimator_sparse_tag` is added. It checks that the `input_tags.sparse` tag of an estimator is consistent: - if `input_tags.sparse=True` the estimator can be fitted on sparse data - if `input_ta...
2024-10-31T16:58:20Z
The input_tags.sparse flag is often incorrect ### Describe the bug If I understood correctly the developer API for tags, `input_tags.sparse` tells us whether an estimator can accept sparse data or not. For many estimators it seems that `input_tags.sparse` is False but should be True. ### Steps/Code to Reproduce ```p...
The current estimator check `_check_estimator_sparse_container` does not rely on the presence of the tag: it just calls the estimator with sparse input and checks that the word "sparse" appears somewhere in the exception message if a `ValueError` is raised. This is quite a low requirement. We could make this a stron...
[ { "body": "### Describe the bug\n\nIf I understood correctly the developer API for tags, `input_tags.sparse` tells us whether an estimator can accept sparse data or not. For many estimators it seems that `input_tags.sparse` is False but should be True.\n\n### Steps/Code to Reproduce\n\n```python\r\nfrom sklearn...
8481e681128822050e996c3ef6b65d3801d102f5
{ "head_commit": "f73913fe3a81691c5b879ae4a5c6e89aabffe325", "head_commit_message": "Merge remote-tracking branch 'upstream/main' into fix_input_sparse_tag", "patch_to_review": "diff --git a/doc/whats_new/upcoming_changes/changed-models/30187.fix.rst b/doc/whats_new/upcoming_changes/changed-models/30187.fix.rst\n...
[ { "diff_hunk": "@@ -0,0 +1,4 @@\n+- :func:`utils.estimator_checks.check_estimator_sparse_tag` ensures that\n+ the estimator tag `input_tags.sparse` is consistent with its `fit`\n+ method (acceting sparse input `X` or raising the appropriate error).", "line": null, "original_line": 3, "original_sta...
b54a408c0bad6dd4eaa5329cf29acbec3e43bdb9
diff --git a/doc/whats_new/upcoming_changes/changed-models/30187.fix.rst b/doc/whats_new/upcoming_changes/changed-models/30187.fix.rst new file mode 100644 index 0000000000000..001b8840d9a7b --- /dev/null +++ b/doc/whats_new/upcoming_changes/changed-models/30187.fix.rst @@ -0,0 +1,2 @@ +- The `tags.input_tags.sparse` f...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-2010@120e5d8
reflex-dev/reflex
Python
2,010
Improve Var type handling for better rx.Model attribute access
Support accessing relationship attributes on Models Support accessing all possible attributes when Var is annotated as a Union (fix #1814) Use null coalescing when the var is Optional or has a default value of None `reflex.utils.types.is_union` supports new style `UnionType` on py3.10
2023-10-20T22:12:59Z
rx.foreach Union support In my app I'm trying to use an union to hold slightly different classes (common base members but extra members) and using rx.foreach to try to display those entities. If I specify the union, the foreach component won't run, citing : ```AttributeError: The State var `_` has no attribute 'MY_A...
> `if isinstance(entry, Reaction2):` This line is problematic because `entry` is always going to be a `BaseVar`, not an actual instance of the class it originated from. The code that comprises the frontend is compiled into javascript code that runs in the browser, so any python conditions and type differentiation...
[ { "body": "In my app I'm trying to use an union to hold slightly different classes (common base members but extra members) and using rx.foreach to try to display those entities. If I specify the union, the foreach component won't run, citing :\r\n\r\n```AttributeError: The State var `_` has no attribute 'MY_ATT...
f404205c3fa11ff854ada60fd97e4d1725fb2eb8
{ "head_commit": "120e5d81c37f027c0c679b626df9b99835d081f6", "head_commit_message": "types: Only check for UnionType if it is present", "patch_to_review": "diff --git a/reflex/model.py b/reflex/model.py\nindex 12703e7be2b..69a3bbf5369 100644\n--- a/reflex/model.py\n+++ b/reflex/model.py\n@@ -15,6 +15,7 @@\n impor...
[ { "diff_hunk": "@@ -85,7 +87,58 @@ def is_literal(cls: GenericType) -> bool:\n Returns:\n Whether the class is a literal.\n \"\"\"\n- return hasattr(cls, \"__origin__\") and cls.__origin__ is Literal\n+ return get_origin(cls) is Literal\n+\n+\n+def is_optional(cls: GenericType) -> bool:\n+...
fcc12c9d33b55887e8963da21fbc61ebf09ecb1f
diff --git a/reflex/model.py b/reflex/model.py index 12703e7be2b..3167782e5f8 100644 --- a/reflex/model.py +++ b/reflex/model.py @@ -15,6 +15,7 @@ import alembic.script import alembic.util import sqlalchemy +import sqlalchemy.orm import sqlmodel from reflex import constants @@ -68,6 +69,22 @@ def __init_subclass...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
reflex-dev__reflex-1842@cca8296
reflex-dev/reflex
Python
1,842
add option to disable Tailwind
This PR provides an option to disable the out-of-the-box supported Tailwind. To do that, simply set the `tailwind` config to `None` : `rxconfig.py` --------------------------------- ```python import reflex as rx config = ExampleConfig( app_name="example", tailwind= None ) ``` fixes #1829 Doc...
2023-09-20T11:13:57Z
Don't have Tailwind defaulty included in reflex app Currently Tailwind is added to each fresh initialization of Reflex app. This may interfere with some other css libraries. The `tailwindcss` module is installed defaulty. Also the is a default style style file in `.web\styles\tailwind.css`. It would be nice, if i...
[ { "body": "Currently Tailwind is added to each fresh initialization of Reflex app. This may interfere with some other css libraries.\r\n\r\nThe `tailwindcss` module is installed defaulty. Also the is a default style style file in `.web\\styles\\tailwind.css`.\r\n\r\nIt would be nice, if it was included only opt...
33ee0675d44b1e193ab207f4a1e27c89dee58a5d
{ "head_commit": "cca8296f4931e1e14e5e37d8f91be0d619496218", "head_commit_message": "fix precommit", "patch_to_review": "diff --git a/reflex/.templates/web/package.json b/reflex/.templates/web/package.json\nindex 191e7a4e50d..09c44220fa4 100644\n--- a/reflex/.templates/web/package.json\n+++ b/reflex/.templates/we...
[ { "diff_hunk": "@@ -432,13 +432,23 @@ def install_frontend_packages(packages: set[str]):\n processes.show_status(\"Installing base frontend packages\", process)\n \n config = get_config()\n- if config.tailwind is not None and \"plugins\" in config.tailwind:\n+ if config.tailwind is not None:\n+ ...
2721d8e41639be89009805fd3c03fd19268f4ca6
diff --git a/reflex/.templates/web/package.json b/reflex/.templates/web/package.json index 191e7a4e50d..09c44220fa4 100644 --- a/reflex/.templates/web/package.json +++ b/reflex/.templates/web/package.json @@ -24,7 +24,6 @@ }, "devDependencies": { "autoprefixer": "^10.4.14", - "postcss": "^8.4.24", - "t...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Dependency Updates & Env Compatibility" }
reflex-dev__reflex-2012@4ab1245
reflex-dev/reflex
Python
2,012
Support Form controls via name attribute (no ID or ref)
Dynamic refs / ids don't really work... but dynamic `name` is not a problem! ```python import reflex as rx class State(rx.State): n_fields: int = 0 grid: int = 1 def handle_submit(self, form_data: dict): print(form_data) def add_field(self): self.n_fields += 1 d...
2023-10-21T10:11:31Z
Short-hand for clearing a form after submitting Please create an alternative method that can set all the elements inside a form to "" after the on_submit takes place. We used reflex in CalHacks 10.0, and this is one of the enhancements we think would be great!
[ { "body": "Please create an alternative method that can set all the elements inside a form to \"\" after the on_submit takes place.\r\n\r\nWe used reflex in CalHacks 10.0, and this is one of the enhancements we think would be great!", "number": 2074, "title": "Short-hand for clearing a form after submit...
96eca4f690240accaab3ee45e1e366219a4a46b5
{ "head_commit": "4ab12457d24b66f6dfe9b2df858bb9600ca7b595", "head_commit_message": "form: useCallback to memoize handleSubmit", "patch_to_review": "diff --git a/integration/test_form_submit.py b/integration/test_form_submit.py\nindex a9611ecc175..b8d0fd0bde3 100644\n--- a/integration/test_form_submit.py\n+++ b/i...
[ { "diff_hunk": "@@ -625,3 +625,25 @@ def unescape_double_quotes_in_var(m: re.Match) -> str:\n string=value,\n flags=re.VERBOSE,\n )\n+\n+\n+def collect_form_dict_names(form_dict: dict[str, Any]) -> dict[str, Any]:\n+ \"\"\"Collapse keys with consecutive suffixes into a single list value.\...
505f1e833aa82f3d6f78f07971c0f33b7a6edae9
diff --git a/integration/test_form_submit.py b/integration/test_form_submit.py index 25296b3d4eb..4a9f6c2d10a 100644 --- a/integration/test_form_submit.py +++ b/integration/test_form_submit.py @@ -7,6 +7,7 @@ from selenium.webdriver.common.keys import Keys from reflex.testing import AppHarness +from reflex.utils im...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-29738@9ec3865
scikit-learn/scikit-learn
Python
29,738
PERF speedup classification_report by attaching unique values to dtype.metadata
Fixes #26808 Closes #26820 This is alternative to https://github.com/scikit-learn/scikit-learn/pull/26820 where we attach unique values to the `dtype.metadata` of a view on `y`. This gets the same speedup as reported in #26820 but is a lot cleaner IMO. WDYT @ogrisel @glemaitre @thomasjpfan (I'm still wor...
2024-08-29T11:50:54Z
Speed up classification_report ### Describe the workflow you want to enable I'm concerned with slow execution speed of the classification_report procedure which makes it barely suitable for production-grade workloads. On a 8M sample it already takes 15 seconds whereas simple POC numba implementation takes 20 to 40...
I have actually improved it slightly to have more concise variable names & handle multiclasses. The only things of sklearn's classification report it does not support are micro,sample averages and sample weights (not hard to add them as well). As an extra it has balanced accuracy though. ```python @njit() def fast...
[ { "body": "### Describe the workflow you want to enable\r\n\r\nI'm concerned with slow execution speed of the classification_report procedure which makes it barely suitable for production-grade workloads.\r\nOn a 8M sample it already takes 15 seconds whereas simple POC numba implementation takes 20 to 40 **mil...
a5ea01c838aef012d54c5859a251a954105a5015
{ "head_commit": "9ec38652fe3e84a4174a7bd9402282e4398da738", "head_commit_message": "add another test", "patch_to_review": "diff --git a/doc/whats_new/v1.6.rst b/doc/whats_new/v1.6.rst\nindex d4d373e9bf280..347fa429e12d3 100644\n--- a/doc/whats_new/v1.6.rst\n+++ b/doc/whats_new/v1.6.rst\n@@ -271,6 +271,9 @@ Chang...
[ { "diff_hunk": "@@ -0,0 +1,96 @@\n+# Authors: The scikit-learn developers\n+# SPDX-License-Identifier: BSD-3-Clause\n+\n+import numpy as np\n+\n+from sklearn.utils._array_api import get_namespace\n+\n+\n+def _attach_unique(y):\n+ \"\"\"Attach unique values of y to y and return the result.\n+\n+ The result...
c6ced7cdda8d92a0dd40e38e4f468177686993ed
diff --git a/doc/whats_new/v1.6.rst b/doc/whats_new/v1.6.rst index d4d373e9bf280..6bb6eab32464e 100644 --- a/doc/whats_new/v1.6.rst +++ b/doc/whats_new/v1.6.rst @@ -271,6 +271,10 @@ Changelog :pr:`29210` by :user:`Marc Torrellas Socastro <marctorsoc>` and :user:`Stefanie Senger <StefanieSenger>`. +- |Efficiency...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Performance Optimizations" }
reflex-dev__reflex-3624@d1f537f
reflex-dev/reflex
Python
3,624
rx._x.asset improvements
Closes #3623
2024-07-04T18:53:07Z
Multiple rx._x.asset issues - Assets should not be checked and copied in backend only mode. Even if you do not put them in globals, they will for example be executed if you use them in a `@rx.page` which will be loaded. Even in backend only mode. - Local/Normal asset support - Assets which are in the local `assets/` d...
[ { "body": "- Assets should not be checked and copied in backend only mode. Even if you do not put them in globals, they will for example be executed if you use them in a `@rx.page` which will be loaded. Even in backend only mode.\r\n- Local/Normal asset support - Assets which are in the local `assets/` director...
34c11fdf108395fcacbe2488655969fef5c7958c
{ "head_commit": "d1f537f50cb6be9e80024c85887b0d457d6c2618", "head_commit_message": "fix darglint", "patch_to_review": "diff --git a/reflex/constants/__init__.py b/reflex/constants/__init__.py\nindex e974ab91583..185c2ee3e00 100644\n--- a/reflex/constants/__init__.py\n+++ b/reflex/constants/__init__.py\n@@ -2,6 +...
[ { "diff_hunk": "@@ -1,57 +1,90 @@\n \"\"\"Helper functions for adding assets to the app.\"\"\"\n \n import inspect\n+import os\n from pathlib import Path\n from typing import Optional\n \n from reflex import constants\n \n \n-def asset(relative_filename: str, subfolder: Optional[str] = None) -> str:\n- \"\"\...
45e2852f52ad5f00ed6e79a5c9a17106fd558aaa
diff --git a/reflex/__init__.py b/reflex/__init__.py index 3941542f2d6..56252441601 100644 --- a/reflex/__init__.py +++ b/reflex/__init__.py @@ -264,6 +264,7 @@ "experimental": ["_x"], "admin": ["AdminDash"], "app": ["App", "UploadFile"], + "assets": ["asset"], "base": ["Base"], "components....
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-29693@5bddd8c
scikit-learn/scikit-learn
Python
29,693
DOC clarify that n_jobs argument uses threading in pairwise_distances and pairwise_kernels
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2024-08-20T08:57:36Z
Truly parallel execution of pairwise_kernels and pairwise_distances ### Describe the workflow you want to enable Both `pairwise_kernels` and `pairwise_distances` functions call `_parallel_pairwise` function, which is (contrary to its name) not parallel as it enforces the threading backend. Therefore, these functions...
> which is (contrary to its name) not parallel as it enforces the threading backend. > ... Therefore, these functions are terribly slow, especially for computationally expensive user-defined metrics. Some CPU intensive operations in numpy or pandas do release the GIL, so the threading backend might be a good choice...
[ { "body": "### Describe the workflow you want to enable\r\n\r\nBoth `pairwise_kernels` and `pairwise_distances` functions call `_parallel_pairwise` function, which is (contrary to its name) not parallel as it enforces the threading backend. Therefore, these functions are terribly slow, especially for computatio...
f38aa4923330b593c1e5319ab8aa043844582fc5
{ "head_commit": "5bddd8cada8d3f97122ea8f7d9a5416a2a0efc29", "head_commit_message": "clarification of the documentation for n_jobs argument", "patch_to_review": "diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py\nindex fd08850ce47b3..771da7e1a1d9a 100644\n--- a/sklearn/metrics/pairwise.py\n++...
[ { "diff_hunk": "@@ -2597,8 +2597,8 @@ def pairwise_kernels(\n \n n_jobs : int, default=None\n The number of jobs to use for the computation. This works by breaking\n- down the pairwise matrix into n_jobs even slices and computing them in\n- parallel.\n+ down the pairwise matrix ...
dfcd469d2d46f182ea759227110852583137d912
diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py index fd08850ce47b3..c27bc22583660 100644 --- a/sklearn/metrics/pairwise.py +++ b/sklearn/metrics/pairwise.py @@ -1938,7 +1938,7 @@ def _dist_wrapper(dist_func, dist_matrix, slice_, *args, **kwargs): def _parallel_pairwise(X, Y, func, n_jobs, **k...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Performance Optimizations" }
scikit-learn__scikit-learn-29708@98bce9b
scikit-learn/scikit-learn
Python
29,708
FIX #13117: implement fit methods in subclasses of LinearModelCV
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2024-08-23T14:42:26Z
Possible error in documentation of ElasticNetCV() The documentation for class `ElasticNetCV()` reads: y : array-like, shape (n_samples,) or (n_samples, n_targets) However, when I try to pass a 2D array I get the error: ``` --------------------------------------------------------------------------- ValueE...
would you like to submit a PR to fix it @albertotb ? Sure, I'll get to it On Sat, Feb 9, 2019 at 2:51 PM Adrin Jalali <notifications@github.com> wrote: > would you like to submit a PR to fix it @albertotb > <https://github.com/albertotb> ? > > — > You are receiving this because you were mentioned. > Reply to this ema...
[ { "body": "The documentation for class `ElasticNetCV()` reads:\r\n\r\n y : array-like, shape (n_samples,) or (n_samples, n_targets)\r\n\r\nHowever, when I try to pass a 2D array I get the error:\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nValueError ...
ede02b4d000d3f9334940cf5c81155f9dc070e77
{ "head_commit": "98bce9bd4d8f5cf1f3029e66b7f8a8fe201f35be", "head_commit_message": "remove duplicate fits", "patch_to_review": "diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py\nindex 4ede6c04b462b..544cdb1412cc6 100644\n--- a/sklearn/linear_model/_coordinate...
[ { "diff_hunk": "@@ -2322,6 +2362,46 @@ def _is_multitask(self):\n def _more_tags(self):\n return {\"multioutput\": False}\n \n+ def fit(self, X, y, sample_weight=None, **params):\n+ \"\"\"Fit ElasticNet model with coordinate descent.\n+\n+ Fit is on grid of alphas and best alpha est...
0037db53d67c03e20f1ec45ed124054a716de9cb
diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index 4ede6c04b462b..60ffa0b8f468c 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -2083,6 +2083,46 @@ def _is_multitask(self): def _more_tags(self): ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Documentation Updates" }
reflex-dev__reflex-1458@f2c96ae
reflex-dev/reflex
Python
1,458
Remove curl and parallelize node/bun install
Use `httpx` to install nvm and bun instead of curl, removing one dependency. Also parallelize the process to install nvm/bun during `reflex init`
2023-07-28T22:15:11Z
Download node and bun in parallel Currently we download node and bun sequentially during the initial `reflex init`. We can parallelize this. Curl dependency in Bun and NVM installs It would be good to remove this curl dependency. Instead we can use Python to download the relevant installation script and then run them...
[ { "body": "Currently we download node and bun sequentially during the initial `reflex init`. We can parallelize this.", "number": 1434, "title": "Download node and bun in parallel" }, { "body": "It would be good to remove this curl dependency. Instead we can use Python to download the relevant ...
0ebe1529a67e6395307415fa0fbf69b761ac69d4
{ "head_commit": "f2c96ae32d4d3c07867dd823703c9f2ebcc26314", "head_commit_message": "Parallelize node/bun install", "patch_to_review": "diff --git a/reflex/constants.py b/reflex/constants.py\nindex d4f7725ae63..7fdd6a248bc 100644\n--- a/reflex/constants.py\n+++ b/reflex/constants.py\n@@ -45,54 +45,57 @@ def get_v...
[ { "diff_hunk": "@@ -319,27 +336,35 @@ def install_bun():\n \"\"\"\n # Bun is not supported on Windows.\n if IS_WINDOWS:\n- console.log(\"Skipping bun installation on Windows.\")\n return\n \n- # Only install if bun is not already installed.\n- if not os.path.exists(constants.BUN...
08ca4530d44668f86c65c96ce5895f9e35b276f7
diff --git a/reflex/constants.py b/reflex/constants.py index d4f7725ae63..7fdd6a248bc 100644 --- a/reflex/constants.py +++ b/reflex/constants.py @@ -45,54 +45,57 @@ def get_value(key: str, default: Any = None, type_: Type = str) -> Type: # The current version of Reflex. VERSION = metadata.version(MODULE_NAME) -# Pr...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Code Refactoring / Architectural Improvement" }
reflex-dev__reflex-1361@ef37bd9
reflex-dev/reflex
Python
1,361
rx.App `state` arg should not be required
With this PR, the `state` arg for `rx.App` will be optional, which means you dont necessarily have to specify a state as it will be inferred. However an exception is thrown if there are multiple state classes that subclass `rx.State`. Allowed: ```python import reflex as rx class AppState(rx.State): pass...
2023-07-18T12:18:28Z
rx.App doesn't need to specify state Currently we require the user specify their state when creating the app i.e. `app = rx.App(state=State)` We can remove this because we can infer the base state by checking what has subclassed `rx.State`. This will also let us throw an error when `rx.State` has multiple subclasses...
[ { "body": "Currently we require the user specify their state when creating the app i.e. `app = rx.App(state=State)`\r\n\r\nWe can remove this because we can infer the base state by checking what has subclassed `rx.State`. This will also let us throw an error when `rx.State` has multiple subclasses, which is a c...
915685c07374b376c001334e1629026c2c42d5a2
{ "head_commit": "ef37bd998e0711754fd572b9ce7f8de846f614a0", "head_commit_message": "refactor", "patch_to_review": "diff --git a/reflex/app.py b/reflex/app.py\nindex 235c0d87ac3..6aa379de033 100644\n--- a/reflex/app.py\n+++ b/reflex/app.py\n@@ -2,6 +2,7 @@\n \n import asyncio\n import inspect\n+import os\n from m...
[ { "diff_hunk": "@@ -100,8 +101,25 @@ def __init__(self, *args, **kwargs):\n \n Raises:\n ValueError: If the event namespace is not provided in the config.\n+ Also, if there are multiple client subclasses of rx.State(Subclasses of rx.State should consist\n+ ...
3751d0ece33634f8eb413216c5a81954c19dba91
diff --git a/reflex/app.py b/reflex/app.py index 235c0d87ac3..b5731b24f2f 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -2,6 +2,7 @@ import asyncio import inspect +import os from multiprocessing.pool import ThreadPool from typing import ( Any, @@ -42,7 +43,7 @@ verify_route_validity, ) from reflex...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
reflex-dev__reflex-1111@9648173
reflex-dev/reflex
Python
1,111
UI connection warning:
This Pr adds a UI warning when server is unreachable <img width="1512" alt="Screenshot 2023-05-31 at 3 34 45 PM" src="https://github.com/pynecone-io/pynecone/assets/19895635/6bf310bd-351d-4ceb-b08b-2473bfe457a2"> You also have the option of modifying the component that gets displayed. ```python # Add state an...
2023-05-31T15:40:05Z
Show warning if can't connect to api_url When deploying an app if you don't update the `api_url` in your `pcconfig.py` currently the app doesn't work and you have to go in the Network tab to see the error. We should have a way to throw a UI warning when the backend isn't connected.
Hi @picklelo @Alek99, I would like to take up this issue. I have gone through the deploy function in the pc.py file. I got some understanding. Please brief this issue so that I can take this and I work on this.
[ { "body": "When deploying an app if you don't update the `api_url` in your `pcconfig.py` currently the app doesn't work and you have to go in the Network tab to see the error. We should have a way to throw a UI warning when the backend isn't connected.", "number": 971, "title": "Show warning if can't co...
d4b5c78406a90496b561ff1b66d54d9b6db43eed
{ "head_commit": "9648173ec539789356480efa9232cab4f0b2a551", "head_commit_message": "added ommited libraries to default", "patch_to_review": "diff --git a/pynecone/.templates/jinja/web/pages/index.js.jinja2 b/pynecone/.templates/jinja/web/pages/index.js.jinja2\nindex 17686aebe5a..e1293616c96 100644\n--- a/pynecon...
[ { "diff_hunk": "@@ -70,7 +71,21 @@ export default function Component() {\n {% endfor %}\n \n return (\n+ <Fragment>\n+ <Fragment>\n+ {notConnected ? (\n+ <Box sx={% raw %}{{\"textAlign\": \"center\"}}{% endraw %}>", "line": null, "original_line": 77, "original_start_line": ...
3b239b190876fc353dcf3017eb147a24fd2f2e0b
diff --git a/pynecone/.templates/jinja/web/pages/index.js.jinja2 b/pynecone/.templates/jinja/web/pages/index.js.jinja2 index 17686aebe5a..32dcc11279f 100644 --- a/pynecone/.templates/jinja/web/pages/index.js.jinja2 +++ b/pynecone/.templates/jinja/web/pages/index.js.jinja2 @@ -11,6 +11,7 @@ export default function Comp...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-29436@5074d55
scikit-learn/scikit-learn
Python
29,436
Fix tests for numpy 2 and array api compat
Fixes #29396. Update the array API tests and the `_average` private helper for compatibility with NumPy 2.0.0.
2024-07-08T15:53:02Z
Array API tests fail on main ### Describe the bug I ran the Array API tests on main and got 10 failing tests. (Last week, with an older main and everything else the same, I had 4 failing tests.) array_api_compat==1.7.1 I only ran the cpu tests. ### Steps/Code to Reproduce `pytest sklearn/utils/tests/te...
I do have the same issues locally, it seems like the problem disappear when using `numpy<2` (tried with numpy 1.26.4) for some reason ... Maybe @betatim or @OmarManzoor have some suggestions about this and whether this is expected? @lesteve Might be because of some updates in the new version of numpy. Will have to c...
[ { "body": "### Describe the bug\r\n\r\nI ran the Array API tests on main and got 10 failing tests. \r\n(Last week, with an older main and everything else the same, I had 4 failing tests.)\r\n\r\narray_api_compat==1.7.1\r\n\r\nI only ran the cpu tests.\r\n\r\n### Steps/Code to Reproduce\r\n\r\n`pytest sklearn/ut...
0dba98f1eb7edc893e26c36d54519386a265467d
{ "head_commit": "5074d5562e48142b571ef434ce960454eec0c179", "head_commit_message": "TST remove numpy deprecation warnings in _atol_for_type by assuming NumPy's default floating point precision level", "patch_to_review": "diff --git a/build_tools/azure/pylatest_pip_openblas_pandas_environment.yml b/build_tools/az...
[ { "diff_hunk": "@@ -179,7 +184,10 @@ def test_average(\n with config_context(array_api_dispatch=True):\n result = _average(array_in, axis=axis, weights=weights, normalize=normalize)\n \n- assert getattr(array_in, \"device\", None) == getattr(result, \"device\", None)\n+ if np_version < parse_v...
0ee1a213fa2355f4ee0407108e114a0976d1f394
diff --git a/build_tools/azure/pylatest_pip_openblas_pandas_environment.yml b/build_tools/azure/pylatest_pip_openblas_pandas_environment.yml index adb7add7622e1..c0d6aeaa717c0 100644 --- a/build_tools/azure/pylatest_pip_openblas_pandas_environment.yml +++ b/build_tools/azure/pylatest_pip_openblas_pandas_environment.yml...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-700@d497918
reflex-dev/reflex
Python
700
[fix issue 632] textarea rendering issue
### All Submissions: - [x] Have you followed the guidelines stated in [CONTRIBUTING.md](https://github.com/pynecone-io/pynecone/blob/main/CONTRIBUTING.md) file? - [x] Have you checked to ensure there aren't any other open [Pull Requests](https://github.com/pynecone-io/pynecone/pulls ) for the desired changed? ##...
2023-03-17T09:16:07Z
How to solve `pc.text_area` state render problem? **Describe the bug** Hi, I am trying a create a fully controlled `pc.text_area`, so that can be cleared by a button. Using `pc.text_area(value=State.area_value, on_change=State.set_area_value)`, when I move the cursor inside the text and after key up, the cusor will...
According to [React document](https://reactjs.org/docs/forms.html) this is the right way. I think thera are two reasons the cursor jumps to end of text: 1. reset the input value with state's value. Textare with only `value=State.area_value` always update input. 3. update the input value with on change eve...
[ { "body": "**Describe the bug**\r\nHi, \r\nI am trying a create a fully controlled `pc.text_area`, so that can be cleared by a button.\r\nUsing `pc.text_area(value=State.area_value, on_change=State.set_area_value)`, when I move the cursor inside the text and after key up, the cusor will be auto focus at the end...
e96f1c4d39e8ffd05a2373bf82967111a1232083
{ "head_commit": "d49791861100140d031bc162b7abec52b64c1404", "head_commit_message": "fix fully controled textarea inssue.", "patch_to_review": "diff --git a/pynecone/compiler/templates.py b/pynecone/compiler/templates.py\nindex c8731f963ea..39fb89c9bdc 100644\n--- a/pynecone/compiler/templates.py\n+++ b/pynecone/...
[ { "diff_hunk": "@@ -466,6 +479,27 @@ def get_custom_components(\n custom_components |= child.get_custom_components(seen=seen)\n return custom_components\n \n+ def is_full_control(self, kwargs: dict) -> bool:\n+ \"\"\"Return if the component is fully controled input.\n+\n+ Ar...
7141eb798c2ceebabdfe9abd659d0f274580d337
diff --git a/pynecone/compiler/templates.py b/pynecone/compiler/templates.py index c8731f963ea..39fb89c9bdc 100644 --- a/pynecone/compiler/templates.py +++ b/pynecone/compiler/templates.py @@ -154,7 +154,15 @@ def format_state( "}})", ] ).format - +FULL_CONTROL = path_ops.join( + [ + "{{setStat...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-29401@819e167
scikit-learn/scikit-learn
Python
29,401
FIX `TransformedTargetRegressor` warns when `set_output` expects dataframe
#### Reference Issues/PRs closes #29361 #### What does this implement/fix? Explain your changes. Prevents warnings on output type to be raised on `TransformedTargetRegressor().fit()` when global output is set to "pandas" or "polars". #### Any other comments? Did this together with @lesteve: we figured that `Tr...
2024-07-03T13:00:00Z
TransformedTargetRegressor warns about set_output set to pandas ### Describe the bug If `set_output` is set to `"pandas"`, `TransformedTargetRegressor` warns unnecessarily. ### Steps/Code to Reproduce ```python import numpy as np import pandas as pd from sklearn import set_config from sklearn.compose import Tran...
Thanks for the reproducer, this seems like an issue indeed, I'll try to take a closer look soonish.
[ { "body": "### Describe the bug\n\nIf `set_output` is set to `\"pandas\"`, `TransformedTargetRegressor` warns unnecessarily.\n\n### Steps/Code to Reproduce\n\n```python\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom sklearn import set_config\r\nfrom sklearn.compose import TransformedTargetRegressor\r\nfro...
ecdc9570953f21d702e3e96394133abdad8e3b6a
{ "head_commit": "819e167df9020453ac2f26e8d0230e97f0de6b20", "head_commit_message": "clearer documentation for args None and 'default'", "patch_to_review": "diff --git a/sklearn/_config.py b/sklearn/_config.py\nindex fc9392de68df6..e8da4bcaa3381 100644\n--- a/sklearn/_config.py\n+++ b/sklearn/_config.py\n@@ -142,...
[ { "diff_hunk": "@@ -393,3 +393,17 @@ def test_transform_target_regressor_pass_extra_predict_parameters():\n regr.fit(X, y)\n regr.predict(X, check_input=False)\n assert regr.regressor_.predict_called\n+\n+\n+@pytest.mark.filterwarnings(\"error\")", "line": null, "original_line": 398, "or...
792bd4abe657f94a2c7d4297db35e47afdeaa061
diff --git a/doc/whats_new/v1.5.rst b/doc/whats_new/v1.5.rst index 20184bbd2a551..059875eec12d6 100644 --- a/doc/whats_new/v1.5.rst +++ b/doc/whats_new/v1.5.rst @@ -13,6 +13,23 @@ For a short description of the main highlights of the release, please refer to .. include:: changelog_legend.inc +.. _changes_1_5_2: + ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-773@529fc8c
reflex-dev/reflex
Python
773
Fix Event chaining in the on_load event handler return not working
This PR fixes a couple of issues with the way on-load events are handled. In this PR, the following should work now: - event-chaining( handlers that return other handlers) - list of on-load events (eg. `app.add_page('index', on_load = [State.first_handler, State.second_handler]`) - Async handlers fixes #610 , #...
2023-04-04T15:55:48Z
Event chaining in the on_load event handler return is not working. **Describe the bug** A clear and concise description of what the bug is. Event chaining in the on_load event handler return is not working. **To Reproduce** Steps to reproduce the behavior: - Code/Link to Repo: I implemented it like this ...
Currently event chains don't work in `on_load` since `on_load` events are handled in [HydrateMiddleware](https://github.com/pynecone-io/pynecone/blob/387bacff734078267183e72d05496fc3b271efc8/pynecone/middleware/hydrate_middleware.py). A different method for handling `on_load` events has been proposed to handle chai...
[ { "body": "**Describe the bug**\r\nA clear and concise description of what the bug is.\r\n\r\nEvent chaining in the on_load event handler return is not working.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n - Code/Link to Repo:\r\n\r\nI implemented it like this\r\n\r\n```python\r\nclass BaseSt...
bd6ea9d977427c2590343ec1438096a87ac60e3c
{ "head_commit": "529fc8c41f18923c4ea1d4616f8d7dd5cecff97c", "head_commit_message": "added async tests", "patch_to_review": "diff --git a/pynecone/app.py b/pynecone/app.py\nindex 8c359e30da1..0a3ef91d49d 100644\n--- a/pynecone/app.py\n+++ b/pynecone/app.py\n@@ -148,7 +148,7 @@ def add_cors(self):\n al...
[ { "diff_hunk": "@@ -37,20 +39,42 @@ def preprocess(self, app: App, state: State, event: Event) -> Optional[Delta]:\n load_event = None\n \n if load_event:\n- if isinstance(load_event, list):\n- for single_event in load_event:\n- ...
e69e819e3580bcf0f5a5ac3f6230ca8b3face9c0
diff --git a/pynecone/app.py b/pynecone/app.py index 8c359e30da1..c4868e8d9e9 100644 --- a/pynecone/app.py +++ b/pynecone/app.py @@ -148,7 +148,9 @@ def add_cors(self): allow_origins=["*"], ) - def preprocess(self, state: State, event: Event) -> Optional[Delta]: + async def preprocess( + ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-915@997af8f
reflex-dev/reflex
Python
915
[Fix 477] Use jinja2 for templating
### All Submissions: - [x] Have you followed the guidelines stated in [CONTRIBUTING.md](https://github.com/pynecone-io/pynecone/blob/main/CONTRIBUTING.md) file? - [x] Have you checked to ensure there aren't any other open [Pull Requests](https://github.com/pynecone-io/pynecone/pulls ) for the desired changed? <!...
2023-04-30T11:53:15Z
Use Jinja for templating Currently all the JS templating is done manually in Python and f-string formatting. It would be nice to use something like Jinja that was designed for this very task. As the templates get bigger, this will help us stay more understandable and maintainable.
Waiting for a follow up PR to fix the build, then we will merge this
[ { "body": "Currently all the JS templating is done manually in Python and f-string formatting. It would be nice to use something like Jinja that was designed for this very task. As the templates get bigger, this will help us stay more understandable and maintainable. ", "number": 477, "title": "Use Jinj...
dc2dff9323a7013824c3a73dfea02578b0ecea69
{ "head_commit": "997af8fff71eb283dc08b0fc7670f2052746bd6b", "head_commit_message": "fix test fails of python 3.8", "patch_to_review": "diff --git a/poetry.lock b/poetry.lock\nindex 2012042a11d..6839da93192 100644\n--- a/poetry.lock\n+++ b/poetry.lock\n@@ -1,4 +1,4 @@\n-# This file is automatically @generated by ...
[ { "diff_hunk": "@@ -117,55 +119,22 @@ def format_prop(\n assert isinstance(prop, str), \"The prop must be a string.\"\n return format.wrap(prop, \"{\", check_first=False)\n \n- def format_props(self) -> str:\n+ def format_props(self) -> list:", "line": null, "original_line": 122, ...
631a4447a034de19681614875edaa55ff714d49a
diff --git a/poetry.lock b/poetry.lock index 55cd70c4982..efdf81a702e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -463,6 +463,84 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] +[[package]] +name = "jinja2" +version = "3.1.2" ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
reflex-dev__reflex-550@47a38ed
reflex-dev/reflex
Python
550
Anonymous Telemetry
### All Submissions: - [ ] Have you followed the guidelines stated in [CONTRIBUTING.md](https://github.com/pynecone-io/pynecone/blob/main/CONTRIBUTING.md) file? - [ ] Have you checked to ensure there aren't any other open [Pull Requests](https://github.com/pynecone-io/pynecone/pulls ) for the desired changed? <!...
2023-02-16T06:59:35Z
Add anonymous telemetry Currently it's hard to measure how much Pynecone is being used once it's installed. We want to measure some very basic usage statistics. Key Measurements to Log: * Operating System * Python Version * Node Version * Pynecone Version * CPU / Memory Key Times to Log: * pc init (to under...
[ { "body": "Currently it's hard to measure how much Pynecone is being used once it's installed. We want to measure some very basic usage statistics.\r\n\r\nKey Measurements to Log:\r\n* Operating System\r\n* Python Version\r\n* Node Version\r\n* Pynecone Version\r\n* CPU / Memory\r\n\r\nKey Times to Log:\r\n* pc...
d0b47e1c2329ef134ac7c82d5ff8d98b73cef73d
{ "head_commit": "47a38ede12f9220854ad5606d8df0c4fe933df3b", "head_commit_message": "Ruff", "patch_to_review": "diff --git a/poetry.lock b/poetry.lock\nindex 7471e7e4751..20aadc3dff7 100644\n--- a/poetry.lock\n+++ b/poetry.lock\n@@ -122,6 +122,104 @@ files = [\n {file = \"certifi-2022.12.7.tar.gz\", hash = \"...
[ { "diff_hunk": "@@ -100,6 +107,9 @@ def run(\n frontend_cmd, backend_cmd = utils.run_frontend_prod, utils.run_backend_prod\n assert frontend_cmd and backend_cmd, \"Invalid env\"\n \n+ # Post a telemetry event.\n+ pynecone_telemetry(f\"run-{env}\", utils.get_config().telemetry_enabled)", "l...
81175ee5010ce0faf44cd0bbecaba74fe03482a3
diff --git a/poetry.lock b/poetry.lock index 7471e7e4751..a9e23043e5a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -628,14 +628,14 @@ plugins = ["importlib-metadata"] [[package]] name = "pyright" -version = "1.1.293" +version = "1.1.294" description = "Command line wrapper for pyright" category = "dev" optional...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
reflex-dev__reflex-513@a1e427a
reflex-dev/reflex
Python
513
add pc.route decorator
### All Submissions: - [x] Have you followed the guidelines stated in [CONTRIBUTING.md](https://github.com/pynecone-io/pynecone/blob/main/CONTRIBUTING.md) file? - [x] Have you checked to ensure there aren't any other open [Pull Requests](https://github.com/pynecone-io/pynecone/pulls ) for the desired changed? ##...
2023-02-11T23:48:08Z
Add wrapper for adding a page Adding a function wrapper for adding a page is more pythonic and would be cleaner instead of dumping all your add_page's at the bottom. Also don't remove the actual add_page function, just add an alternate wrapper method.
[ { "body": "Adding a function wrapper for adding a page is more pythonic and would be cleaner instead of dumping all your add_page's at the bottom.\r\nAlso don't remove the actual add_page function, just add an alternate wrapper method.", "number": 462, "title": "Add wrapper for adding a page" } ]
d3c3174ba4139bcbbecfaf9f3f675fcf9ecd59cd
{ "head_commit": "a1e427a06b5566d5f7167baa9547b2de1e798db1", "head_commit_message": "remove unused import", "patch_to_review": "diff --git a/pynecone/__init__.py b/pynecone/__init__.py\nindex b0fcb441f5a..56e66b33f52 100644\n--- a/pynecone/__init__.py\n+++ b/pynecone/__init__.py\n@@ -13,6 +13,7 @@\n from .event i...
[ { "diff_hunk": "@@ -0,0 +1,42 @@\n+\"\"\"The route decorator and associated variables.\"\"\"\n+\n+DECORATED_ROUTES = []\n+\n+\n+def route(route=None, title=None, image=None, description=None, on_load=None):\n+ \"\"\"Decorate a function as a page.\n+\n+ pc.App() will automatically call add_page() for any m...
9ee99503abaa9a205ee935467354b68748ef7a14
diff --git a/pynecone/__init__.py b/pynecone/__init__.py index b0fcb441f5a..56e66b33f52 100644 --- a/pynecone/__init__.py +++ b/pynecone/__init__.py @@ -13,6 +13,7 @@ from .event import EventChain, console_log, redirect, window_alert from .middleware import Middleware from .model import Model, session +from .route i...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-29442@3a19575
scikit-learn/scikit-learn
Python
29,442
Fix elasticnect cv sample weight
Fixes #22914 What does this implement/fix? Explain your changes. Adapted from the pull request #23045 by s-banach and #29308 from snath-xoc Modifies _alpha_grid function in linear_model._coordinate_descent to accept a sample_weight argument and implements changes to be compatible with _preprocess_data TODO ...
2024-07-09T20:09:54Z
Calculation of alphas in ElasticNetCV doesn't use sample_weight ### Describe the bug In ElasticNetCV, the first and largest value of `alpha`, call it `alpha_max`, should be just large enough to force all of the coefficients to become zero. The existing code works correctly when `sample_weight` is not specified. Howe...
I agree, the max `alpha` should give zero coefficients. Do you want to give it a try and open a PR? The *change policy* might be tricky as it corresponds to changing a model (once fixed, `ElasticNetCV.fit` will give different results than before) and there is no meaningful deprecation path, IMO. I consider it a bu...
[ { "body": "### Describe the bug\r\n\r\nIn ElasticNetCV, the first and largest value of `alpha`, call it `alpha_max`, should be just large enough to force all of the coefficients to become zero. The existing code works correctly when `sample_weight` is not specified. However, the computation of `alpha_max` does ...
f9776619f1144075289813634c5d450d5b31fa71
{ "head_commit": "3a1957589f7dd56713ea9040b70228124dbd5fc7", "head_commit_message": "add global_random_seed", "patch_to_review": "diff --git a/doc/whats_new/v1.6.rst b/doc/whats_new/v1.6.rst\nindex c98314d5ca1de..0153de68662c4 100644\n--- a/doc/whats_new/v1.6.rst\n+++ b/doc/whats_new/v1.6.rst\n@@ -103,6 +103,12 @...
[ { "diff_hunk": "@@ -1306,55 +1307,60 @@ def test_enet_sample_weight_consistency(\n \n @pytest.mark.parametrize(\"fit_intercept\", [True, False])\n @pytest.mark.parametrize(\"sparse_container\", [None] + CSC_CONTAINERS)\n-def test_enet_cv_sample_weight_correctness(fit_intercept, sparse_container):\n+def test_ene...
080c8469d2c14766b739da4bcdfd26eddd611c25
diff --git a/doc/whats_new/v1.6.rst b/doc/whats_new/v1.6.rst index a45765cbd04a3..5d56e534364fd 100644 --- a/doc/whats_new/v1.6.rst +++ b/doc/whats_new/v1.6.rst @@ -233,6 +233,11 @@ Changelog has no effect. `copy_X` will be removed in 1.8. :pr:`29105` by :user:`Adam Li <adam2392>`. +- |Fix| :class:`linear_model...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-503@f84b37b
reflex-dev/reflex
Python
503
334: create PCDict
This PR adds a PCDict feature to handle mutable dicts ### All Submissions: - [x] Have you followed the guidelines stated in [CONTRIBUTING.md](https://github.com/pynecone-io/pynecone/blob/main/CONTRIBUTING.md) file? - [x] Have you checked to ensure there aren't any other open [Pull Requests](https://github.com/py...
2023-02-11T03:15:58Z
Create pc.dict and pc.list Currently Pynecone doesn't detect mutations in list/dict state vars which is annoying and can lead to bugs if one is not careful. Maybe we could create classes `pc.dict` and `pc.list` that wrap any dict/list State vars, and modify them such that they detect mutations.
I can work on this. Can you provide an example how `pc.dict` & `pc.list` would look like? My guess would be sth like this: ```py def index(): colors = pc.list(['red', 'oragen']) return pc.vstack( pc.text('Number of colors:' + len(colors)), pc.button('+', on_click=lambda : colors.append('another colo...
[ { "body": "Currently Pynecone doesn't detect mutations in list/dict state vars which is annoying and can lead to bugs if one is not careful.\r\n\r\nMaybe we could create classes `pc.dict` and `pc.list` that wrap any dict/list State vars, and modify them such that they detect mutations.", "number": 334, ...
5e0d5b9e2e2aec9bdf19dd75629bfcef26a33f6a
{ "head_commit": "f84b37b89044689993473d44ea6fdc441783aea7", "head_commit_message": "334: create PCDict\n\nThis PR adds a PCDict feature to handle mutable dicts", "patch_to_review": "diff --git a/pynecone/state.py b/pynecone/state.py\nindex e5c452e0585..6841bf40cd8 100644\n--- a/pynecone/state.py\n+++ b/pynecone/...
[ { "diff_hunk": "@@ -79,7 +79,9 @@ def _init_mutable_fields(self):\n value, self._reassign_field, field.name\n )\n \n- if utils._issubclass(field.type_, List):\n+ if utils._issubclass(field.type_, List) or utils._issubclass(", "line": null, "original_line...
db42280fc088673c21bed6c28a99b061521a7df9
diff --git a/pynecone/state.py b/pynecone/state.py index e5c452e0585..0417b73806b 100644 --- a/pynecone/state.py +++ b/pynecone/state.py @@ -5,7 +5,18 @@ import functools import traceback from abc import ABC -from typing import Any, Callable, ClassVar, Dict, List, Optional, Sequence, Set, Type +from typing import ( ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-29243@4cc3995
scikit-learn/scikit-learn
Python
29,243
DOC add example with ``set_params``.
#### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to the issues or pull requests you resolved, so that they will automatically be closed when your pull request is merged. See https://github.com/blog/1506-closing-issues-via-pull-requests --> Atte...
2024-06-12T19:17:59Z
When a Pipeline step is changed via set_params, the set_output state is cleared ### Describe the bug When a Pipeline step is set via `set_params`, the subsequent output of `fit_transform` is a numpy ndarray even if previously the pipeline's output was set to be of type pandas.DataFrame via a call to `set_output(tran...
I think this happens because `pipe.set_output` will call `.set_output` to all its underlying estimators in particular `pipe['scale']` i.e. its `MinMaxScaler` estimator. When you do `pipe.set_params(scale=MinMaxScaler())` you replace `pipe['scale']` with an estimator that does not have `set_output` set. The easiest w...
[ { "body": "### Describe the bug\r\n\r\nWhen a Pipeline step is set via `set_params`, the subsequent output of `fit_transform` is a numpy ndarray even if previously the pipeline's output was set to be of type pandas.DataFrame via a call to `set_output(transform= 'pandas')`.\r\n\r\nThis only happens when the enti...
7e8ad632ff7aec09e99f0c4b8e493e13e19aef14
{ "head_commit": "4cc39952bc6a5c4512489b40ac9bb7700069727e", "head_commit_message": "DOC Linting", "patch_to_review": "diff --git a/examples/miscellaneous/plot_set_output.py b/examples/miscellaneous/plot_set_output.py\nindex 9baa71a1b3648..2e8a65cb82d6e 100644\n--- a/examples/miscellaneous/plot_set_output.py\n+++...
[ { "diff_hunk": "@@ -63,6 +63,12 @@\n # means that the final logistic regression step contains the feature names of the input.\n clf[-1].feature_names_in_\n \n+# %%\n+# As a side note, if one uses the method `set_params`, the transformer will be\n+# replaced by a new one which does not have `set_output` set:\n+c...
0d2cbae569b189655f691bae3aaafa74d67f318e
diff --git a/examples/miscellaneous/plot_set_output.py b/examples/miscellaneous/plot_set_output.py index 9baa71a1b3648..e74d94957c685 100644 --- a/examples/miscellaneous/plot_set_output.py +++ b/examples/miscellaneous/plot_set_output.py @@ -63,6 +63,21 @@ # means that the final logistic regression step contains the fe...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-339@7ed7ca5
reflex-dev/reflex
Python
339
Add and use `pc.list` to have list mutation detection
To add and use `pc.list`/`PcList` to have list mutation detection. It's not as straightforward as I thought. Or is my approach too complicated? For #334. `pc.dict` would be in another PR.
2023-01-25T15:21:22Z
Create pc.dict and pc.list Currently Pynecone doesn't detect mutations in list/dict state vars which is annoying and can lead to bugs if one is not careful. Maybe we could create classes `pc.dict` and `pc.list` that wrap any dict/list State vars, and modify them such that they detect mutations.
I can work on this. Can you provide an example how `pc.dict` & `pc.list` would look like? My guess would be sth like this: ```py def index(): colors = pc.list(['red', 'oragen']) return pc.vstack( pc.text('Number of colors:' + len(colors)), pc.button('+', on_click=lambda : colors.append('another colo...
[ { "body": "Currently Pynecone doesn't detect mutations in list/dict state vars which is annoying and can lead to bugs if one is not careful.\r\n\r\nMaybe we could create classes `pc.dict` and `pc.list` that wrap any dict/list State vars, and modify them such that they detect mutations.", "number": 334, ...
bfe9ad807e29ada85486001efcae1e605630fb76
{ "head_commit": "7ed7ca5ea311936d5946a08e00bfe4e7f3de6cc9", "head_commit_message": "simply PcList", "patch_to_review": "diff --git a/pynecone/state.py b/pynecone/state.py\nindex 0957001285d..378bc1696df 100644\n--- a/pynecone/state.py\n+++ b/pynecone/state.py\n@@ -13,7 +13,7 @@\n from pynecone import constants, ...
[ { "diff_hunk": "@@ -748,3 +748,54 @@ def type_(self):\n if \"return\" in self.fget.__annotations__:\n return self.fget.__annotations__[\"return\"]\n return Any\n+\n+\n+class PcList(list):", "line": null, "original_line": 753, "original_start_line": null, "path": "pyne...
fd7c722759bc0e45631f10030e5446935b2f5df3
diff --git a/pynecone/state.py b/pynecone/state.py index 0957001285d..a5901e9f1fd 100644 --- a/pynecone/state.py +++ b/pynecone/state.py @@ -13,7 +13,7 @@ from pynecone import constants, utils from pynecone.base import Base from pynecone.event import Event, EventHandler, window_alert -from pynecone.var import BaseVa...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
reflex-dev__reflex-323@f8afb87
reflex-dev/reflex
Python
323
Resolve #304: Relax type requirement on pc.cond
Resolve #304: Relax type requirement on pc.cond
2023-01-23T19:11:43Z
Relax type requirement on pc.cond Currently the first argument to `pc.cond` must be a `pc.Var` with type `bool`. However since JS is lax about converting anything to a bool, perhaps we can relax this requirement and just allow anything in. There's a tradeoff here when we do this stuff implicitly as it may lead to un...
[ { "body": "Currently the first argument to `pc.cond` must be a `pc.Var` with type `bool`. However since JS is lax about converting anything to a bool, perhaps we can relax this requirement and just allow anything in.\r\n\r\nThere's a tradeoff here when we do this stuff implicitly as it may lead to unexpected er...
dd5fa88050aa9d3158b6a3185e07fbdc616c951a
{ "head_commit": "f8afb871e8802727c30b5e551a809e8b6499b7ba", "head_commit_message": "unit test for pc.cond validation", "patch_to_review": "diff --git a/pynecone/components/layout/cond.py b/pynecone/components/layout/cond.py\nindex 8146e2d5a33..d80f306f253 100644\n--- a/pynecone/components/layout/cond.py\n+++ b/p...
[ { "diff_hunk": "@@ -0,0 +1,37 @@\n+import pytest\n+\n+import pynecone as pc\n+\n+\n+@pytest.fixture\n+def cond_state(request):\n+ class CondState(pc.State):\n+ value: request.param[\"value_type\"] = request.param[\"value\"]\n+\n+ return CondState\n+\n+\n+@pytest.mark.parametrize(\n+ \"cond_state...
015b5a050a11388cea2cd0560831d2b1fe8b1890
diff --git a/pynecone/components/layout/cond.py b/pynecone/components/layout/cond.py index 8146e2d5a33..d80f306f253 100644 --- a/pynecone/components/layout/cond.py +++ b/pynecone/components/layout/cond.py @@ -1,9 +1,7 @@ """Create a list of components from an iterable.""" from __future__ import annotations -from ty...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
reflex-dev__reflex-269@697d86c
reflex-dev/reflex
Python
269
Empty .web/pages directory on recompile
Empty the .web/pages directory on recompile so that old pages that don't exist anymore in the python code get removed.
2023-01-16T20:32:52Z
Old pages aren't deleted on recompile **Describe the bug** Old pages stay in the web directory **To Reproduce** Steps to reproduce the behavior: * compile the app with pages ["page1", "page2"] * compile the app with just ["page1"] * the file `/.web/page2` still exists **Expected behavior** Only the specifie...
[ { "body": "**Describe the bug**\r\nOld pages stay in the web directory\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n* compile the app with pages [\"page1\", \"page2\"]\r\n* compile the app with just [\"page1\"]\r\n* the file `/.web/page2` still exists\r\n\r\n**Expected behavior**\r\nOnly the s...
8858754d409f597e59f19841487ffe85881f162c
{ "head_commit": "697d86cde93172269dc0e3f9455e5536c94687c5", "head_commit_message": "added ignored files 404.js and _app.js when .web/pages is purged", "patch_to_review": "diff --git a/pynecone/app.py b/pynecone/app.py\nindex d6a7c4f74bf..2df8b13bc26 100644\n--- a/pynecone/app.py\n+++ b/pynecone/app.py\n@@ -284,6...
[ { "diff_hunk": "@@ -208,3 +208,10 @@ def compile_components(components: Set[CustomComponent]):\n # Compile the components.\n code = _compile_components(components)\n return output_path, code\n+\n+\n+def purge_web_pages_dir():\n+ \"\"\"Empty out .web directory.\n+ \"\"\"\n+ template_files = ...
1c67ab0b44afd79caa4b51eb5685d8e9e5cb7b7c
diff --git a/pynecone/app.py b/pynecone/app.py index d6a7c4f74bf..3979d246fc3 100644 --- a/pynecone/app.py +++ b/pynecone/app.py @@ -284,6 +284,9 @@ def compile(self, force_compile: bool = False): # Create the database models. Model.create_all() + # Empty the .web pages directory + com...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
reflex-dev__reflex-228@bb5c9f0
reflex-dev/reflex
Python
228
Add path event
Closes #138 I needed this feature so I figured I would try to add it, turn out it didn't require too much effort. Notes: - There is a modification in .templates/web/utils/state.js , if I'm getting it right, this file is copied during `pc init`, so I'm not sure how to update it for existing project? I haven't see...
2023-01-08T19:50:40Z
Access current page within state Currently within the state event handlers (and computed var functions), we don't have access to the current page. We can add a method to the `pc.State` class called `get_current_page` that returns this info (potentially along with route params, query params, etc.)
[ { "body": "Currently within the state event handlers (and computed var functions), we don't have access to the current page. We can add a method to the `pc.State` class called `get_current_page` that returns this info (potentially along with route params, query params, etc.)", "number": 138, "title": "A...
f583c4f9421e909e9c2ed5dc6440ad8f12d65580
{ "head_commit": "bb5c9f04ac09f00e7c354daefb699c588ce14f68", "head_commit_message": "switch to using get_current_page() method instead", "patch_to_review": "diff --git a/pynecone/.templates/web/utils/state.js b/pynecone/.templates/web/utils/state.js\nindex b0612df83e3..256f07e79ad 100644\n--- a/pynecone/.template...
[ { "diff_hunk": "@@ -70,6 +70,9 @@ export const applyDelta = (state, delta) => {\n */\n export const applyEvent = async (event, router, socket) => {\n // Handle special events\n+\n+ event.router_data = router;", "line": null, "original_line": 74, "original_start_line": null, "path": "pynecone...
619a9a3a2c508331c2e7a84c4444221a4ec6c1ad
diff --git a/pynecone/.templates/web/utils/state.js b/pynecone/.templates/web/utils/state.js index b0612df83e3..b81e5e674ea 100644 --- a/pynecone/.templates/web/utils/state.js +++ b/pynecone/.templates/web/utils/state.js @@ -70,6 +70,9 @@ export const applyDelta = (state, delta) => { */ export const applyEvent = asy...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-29312@78cc39f
scikit-learn/scikit-learn
Python
29,312
FEA Add metadata routing for RFE and RFECV
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2024-06-20T11:52:44Z
RFE/RFECV doesn't work with sample weights As far as I can tell, `sklearn.feature_selection.RFE` has no way to pass sample weights to the estimator alongside the data. I have fixed this in my code with: ``` diff index bbe0cda..f5072b2 100644 --- a/sklearn/feature_selection/rfe.py +++ b/sklearn/feature_selectio...
yeah I think you can open a PR for that. You need to add tests, though. Note that testing for sample weights usually involves checking that weights correspond to repeating samples. On 1 September 2016 at 03:33, Andreas Mueller notifications@github.com wrote: > yeah I think you can open a PR for that. You need to add...
[ { "body": "As far as I can tell, `sklearn.feature_selection.RFE` has no way to pass sample weights to the estimator alongside the data.\r\n\r\nI have fixed this in my code with:\r\n\r\n``` diff\r\nindex bbe0cda..f5072b2 100644\r\n--- a/sklearn/feature_selection/rfe.py\r\n+++ b/sklearn/feature_selection/rfe.py\r...
5600faab452b0adb1f4090219012aa3ae6208c66
{ "head_commit": "78cc39f92ffe3e2a9056d1a2f0ceaddc17c49d2e", "head_commit_message": "Add _deprecate_positional_args for groups", "patch_to_review": "diff --git a/doc/metadata_routing.rst b/doc/metadata_routing.rst\nindex 31dae6813bda5..a753269e1903a 100644\n--- a/doc/metadata_routing.rst\n+++ b/doc/metadata_routi...
[ { "diff_hunk": "@@ -811,3 +925,42 @@ def fit(self, X, y, groups=None):\n \"n_features\": step_n_features_rev,\n }\n return self\n+\n+ def get_metadata_routing(self):\n+ \"\"\"Get metadata routing of this object.\n+\n+ Please check :ref:`User Guide <metadata_routing>`...
2b860e213176f1c1badece8cee62115f709d2828
diff --git a/doc/metadata_routing.rst b/doc/metadata_routing.rst index fec2cf610c02f..9b21b74032562 100644 --- a/doc/metadata_routing.rst +++ b/doc/metadata_routing.rst @@ -284,6 +284,8 @@ Meta-estimators and functions supporting metadata routing: - :class:`sklearn.ensemble.VotingRegressor` - :class:`sklearn.ensemble...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-28860@6579b83
scikit-learn/scikit-learn
Python
28,860
fixed error that prevented parametrizing custom estimators that implements `__call__`
#### Reference Issues/PRs Fixes #28859 #### What does this implement/fix? Explain your changes. Replaced `if callable(obj)` with two separate checks `if isisfunction(obj)` and `if isinstance(obj, partial)`.
2024-04-19T10:10:37Z
`parametrize_with_checks` fails if custom estimator implements `__call__` ### Describe the bug Title. ### Steps/Code to Reproduce ```python from sklearn.utils.estimator_checks import parametrize_with_checks class MyEstimator: """Dummy estimator.""" def get_params(self, *, deep=True): retur...
[ { "body": "### Describe the bug\n\nTitle.\n\n### Steps/Code to Reproduce\n\n```python\r\nfrom sklearn.utils.estimator_checks import parametrize_with_checks\r\n\r\n\r\nclass MyEstimator:\r\n \"\"\"Dummy estimator.\"\"\"\r\n\r\n def get_params(self, *, deep=True):\r\n return {}\r\n\r\n def set_par...
05ee9dd4b5d925c6172d2f21c095051587a84083
{ "head_commit": "6579b83ee0b5ad40133478bdb7dc83b8106a86dd", "head_commit_message": "fixed error that prevented parametrizing custom estimators that implement __call__", "patch_to_review": "diff --git a/sklearn/tests/test_common.py b/sklearn/tests/test_common.py\nindex 4564eddee410c..ab9be06f4b579 100644\n--- a/s...
[ { "diff_hunk": "@@ -103,6 +103,31 @@ def _sample_func(x, y=1):\n pass\n \n \n+class EstimatorStub:", "line": null, "original_line": 106, "original_start_line": null, "path": "sklearn/tests/test_common.py", "start_line": null, "text": "@user1:\n```suggestion\r\nclass CallableEstimator...
f0514afda3934be2181b7945ccb18978ac2e3aa7
diff --git a/sklearn/tests/test_common.py b/sklearn/tests/test_common.py index 4564eddee410c..9ff83953f4b0e 100644 --- a/sklearn/tests/test_common.py +++ b/sklearn/tests/test_common.py @@ -20,6 +20,7 @@ import pytest import sklearn +from sklearn.base import BaseEstimator from sklearn.cluster import ( OPTICS, ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-28764@cab58f3
scikit-learn/scikit-learn
Python
28,764
RFE and RFECV allow features_to_select to be larger than available
fixes #28725 Implemented a warning message for when the RFE or the RFECV objects are initialized with a n_features_to_select or min_features_to_select (respectively) attribute larger than the number of features present in the X variable that is passed to the fit method. Additionally, a new test function has been ...
2024-04-03T17:06:03Z
RFE and RFECV allow features_to_select to be larger than available features ### Describe the bug If the `RFE` or the `RFECV` objects are initialized with a `n_features_to_select` or a `min_features_to_select` (respectively) attribute larger than the number of features present in the `X` variable that is passed to th...
Hi @miguelcsilva, I agree that the behavior is unclear. I'm not sure if we want an error or a warning. I sligthly tend towards a warning. We also need to explain the behavior in the parameter descriptions. ping @glemaitre, wdyt ? Can I work on this issue? @ogrisel @jeremiedbb > Can I work on this issue? @ogrisel @j...
[ { "body": "### Describe the bug\r\n\r\nIf the `RFE` or the `RFECV` objects are initialized with a `n_features_to_select` or a `min_features_to_select` (respectively) attribute larger than the number of features present in the `X` variable that is passed to the `fit` method, I would expect an error to be raised....
beb71774647fe1e7154c546a69c7ce412e5a2027
{ "head_commit": "cab58f3dbaef17ae52f2d417c2fd825718827044", "head_commit_message": "RFE and RFECV allow features_to_select to be larger than available features (scikit-learn#28725)\n\nImplemented a warning message for when the RFE or the RFECV objects are initialized with a n_features_to_select or min_features_to_...
[ { "diff_hunk": "@@ -289,6 +290,15 @@ def _fit(self, X, y, step_score=None, **fit_params):\n else: # float\n n_features_to_select = int(n_features * self.n_features_to_select)\n \n+ if n_features_to_select > n_features:\n+ warnings.warn(\n+ (\n+ ...
81992c672d893e509f3f4704a99de4e0d3e219f7
diff --git a/sklearn/feature_selection/_rfe.py b/sklearn/feature_selection/_rfe.py index 44764655e988d..7c5cd8d45b8d1 100644 --- a/sklearn/feature_selection/_rfe.py +++ b/sklearn/feature_selection/_rfe.py @@ -6,6 +6,7 @@ """Recursive feature elimination for feature ranking""" +import warnings from numbers import ...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-28564@e23af64
scikit-learn/scikit-learn
Python
28,564
DOC add example docstring for make_low_rank_matrix
closes #27982 This the remaining docstring that needs to be addressed in #27982. We can close the issue then.
2024-03-02T14:41:49Z
Ensure that we have an example in the docstring of each public function or class We should make sure that we have a small example for all public functions or classes. Most of the missing examples are linked to functions. I could list the following classes and functions for which `numpydoc` did not find any example: ...
I am new to GitHub, and I want to work on this! Hi @AdarshWase, to start working on this, you can fork the scikit-learn repository, clone it to your local machine, make your changes, and then send a pull request. The pull request should mention this issue (#27982). I've already send a PR for the clustering functions...
[ { "body": "We should make sure that we have a small example for all public functions or classes. Most of the missing examples are linked to functions.\r\n\r\nI could list the following classes and functions for which `numpydoc` did not find any example:\r\n\r\n- [x] sklearn.base.BaseEstimator\r\n- [x] sklearn.b...
d967cfe8124902181892411b18b50dce9921a32d
{ "head_commit": "e23af648573d69ade443be71a2a903757b6f3fe1", "head_commit_message": "DOC add example docstring for make_low_rank_matrix", "patch_to_review": "diff --git a/sklearn/datasets/_samples_generator.py b/sklearn/datasets/_samples_generator.py\nindex 9d689da99fa45..527c87641403d 100644\n--- a/sklearn/datas...
[ { "diff_hunk": "@@ -1411,6 +1411,22 @@ def make_low_rank_matrix(\n -------\n X : ndarray of shape (n_samples, n_features)\n The matrix.\n+\n+ Examples\n+ --------\n+ >>> from numpy.linalg import svd\n+ >>> from sklearn.datasets import make_low_rank_matrix\n+ >>> X = make_low_rank_...
55b773d034c87d6a5a75391423e0e05ec7033cb7
diff --git a/sklearn/datasets/_samples_generator.py b/sklearn/datasets/_samples_generator.py index 9d689da99fa45..21326bc3c630b 100644 --- a/sklearn/datasets/_samples_generator.py +++ b/sklearn/datasets/_samples_generator.py @@ -1411,6 +1411,20 @@ def make_low_rank_matrix( ------- X : ndarray of shape (n_samp...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
scikit-learn__scikit-learn-28365@6ad9733
scikit-learn/scikit-learn
Python
28,365
FIX handle inconsistence between `fill_value` and `X` dtype in `SimpleImputer`
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2024-02-05T18:50:18Z
SimpleImputer silently cast fill values to integer when the input is of integer type ### Describe the bug Fitting the SimpleImputer on an integer array silently cast the float `fill_value` values to integer. If `fill_value` is nan, nothing is imputed but a warning is raise: `RuntimeWarning: invalid value encountered ...
Indeed this is bad. We probably introduced the bug here: https://github.com/scikit-learn/scikit-learn/pull/22063 I assume that we need to make a casting rule between the dtype of `X` seen at `fit` and the `fill_value` parameter. @LeoGrin do you fill like making a fix. Basically we need a the casting rule to apply...
[ { "body": "### Describe the bug\n\nFitting the SimpleImputer on an integer array silently cast the float `fill_value` values to integer. If `fill_value` is nan, nothing is imputed but a warning is raise:\r\n`RuntimeWarning: invalid value encountered in cast\r\n multiarray.copyto(a, fill_value, casting='unsafe'...
be35d8c58a1797c7243c25977d22d355dfdf8f1c
{ "head_commit": "6ad97336bffd2a53676a500193f9536bee0a3745", "head_commit_message": "update changelog", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex 2baa45e88a115..5fa6b934f6f3e 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1.4.rst\n@@ -152,6 +152,14 @@ Chan...
[ { "diff_hunk": "@@ -152,6 +152,14 @@ Changelog\n works with pandas copy-on-write mode enabled.\n :pr:`28233` by :user:`John Hopfensperger <s-banach>`.\n \n+\n+:mod:`sklearn.impute`", "line": null, "original_line": 156, "original_start_line": null, "path": "doc/whats_new/v1.4.rst", "start...
92a1371b8ea3b3f7e7ecff78475d26f8582a45c1
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index df18adf3401ec..11051c727c239 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -115,6 +115,14 @@ Changelog target is multilabel or multiclass-multioutput in a DataFrame format. :pr:`27702` by :user:`Guillaume Lemaitre <glemaitre>...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-28165@1662a8f
scikit-learn/scikit-learn
Python
28,165
Fix prevent infinite loop in KMeans
Fixes https://github.com/scikit-learn/scikit-learn/issues/28055 When there are more centers than non-duplicate samples, the relocation of empty cluster will trigger at every iteration preventing the algorithm to stop.
2024-01-18T11:17:24Z
Infinite Loop in K-means when relocating empty clusters ### Describe the bug Relocating empty clusters in Kmeans is not working as expected in this edge case, where : - There is duplicate entries. - The number of clusters is equal to the number of entries. - Very particular initial positions. Kmeans is stuck i...
> Kmeans is stuck in a infinite loop, and the only way to end it is the max number of iterations. Hi @brmel, I used the code example you provided, except I omitted the `max_iterations` parameter: ``` import numpy as np from sklearn.cluster import KMeans X = np.array([[100, 100], [100, 102], [106, 100], [107,...
[ { "body": "### Describe the bug\r\n\r\nRelocating empty clusters in Kmeans is not working as expected in this edge case, where :\r\n- There is duplicate entries.\r\n- The number of clusters is equal to the number of entries.\r\n- Very particular initial positions.\r\n\r\nKmeans is stuck in a infinite loop, and ...
d418e79a41d5d4de167114d88465a0b47b0d6a2c
{ "head_commit": "1662a8fa6cd3082539356683ed634a7c56a3849c", "head_commit_message": "Merge branch 'fix-infinite-loop-kmeans' of github.com:jeremiedbb/scikit-learn into fix-infinite-loop-kmeans", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex c674a8619e076..fa5e6c094796c 10...
[ { "diff_hunk": "@@ -20,6 +20,9 @@ Changelog\n :pr:`28121` by :user:`Pietro Peterlongo <pietroppeter>` and\n :user:`Yao Xiao <Charlie-XIAO>`.\n \n+- |Fix| Avoid inifinte loop in :class:`cluster.KMeans` when the number of clusters is", "line": null, "original_line": 23, "original_start_line": null...
1f3d9e3296b34af10bc5f1512be26d86813d8733
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index c674a8619e076..ee47bae7b1f5b 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -20,6 +20,9 @@ Changelog :pr:`28121` by :user:`Pietro Peterlongo <pietroppeter>` and :user:`Yao Xiao <Charlie-XIAO>`. +- |Fix| Avoid infinite loop i...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-28262@d642067
scikit-learn/scikit-learn
Python
28,262
FIX handle column names renaming in ColumnTransformer
closes #28260 The adapters in charge of renaming columns with `set_output` to a DataFrame-like object was failing in case that the original DataFrame-like as duplicated columns (that is possible in `pandas`. We inverse the stacking and and renaming to avoid potential column duplicate that should not happen.
2024-01-25T15:24:13Z
ColumnTransformer output unexpected prefixed feature names from FunctionTransformer() step ### Describe the bug The following code demonstrates that when `FunctionTransformer` is present as a step in `ColumnTransformer`, the feature names output are all prefixed with the name from the last step '**C__**'. For examp...
I can reproduce the issue. I'll investigate the reason. As a temporary workaround, setting `feature_names_out="one-to-one"` provide the expected results. We indeed refactor and use a dictionary to rename the columns: https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/utils/_set_output.py#L125 But we over...
[ { "body": "### Describe the bug\r\n\r\nThe following code demonstrates that when `FunctionTransformer` is present as a step in `ColumnTransformer`, the feature names output are all prefixed with the name from the last step '**C__**'. For example, column '**x1**' is output as '**C__x1**' for 3 times. \r\nWhen '...
bb8776874410d65f510717c97b8027331bb0f3ff
{ "head_commit": "d642067be790f9f155a52b95abe9eae10f093852", "head_commit_message": "TST check that we raise the proper error message", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex 4b5a822108f4b..855c64ba7e053 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1....
[ { "diff_hunk": "@@ -1083,13 +1067,69 @@ def _hstack(self, Xs):\n skip_empty_columns=True,\n )\n ]\n- # Selection of columns might be empty.\n- # Hence feature names are filtered for non-emptiness.\n feature...
4c1634594bc093b884652754d68f79b4f5af7350
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index c68c03a12ee10..f255e3abbcab8 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -44,6 +44,11 @@ Changes impacting all modules :pr:`28235` by :user:`Julien Jerphanion <jjerphan>`. +- |Fix| Fixes a bug for all scikit-learn transfor...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-28119@2d96398
scikit-learn/scikit-learn
Python
28,119
DOC Provide info regarding impact of sample weights scale
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2024-01-13T18:35:33Z
Weighted ridge regression regularization variable is dependent on sample weight magnitude ### Describe the issue linked to the documentation When doing weighted ridge regression, the value of the regularization parameter for a particular solution is dependent on the sample weight vector due to scaling in the implement...
It is somehow connected to https://github.com/scikit-learn/scikit-learn/issues/26848 Maybe there should be a discussion about some general accepted way of dealing with sample weights in different algorithms ( scaling them to sum up to 1, etc) I recall some discussion here regarding the scaling (or not) of sample-we...
[ { "body": "### Describe the issue linked to the documentation\n\nWhen doing weighted ridge regression, the value of the regularization parameter for a particular solution is dependent on the sample weight vector due to scaling in the implementation. Scaling should either be according to the weighted average in...
8635d96e49f460cffcea82285408d297a534bacf
{ "head_commit": "2d963980c80195d308951ef77bc72ed9d17145e1", "head_commit_message": "linting", "patch_to_review": "diff --git a/sklearn/linear_model/_ridge.py b/sklearn/linear_model/_ridge.py\nindex e39af10053c34..2b77e45bf26f7 100644\n--- a/sklearn/linear_model/_ridge.py\n+++ b/sklearn/linear_model/_ridge.py\n@@...
[ { "diff_hunk": "@@ -1969,7 +1969,8 @@ def fit(self, X, y, sample_weight=None):\n \n sample_weight : float or ndarray of shape (n_samples,), default=None\n Individual weights for each sample. If given a float, every sample\n- will have the same weight.\n+ will have the s...
62a63e842d1bb366ef3f164fb989567066c3e5af
diff --git a/sklearn/linear_model/_ridge.py b/sklearn/linear_model/_ridge.py index e39af10053c34..1fdefee5c174a 100644 --- a/sklearn/linear_model/_ridge.py +++ b/sklearn/linear_model/_ridge.py @@ -1969,7 +1969,9 @@ def fit(self, X, y, sample_weight=None): sample_weight : float or ndarray of shape (n_samples,...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-28048@ba58f6f
scikit-learn/scikit-learn
Python
28,048
FIX more precise log loss gradient and hessian
#### Reference Issues/PRs Fixes #28046. #### What does this implement/fix? Explain your changes. This PR improves gradient and hessian of `HalfBinomialLoss` thereby preventing overflow of exp(large number) resulting in inf/nan return values. The implemented change is very carefully designed and tested for minim...
2024-01-02T16:21:07Z
Log Loss gradient and hessian returns NaN for large negative values ### Describe the bug The private `HalfBinomialLoss` gradient and hessian returns `np.NaN` for large negative values of `raw_prediction`: - `gradient` - `gradient_hessian` Only the `loss_gradient` returns the correct gradient. ### Steps/Code to Rep...
[ { "body": "### Describe the bug\n\nThe private `HalfBinomialLoss` gradient and hessian returns `np.NaN` for large negative values of `raw_prediction`:\r\n- `gradient`\r\n- `gradient_hessian`\r\nOnly the `loss_gradient` returns the correct gradient.\n\n### Steps/Code to Reproduce\n\n```python\r\nimport numpy as ...
ffe4e789dab9237230530d49dd210aeb84e8608d
{ "head_commit": "ba58f6f3ff2e450c00e386c60b8a2b2c298b0947", "head_commit_message": "ENH more precise gradient and hessian for CyHalfBinomialLoss", "patch_to_review": "diff --git a/sklearn/_loss/_loss.pyx.tp b/sklearn/_loss/_loss.pyx.tp\nindex 0ce653de84310..ff7d62cf1b53a 100644\n--- a/sklearn/_loss/_loss.pyx.tp\...
[ { "diff_hunk": "@@ -224,48 +224,123 @@ def test_loss_boundary_y_pred(loss, y_pred_success, y_pred_fail):\n \n \n @pytest.mark.parametrize(\n- \"loss, y_true, raw_prediction, loss_true\",\n+ \"loss, y_true, raw_prediction, loss_true, gradient_true, hessian_true\",\n [\n- (HalfSquaredError(), 1.0...
0293fad165e9c964e51789e92ddead75d84af307
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index d2de5ee433f94..a932391b732cd 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -220,6 +220,17 @@ See :ref:`array_api` for more details. - :class:`preprocessing.MinMaxScaler` in :pr:`26243` by `Tim Head`_; - :class:`preprocessing.Norm...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27898@11752ba
scikit-learn/scikit-learn
Python
27,898
FIX raise error in HDBSCAN with precomputed X and request centers
closes #27893 Raise a proper `ValueError` when requesting storing center and `metric="precomputed"`.
2023-12-04T10:09:45Z
sklearn.cluster.HDBSCAN shape error when making medoids with precomputed metric ### Describe the bug When fitting with HDBSCAN with metric="precomputed" and store_centers='medoid', it would raise the ValueError `ValueError: Precomputed metric requires shape (n_queries, n_indexed). Got (11, 300) for 11 indexed.` Cl...
Reading just the documentation of the private functions, it seems that `_weighted_cluster_center` expect to get the raw data and not the precomputed array. Therefore, we should raise an error much earlier that you cannot store the centroids and medoids in combination with `metric="precomputed"`.
[ { "body": "### Describe the bug\r\n\r\nWhen fitting with HDBSCAN with metric=\"precomputed\" and store_centers='medoid', it would raise the ValueError\r\n`ValueError: Precomputed metric requires shape (n_queries, n_indexed). Got (11, 300) for 11 indexed.`\r\nClaiming the shape of input distance matrix not squar...
0027893288dd58806c731de7efc52b6c8e6c131a
{ "head_commit": "11752badb434c9a6a04814172c54cbebe2939133", "head_commit_message": "update changelog", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex 204cbb9e9c890..51d16ec284193 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1.4.rst\n@@ -259,6 +259,10 @@ Chan...
[ { "diff_hunk": "@@ -699,6 +699,11 @@ def fit(self, X, y=None):\n Returns self.\n \"\"\"\n self._validate_params()", "line": null, "original_line": 701, "original_start_line": null, "path": "sklearn/cluster/_hdbscan/hdbscan.py", "start_line": null, "text": "@us...
5164e2489032a12f953558acda0939455526b00c
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index 204cbb9e9c890..51d16ec284193 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -259,6 +259,10 @@ Changelog value instead. :pr:`27828` by :user:`Guillaume Lemaitre <glemaitre>`. +- |Fix| Raises a proper `ValueError` when `metric...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27817@bbb702b
scikit-learn/scikit-learn
Python
27,817
FIX RandomForestRegressor OOB fails with integer-values multiple targets
Fixes #27814 Allow to compute the OOB score with `RandomForestRegressor` and an integral multi-target regression.
2023-11-20T23:15:18Z
RandomForestRegressor having problem with integer-values targets: The type of target cannot be used to compute OOB estimates ### Describe the bug When having: - RandomForestRegressor - Multiple targets - integer values only (e.g., 1.0, 2.0, 3.0, ...) in the targets - oob_score=True The check in `BaseForest` wil...
Indeed, we should be able to compute the OOB score. We did not anticipate that `type_of_target` will return the invalid type. You PR as the right fix since that we can leverage already the `_estimator_type`.
[ { "body": "### Describe the bug\n\nWhen having:\r\n- RandomForestRegressor\r\n- Multiple targets\r\n- integer values only (e.g., 1.0, 2.0, 3.0, ...) in the targets\r\n- oob_score=True\r\n\r\nThe check in `BaseForest` will raise the error:\r\n\r\n```\r\nValueError: The type of target cannot be used to compute OO...
c069511e067619eec658e8070edbd51fcd4545d9
{ "head_commit": "bbb702b82fae0ff15348b75220e5afe3608b05e5", "head_commit_message": "add tests for all combinations of conditions", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex f3f40fd26e27a..c4f525d3d3040 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1.4.rs...
[ { "diff_hunk": "@@ -598,29 +598,36 @@ def test_forest_oob_warning(ForestEstimator):\n \n \n @pytest.mark.parametrize(\"ForestEstimator\", FOREST_CLASSIFIERS_REGRESSORS.values())\n-@pytest.mark.parametrize(\n- \"X, y, params, err_msg\",\n- [\n- (\n- iris.data,\n- iris.target,\n...
83a512eda8cada094cd0a25c29dedb5f74713a78
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index f3f40fd26e27a..0469e38ad1798 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -331,6 +331,7 @@ Changelog - |API| In :class:`ensemble.AdaBoostClassifier`, the `algorithm` argument `SAMME.R` was deprecated and will be removed in 1.6...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-28322@65392e4
scikit-learn/scikit-learn
Python
28,322
Fixed TimeSeriesSplit training set size formula
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs Fixes #28321. #### What does this implement/fix? Explain your changes. This fixes the incorre...
2024-01-31T14:00:21Z
TimeSeriesSplit Train Size formula correction ### Describe the issue linked to the documentation The documentation states: > The training set has size `i * n_samples // (n_splits + 1) + n_samples % (n_splits + 1)` in the `i`th split, with a test set of size `n_samples // (n_splits + 1)` by default, where `n_samples...
[ { "body": "### Describe the issue linked to the documentation\r\n\r\nThe documentation states:\r\n> The training set has size `i * n_samples // (n_splits + 1) + n_samples % (n_splits + 1)` in the `i`th split, with a test set of size `n_samples // (n_splits + 1)` by default, where `n_samples` is the number of sa...
dc1cad2b3fddb8b9069d7cfd89cb1039260baf8e
{ "head_commit": "65392e40b2f1453011aa5f138deb6cafdbac738f", "head_commit_message": "Removed redundant parentheses", "patch_to_review": "diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py\nindex 93898a5114191..8147f79ded361 100644\n--- a/sklearn/model_selection/_split.py\n+++ b/skl...
[ { "diff_hunk": "@@ -1167,10 +1167,10 @@ class TimeSeriesSplit(_BaseKFold):\n \n Notes\n -----\n- The training set has size ``i * n_samples // (n_splits + 1)\n- + n_samples % (n_splits + 1)`` in the ``i`` th split,\n- with a test set of size ``n_samples//(n_splits + 1)`` by default,\n- where ...
2c9d3bbde78f4d1577024b28094a0c56dfade505
diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index bae48e5b93d77..b2e0f64af1c9d 100644 --- a/sklearn/model_selection/_split.py +++ b/sklearn/model_selection/_split.py @@ -1183,7 +1183,9 @@ class TimeSeriesSplit(_BaseKFold): The training set has size ``i * n_samples // (n_split...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Documentation Updates" }
scikit-learn__scikit-learn-27841@f946f3e
scikit-learn/scikit-learn
Python
27,841
ENH Warn in SelectKBest when k > n_features
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2023-11-24T17:14:18Z
SelectKBest shouldn't raise if k > n_samples ### Describe the workflow you want to enable Let's say I want to build a logistic regression model with at most 50 features. I could do that with something like this: ``make_pipeline(ColumnTransformer(...OneHotEncoder(), remainder="passthrough"), SelectKBest(k=50), Logi...
I would not be opposed to raise a warning instead of the error mentioning that all available features are returned. That would work for me, as the warning would be expected I could filter it out here. To make sure I understand the case properly: you have a dataset where the number of features passed to `SelectKBest` is...
[ { "body": "### Describe the workflow you want to enable\r\n\r\nLet's say I want to build a logistic regression model with at most 50 features. I could do that with something like this: \r\n``make_pipeline(ColumnTransformer(...OneHotEncoder(), remainder=\"passthrough\"), SelectKBest(k=50), LogisticRegression())`...
5ac2eb117a0d242244ac4cff0d9f22abc6873ae2
{ "head_commit": "f946f3ee3c70cf15fad3a86cc3240e940cffa91d", "head_commit_message": "DOC Adds whats new", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex f3f40fd26e27a..9f3f4cdf022b2 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1.4.rst\n@@ -345,6 +345,11 @@ Ch...
[ { "diff_hunk": "@@ -345,6 +345,11 @@ Changelog\n not check for nans during input validation.\n :pr:`21807` by `Thomas Fan`_.\n \n+- |API| :class:`feature_selection.SelectKBest` and\n+ :class:`feature_selection.GenericUnivariateSelect` with `mode='k_best'", "line": null, "original_line": 349, "o...
efb6f2a76ac2067c7a2ba762075b42c68a41edae
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index 42543f7591266..44d5cfa01c8bb 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -374,6 +374,11 @@ Changelog not check for nans during input validation. :pr:`21807` by `Thomas Fan`_. +- |Enhancement| :class:`feature_selection.Sel...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27937@e3154e9
scikit-learn/scikit-learn
Python
27,937
add feature_names_in_ and n_features_in_ attributes to dummy estimators
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2023-12-11T08:48:16Z
Dummy estimators don't have the `feature_names_in_` nor `n_features_in_` attributes ### Describe the bug `DummyClassifier` and `DummyRegressor` estimators don't have the `feature_names_in_` nor `n_features_in_` attributes. The reason is that they don't call `self._validate_data` during `fit` like other estimators do. ...
probably it's more a feature request than a bug. I am willing to make a PR for this. these estimators are not really checking the input `X` and hence they don't store feature names. I'm not sure if it's a good idea to add that validation step. It makes sense to not do the validation, but they could still store feature ...
[ { "body": "### Describe the bug\n\n`DummyClassifier` and `DummyRegressor` estimators don't have the `feature_names_in_` nor `n_features_in_` attributes. The reason is that they don't call `self._validate_data` during `fit` like other estimators do.\n\n### Steps/Code to Reproduce\n\n```python\r\nfrom sklearn.dat...
db971d1e63acdac0d00ac1c32636ceec904f48df
{ "head_commit": "e3154e96fed588fdff6fbb676323e377fe2a1c95", "head_commit_message": "add changelog and fix test", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex a2aca5841cd9e..8e832db2da603 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1.4.rst\n@@ -35,6 +35,10...
[ { "diff_hunk": "@@ -110,6 +110,13 @@ class prior probabilities.\n Frequency of each class observed in `y`. For multioutput classification\n problems, this is computed independently for each output.\n \n+ n_features_in_ : int\n+ Number of features seen during fit.\n+\n+ feature_names...
7166583078113b5d7bf33dc3208905c097320e61
diff --git a/doc/whats_new/v1.5.rst b/doc/whats_new/v1.5.rst index 96cbd21021f08..4a44bd6666615 100644 --- a/doc/whats_new/v1.5.rst +++ b/doc/whats_new/v1.5.rst @@ -25,12 +25,20 @@ Changelog :pr:`123456` by :user:`Joe Bloggs <joeongithub>`. where 123455 is the *pull request* number, not the issue number. + ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27650@9ddc618
scikit-learn/scikit-learn
Python
27,650
ENH Add warning when only one label found in `confusion_matrix`
#### Reference Issues/PRs fixes #19756 #### What does this implement/fix? Explain your changes. Add warning when only one label found in `confusion_matrix` and advise user to pass all labels via `labels` parameter.
2023-10-24T05:59:03Z
Confusion Matrix is of wrong shape #### Describe the bug Having 100 percent true positive rate gives a 1x1 matrix. This can cause bugs if you are using the confusion matrix in a function to calculate evaluation parameters such as sensitivity, auc, specifity, accuracy. ``` from sklearn.metrics import confusio...
If `y_true` and `y_pred` does not contain all the known labels, then you can use `labels` to pass them in: ```py from sklearn.metrics import confusion_matrix, roc_auc_score ground_truth, predictions = np.ones((2,1)) cf_matrix = confusion_matrix(ground_truth, predictions, labels=[0, 1]) cf_matrix # array([[0, ...
[ { "body": "\r\n\r\n#### Describe the bug\r\n\r\nHaving 100 percent true positive rate gives a 1x1 matrix. This can cause bugs if you are using the confusion matrix in a function to calculate evaluation parameters such as sensitivity, auc, specifity, accuracy.\r\n\r\n```\r\nfrom sklearn.metrics import confusion_...
1f1329f7ecb001eda2ff8e6d6a68bc2054c4962f
{ "head_commit": "9ddc6188e619bdd3cb220786423f99a24029f52b", "head_commit_message": "black", "patch_to_review": "diff --git a/sklearn/metrics/_classification.py b/sklearn/metrics/_classification.py\nindex d1dc3232c53ab..73260a2be1d52 100644\n--- a/sklearn/metrics/_classification.py\n+++ b/sklearn/metrics/_classif...
[ { "diff_hunk": "@@ -382,6 +382,15 @@ def confusion_matrix(\n cm = cm / cm.sum()\n cm = np.nan_to_num(cm)\n \n+ if cm.shape == (1, 1):\n+ warnings.warn(\n+ (\n+ \"Only one label was found in 'y_true' and 'y_pred', use the 'labels' \"", "line": null, ...
33fe2a09b0158828809bef4255e3a8a2b2fcdb3f
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index a947dfe225b04..0063fa77bf87a 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -376,6 +376,9 @@ Changelog `predict_proba`). Such scorer are specific to classification. :pr:`26840` by :user:`Guillaume Lemaitre <glemaitre>`. +- |...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27721@369719e
scikit-learn/scikit-learn
Python
27,721
ENH support unsupervised feature selection for percentile and k-best
closes #27609 Allow `SelectKBest`, `SelectPercentile`, and `GenericUnivariateSelection` (with k-best and percentile modes) to work with unsupervised scoring function.
2023-11-04T14:21:01Z
Add a version of `GenericUnivariateSelect`/`SelectPercentile`/`SelectKBest` that allows input of X with missing values and `y=None`. ### Describe the workflow you want to enable - Select features by the percentage of missing values of X - Select features only by statistical properties of X before y is available ### ...
Thanks for creating the issue. Could you add a bit more context on use-cases where it would be useful to have this and maybe examples in the wild where this is being used. This will help to decide if we want to include this in scikit-learn. > Select features by the percentage of missing values of X For example, if o...
[ { "body": "### Describe the workflow you want to enable\n\n- Select features by the percentage of missing values of X\r\n- Select features only by statistical properties of X before y is available\n\n### Describe your proposed solution\n\nCreate a version with weaker X, y checks.\n\n### Describe alternatives yo...
0027893288dd58806c731de7efc52b6c8e6c131a
{ "head_commit": "369719eab21427419c70d8f97606037e73a47abe", "head_commit_message": "Update doc/whats_new/v1.4.rst", "patch_to_review": "diff --git a/doc/modules/feature_selection.rst b/doc/modules/feature_selection.rst\nindex 1190d17019183..7fcec524e7168 100644\n--- a/doc/modules/feature_selection.rst\n+++ b/doc...
[ { "diff_hunk": "@@ -680,6 +689,9 @@ class SelectKBest(_BaseFilter):\n Ties between features with equal scores will be broken in an unspecified\n way.\n \n+ This filter supports unsupervised feature selection that only request `X` for", "line": null, "original_line": 692, "original_start_l...
43220b1b0366ae19a624160e005f6ea7a88f57fb
diff --git a/doc/modules/feature_selection.rst b/doc/modules/feature_selection.rst index 1190d17019183..7fcec524e7168 100644 --- a/doc/modules/feature_selection.rst +++ b/doc/modules/feature_selection.rst @@ -108,6 +108,12 @@ applied to non-negative features, such as frequencies. Beware not to use a regression sco...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-27412@69dd9e3
scikit-learn/scikit-learn
Python
27,412
FIX make `roc_auc_score` consistent with `roc_curve` with a single class
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2023-09-18T21:08:32Z
Inconsistency in AUC ROC and AUPR API ### Describe the bug When only one class is present on the groundtruth. The function `roc_auc_score` throws an `ValueError` and exits while the `average_precision_score` returns `-0.0`. I feel that both functions should return similar output in this case. ### Steps/Code to Reprod...
`average_precision_score` is not an area under precision-recall curve, it's a different metric @GLevV isn't it an discrete estimation of the area under the PR curve? https://glassboxmedicine.com/2019/03/02/measuring-performance-auprc/ EDIT- added the correct link Actually, they are different. Check [sklearn.metri...
[ { "body": "### Describe the bug\n\nWhen only one class is present on the groundtruth. The function `roc_auc_score` throws an `ValueError` and exits while the `average_precision_score` returns `-0.0`. I feel that both functions should return similar output in this case.\n\n### Steps/Code to Reproduce\n\n```pytho...
364cafe979592abdf90b56722e18c27f3b02b9b2
{ "head_commit": "69dd9e38d68a0ac581bc04f742458d0d3e91c336", "head_commit_message": "bugfix", "patch_to_review": "diff --git a/doc/whats_new/v1.6.rst b/doc/whats_new/v1.6.rst\nindex e93eb01d3d32d..629944b7e52be 100644\n--- a/doc/whats_new/v1.6.rst\n+++ b/doc/whats_new/v1.6.rst\n@@ -326,6 +326,10 @@ Changelog\n ...
[ { "diff_hunk": "@@ -355,6 +354,24 @@ def test_roc_curve_toydata():\n assert_array_almost_equal(fpr, [0, 1])\n assert_almost_equal(roc_auc, 0.5)\n \n+ y_true = [1, 1]", "line": null, "original_line": 357, "original_start_line": null, "path": "sklearn/metrics/tests/test_ranking.py", ...
8cbac3e1e20ed0ec9488d56c8221b4b4102633f2
diff --git a/doc/whats_new/v1.6.rst b/doc/whats_new/v1.6.rst index e93eb01d3d32d..629944b7e52be 100644 --- a/doc/whats_new/v1.6.rst +++ b/doc/whats_new/v1.6.rst @@ -326,6 +326,10 @@ Changelog classification labels. :pr:`29738` by `Adrin Jalali`_. +- |Fix| :func:`metrics.roc_auc_score` will now correctly return ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27387@b00ad8c
scikit-learn/scikit-learn
Python
27,387
DOC: add note about restarting conda environment after creation
#### Reference Issues/PRs Fixes #27356 #### What does this implement/fix? Explain your changes. Adds an explanatory notes section that the conda environment after creation needs to be deactivated and reactivated before environment variables become active. It is the same notes section as for the macOS conda bui...
2023-09-15T20:16:55Z
Building from source fails using conda instructions ### Describe the bug I am trying to build the development version of scikit-learn in Windows Subsystem for Linux running Ubuntu 20.04.5 and conda 23.7.2. After creating the environment, building scikit-learn fails as cython is not found for some reason. ### S...
Could you close and reopen a terminal between the step 1 and step 2. Since `compilers` will modify some environment variables, it can happen that those don't take effect. I tried on my linux machine and the above command are working as expected. Thank you @glemaitre , that worked. Is this worth being noted in the do...
[ { "body": "### Describe the bug\r\n\r\nI am trying to build the development version of scikit-learn in Windows Subsystem for Linux running Ubuntu 20.04.5 and conda 23.7.2.\r\n\r\nAfter creating the environment, building scikit-learn fails as cython is not found for some reason.\r\n\r\n### Steps/Code to Reproduc...
8faa92011e76bace1df02230bce83ee3a5e083b0
{ "head_commit": "b00ad8ce20f34d71bd1c731484f70677bd532e35", "head_commit_message": "add accidentally deleted freebsd header", "patch_to_review": "diff --git a/doc/developers/advanced_installation.rst b/doc/developers/advanced_installation.rst\nindex a9461e965af2a..bfcbd1649d56f 100644\n--- a/doc/developers/advan...
[ { "diff_hunk": "@@ -286,7 +292,13 @@ scikit-learn from source:\n .. prompt:: bash $\n \n conda create -n sklearn-dev -c conda-forge python numpy scipy cython \\\n- joblib threadpoolctl pytest compilers llvm-openmp\n+ joblib threadpoolctl pytest compilers", "line": null, "original_line"...
3532a44cc8a7481d892805fb9762e7076588d900
diff --git a/doc/developers/advanced_installation.rst b/doc/developers/advanced_installation.rst index a9461e965af2a..2eab1bb06d979 100644 --- a/doc/developers/advanced_installation.rst +++ b/doc/developers/advanced_installation.rst @@ -69,6 +69,12 @@ feature, code or documentation improvement). .. prompt:: bash $ ...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27700@4141451
scikit-learn/scikit-learn
Python
27,700
ENH Add `chain_method` to `ClassifierChain`
#### Reference Issues/PRs Fixes #9247 Closes #9316 (supersedes) #### What does this implement/fix? Explain your changes. Add `chain_method` to `ClassifierChain`. Supports `{'predict', 'predict_proba', 'predict_log_proba', 'decision_function'}` (as suggested in https://github.com/scikit-learn/scikit-learn/pull/931...
2023-11-01T02:27:08Z
Chain on decision_function or predict_proba in ClassifierChain ClassifierChain uses the prediction from the classifier for each label as a feature for the next label's classifier. Instead of chaining on the categorical prediction it should be able to select a `method` to chain on, one of { predict, predict_proba, decis...
Hi, I would like to work on it Go ahead On Thu, Jun 29, 2017 at 11:43 AM, RAKOTOARISON Herilalaina < notifications@github.com> wrote: > Hi, I would like to work on it > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/sciki...
[ { "body": "ClassifierChain uses the prediction from the classifier for each label as a feature for the next label's classifier. Instead of chaining on the categorical prediction it should be able to select a `method` to chain on, one of { predict, predict_proba, decision_function }.", "number": 9247, "t...
e94eae47b57ce44038982de5321c4ad44b5a7bcd
{ "head_commit": "41414511514fadb95e6816546371cf4ff2edc00d", "head_commit_message": "lint", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex 204cbb9e9c890..00b0be9917961 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1.4.rst\n@@ -529,6 +529,12 @@ Changelog\n ob...
[ { "diff_hunk": "@@ -492,10 +492,14 @@ def generate_multilabel_dataset_with_correlations():\n return X, Y_multi\n \n \n-def test_classifier_chain_fit_and_predict_with_linear_svc():\n+@pytest.mark.parametrize(\"chain_method\", [\"predict\", \"decision_function\"])\n+def test_classifier_chain_fit_and_predict_w...
969d8892a6e78ae91c028374f3479d0c94a9cb86
diff --git a/doc/whats_new/v1.5.rst b/doc/whats_new/v1.5.rst index 53f0fbd8a74e8..d70c9cc2f1f23 100644 --- a/doc/whats_new/v1.5.rst +++ b/doc/whats_new/v1.5.rst @@ -158,6 +158,12 @@ Changelog - |Enhancement| :term:`CV splitters <CV splitter>` that ignores the group parameter now raises a warning when groups are pas...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-28509@e6a74da
scikit-learn/scikit-learn
Python
28,509
FEA add zero_division to matthews_corrcoef
#### Reference Issues/PRs Partially address: https://github.com/scikit-learn/scikit-learn/issues/29048 Fixes #25258 See also #19977 #### What does this implement/fix? Explain your changes. The Matthews correlation coefficient is ill-defined (due to zero division) when only one class is present in either the tr...
2024-02-22T21:10:44Z
Matthews correlation coefficient gives wrong results for single-class result ### Describe the bug for a single class input, (ie perfect correlation) MCC returns 0, when it should return 1. since MCC is a special case of pearson correlation, it should fall back to pearson when appropriate ### Steps/Code to Reproduc...
First, I thought that we could quickly fix the problem you pointed out with something like: ```python if all(y_true == y_pred): return 1 ``` But this problem is more general: MCC and Pearson Correlation (as far as I understand) are not defined if we have a constant array/variable because the standard deviation...
[ { "body": "### Describe the bug\n\nfor a single class input, (ie perfect correlation) MCC returns 0, when it should return 1.\r\n\r\nsince MCC is a special case of pearson correlation, it should fall back to pearson when appropriate\n\n### Steps/Code to Reproduce\n\nfrom sklearn.metrics import matthews_corrcoef...
087d8b7a4aeef796ce175c8c8012b4211c2a175b
{ "head_commit": "e6a74da862233370d7e77263c78d6c5e9473dcaf", "head_commit_message": "Fixed a typo", "patch_to_review": "diff --git a/sklearn/metrics/_classification.py b/sklearn/metrics/_classification.py\nindex b6d59d25696ce..a5db319cea4cb 100644\n--- a/sklearn/metrics/_classification.py\n+++ b/sklearn/metrics/_...
[ { "diff_hunk": "@@ -886,12 +886,13 @@ def test_matthews_corrcoef():\n y_true_inv2 = np.where(y_true_inv2, \"a\", \"b\")\n assert_almost_equal(matthews_corrcoef(y_true, y_true_inv2), -1)\n \n- # For the zero vector case, the corrcoef cannot be calculated and should\n- # output 0\n- assert_almost...
a8a4ca0bda212ba58c253352c94c39e8b24f00f4
diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/28509.feature.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/28509.feature.rst new file mode 100644 index 0000000000000..755d586dbce2b --- /dev/null +++ b/doc/whats_new/upcoming_changes/sklearn.metrics/28509.feature.rst @@ -0,0 +1,3 @@ +- Adds `zero_divi...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27645@cc576c2
scikit-learn/scikit-learn
Python
27,645
FIX IsolationForest accepts sparse matrix with float value contamination
closes #27626 This PR makes sure to convert to CSR the validated CSC matrix when contamination is a floating number. We still don't want to call `score_samples` because it will cost an additional validation, more expensive than the expected `X.asformat("csr")`.
2023-10-23T17:48:40Z
Isolation Forest Bug with Sparse Matrix and Contamination as Float ### Describe the bug ### Environment: ``` Python 3.11 and 3.8 Scikit-learn library 1.3.1 Isolation Forest algorithm Sparse matrix input (tested csr and csc) Contamination parameter set as a float ``` ### Bug Summary: When using the Iso...
I can reproduce. The thing is that we call `_score_samples` to avoid a second input validation. However, the first validation make sure that we have a CSC matrix while `_score_samples` expect a CSR matrix. We should therefore make the conversion before calling the private function since we still want to avoid all extra...
[ { "body": "### Describe the bug\r\n\r\n### Environment:\r\n\r\n```\r\nPython 3.11 and 3.8\r\nScikit-learn library 1.3.1\r\nIsolation Forest algorithm\r\nSparse matrix input (tested csr and csc)\r\nContamination parameter set as a float\r\n```\r\n\r\n### Bug Summary:\r\n\r\nWhen using the Isolation Forest algori...
1471fa7c5816e6340d25e67c6f9555f142bc3aea
{ "head_commit": "cc576c269a7035ed2522111bf2536319bcc3c11a", "head_commit_message": "add changelog", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex a947dfe225b04..896b018c89620 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1.4.rst\n@@ -276,6 +276,10 @@ Changel...
[ { "diff_hunk": "@@ -348,7 +348,9 @@ def fit(self, X, y=None, sample_weight=None):\n \n # Else, define offset_ wrt contamination parameter\n # To avoid performing input validation a second time we call\n- # _score_samples rather than score_samples\n+ # X to a CSR matrix while it was...
e5cb2295be942ea1eaed2321bcb155fd0eadf782
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index 2f73e0a03d68f..ccfec4c9c2bb5 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -368,6 +368,10 @@ Changelog is a predefined metric listed in :func:`metrics.get_scorer_names` and early stopping is enabled. :pr:`26163` by `Thomas Fa...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27309@87c19e2
scikit-learn/scikit-learn
Python
27,309
FIX raise an error if nan is not the last element in user provided categories
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2023-09-07T01:24:38Z
Wrong infrequent categories and error in OrdinalEncoder ### Describe the bug When I manually set the numpy object to `categories` in OrdinalEncoder, I got wrong `infrequent_categories_`. If I run `fit_transform`, then I got an error. See the code below. ### Steps/Code to Reproduce ```python import numpy as np fr...
For numerical categories, nan should be the last element if there are nans. But for other types of categories, e.g., object, do we need to add this constraint? Would you like to take a look at this? @thomasjpfan Yea, the current infrequent API assumes that nans are the last element even for object dtypes. For now, I t...
[ { "body": "### Describe the bug\n\nWhen I manually set the numpy object to `categories` in OrdinalEncoder, I got wrong `infrequent_categories_`. \r\nIf I run `fit_transform`, then I got an error. See the code below.\n\n### Steps/Code to Reproduce\n\n```python\r\nimport numpy as np\r\nfrom sklearn.preprocessing ...
a5fed0d77842a229a98655485530264c82ca59d6
{ "head_commit": "87c19e251a6cf4677a99e10f9fa45fe486fd4b11", "head_commit_message": "add an entry in changelog v1.4", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex 2a631d43ac5c2..1390ee594ceff 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1.4.rst\n@@ -450,6 +...
[ { "diff_hunk": "@@ -123,13 +123,13 @@ def _fit(\n )\n raise ValueError(msg)\n \n- last_idx = len(cats) - 1\n- for idx, category in enumerate(cats):\n- if is_scalar_nan(category) and idx != last_idx:\n+ # `nan...
8c18bcc05d7563f3d65872417c98165aa04758a5
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index 2a631d43ac5c2..ce0a2c175ea48 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -450,6 +450,11 @@ Changelog - |Enhancement| :class:`preprocessing.TargetEncoder` now supports `target_type` 'multiclass'. :pr:`26674` by :user:`Lucy Liu...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27167@75661f6
scikit-learn/scikit-learn
Python
27,167
Fix low level crash in BisectingKMeans.predict on rescaled data
Fixes #27081. I will first open this PR with the non-regression test that should hopefully make the macOS Intel CI workers segfault (for some reason, this bug seems to stay silent on other platforms)... Then I will push a fix for the underlying root cause.
2023-08-25T16:03:08Z
BisectingKMeans floating point exception fatal error on OSX ### Describe the bug Hi, thanks for this fantastic library 🚀 🎉 I believe I found a bug. In the BisectingKMeans clustering, the `predict` function cannot be used when the to-be-predicted-data is on a different numerical scale than the fitted data. Othe...
This is unexpected and is likely to be something specific to your machine being a MacOS or your environment. One thing I noticed in your versions is that you have a different OpenBLAS version from numpy and scipy. Could it be the issue, hard to tell. Could you follow the instructions from https://github.com/sciki...
[ { "body": "### Describe the bug\r\n\r\nHi, thanks for this fantastic library 🚀 🎉 \r\n\r\nI believe I found a bug. In the BisectingKMeans clustering, the `predict` function cannot be used when the to-be-predicted-data is on a different numerical scale than the fitted data. Other clustering methods like e.g., K...
d90dd114ab85b85e49facdb7b37242b7362696c8
{ "head_commit": "75661f6d2145b602e6369427abe1c6c9f3909e14", "head_commit_message": "DOC update changelog", "patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex d97ccea9469eb..05e9584028647 100644\n--- a/doc/whats_new/v1.3.rst\n+++ b/doc/whats_new/v1.3.rst\n@@ -18,6 +18,13 @@ Ch...
[ { "diff_hunk": "@@ -133,3 +133,17 @@ def test_float32_float64_equivalence(csr_container):\n \n assert_allclose(km32.cluster_centers_, km64.cluster_centers_)\n assert_array_equal(km32.labels_, km64.labels_)\n+\n+\n+def test_non_regression_segfault_on_empty_bisections():", "line": null, "original_...
a4a5abf23aed937d5f4917140a40ed1ff9ff2600
diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst index d97ccea9469eb..05e9584028647 100644 --- a/doc/whats_new/v1.3.rst +++ b/doc/whats_new/v1.3.rst @@ -18,6 +18,13 @@ Changes impacting all modules Changelog --------- +:mod:`sklearn.cluster` +...................... + +- |Fix| :class:`cluster.BisectingKM...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27454@bf88e93
scikit-learn/scikit-learn
Python
27,454
CI raise error for all kind of deprecation warnings in doc build
closes #27430 We are currently catching any deprecation warnings in the test and source code but not in our examples. This PRs intend to raise an error if there is any. Since we are using lock file, we should not have warning until and if any when updating the lock files, then we should fix them. It is expecte...
2023-09-22T21:09:37Z
Catching deprecation warnings from examples Up-to-now, we never check deprecation warnings that are raised when executing our examples. I assume that we could scrap the RST generated file to find such warning: ```python from pathlib import Path from pprint import pprint from sklearn.utils.fixes import VisibleD...
For instance this is the current output: ```shell > python warning_scraping_from_generated_examples.py /home/glemaitre/Documents/packages/scikit-learn/doc/conf.py:81: UserWarning: jupyterlite_sphinx is not installed, you need to install it if you want JupyterLite links to appear in each example ['auto_exampl...
[ { "body": "Up-to-now, we never check deprecation warnings that are raised when executing our examples.\r\nI assume that we could scrap the RST generated file to find such warning:\r\n\r\n```python\r\nfrom pathlib import Path\r\nfrom pprint import pprint\r\n\r\nfrom sklearn.utils.fixes import VisibleDeprecationW...
bd162e5548e04264589221af2dcc6162fee40863
{ "head_commit": "bf88e93fe046e32eef36880c57d246d46ca1b2e4", "head_commit_message": "[doc build][azure parallel] trigger documentation", "patch_to_review": "diff --git a/doc/conf.py b/doc/conf.py\nindex 1d4b061f9afb5..6dbbb1be670fd 100644\n--- a/doc/conf.py\n+++ b/doc/conf.py\n@@ -692,6 +692,8 @@ def setup(app):\...
[ { "diff_hunk": "@@ -700,6 +702,11 @@ def setup(app):\n \" non-GUI backend, so cannot show the figure.\"\n ),\n )\n+# Raise warning as error in example to catch warnings when building the documentation\n+# Since we are using lock files to build the documentation, we should not have any\n+# warnings o...
2e766d7e3dabcd6c8e861204feb6f8e891e8ec69
diff --git a/doc/conf.py b/doc/conf.py index 0851d243d17c8..4ef9cb61519ec 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -696,6 +696,8 @@ def setup(app): ), ) +from sklearn.utils.fixes import VisibleDeprecationWarning + warnings.filterwarnings( "ignore", category=UserWarning, @@ -704,6 +706,18 @@ def ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Test Suite / CI Enhancements" }
scikit-learn__scikit-learn-27456@8d7a266
scikit-learn/scikit-learn
Python
27,456
FEA Allow string input for pairwise distances
#### Reference Issues/PRs closes #15932 closes #17991 closes #24674 supersedes #17991 supersedes #24674 #### What does this implement/fix? Explain your changes. This allows the user to compute pairwise distance using a custom metric for non-metric data types (e.g. string or boolean). #### Any other comm...
2023-09-23T22:44:51Z
compute pairwise_distance with custom metric function for non-numeric data This is a feature request: I'm working with strings and have a custom metric function to compute similarities between the strings. I would love to use the pairwise_distance function together with this custom metric to compute the whole distance/...
Thanks for the feature request. Sounds useful indeed (though I have not studied the question in detail). See earlier related discussion in https://github.com/scikit-learn/scikit-learn/issues/3737 and https://github.com/scikit-learn/scikit-learn/issues/4208 Can I work on this request? You're welcome to work on this @ven...
[ { "body": "This is a feature request: I'm working with strings and have a custom metric function to compute similarities between the strings. I would love to use the pairwise_distance function together with this custom metric to compute the whole distance/similarity matrix for my data. However, I'm getting a `V...
f4c058ac0913895318b5b0f5001bedf54c94bd36
{ "head_commit": "8d7a266a62cf0b008e312f59ccdbf3335fad030c", "head_commit_message": "Update sklearn/metrics/tests/test_pairwise.py", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex 07f4d335058b4..43b654ef511b4 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1.4.r...
[ { "diff_hunk": "@@ -130,6 +135,14 @@ def check_pairwise_arrays(\n .. versionchanged:: 0.23\n Accepts `pd.NA` and converts it into `np.nan`.\n \n+ only_check_num_samples : bool, default=False\n+ Whether to only check the length of the array.", "line": null, "original_line": 1...
3df1d5ce9afff5ff2cf927768f6ce12bc48ddb99
diff --git a/doc/whats_new/v1.5.rst b/doc/whats_new/v1.5.rst index aad9fe591def7..65c9558b88bf2 100644 --- a/doc/whats_new/v1.5.rst +++ b/doc/whats_new/v1.5.rst @@ -218,6 +218,11 @@ Changelog :mod:`sklearn.metrics` ...................... +- |Feature| :func:`metrics.pairwise_distances` accepts calculating pairwise d...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-26931@8eb9b28
scikit-learn/scikit-learn
Python
26,931
FIX Adds more informative error message for OHE
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2023-07-29T00:48:43Z
Improve error message with pandas output and sparse data Currently, we raise an error: ``` ValueError: Pandas output does not support sparse data. ``` when a transformer does output sparse data and we try to wrap it inside a dataframe due to `set_output(transform="pandas")`. I assume that at this point, we coul...
I am +1 with adding a more informative error message for transformers with `sparse_output`. Hi @thomasjpfan , I am new to open source and would love to work on this issue with your help and guidance. @sqali You should start by going through the contribution guideline: https://scikit-learn.org/dev/developers/contribu...
[ { "body": "Currently, we raise an error:\r\n\r\n```\r\nValueError: Pandas output does not support sparse data.\r\n```\r\n\r\nwhen a transformer does output sparse data and we try to wrap it inside a dataframe due to `set_output(transform=\"pandas\")`. I assume that at this point, we could be extra nice and chec...
2b0eef892d4ee973789089ac82f24669a89a3859
{ "head_commit": "8eb9b28fe20802883d09fb21a8af8f5bb8fc4ffd", "head_commit_message": "TST Adjust comment test", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex 1f66619ae2219..1bdce6df4d6c7 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1.4.rst\n@@ -150,6 +150,13 ...
[ { "diff_hunk": "@@ -1008,6 +1009,14 @@ def transform(self, X):\n returned.\n \"\"\"\n check_is_fitted(self)\n+ transform_output = _get_output_config(\"transform\", estimator=self)[\"dense\"]\n+ if transform_output == \"pandas\" and self.sparse_output:\n+ rais...
713207f2fc7ffb4142a729be6fa31ddd93cfabe8
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index 1f66619ae2219..1bdce6df4d6c7 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -150,6 +150,13 @@ Changelog metric parameter `p` is in the range `0 < p < 1`, regardless of the `dtype` of `X`. :pr:`26760` by :user:`Shreesha Kumar B...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-28043@2c261c9
scikit-learn/scikit-learn
Python
28,043
ENH Add support for np.nan values in SplineTransformer
#### Reference Issues/PRs Closes #26793 #### What does this implement/fix? Explain your changes. Adds support for np.nan values in SplineTransformer. - adds param `handle_missing : {'error', 'zeros'}` to __init__, where `error` preserves the previous behaviour and `zeros` handles nan values by setting their spli...
2024-01-02T12:05:59Z
Handle np.nan / missing values in SplineTransformer I think it would be quite natural to add an option to `SplineTransformer` to accept inputs with missing values as follows: - `handle_missing="error"` the default (keep current behavior) - `handle_missing="zero"`/"constant": encode missing values by setting all out...
Note: we could also add `handle_missing="passthrough"` for consistency with other preprocessors that allow this. I am not sure it would be that useful though. Maybe `handle_missing="passthrough"` would be a YAGNI. I will take this issue. @lorentzenchr do you have any opinion on which options are best for this estimator...
[ { "body": "I think it would be quite natural to add an option to `SplineTransformer` to accept inputs with missing values as follows:\r\n\r\n- `handle_missing=\"error\"` the default (keep current behavior)\r\n- `handle_missing=\"zero\"`/\"constant\": encode missing values by setting all output features for that...
c92330fee2f602802446a0c3c6023f1908004d13
{ "head_commit": "2c261c939c6385da0bb08748f88c36fc2fa6ac72", "head_commit_message": "delete unused code", "patch_to_review": "diff --git a/doc/whats_new/v1.5.rst b/doc/whats_new/v1.5.rst\nindex f313d0c675ceb..26010252f7abc 100644\n--- a/doc/whats_new/v1.5.rst\n+++ b/doc/whats_new/v1.5.rst\n@@ -131,7 +131,7 @@ Cha...
[ { "diff_hunk": "@@ -642,6 +643,14 @@ class SplineTransformer(TransformerMixin, BaseEstimator):\n Order of output array in the dense case. `'F'` order is faster to compute, but\n may slow down subsequent estimators.\n \n+ handle_missing : {'error', 'zeros'}, default='error'\n+ Specifies...
08a72304bf37a11fc68875a437af176cbf1e37c0
diff --git a/doc/whats_new/upcoming_changes/sklearn.preprocessing/28043.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.preprocessing/28043.enhancement.rst new file mode 100644 index 0000000000000..8195352292539 --- /dev/null +++ b/doc/whats_new/upcoming_changes/sklearn.preprocessing/28043.enhancement.rst @@ -...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-26681@b0447ad
scikit-learn/scikit-learn
Python
26,681
MNT linter bot: tool versions and finished linting check
This fixes a few issues: - linter should fail if downloading `linting.sh` fails (hence moving `set +e`) - linter should fail if `linting.sh` failes to finish (@glemaitre noticed this in some PRs) - comment includes the version of the tool used (@lucyleeow, Fixes https://github.com/scikit-learn/scikit-learn/issues/...
2023-06-23T11:19:17Z
CI: Add black version in linter bot Great job on the linter bot @adrinjalali ! Would it be a good idea to add in the comment what the desired black (and ruff ??) versions are? I think I recall for black at least that different versions can affect formatting...
[ { "body": "Great job on the linter bot @adrinjalali !\r\n\r\nWould it be a good idea to add in the comment what the desired black (and ruff ??) versions are? I think I recall for black at least that different versions can affect formatting...", "number": 26676, "title": "CI: Add black version in linter ...
02dce942d7232e82ecfd266a613d12f4e2428ad6
{ "head_commit": "b0447ad20ab2fc0cb81a0ecbe03812bc742a694b", "head_commit_message": "MNT linter bot: tool versions and finished linting check", "patch_to_review": "diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml\nindex e4b606f36b7f8..9648f66d840d4 100644\n--- a/.github/workflows/lint.yml\n+++...
[ { "diff_hunk": "@@ -7,6 +7,26 @@\n import requests\n \n \n+def get_versions(versions_file):\n+ \"\"\"Get the versions of the packages used in the linter job.\n+\n+ Parameters\n+ ----------\n+ versions_file : str\n+ The path to the file that contains the versions of the packages.\n+\n+ Retu...
ccdb54c602dd7be58f250c56c510ad5aa2da4b42
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e4b606f36b7f8..9648f66d840d4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -34,14 +34,19 @@ jobs: source build_tools/shared.sh # Include pytest compatibility with mypy pip install py...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Test Suite / CI Enhancements" }
scikit-learn__scikit-learn-26772@fa77f00
scikit-learn/scikit-learn
Python
26,772
FIX Dataframe support in KNN.predict
Fixes https://github.com/scikit-learn/scikit-learn/issues/26768 knn.predict doesn't validate X right away because it call `kneighbors` that does validate X. The issue is that ``ArgKMin.is_usable_for`` assumes that it's a numpy array. This PR simply adds a check there. Note that it is not usable for a pandas datafra...
2023-07-05T09:35:07Z
AttributeError "Flags object has no attribute 'c_contiguous'" when using KNeighborsClassifier predict ### Describe the bug I tried to build a K-nearest neighbor model. I used the default ``weights`` parameter and called the ``predict`` method with a pandas DataFrame object and got the following error: AttributeEr...
Thanks for the report @wejaeger. A fix is proposed in #26772.
[ { "body": "### Describe the bug\r\n\r\nI tried to build a K-nearest neighbor model. I used the default ``weights`` parameter and called the ``predict`` method with a pandas DataFrame object and got the following error:\r\n\r\nAttributeError: 'Flags' object has no attribute 'c_contiguous'\r\n\r\n### Steps/Code t...
34446739dfbe5cb61d2ddccb1f4fcfaa1efd7a9b
{ "head_commit": "fa77f008c1d244f4903a54c8cb07e603bb85c6b4", "head_commit_message": "ref", "patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex e3c444b3ae9ff..a559646fcb48e 100644\n--- a/doc/whats_new/v1.3.rst\n+++ b/doc/whats_new/v1.3.rst\n@@ -2,6 +2,22 @@\n \n .. currentmodule...
[ { "diff_hunk": "@@ -96,7 +96,9 @@ def is_usable_for(cls, X, Y, metric) -> bool:\n \"\"\"\n \n def is_numpy_c_ordered(X):\n- return hasattr(X, \"flags\") and X.flags.c_contiguous\n+ if not hasattr(X, \"flags\"):", "line": null, "original_line": 99, "original_star...
61467a0885bffaafc43c3ee08f553aa3bf82d5be
diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst index 8dcb07b271985..237072fd938da 100644 --- a/doc/whats_new/v1.3.rst +++ b/doc/whats_new/v1.3.rst @@ -7,7 +7,7 @@ Version 1.3.1 ============= -**TODO: set date** +**In development** Changelog --------- @@ -15,6 +15,10 @@ Changelog :mod:`sklearn.nei...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-26597@ca3185d
scikit-learn/scikit-learn
Python
26,597
DOC FIx the formula for support_fraction in the covariance estimators
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2023-06-16T19:15:42Z
ValueError: The covariance matrix of the support data is equal to 0 - Elliptic Envelope ### Describe the bug I have been using Elliptic Envelope on a simple time series dataset with default parameters and only setting `contamination` value to `0.5`. However it throws me error like below: `ValueError: The covarian...
Thank you for reporting this. Could you please extend your "Steps/Code to Reproduce" with a (minimal) `X` that reproduces the problem? Here are the steps to reproduce it: ``` X = ([[1.04725631], [1.84803131], [1.29789207], [1.59315107], [0.79657553], [0. ], [0. ...
[ { "body": "### Describe the bug\r\n\r\nI have been using Elliptic Envelope on a simple time series dataset with default parameters and only setting `contamination` value to `0.5`. However it throws me error like below:\r\n\r\n`ValueError: The covariance matrix of the support data is equal to 0, try to increase ...
714c50092b1bfafad2b568a07d635d5db1301d58
{ "head_commit": "ca3185d7429cb1fae901468b273474cdd247dc70", "head_commit_message": "Merge branch 'main' into Doc_support_fraction", "patch_to_review": "diff --git a/sklearn/covariance/_elliptic_envelope.py b/sklearn/covariance/_elliptic_envelope.py\nindex fe109dddd5303..2bf81cd78a22a 100644\n--- a/sklearn/covari...
[ { "diff_hunk": "@@ -373,7 +373,7 @@ def fast_mcd(\n The proportion of points to be included in the support of the raw\n MCD estimate. Default is `None`, which implies that the minimum\n value of `support_fraction` will be used within the algorithm:\n- `(n_sample + n_features + 1) ...
3ab6417589290171623ddd4da75c6aa9bad8d42c
diff --git a/sklearn/covariance/_elliptic_envelope.py b/sklearn/covariance/_elliptic_envelope.py index fe109dddd5303..ed99a38c0ee56 100644 --- a/sklearn/covariance/_elliptic_envelope.py +++ b/sklearn/covariance/_elliptic_envelope.py @@ -35,7 +35,7 @@ class EllipticEnvelope(OutlierMixin, MinCovDet): support_fractio...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-26893@98f9412
scikit-learn/scikit-learn
Python
26,893
FIX `param_distribution` param of `HalvingRandomSearchCV` accepts list of dicts
#### What does this implement/fix? Explain your changes. Closes #26885 Fixed that the `param_distribution` param of `HalvingRandomSearchCV` accepts lists of dicts and updated documentation. I also tried to implement a test, using` test_random_search_cv_results` as a template, as you suggested @glemaitre , but ...
2023-07-24T23:29:37Z
HalvingRandomSearchCV does not support param_distribution as a list ### Describe the bug Before scikit-learn version 1.3.0 (e.g. 1.2.0) HalvingRandomSearchCV could be used with a `list[dict]` as the input for param_distribution (similar to RandomizedSearchCV). The type hint in the documentation states that only `d...
cc @jeremiedbb @glemaitre I can take care of it, thanks @adrinjalali. So we need to enable it and have some unit tests (since we did not break anything it seems to not be tested :)). @StefanieSenger Go ahead, happy to review the PR. The param description in the docstring should also be updated. It should be like the o...
[ { "body": "### Describe the bug\r\n\r\nBefore scikit-learn version 1.3.0 (e.g. 1.2.0) HalvingRandomSearchCV could be used with a `list[dict]` as the input for param_distribution (similar to RandomizedSearchCV). \r\nThe type hint in the documentation states that only `dict` is possible but the description talks ...
38a06e4be504f3971d109d6741b8b4c7192d7323
{ "head_commit": "98f941287e07d3be5a472ed48b1e15aff76325ef", "head_commit_message": "bug fix and cleanup in test_grid_search_cv_results and test_random_search_cv_results", "patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex 8d39ca2fed143..6ba517f4e24a9 100644\n--- a/doc/whats_n...
[ { "diff_hunk": "@@ -967,31 +963,35 @@ def test_grid_search_cv_results():\n check_cv_results_keys(cv_results, param_keys, score_keys, n_candidates)\n # Check masking\n cv_results = search.cv_results_\n- n_candidates = len(search.cv_results_[\"params\"])\n- assert all(\n+\n+ poly_results = [\...
5afd7d014d60a44ac3343c8fa5912f77f452b4bf
diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst index d486b177b0f2c..e9961ab7567a3 100644 --- a/doc/whats_new/v1.3.rst +++ b/doc/whats_new/v1.3.rst @@ -23,6 +23,10 @@ Changelog :attr:`sklearn.neighbors.KDTree.valid_metrics` as public class attributes. :pr:`26754` by :user:`Julien Jerphanion <jjerphan...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-27002@24875f8
scikit-learn/scikit-learn
Python
27,002
FIX accept multilabel-indicator in _get_response_values
closes #26817 Accept "multilabel-indicator" in `_get_response_values`.
2023-08-03T13:34:42Z
Scorer not working on ClassifierChain ### Describe the bug ClassifeirChain fails when trying to make scoring predictions. The reason is: ClassifeirChain's attribute `classes_` is a list and not a np.array as the `_get_response_values` function expects. ### Steps/Code to Reproduce ```python from sklearn.multi...
Thanks for reporting this. I can reproduce the problem. A slight complication is that `ClassifierChain.classes_` is defined as a list of the classes for each estimator in the chain. This is a bit different from what `classes_` should be IMHO. I think it makes sense to fix this and stick to the uniform interface for ...
[ { "body": "### Describe the bug\r\n\r\nClassifeirChain fails when trying to make scoring predictions. The reason is: ClassifeirChain's attribute `classes_` is a list and not a np.array as the `_get_response_values` function expects. \r\n\r\n### Steps/Code to Reproduce\r\n\r\n```python\r\nfrom sklearn.multioutpu...
0d701e8fef043b3604008868bcd94a96d1217f4b
{ "head_commit": "24875f8c779f726ad645ce33a06ddd1b04fc7bfa", "head_commit_message": "Apply suggestions from code review\n\nCo-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>", "patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex d486b177b0f2c..0a1778a3277b9 100644\n--- a/doc/...
[ { "diff_hunk": "@@ -94,10 +95,14 @@ def _get_response_values(\n \"classifier with two classes.\"\n )\n raise ValueError(err_msg)\n+ elif target_type == \"multilabel-indicator\" and isinstance(y_pred, list):\n+ y_pred = np....
8aeb8b472e573c3d3223877beca2652127faa801
diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst index 985cdc5e6411c..893502a1568a6 100644 --- a/doc/whats_new/v1.3.rst +++ b/doc/whats_new/v1.3.rst @@ -43,6 +43,13 @@ Changelog ``transform`` when ``add_indicator`` is set to ``True`` and missing values are observed during ``fit``. :pr:`26600` by :user...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-26602@b391e12
scikit-learn/scikit-learn
Python
26,602
FIX ravel prediction of `PLSRegression` when fitted on 1d `y`
#### Reference Issues/PRs Fixes: #26549. #### What does this implement/fix? Explain your changes. This implements https://github.com/scikit-learn/scikit-learn/issues/26549#issuecomment-1594874351 for `PLSRegression`. Please let me know if the alternative (https://github.com/scikit-learn/scikit-learn/issues/265...
2023-06-18T12:12:27Z
PLSRegression not working with VotingRegressor Hi, Unfortunately, PLSRegression does not work in VotingRegressor. Likely related to PLSRegression returning predictions in shape of (n_samples, 1) instead of (n_samples,) like other single-target regressors. thanks! ```python import numpy as np from sklearn.l...
`PLSRegresson `supports multi-target regression, hence the predicition is 2d-array. As a proposed solution, I suggest creating a custom subclass of `PLSRegression`, which we can call `PLS1D`. This subclass overrides the `predict `method of `PLSRegression `to ensure it returns a 1-dimensional array, making it compati...
[ { "body": "Hi, \r\n\r\nUnfortunately, PLSRegression does not work in VotingRegressor. Likely related to PLSRegression returning predictions in shape of (n_samples, 1) instead of (n_samples,) like other single-target regressors. \r\n\r\nthanks!\r\n\r\n```python\r\nimport numpy as np\r\nfrom sklearn.linear_model ...
04860335c82d557e663b4cfa218663d1c7bf65fd
{ "head_commit": "b391e126889f52b024a8379caabb7d6a8bfd36a0", "head_commit_message": "changelof entry updated", "patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex 7bdbe7841f0d4..cdcde6561ff30 100644\n--- a/doc/whats_new/v1.3.rst\n+++ b/doc/whats_new/v1.3.rst\n@@ -276,6 +276,13 ...
[ { "diff_hunk": "@@ -276,6 +276,13 @@ Changelog\n :func:`covariance.graphical_lasso_path`, and :class:`covariance.GraphicalLassoCV`.\n :pr:`26033` by :user:`Genesis Valencia <genvalen>`.\n \n+:mod:`sklearn.cross_decomposition`\n+..................................\n+\n+- |Enhancement| :class:`cross_decomposit...
53d4907836402206b61e8c9ae254c940599d4e02
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index e058419c81ca8..0ce08c6eea751 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -66,6 +66,13 @@ Changelog - |Enhancement| :func:`base.clone` now supports `dict` as input and creates a copy. :pr:`26786` by `Adrin Jalali`_. +:mod:`s...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-26281@3b4c8a2
scikit-learn/scikit-learn
Python
26,281
Include informative error message when checking classification target is of a non-regression type
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2023-04-25T10:04:11Z
Unhelpful error message when running a classifier on a regression outcome ### Describe the bug When running a classifier on a regression outcome, we get a really unhelpful error message: ### Steps/Code to Reproduce ```python In [2]: from sklearn import linear_model, datasets In [3]: X, y = datasets.make_regres...
I will take this up and open a PR ASAP.
[ { "body": "### Describe the bug\n\nWhen running a classifier on a regression outcome, we get a really unhelpful error message:\r\n\n\n### Steps/Code to Reproduce\n\n```python\r\nIn [2]: from sklearn import linear_model, datasets\r\n\r\nIn [3]: X, y = datasets.make_regression()\r\n\r\nIn [4]: model = linear_mode...
ae78c25b00e0c5b76468c28724c7a1f3e710483e
{ "head_commit": "3b4c8a29eb63304dff53a849ce0b7d74615305b4", "head_commit_message": "Include informative error message", "patch_to_review": "diff --git a/sklearn/utils/multiclass.py b/sklearn/utils/multiclass.py\nindex 02725f8986948..6b05c750d8331 100644\n--- a/sklearn/utils/multiclass.py\n+++ b/sklearn/utils/mul...
[ { "diff_hunk": "@@ -215,7 +215,11 @@ def check_classification_targets(y):\n \"multilabel-indicator\",\n \"multilabel-sequences\",\n ]:\n- raise ValueError(\"Unknown label type: %r\" % y_type)\n+ raise ValueError(\n+ \"Unknown label type: %r\"\n+ \"Maybe yo...
8bf4c481fc32ea1c132ed586d84e837870697d61
diff --git a/sklearn/utils/multiclass.py b/sklearn/utils/multiclass.py index 02725f8986948..24e528d10a0a2 100644 --- a/sklearn/utils/multiclass.py +++ b/sklearn/utils/multiclass.py @@ -215,7 +215,11 @@ def check_classification_targets(y): "multilabel-indicator", "multilabel-sequences", ]: - ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-26840@8f36235
scikit-learn/scikit-learn
Python
26,840
ENH/DEPR add new response_method and deprecate needs_* in make_scorer
closes #26817 While working in https://github.com/scikit-learn/scikit-learn/pull/26120, I find myself doing dirty tricks to overwrite the response method used in `_ThresholdScorer` while we should be able to pass a list of priorities and delegate to `_get_response_values`. I introduce `response_method` in `make_s...
2023-07-15T11:39:59Z
Scorer not working on ClassifierChain ### Describe the bug ClassifeirChain fails when trying to make scoring predictions. The reason is: ClassifeirChain's attribute `classes_` is a list and not a np.array as the `_get_response_values` function expects. ### Steps/Code to Reproduce ```python from sklearn.multi...
Thanks for reporting this. I can reproduce the problem. A slight complication is that `ClassifierChain.classes_` is defined as a list of the classes for each estimator in the chain. This is a bit different from what `classes_` should be IMHO. I think it makes sense to fix this and stick to the uniform interface for ...
[ { "body": "### Describe the bug\r\n\r\nClassifeirChain fails when trying to make scoring predictions. The reason is: ClassifeirChain's attribute `classes_` is a list and not a np.array as the `_get_response_values` function expects. \r\n\r\n### Steps/Code to Reproduce\r\n\r\n```python\r\nfrom sklearn.multioutpu...
d91e1a5c4622ad6ed64c37b4236a2538ff8f09bd
{ "head_commit": "8f36235db896e210e94b1b209e9820f99277741a", "head_commit_message": "TST add mulitlabel test", "patch_to_review": "diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst\nindex c2b7d19404af9..478fc8a1f1c2a 100644\n--- a/doc/whats_new/v1.4.rst\n+++ b/doc/whats_new/v1.4.rst\n@@ -111,6 +111,17 ...
[ { "diff_hunk": "@@ -452,20 +469,15 @@ def _score(self, method_caller, clf, X, y, **kwargs):\n raise ValueError(\"{0} format is not supported\".format(y_type))\n \n if is_regressor(clf):\n- y_pred = method_caller(clf, \"predict\", X)\n+ response_method = self._response_m...
b80e944082b7562b508d0fdf7164e83db934d994
diff --git a/doc/modules/model_evaluation.rst b/doc/modules/model_evaluation.rst index 2ebb7dff7810b..a88a92604767e 100644 --- a/doc/modules/model_evaluation.rst +++ b/doc/modules/model_evaluation.rst @@ -181,9 +181,15 @@ take several parameters: of the python function is negated by the scorer object, conforming to ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-26337@9d8ef58
scikit-learn/scikit-learn
Python
26,337
FIX KernelPCA inverse transform when gamma is not given
#### Reference Issues/PRs Fixes #26280. #### What does this implement/fix? Explain your changes. Quote @jeremiedbb: > Originally when `gamma` is `None`, its set to `1 / n_features` each time the kernel is called, not once at the beginning of fit. It means that when the kernel is called at `inverse_transform`,...
2023-05-05T20:12:00Z
KernelPCA inverse transform behaves unexpectly. ### Describe the bug Hi! we wanted to use inverse transform in kernel PCA. There is a parameter gamma, which is defined as 1/num_features if gamma=None. However if gamma is provided as gamma=1/num_features, the resultant inverse transform results is different. Why is th...
From what I recall and what the documentation says, the `inverse_transform` is a learnt approximation: https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.KernelPCA.html#sklearn.decomposition.KernelPCA.inverse_transform It is not surprising to not recover the original data. > It is not surprising...
[ { "body": "### Describe the bug\n\nHi!\r\nwe wanted to use inverse transform in kernel PCA. There is a parameter gamma, which is defined as 1/num_features if gamma=None. However if gamma is provided as gamma=1/num_features, the resultant inverse transform results is different. Why is that? How the parameter gam...
ea046f024694b9a558c882b8c2610c52dad95e29
{ "head_commit": "9d8ef580ff3de1f695de6451bbceac7adca67e78", "head_commit_message": "changelog added", "patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex 5965cd90c1b89..903a70c9367d9 100644\n--- a/doc/whats_new/v1.3.rst\n+++ b/doc/whats_new/v1.3.rst\n@@ -230,6 +230,11 @@ Chang...
[ { "diff_hunk": "@@ -523,3 +523,28 @@ def test_kernel_pca_feature_names_out():\n \n names = kpca.get_feature_names_out()\n assert_array_equal([f\"kernelpca{i}\" for i in range(2)], names)\n+\n+\n+def test_kernel_pca_inverse_correct_gamma():\n+ \"\"\"Check that gamma is set correctly when not provided....
676725e6e0de8c757a6467d774d25b6f79f60716
diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst index 9cab0db995c5d..b319d5096ca8c 100644 --- a/doc/whats_new/v1.3.rst +++ b/doc/whats_new/v1.3.rst @@ -43,6 +43,14 @@ random sampling procedures. :user:`Jérémie du Boisberranger <jeremiedbb>`, :user:`Guillaume Lemaitre <glemaitre>`. +- |Fix| :class:`...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-26289@cb58a4e
scikit-learn/scikit-learn
Python
26,289
FIX `export_text` and `export_graphviz` accepts feature and class names as array-like
#### Reference Issues/PRs Fixes #26265. #### What does this implement/fix? Explain your changes. Make `tree.export_text` accept both feature names and class names as numpy arrays. Before modification, both `tree.export_graphviz` and `tree.export_text` accept can deal with class names which are numpy arrays, bu...
2023-04-27T13:39:27Z
sklearn.tree.export_text failing when feature_names supplied folks, I'm not sure why this works for ```py import sklearn.tree print(my_feature_names) ['0' '0 trump' '0 trump versus' ... 'zur' 'zur ckhalten' 'zur ckhalten muss'] tree.export_graphviz(clf, out_file=None, max_depth=4, feature_names=my_feature_names)...
Could you please post a minimal reproducible? (something we can copy paste in its entirety to produce the issue). @NickKanellos From the error message, it seems that the feature names you passed in is an array, but as [documented](https://scikit-learn.org/stable/modules/generated/sklearn.tree.export_graphviz.html), `fe...
[ { "body": "folks, I'm not sure why this works for\r\n```py\r\nimport sklearn.tree\r\nprint(my_feature_names)\r\n['0' '0 trump' '0 trump versus' ... 'zur' 'zur ckhalten' 'zur ckhalten muss']\r\n\r\ntree.export_graphviz(clf, out_file=None, max_depth=4, feature_names=my_feature_names)\r\n```\r\nbut not for \r\n\r\...
8521819eecbacb93deb87fce28842680ab1a5301
{ "head_commit": "cb58a4e46387500eaadc12400c6625f9f93c5ae4", "head_commit_message": "added changelog", "patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex bb245aa466152..6a50d0cb00d1a 100644\n--- a/doc/whats_new/v1.3.rst\n+++ b/doc/whats_new/v1.3.rst\n@@ -491,6 +491,10 @@ Chang...
[ { "diff_hunk": "@@ -953,16 +953,16 @@ def export_text(\n It can be an instance of\n DecisionTreeClassifier or DecisionTreeRegressor.\n \n- feature_names : list of str, default=None\n- A list of length n_features containing the feature names.\n+ feature_names : array-like of shape (n...
d1cb4a4b19c292d0d4569c56e8265230537d3099
diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst index 5965cd90c1b89..5a3e1a6d6d82d 100644 --- a/doc/whats_new/v1.3.rst +++ b/doc/whats_new/v1.3.rst @@ -514,6 +514,10 @@ Changelog for each target class in ascending numerical order. :pr:`25387` by :user:`William M <Akbeeh>` and :user:`crispinlogan <cri...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-26410@4e81d2a
scikit-learn/scikit-learn
Python
26,410
FIX `KNeighborsClassifier` raise when all neighbors of some sample have zero weights
#### Reference Issues/PRs Fixes #25854. #### What does this implement/fix? Explain your changes. Raises a `ValueError` when the weights for all neighbors of some sample are zero. Previous behavior: `predict` predicts the first class, `predict_proba` returns all zero probability.
2023-05-21T07:30:24Z
`KNeighborsClassifier` with Default Label ### Describe the workflow you want to enable In `KNeighborsClassifier`, for a user-provided callable `weights` parameter, it would be nice to allow for a situation with no winner. Say I want to give a weight of `0.0` to samples that are "too far away". Then, there can be a sit...
I agree that the current behavior is problematic. But adding a new public parameter for such an edge case sounds too much. So my suggestion would be to: - do a PR to raise an informative error when this case happens (am not sure about the type of exception though) so that they can change there `weights` callable to...
[ { "body": "### Describe the workflow you want to enable\n\nIn `KNeighborsClassifier`, for a user-provided callable `weights` parameter, it would be nice to allow for a situation with no winner. Say I want to give a weight of `0.0` to samples that are \"too far away\". Then, there can be a situation in which *al...
93e199d517aca98c0eeb222ebfaa2ac99b368e0a
{ "head_commit": "4e81d2a41c7bc0d70fa877657a1c535a82edebb4", "head_commit_message": "add any_zero_row to api (is this necessary?)", "patch_to_review": "diff --git a/doc/developers/utilities.rst b/doc/developers/utilities.rst\nindex 2525b2b1365ed..f5f2bf048328a 100644\n--- a/doc/developers/utilities.rst\n+++ b/doc...
[ { "diff_hunk": "@@ -24,6 +24,25 @@ def min_pos(const floating[:] X):\n return min_val\n \n \n+def any_zero_row(floating[:, :] X):", "line": null, "original_line": 27, "original_start_line": null, "path": "sklearn/utils/arrayfuncs.pyx", "start_line": null, "text": "@user1:\nI would ma...
2fee151b16641062089a041f1985798ea14f740c
diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst index c0261a51384c6..ba0facf7cdd13 100644 --- a/doc/whats_new/v1.4.rst +++ b/doc/whats_new/v1.4.rst @@ -19,6 +19,15 @@ Changelog is read-only, e.g., a `numpy.memmap` instance. :pr:`28111` by :user:`Yao Xiao <Charlie-XIAO>`. +:mod:`sklearn.neighbors` +...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-26286@43e493b
scikit-learn/scikit-learn
Python
26,286
FIX Improve ColumnTransformer error when indexes are different
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2023-04-26T15:16:44Z
confusing fit failure when using set_config(transform_output="pandas") ### Describe the bug Using `set_config(transform_output="pandas")` in combination with `ColumnTransformer` may result in a failed fit, since indices do not align as expected. The error will not be especially helpful: "ValueError: Found input variab...
> doesn't work with ColumnTransformer if other transformers maintain aligned indices Could you please provide a reproducer snippet that triggers the problem with `ColumnTransformer` and include the full traceback? I assume the problem is related to the use of non-positional indices in the dataframe but it would b...
[ { "body": "### Describe the bug\n\nUsing `set_config(transform_output=\"pandas\")` in combination with `ColumnTransformer` may result in a failed fit, since indices do not align as expected. The error will not be especially helpful: \"ValueError: Found input variables with inconsistent numbers of samples: [705,...
e5c65906ee7fdab81c2950fab0fe4d04ed7ad522
{ "head_commit": "43e493b60276278038d5fee9e2f39d3cba4f32ac", "head_commit_message": "Apply suggestions from code review\n\nCo-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>", "patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex bb245aa466152..739ced82f9ec9 100644\n---...
[ { "diff_hunk": "@@ -2157,3 +2157,31 @@ def test_empty_selection_pandas_output(empty_selection):\n ct.set_params(verbose_feature_names_out=False)\n X_out = ct.fit_transform(X)\n assert_array_equal(X_out.columns, [\"a\", \"b\"])\n+\n+\n+def test_raise_error_if_index_not_aligned():\n+ \"\"\"Check co...
ce041612d3993d727b7cb383053a5f4dd5ee828a
diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst index b55e5e7578155..a9a2e8d2d3b56 100644 --- a/doc/whats_new/v1.3.rst +++ b/doc/whats_new/v1.3.rst @@ -228,6 +228,13 @@ Changelog :pr:`26385` by :user:`Meekail Zain <micky774>` +:mod:`sklearn.compose` +...................... + +- |Fix| `compose.Column...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-26093@608e226
scikit-learn/scikit-learn
Python
26,093
API Accept 'auto' option for 'dual' parameter in LinearSVC and LinearSVR
Fixes #24651 closes #24731 <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at cd87daa</samp> Set `dual` to "auto" for `LinearSVC` and `LinearSVR` in some tests to avoid future warnings. This is a temporary fix for compatibility with the upcoming version of scikit-learn.
2023-04-05T10:18:14Z
Default value for solving an SVM in primal and dual should be determined automatically ### Describe the workflow you want to enable Currently the default value for LinearSVC and LinearSVR with regards to solving the problem in dual is True. This means that for users that are unfamiliar with support-vector machines a...
@agramfort I don't know enough about the potential side-effect of solving the SVM problem in the primal. Would having an `"auto"` option indeed be better to switch automatically from dual to primal depending on the shape of `X`? indeed. Dual should be faster when n_samples < n_features. This would deserve a tiny benchm...
[ { "body": "### Describe the workflow you want to enable\r\n\r\nCurrently the default value for LinearSVC and LinearSVR with regards to solving the problem in dual is True. This means that for users that are unfamiliar with support-vector machines and do not know the importance of this parameter they could be us...
86541f2b3bc8a96264e265cb810cf79858544340
{ "head_commit": "608e226353effbb93440dc4cca2c8334e10ecb0b", "head_commit_message": "lint", "patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex e47c74a54edd6..480ec9e740031 100644\n--- a/doc/whats_new/v1.3.rst\n+++ b/doc/whats_new/v1.3.rst\n@@ -443,6 +443,12 @@ Changelog\n Th...
[ { "diff_hunk": "@@ -1,14 +1,35 @@\n from numbers import Integral, Real\n+import warnings\n \n import numpy as np\n \n-from ._base import _fit_liblinear, BaseSVC, BaseLibSVM\n+from ._base import _fit_liblinear, _get_liblinear_solver_type, BaseSVC, BaseLibSVM\n from ..base import BaseEstimator, RegressorMixin, Ou...
290b254fb331b6ddb168effb54b3470681247a66
diff --git a/benchmarks/bench_mnist.py b/benchmarks/bench_mnist.py index 821fe303e8bf7..4bc28ea1a165d 100644 --- a/benchmarks/bench_mnist.py +++ b/benchmarks/bench_mnist.py @@ -86,10 +86,10 @@ def load_data(dtype=np.float32, order="F"): "ExtraTrees": ExtraTreesClassifier(), "RandomForest": RandomForestClassif...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-25940@518d878
scikit-learn/scikit-learn
Python
25,940
TST fix unstable test_newrand_set_seed
Fixes #25937. This test would not break on the CI because the ordering is fixed. On my laptop where pytest run tests in non-deterministic order for some reason, this would fail randomly.
2023-03-22T10:59:22Z
Unstable sklearn/svm/tests/test_bounds.py::test_newrand_set_seed On my local laptop I often observe a random failure for `test_newrand_set_seed`. I am running macos m1 with Python 3.11 from conda-forge. scikit-learn has been built with the clang compilers from conda-forge. Here is a typical run with 10 repetition...
I think I understand the problem: the first time the rng is used the result is 81, but then its state is mutated so the outcome is different. On my laptop, the ordering of the pytest test in my Python 3.11 environment is not deterministic, so I trigger this often but not on the CI. Let me do a PR to remove this t...
[ { "body": "On my local laptop I often observe a random failure for `test_newrand_set_seed`.\r\n\r\nI am running macos m1 with Python 3.11 from conda-forge. scikit-learn has been built with the clang compilers from conda-forge.\r\n\r\nHere is a typical run with 10 repetitions using `pytest-repeat`:\r\n\r\n<detai...
c64e88d69ec13ec8a9b4e91b5eb97a5ea18b9306
{ "head_commit": "518d878e8fd5402404e7a35ae5cea97e011c255e", "head_commit_message": "TST fix unstable test_newrand_set_seed", "patch_to_review": "diff --git a/sklearn/svm/tests/test_bounds.py b/sklearn/svm/tests/test_bounds.py\nindex 23d6be2f44e98..090959a5d1a83 100644\n--- a/sklearn/svm/tests/test_bounds.py\n+++...
[ { "diff_hunk": "@@ -72,13 +72,30 @@ def test_ill_posed_min_c():\n _MAX_UNSIGNED_INT = 4294967295\n \n \n-@pytest.mark.parametrize(\"seed, val\", [(None, 81), (0, 54), (_MAX_UNSIGNED_INT, 9)])\n-def test_newrand_set_seed(seed, val):\n+def test_newrand_default():\n+ \"\"\"Test that bounded_rand_int_wrap withou...
b7fdb4b594e596c152dbe1e7bba612ee1f76de09
diff --git a/sklearn/svm/tests/test_bounds.py b/sklearn/svm/tests/test_bounds.py index 23d6be2f44e98..d51865717e2fa 100644 --- a/sklearn/svm/tests/test_bounds.py +++ b/sklearn/svm/tests/test_bounds.py @@ -72,13 +72,24 @@ def test_ill_posed_min_c(): _MAX_UNSIGNED_INT = 4294967295 -@pytest.mark.parametrize("seed, va...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Test Suite / CI Enhancements" }
scikit-learn__scikit-learn-25900@427fcce
scikit-learn/scikit-learn
Python
25,900
DOC note on calibration impact on ranking
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2023-03-18T12:59:23Z
Isotonic calibration changes rank-based test metrics values [As discussed with @ogrisel] #### Describe the bug Using isotonic calibration changes metrics values. This is because it is a non-strictly monotonic calibration. Sigmoid calibration being strictly monotonic doesn't suffer from this. #### Steps/Code to R...
Thank you very much @dsleo for the detailed report. I started from your code and pushed the analysis further. If one introspect the calibrator, on can observe the following: ```python y_pred_calib = isotonic.predict_proba(X_test) print(roc_auc_score(y_test, y_pred_calib[:, 1])) calibrator = isotonic.calibr...
[ { "body": "[As discussed with @ogrisel]\r\n\r\n#### Describe the bug\r\nUsing isotonic calibration changes metrics values. This is because it is a non-strictly monotonic calibration. Sigmoid calibration being strictly monotonic doesn't suffer from this.\r\n\r\n#### Steps/Code to Reproduce\r\nHere is quick examp...
e3e880f9a749df95727a9c3102feb755387d33bb
{ "head_commit": "427fcce7b55d1d1fffeaa0595d08c15d071316b7", "head_commit_message": "DOC fix doi", "patch_to_review": "diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst\nindex 9a3efd3d2c8db..a0680ed87887e 100644\n--- a/doc/developers/contributing.rst\n+++ b/doc/developers/contributing...
[ { "diff_hunk": "@@ -736,7 +736,7 @@ To also generate the example gallery you can use:\n \n .. prompt:: bash $\n \n- make html\n+ make doc", "line": null, "original_line": 739, "original_start_line": null, "path": "doc/developers/contributing.rst", "start_line": null, "text": "@user...
f87a5db519b502a383cae3bc24fe23062cbde44f
diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst index 9a3efd3d2c8db..8ff924fa04a9f 100644 --- a/doc/developers/contributing.rst +++ b/doc/developers/contributing.rst @@ -714,7 +714,7 @@ Building the documentation requires installing some additional packages: pip install sphinx sphi...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }