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
scikit-learn__scikit-learn-17357@0a418f6
scikit-learn/scikit-learn
Python
17,357
BUG Fixes stacker compatibility with estimators without n_features_in_
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2020-05-26T15:20:13Z
n_features_in_ in StackingRegressor In updating to version _0.23.1_, the behavior of ```StackingRegressor``` changed with the **n_features_in_** attribute in line 149 of ```_stacking.py```. Namely, ```self.estimators_[0].n_features_in_``` requires the first estimator to have this attribute, i.e., it currently precludes...
[ { "body": "In updating to version _0.23.1_, the behavior of ```StackingRegressor``` changed with the **n_features_in_** attribute in line 149 of ```_stacking.py```. Namely, ```self.estimators_[0].n_features_in_``` requires the first estimator to have this attribute, i.e., it currently precludes an estimator suc...
1e08459c742537517bb8fc4c9d4621b9d6d227bf
{ "head_commit": "0a418f65e13072d8355a6d784822636dbe31810a", "head_commit_message": "TST Adds more tests", "patch_to_review": "diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst\nindex b089b4d5a1d78..e3a945d811e8e 100644\n--- a/doc/whats_new/v0.23.rst\n+++ b/doc/whats_new/v0.23.rst\n@@ -2,6 +2,21 @@\n...
[ { "diff_hunk": "@@ -491,3 +493,24 @@ def test_stacking_cv_influence(stacker, X, y):\n with pytest.raises(AssertionError, match='Not equal'):\n assert_allclose(stacker_cv_3.final_estimator_.coef_,\n stacker_cv_5.final_estimator_.coef_)\n+\n+\n+@pytest.mark.parametrize(\"make_d...
1b874fc17a4a48f99eab4c636bf108ddda8a7d1a
diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst index e3bce16e96ae2..2c33a665bbf06 100644 --- a/doc/whats_new/v0.23.rst +++ b/doc/whats_new/v0.23.rst @@ -2,6 +2,21 @@ .. currentmodule:: sklearn +.. _changes_0_23_2: + +Version 0.23.2 +============== + +Changelog +--------- + +:mod:`sklearn.ensemble` ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-17414@ff3349b
scikit-learn/scikit-learn
Python
17,414
ENH: Add regularization to the main NMF 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2020-06-01T19:36:33Z
non_negative_factorization's 'regularize' parameter is lost in the OO interface #### Description The function 'non_negative_factorization' in decomposition/nmf.py has a nice parameter 'regularization' where the regularization can be specified towards one of the product factors. There is however no way to access this f...
Can I pick this up? From what I see in the code it seems like a reasonable fix; but I may be wrong. @konqr you can give it a shot, and I guess we'll see in the PR if it's reasonable to use those different options. Please bare in mind that you'll need to add some tests as well. It's interesting that currently only `r...
[ { "body": "#### Description\r\nThe function 'non_negative_factorization' in decomposition/nmf.py has a nice parameter 'regularization' where the regularization can be specified towards one of the product factors. There is however no way to access this feature when using an NMF object. Could be solved easily by ...
b2a7d3646d406b50dd46bab0cc685971601a3de3
{ "head_commit": "ff3349b964d563383ac5196b08e185617b3e2579", "head_commit_message": "ENH: Add regularization to the main NMF class", "patch_to_review": "diff --git a/doc/modules/decomposition.rst b/doc/modules/decomposition.rst\nindex def755f42b796..330dc59c759ed 100644\n--- a/doc/modules/decomposition.rst\n+++ b...
[ { "diff_hunk": "@@ -1163,6 +1163,12 @@ class NMF(TransformerMixin, BaseEstimator):\n max_iter : integer, default: 200\n Maximum number of iterations before timing out.\n \n+ regularization : 'both' | 'components' | 'transformation' | None", "line": null, "original_line": 1166, "origin...
3b299be1c322edf9256580e35d2246b8fe0d77b1
diff --git a/doc/modules/decomposition.rst b/doc/modules/decomposition.rst index 6d441004f8ae6..7e8e79d9d8bdd 100644 --- a/doc/modules/decomposition.rst +++ b/doc/modules/decomposition.rst @@ -759,9 +759,9 @@ and the regularized objective function is: + \frac{\alpha(1-\rho)}{2} ||W||_{\mathrm{Fro}} ^ 2 + \fra...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
sqlfluff__sqlfluff-652@b48dd0a
sqlfluff/sqlfluff
Python
652
Fix issue 646: Rule L036 misbehaves when there's trailing whitespace after "SELECT"
Addresses #646
2020-12-30T22:45:52Z
L036 includes whitespace as a select target which should be on a new line In the sql ``` combined as ( select renamed.*, coalesce(academic_years.is_currently_active, false) as is_current_academic_year from renamed left outer join academic_years using (academic_year_id) ) ``` , th...
[ { "body": "In the sql \r\n```\r\ncombined as (\r\n select \r\n renamed.*,\r\n coalesce(academic_years.is_currently_active, false) as is_current_academic_year\r\n from renamed\r\n left outer join academic_years using (academic_year_id)\r\n)\r\n```\r\n, there is a space after `select`. This...
ce673c5c7731c3c7e0fff76f77d49bc8e362d7f2
{ "head_commit": "b48dd0a6d8da5c0d5e1d7b413ed0fd193bee2518", "head_commit_message": "Fix issue 646: Rule L036 misbehaves when there's trailing whitespace after \"SELECT\"", "patch_to_review": "diff --git a/src/sqlfluff/core/rules/std.py b/src/sqlfluff/core/rules/std.py\nindex c4dd1f36e26..6d4d01e02a0 100644\n--- ...
[ { "diff_hunk": "@@ -3462,11 +3462,14 @@ def _get_indexes(segment):\n cnt_select_targets += 1\n if first_select_target_idx == -1:\n first_select_target_idx = fname_idx\n- if seg.is_type(\"keyword\") and seg.name == \"SELECT\" and select_idx - 1:\n+ ...
d79dd21aa313101822418a4ebbdaf6bc6e9ca4d1
diff --git a/src/sqlfluff/core/rules/std.py b/src/sqlfluff/core/rules/std.py index c4dd1f36e26..040c869d699 100644 --- a/src/sqlfluff/core/rules/std.py +++ b/src/sqlfluff/core/rules/std.py @@ -3462,11 +3462,18 @@ def _get_indexes(segment): cnt_select_targets += 1 if first_select_target...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Style, Linting, Formatting Fixes" }
scikit-learn__scikit-learn-17193@a6e647a
scikit-learn/scikit-learn
Python
17,193
ENH Add option to scale output to unit var in RobustScaler
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs Follows from PR #10140 closes #10139 #### What does this implement/fi...
2020-05-12T16:22:56Z
Feature Request: Gaussian adjust option in RobustScaler It would be nice if sklearn.preprocessing.RobustScaler transformed data to a standard Gaussian when the input data was a Gaussian distribution. Currently, with the default arguments of quantile_range=(25.0, 75.0), if Gaussian data is passed to RobustScaler, then ...
Can't you just specify a different quantile_range? On 15 November 2017 at 04:08, rdturnermtl <notifications@github.com> wrote: > It would be nice if sklearn.preprocessing.RobustScaler transformed data > to a standard Gaussian when the input data was a Gaussian distribution. > Currently, with the default arguments of ...
[ { "body": "It would be nice if sklearn.preprocessing.RobustScaler transformed data to a standard Gaussian when the input data was a Gaussian distribution. Currently, with the default arguments of quantile_range=(25.0, 75.0), if Gaussian data is passed to RobustScaler, then the transformed data has:\r\nmean ~= ...
6c3e17989a7d80c34f124365f2c436a3fdcb1497
{ "head_commit": "a6e647a6b5a86c4f8839f410e4d2ae66a7dceae4", "head_commit_message": "add whats new", "patch_to_review": "diff --git a/doc/whats_new/v0.24.rst b/doc/whats_new/v0.24.rst\nindex 8661f8138f003..e949cff3d3316 100644\n--- a/doc/whats_new/v0.24.rst\n+++ b/doc/whats_new/v0.24.rst\n@@ -65,6 +65,14 @@ Chang...
[ { "diff_hunk": "@@ -1321,6 +1333,10 @@ def robust_scale(X, *, axis=0, with_centering=True, with_scaling=True,\n \n .. versionadded:: 0.18\n \n+ unit_variance : boolean, False by default\n+ If True, scale data so that normally distributed features have a\n+ variance of 1.\n+", "line"...
a1303931572697cbb6b9c45559731792efda65f5
diff --git a/doc/whats_new/v0.24.rst b/doc/whats_new/v0.24.rst index 463d66172d53c..848b415890452 100644 --- a/doc/whats_new/v0.24.rst +++ b/doc/whats_new/v0.24.rst @@ -91,6 +91,14 @@ Changelog :class:`metrics.median_absolute_error`. :pr:`17225` by :user:`Lucy Liu <lucyleeow>`. +:mod:`sklearn.preprocessing` +.....
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sqlfluff__sqlfluff-577@46496f2
sqlfluff/sqlfluff
Python
577
Add rule L035 with fix, 'redundant ELSE NULL in CASE WHEN'
2020-11-22T18:01:38Z
Redundant ELSE NULL in CASE WHEN Came across ```sql select id, case when category = x and category_b = a then x_name when category_c = y then y_name when category_d = z then z_name else null end as name from table_a ``` "else NULL" is redundant
[ { "body": "Came across\r\n\r\n```sql\r\nselect\r\n id,\r\n case\r\n when category = x and category_b = a then x_name\r\n when category_c = y then y_name\r\n when category_d = z then z_name\r\n else null\r\n end as name\r\nfrom table_a\r\n```\r\n\r\n\"else NULL\" is redundant...
e2d9cce92c88f3110f0a0e7a69c4c997d9cc4417
{ "head_commit": "46496f20bc323b362608361d2879ad4627abb52c", "head_commit_message": "Remove dbt_utils added by mistake", "patch_to_review": "diff --git a/src/sqlfluff/core/errors.py b/src/sqlfluff/core/errors.py\nindex 75e17428120..7625d047f95 100644\n--- a/src/sqlfluff/core/errors.py\n+++ b/src/sqlfluff/core/err...
[ { "diff_hunk": "@@ -18,7 +18,7 @@ deps =\n # tox -e py35 -- project/tests/test_file.py::TestClassName::test_method\r\n commands =\r\n python util.py clean-tests\r\n- pytest -vv --cov {posargs}\r\n+ pytest -vv -rs --cov=\"\" {posargs}\r", "line": null, "original_line": 21, "original_start_l...
dee1680cc5e05f4cc9f17ecfec7ba06469d3d573
diff --git a/src/sqlfluff/core/errors.py b/src/sqlfluff/core/errors.py index 269dfd9e165..b907d1e3d59 100644 --- a/src/sqlfluff/core/errors.py +++ b/src/sqlfluff/core/errors.py @@ -221,6 +221,8 @@ def check_tuple(self) -> CheckTuple: ) def __repr__(self): - return "<SQLLintError: rule {0} pos:...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Code Refactoring / Architectural Improvement" }
sqlfluff__sqlfluff-541@c5a16c3
sqlfluff/sqlfluff
Python
541
Source Mapping
This needs a few more test cases, but is otherwise ready for review. I'll add test cases before merging. This is also another **BIT OF A MONSTER PR**. Sorry that this will be quite hard to review, but it's quite a deep reaching change in how templating and fixing is done. This fixes #273 and relates to #368. I...
2020-11-09T20:25:30Z
References to linting errors are in the position in the templated file, not in the reference to the raw file. For example if we have a file such as: ``` select {% for elem in ('a', 'b', 'c' , 'd') %} {{elem}} as col_{{elem}}, {% endfor %} some_other_col from my_table AS foo ``` And lint for...
Update: Conversation on the pallets projects discord: > @amshank In having a similar requirement myself, but for debugging, I ended up having to write my own template engine. :confused: https://stackoverflow.com/a/54678540/211827 is a question I asked long ago about how to efficiently package the line associatio...
[ { "body": "For example if we have a file such as:\r\n\r\n```\r\nselect\r\n {% for elem in ('a', 'b', 'c' , 'd') %}\r\n {{elem}} as col_{{elem}},\r\n {% endfor %}\r\n some_other_col\r\nfrom my_table AS foo\r\n```\r\n\r\nAnd lint for something that will happen late in the file:\r\n\r\n```\r\n$ sqlfluf...
a5665e0d82dc3d8177fbf4a589623976cb1288be
{ "head_commit": "c5a16c3e8fce9064d69141acb3b608bfc883f3a7", "head_commit_message": "Add TemplatedFile", "patch_to_review": "diff --git a/setup.py b/setup.py\nindex 33b5b6625e3..dee6140cde5 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -63,6 +63,7 @@ def read(*names, **kwargs):\n \"sqlfluff.core.parser.segme...
[ { "diff_hunk": "@@ -36,6 +36,35 @@ class RawTemplateInterface(BaseSegment):\n return cls\r\n \r\n \r\n+class TemplatedFile:\r\n+ \"\"\"A templated SQL file.\r\n+\r\n+ This is the response of a templaters .process() method\r\n+ and contains both references to the orginal file and also\r\n+ the ca...
8f7e0e029655e1b104d438198e6a0dbf2ea38acb
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b072d2bca2..7b7057b26e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [466](https://github.com/sqlfluff/sqlfluff/issues/466) - Added L034 'Fields should be stated befo...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Code Style, Linting, Formatting Fixes" }
scikit-learn__scikit-learn-17266@f616eef
scikit-learn/scikit-learn
Python
17,266
ENH add force_finite to control the behaviour of constant target in explained variance and R2
#### Reference Issues/PRs Fixes #16857 #### What does this implement/fix? Explain your changes. Clarified both in the documentation and in the implementation, the fact that the default behaviour of `r2_score` is different from the actual R² formula. Added an explicit `fix_when_y_true_is_constant` arg (name to ...
2020-05-18T14:29:37Z
`r2_score`: improved support of edge case where `y_true` is constant As for many users, when I first encountered sklearn a few years ago I was surprised to see that there is a hardcoded behaviour in the `r2_score` to handle the case where training data is constant. ```python import sys from sklearn.metrics import ...
Update on this ticket before pushing my PR: there also seem to be an ambiguity in the docstring > A constant model that always predicts the expected value of y, disregarding the input features, would get a R^2 score of 0.0. For me this is incorrect, but maybe this is because the sentence is not clear (does "expec...
[ { "body": "As for many users, when I first encountered sklearn a few years ago I was surprised to see that there is a hardcoded behaviour in the `r2_score` to handle the case where training data is constant.\r\n\r\n```python\r\nimport sys\r\nfrom sklearn.metrics import r2_score\r\n\r\nr2_constant_train_nonexact...
f87b5ae223b01414a83a610246a40dae2356a039
{ "head_commit": "f616eef2bb3d71282eb27e33529f5a7a7d6642d2", "head_commit_message": "Update sklearn/metrics/_regression.py\n\nCo-authored-by: Julien Jerphanion <git@jjerphan.xyz>", "patch_to_review": "diff --git a/doc/modules/model_evaluation.rst b/doc/modules/model_evaluation.rst\nindex 3dd7313bb9b59..48e495b719...
[ { "diff_hunk": "@@ -725,6 +770,14 @@ def r2_score(y_true, y_pred, *, sample_weight=None, multioutput=\"uniform_average\n .. versionchanged:: 0.19\n Default value of multioutput is 'uniform_average'.\n \n+ force_finite : boolean, optional", "line": null, "original_line": 773, "...
2643a1f98c85ed9f7a43efc6281b9364351fd5d9
diff --git a/doc/modules/model_evaluation.rst b/doc/modules/model_evaluation.rst index 730b094581276..079313a45c3d0 100644 --- a/doc/modules/model_evaluation.rst +++ b/doc/modules/model_evaluation.rst @@ -2005,6 +2005,19 @@ then the explained variance is estimated as follow: The best possible score is 1.0, lower val...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sqlfluff__sqlfluff-494@554c74a
sqlfluff/sqlfluff
Python
494
Refactor L022 and add more test cases.
This fixes #366 . It also limits the recursion within the fix routines to limit the extent to which a rule can _runaway_, i.e. end up in an infinite loop. This involved a reasonable restructure of L022 to handle the kind of cases that were being thrown at it.
2020-10-19T18:30:51Z
Crash on fixing reported errors about "Inconsistent Capitalisation of Unquoted Identifiers" L014 I have a SQL file which doesn't have consistent capitalization of unquoted identifiers. sqlfluff reports 213 violations of this. But when I run this command `sqlfluff fix fact_daily_moving_forecast.sql --rules L014` I get t...
I'm a bit hesitant to post the actual full SQL file here but if needed I can send it privately. Let me know if this doesn't give enough information to reproduce the issue. If you're happy to send the full sql directly that would be really helpful to debug this. In particular with that `NotImplementedError`, there ar...
[ { "body": "I have a SQL file which doesn't have consistent capitalization of unquoted identifiers. sqlfluff reports 213 violations of this. But when I run this command `sqlfluff fix fact_daily_moving_forecast.sql --rules L014` I get this error message:\r\n\r\n==== fixing violations ====\r\n213 fixable linting v...
b6c993ca124189976b61d5396cb8dc7b1e8f96a2
{ "head_commit": "554c74ab9caa582a0e5bfc1a4a0b7c3776a38960", "head_commit_message": "Update changelog", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex d8ee53c0ec4..942ead694e6 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](h...
[ { "diff_hunk": "@@ -2220,41 +2220,139 @@ def _eval(self, segment, **kwargs):\n \"\"\"Blank line expected but not found after CTE definition.\"\"\"\n error_buffer = []\n if segment.type == 'with_compound_statement':\n- expecting_blank_line = False\n- blank_line_found...
80f31edea5db32e64990086b3ff3f2dbf1c0e92d
diff --git a/CHANGELOG.md b/CHANGELOG.md index 36a8e7a8c27..d51cde3e766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Support for modulo (`%`) operator. +- A limit in the internal fix routines to catch any ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sqlfluff__sqlfluff-458@83b3c74
sqlfluff/sqlfluff
Python
458
Add column index identifier in snowflake dialect
Resolves https://github.com/sqlfluff/sqlfluff/issues/451
2020-10-04T15:01:52Z
'Unable to lex characters: ''$1 as' in snowflake ``` with sweets as ( select $1 as type, $2 as price from (values ('toffee', 5), ('starburst', 8), ('flying_saucer', 1)) ) select * from sweets ``` Results in ``` == [sweets.sql] FAIL L: 2 | P: 12 | LXR | Unable to lex characters: ''$1 as type'...
I know this is valid snowflake syntax for referring to columns by their index, but I can't find a reference to this syntax in the mysql or the postgres docs. @barrywhart - do you know if BigQuery supports a similar syntax? I'm no expert, but I haven't seen anything like that. I did see this code from someone, whi...
[ { "body": "```\r\nwith sweets as (\r\n select $1 as type, $2 as price\r\n from (values ('toffee', 5), ('starburst', 8), ('flying_saucer', 1))\r\n)\r\n\r\nselect * from sweets\r\n\r\n```\r\n\r\nResults in\r\n```\r\n== [sweets.sql] FAIL\r\nL: 2 | P: 12 | LXR | Unable to lex characters: ''$1 as type'...'...
7d68d018cc84ef7aaf3cdd777365a306cbeb6053
{ "head_commit": "83b3c74bdaef8c08f424299a7766d8014f57c082", "head_commit_message": "Add column index identifier in snowflake dialect and lexer", "patch_to_review": "diff --git a/src/sqlfluff/dialects/dialect_snowflake.py b/src/sqlfluff/dialects/dialect_snowflake.py\nindex 1d84ebee1b9..9427d554f62 100644\n--- a/s...
[ { "diff_hunk": "@@ -53,6 +60,9 @@\n QuotedSemiStructuredElementSegment=NamedSegment.make(\n 'double_quote', name='quoted_semi_structured_element',\n type='semi_structured_element'),\n+ ColumnIndexIdentifierSegment=ReSegment.make(\n+ r\"\\$[0-9]+\", name='column_index_identifier_seg...
f95e379e1ba1cf3df0fdca4870093dff05263a5e
diff --git a/src/sqlfluff/dialects/dialect_snowflake.py b/src/sqlfluff/dialects/dialect_snowflake.py index 1d84ebee1b9..6f23ed8d5a6 100644 --- a/src/sqlfluff/dialects/dialect_snowflake.py +++ b/src/sqlfluff/dialects/dialect_snowflake.py @@ -26,6 +26,13 @@ before='not_equal' ) +snowflake_dialect.insert_lexer_str...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-17090@074801c
scikit-learn/scikit-learn
Python
17,090
[MRG] Enable percentage for n_features_to_select in RFE(Fix PR #16228)
This brings PR #16228 up to date, adds tests and fixes some issues with it. That PR was meant to Fix #14567, close #14627 and close #15529 by adding the option to select n features by percentage instead of by absolute number. The changes PR #16228 made to `isotronic.py` have since been added already and are not i...
2020-04-30T10:23:20Z
RFI: Setting the number of features to select 'n_features_to_select' to be percentage While I was working on my thesis, I have used RFE and I needed to set it to select 25% of the available features. So, I calculated the target number of features before call init RFE. I was wondering if sklearn support initiating RF...
I'd consider such a PR, thanks. should it be renamed ``features_to_select``? No strong opinion though. It's still about the number of features, just a different unit of measurement @jnothman I would love to work on this. Can you guide me on how I could go about this? I was thinking to introduce a new attribute `perc...
[ { "body": "While I was working on my thesis, I have used RFE and I needed to set it to select 25% of the available features. So, I calculated the target number of features before call init RFE.\r\n\r\nI was wondering if sklearn support initiating RFE with this ability. for ex. if `n_features_to_select` is float...
d3e4f24015c13db3f76fdc8423fd1bdeba2a8d23
{ "head_commit": "074801c3f83159226f8a58e3491d3bcf5c9fa2db", "head_commit_message": "BUG Fixes issues", "patch_to_review": "diff --git a/doc/whats_new/v0.24.rst b/doc/whats_new/v0.24.rst\nindex 7c2b6af86b815..cce62f12345a0 100644\n--- a/doc/whats_new/v0.24.rst\n+++ b/doc/whats_new/v0.24.rst\n@@ -69,6 +69,11 @@ Ch...
[ { "diff_hunk": "@@ -57,9 +58,13 @@ class RFE(SelectorMixin, MetaEstimatorMixin, BaseEstimator):\n information about feature importance\n (e.g. `coef_`, `feature_importances_`).\n \n- n_features_to_select : int or None, default=None\n- The number of features to select. If `None`, half o...
4b9dc69dfd3b9e1f06862c84ce8e94bfc7d9129a
diff --git a/doc/whats_new/v0.24.rst b/doc/whats_new/v0.24.rst index e41b7e61e6363..348a993aeb08d 100644 --- a/doc/whats_new/v0.24.rst +++ b/doc/whats_new/v0.24.rst @@ -94,6 +94,11 @@ Changelog attribute name/path or a `callable` for extracting feature importance from the estimator. :pr:`15361` by :user:`Venkata...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-17032@e7396db
scikit-learn/scikit-learn
Python
17,032
[MRG] Deprecate class support for check_estimator and parametrize_with_checks
Fix https://github.com/scikit-learn/scikit-learn/issues/17030 This PR deprecates passing a class to `check_estimator` and `parametrize_with_checks`. ~A new `check_class` utility is created.~ Hopefully, this will make the code simpler and our lives easier in the long run. CC @rth @thomasjpfan Maybe also @adrin...
2020-04-24T17:00:11Z
Remove support for classes in check_estimator and parametrize_with_checks We currently partially support classes on `check_estimator()` or `parametrize_with_checks()`. However, they don't work in general when the class requires some parameter with no default (except the hard-coded special cases of 'estimator' and 'base...
+1. We can still introduce the deprecation warning in this release. Deprecating class shouldn't be an issue for things like https://github.com/scikit-learn/scikit-learn/pull/11324 right? cc @jnothman In any case this would go in the direction that instead of default `__init__` parameters, testing different com...
[ { "body": "We currently partially support classes on `check_estimator()` or `parametrize_with_checks()`. However, they don't work in general when the class requires some parameter with no default (except the hard-coded special cases of 'estimator' and 'base_estimator').\r\n\r\nAs far as I understand, the only t...
1b119c46937f29b1b29fb8eaaee6910beb7807d0
{ "head_commit": "e7396dbf2a6db6833439df5bcb9e2641b2754217", "head_commit_message": "Added whatsnew entry", "patch_to_review": "diff --git a/doc/developers/develop.rst b/doc/developers/develop.rst\nindex f17c58cee0d7f..13d2010ca7319 100644\n--- a/doc/developers/develop.rst\n+++ b/doc/developers/develop.rst\n@@ -2...
[ { "diff_hunk": "@@ -511,6 +511,11 @@ Changelog\n matrix from a pandas DataFrame that contains only `SparseArray`s.\n :pr:`16728` by `Thomas Fan`_.\n \n+- |API| Passing classes to :func:`utils.estimator_checks.check_estimator` and\n+ :func:`utils.estimator_checks.parametrize_with_checks` is now deprecated,\...
268728ba1f78aedc872c0a521d5de2b2c469cc9e
diff --git a/doc/developers/develop.rst b/doc/developers/develop.rst index f17c58cee0d7f..13d2010ca7319 100644 --- a/doc/developers/develop.rst +++ b/doc/developers/develop.rst @@ -246,13 +246,13 @@ whether it is just for you or for contributing it to scikit-learn, there are several internals of scikit-learn that you ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Refactoring / Architectural Improvement" }
sktime__sktime-1103@393b2ff
sktime/sktime
Python
1,103
rework of installation guidelines
This is a rework of the installation guidelines. They have grown a bit organically and were all over the place. Was originally going to write the developer guidelines, but I found that these needed a cleaning first.
2021-07-03T20:48:31Z
[DOC]Install requirements for WSL2 in installation guide #### Describe the issue linked to the documentation It has come to my attention that in order to run `sktime` under WSL2, we should follow the Ubuntu linux instructions. <!-- Tell us about the confusion introduced in the documentation. --> We should includ...
Closing for #1010 well, it hasn't been merged yet, so let's reopen but attach to the new PR, so it closes whan that gets merged.
[ { "body": "#### Describe the issue linked to the documentation\r\nIt has come to my attention that in order to run `sktime` under WSL2, we should follow the Ubuntu linux instructions.\r\n\r\n<!--\r\nTell us about the confusion introduced in the documentation.\r\n-->\r\nWe should include a `..note` directive in ...
dbddb8c176db6daa4b926e270d5533426286a295
{ "head_commit": "393b2ff1fe25568ce6d99222bc78ca8c02f587ea", "head_commit_message": "typos", "patch_to_review": "diff --git a/docs/source/installation.rst b/docs/source/installation.rst\nindex 92a8ae555a8..81d27df0f83 100644\n--- a/docs/source/installation.rst\n+++ b/docs/source/installation.rst\n@@ -3,43 +3,114 ...
[ { "diff_hunk": "@@ -3,43 +3,114 @@\n Installation\n ============\n \n-sktime is available via PyPI using:\n+``sktime`` requires an environment with python version 3.6 or higher.\n+\n+Release versions\n+----------------\n+\n+For frequent issues with installation, consult the `Release versions - troubleshooting`_...
78c2cfdacec88e1437a733df7896e7e4d42ce4db
diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 92a8ae555a8..639e1713cdc 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -3,73 +3,162 @@ Installation ============ -sktime is available via PyPI using: +``sktime`` currently supports: + +* environments wit...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Documentation Updates" }
sktime__sktime-1042@45c5ca7
sktime/sktime
Python
1,042
Multivariate Detrending
#### Reference Issues/PRs Fixes #1030 . See also #1038 . #### What does this implement/fix? Explain your changes. This would be a quick fix to #1030 as it adds functionality for multivariate series to the detrender. As discussed with @mloning I took inspiration from how this was done for the imputer. But I als...
2021-06-24T07:30:29Z
Make transformer for detrending support multivariate series **Is your feature request related to a problem? Please describe.** For the EEG applications we need a transformer that detrends each channel. Currently the detrending transformer only supports univariate time series. **Describe the solution you'd like** D...
@SveaMeyer13, what do you think about the solution in #1038? That way, you can apply everything, not just the detrender, to multivariate EEG data. @fkiraly, yes I like the idea in #1038 - for now, I just took inspiration by how it was done in the imputer.
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\nFor the EEG applications we need a transformer that detrends each channel. Currently the detrending transformer only supports univariate time series.\r\n\r\n**Describe the solution you'd like**\r\nDetrend each univariate series sep...
573789b8d92a2035f82500ffb93a89115a944fc1
{ "head_commit": "45c5ca71de1e4a44c8d581fd4775171dec209c12", "head_commit_message": "put forecasters into dict and check if all columns are known", "patch_to_review": "diff --git a/sktime/transformations/series/detrend/_detrend.py b/sktime/transformations/series/detrend/_detrend.py\nindex 7842969c6f4..09a2ffdfde2...
[ { "diff_hunk": "@@ -107,10 +117,22 @@ def transform(self, Z, X=None):\n De-trended series\n \"\"\"\n self.check_is_fitted()\n- z = check_series(Z, enforce_univariate=True)\n+ z = check_series(Z)\n fh = ForecastingHorizon(z.index, is_relative=False)\n- z_p...
b2f385d4e5bbb34e1e62bb6a63f3b764349a4bd7
diff --git a/sktime/transformations/series/detrend/_detrend.py b/sktime/transformations/series/detrend/_detrend.py index 7842969c6f4..d7d03788eca 100644 --- a/sktime/transformations/series/detrend/_detrend.py +++ b/sktime/transformations/series/detrend/_detrend.py @@ -6,6 +6,7 @@ __author__ = ["Markus Löning"] from...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-16655@293ed17
scikit-learn/scikit-learn
Python
16,655
Fixed issue with KernelPCA.inverse_transform mean
Currently `KernelPCA.inverse_transform` returns a data set with zero mean, even if the original data did not have zero mean. I believe that this PR fixes that issue, so that the mean of the inverse-transformed data set is the same as the mean of the original data set. I've also added a test for this update. <...
2020-03-07T16:54:51Z
inverse_transform in KernelPCA does not account for the mean <!-- Before submitting a bug, please make sure the issue hasn't been already addressed by searching through the past issues. --> #### Describe the bug <!-- A clear and concise description of what the bug is. --> `KernelPCA.inverse_transform` gives b...
[ { "body": "<!--\r\nBefore submitting a bug, please make sure the issue hasn't been already\r\naddressed by searching through the past issues.\r\n-->\r\n\r\n#### Describe the bug\r\n<!--\r\nA clear and concise description of what the bug is.\r\n-->\r\n`KernelPCA.inverse_transform` gives back a zero-meaned datase...
f1acf834685f8bcd1bcdd903e9c40b7515fe0a67
{ "head_commit": "293ed177f2959c1518d4dd5d3792e7d24531465b", "head_commit_message": "Updated changelog", "patch_to_review": "diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst\nindex 96702dae01235..0a77277f1da3a 100644\n--- a/doc/whats_new/v0.23.rst\n+++ b/doc/whats_new/v0.23.rst\n@@ -138,6 +138,10 @@...
[ { "diff_hunk": "@@ -282,3 +283,15 @@ def test_kernel_conditioning():\n # check that the small non-zero eigenvalue was correctly set to zero\n assert kpca.lambdas_.min() == 0\n assert np.all(kpca.lambdas_ == _check_psd_eigenvalues(kpca.lambdas_))\n+\n+\n+@pytest.mark.parametrize(\"kernel\",\n+ ...
b77182b8449cc5634a8e3500929491fb3cb69563
diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst index 96702dae01235..0a77277f1da3a 100644 --- a/doc/whats_new/v0.23.rst +++ b/doc/whats_new/v0.23.rst @@ -138,6 +138,10 @@ Changelog :func:`decomposition.non_negative_factorization` now preserves float32 dtype. :pr:`16280` by :user:`Jeremie du Boisber...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sktime__sktime-500@f896b14
sktime/sktime
Python
500
added mape_loss and cosmetic fixes to notebooks (removed kernel)
#### Reference Issues/PRs Fixes #499. #### What does this implement/fix? Explain your changes. Implements MAPE loss function. #### Does your contribution introduce a new dependency? If yes, which one? No new dependencies introduced #### PR checklist ##### For all contributions - [x] I've added myself to...
2020-11-20T15:20:57Z
MAPE loss function implementation **Is your feature request related to a problem? Please describe.** A need for MAPE loss function to be able to compare forecasting results. **Describe the solution you'd like** MAPE loss function compatible with sktime **Describe alternatives you've considered** None **Addi...
Implemented in PR #500. Please have a look. Thx
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\nA need for MAPE loss function to be able to compare forecasting results.\r\n\r\n**Describe the solution you'd like**\r\nMAPE loss function compatible with sktime\r\n\r\n**Describe alternatives you've considered**\r\nNone\r\n\r\n**A...
202f51e8ea962aaa6f948762cad47f0407dd8221
{ "head_commit": "f896b1427cbde522cc460c8125e154064ee9de38", "head_commit_message": "Merge branch 'master' into ftr_tch_add_mape", "patch_to_review": "diff --git a/CHANGELOG.rst b/CHANGELOG.rst\nindex dd8a695399e..be82f301f19 100644\n--- a/CHANGELOG.rst\n+++ b/CHANGELOG.rst\n@@ -6,6 +6,12 @@ All notable changes t...
[ { "diff_hunk": "@@ -0,0 +1,65 @@\n+#!/usr/bin/env python3 -u\n+# -*- coding: utf-8 -*-\n+# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)\n+\n+__author__ = [\"Tomasz Chodakowski\"]\n+\n+import pytest\n+\n+from sktime.performance_metrics.forecasting import mape_loss\n+from sktime.performan...
4a4827294822ac050603aa0acb9102972b0eef3a
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index dd8a695399e..7f479b1749d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file. We keep tra [0.5.0] - 2020-xx-xx -------------------- +Added +~~~~~ +* Added mape_loss function (#499) @tch +...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sktime__sktime-850@9a9ef2b
sktime/sktime
Python
850
Add plot_correlations() to plot series and acf/pacf
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at our contribution guide: https://github.com/alan-turing-institute/sktime/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to th...
2021-04-30T15:44:14Z
Add convenience function to plot series, ACF and PACF **Is your feature request related to a problem? Please describe.** Reviewing a plot of a series, as well as its ACF and PACF functions is a common exploratory data analysis step in time series analysis. Currently users would have to individually plot the series...
I'm planning to submit a Pull Request that contributes this functionality shortly.
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\nReviewing a plot of a series, as well as its ACF and PACF functions is a common exploratory data analysis step in time series analysis. \r\n\r\nCurrently users would have to individually plot the series using sktime's `plot_series`...
50765a6a5bf3a78096dcca10223b3320cf2aa5f0
{ "head_commit": "9a9ef2be260069b60ba549cfc34d1773de58025b", "head_commit_message": "Merge branch 'main' into corr_plot", "patch_to_review": "diff --git a/docs/source/api_reference/utils.rst b/docs/source/api_reference/utils.rst\nindex eb6d56622f4..eca08b3d65f 100644\n--- a/docs/source/api_reference/utils.rst\n++...
[ { "diff_hunk": "@@ -0,0 +1,164 @@\n+# -*- coding: utf-8 -*-\n+import numpy as np\n+import pandas as pd\n+import pytest\n+\n+from sktime.datasets import load_airline\n+from sktime.utils.plotting import plot_series, plot_correlations\n+from sktime.utils.validation._dependencies import _check_soft_dependencies\n+f...
ef641917b92785e5d8ebe12a8b532f2057ff1a9f
diff --git a/docs/source/api_reference/utils.rst b/docs/source/api_reference/utils.rst index eb6d56622f4..eca08b3d65f 100644 --- a/docs/source/api_reference/utils.rst +++ b/docs/source/api_reference/utils.rst @@ -15,6 +15,7 @@ Plotting :template: function.rst plot_series + plot_correlations Data Proce...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-17068@d730bb5
scikit-learn/scikit-learn
Python
17,068
DOC simpler block delimitation in sphinx-gallery examples
Closes https://github.com/scikit-learn/scikit-learn/issues/17063 On Linux, ``` find examples/ -name "*.py" -exec sed -i 's/#\s*#\{5,100\}/# %%/g' {} + ``` (the syntax is slightly different for sed version installed on MacOS cf [SO](https://unix.stackexchange.com/a/36805)) cc @thomasjpfan
2020-04-28T09:00:35Z
Replace "######" separators by "# %%" in gallery Just noticed this was a feature in sphinx-gallery, I think I prefer the `# %%` over the `######`: ```py ############################################################################### # Using the prediction pipeline in a grid search ``` vs ```py # %% # U...
Yes, I think it would make reading examples in text format much nicer! Made a PR in https://github.com/scikit-learn/scikit-learn/pull/17068
[ { "body": "Just noticed this was a feature in sphinx-gallery, I think I prefer the `# %%` over the `######`:\r\n\r\n\r\n```py\r\n###############################################################################\r\n# Using the prediction pipeline in a grid search\r\n```\r\n\r\nvs \r\n\r\n```py\r\n# %%\r\n# Using t...
728b413990b0ced2a8e8fb5b076550eb2f5a5028
{ "head_commit": "d730bb5eb12b193bcc385aa8b0de8c117990d6db", "head_commit_message": "Fix merge conflict", "patch_to_review": "diff --git a/examples/applications/plot_face_recognition.py b/examples/applications/plot_face_recognition.py\nindex 64a18601cd710..1bb8d8ae9d94d 100644\n--- a/examples/applications/plot_fa...
[ { "diff_hunk": "@@ -32,9 +32,9 @@\n # Authors: Maria Telenczuk <https://github.com/maikia>\n # License: BSD 3 clause\n \n-###############################################################################\n+# %%\n # Download the data and make missing values sets\n-################################################\...
e87b06a9ba3268d12186626bfbb23a58923a0759
diff --git a/examples/applications/plot_out_of_core_classification.py b/examples/applications/plot_out_of_core_classification.py index 0c89a31a64b0b..14fb2d260a61f 100644 --- a/examples/applications/plot_out_of_core_classification.py +++ b/examples/applications/plot_out_of_core_classification.py @@ -43,7 +43,7 @@ def _...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-16442@d632739
scikit-learn/scikit-learn
Python
16,442
BUG fix behaviour in confusion_matrix with with empty array-like as input
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs Fixes #16432 #### What does this implement/fix? Explain your changes...
2020-02-14T01:03:21Z
confusion_matrix errors with empty y_true/y_pred #### Describe the bug When `confusion_matrix` is called with zero length `y_true` and `y_pred` and `labels` is not `None`. A value error is raised `ValueError: At least one label specified must be in y_true`. #### Steps/Code to Reproduce call confusion matrix with ...
I think the explicit error is reasonable, as it likely suggest issues earlier in the data pipeline. What is the use case for returning a confusion matrix with zeros in this case? > What is the use case for returning a confusion matrix with zeros in this case? I think the main case is that a matrix of zeros _is_ ...
[ { "body": "#### Describe the bug\r\nWhen `confusion_matrix` is called with zero length `y_true` and `y_pred` and `labels` is not `None`. A value error is raised `ValueError: At least one label specified must be in y_true`.\r\n\r\n#### Steps/Code to Reproduce\r\ncall confusion matrix with zero length `y_true` a...
d591d8c467b23f81e7aa95e626b5b594ee674808
{ "head_commit": "d632739971ee0c32eaec2a916ae3ba2af178c17c", "head_commit_message": "update behavior", "patch_to_review": "diff --git a/sklearn/metrics/_classification.py b/sklearn/metrics/_classification.py\nindex 1fa6086ff32a7..52df38518aaa9 100644\n--- a/sklearn/metrics/_classification.py\n+++ b/sklearn/metric...
[ { "diff_hunk": "@@ -914,6 +914,18 @@ def test_confusion_matrix_multiclass_subset_labels():\n labels=[extra_label, extra_label + 1])\n \n \n+@pytest.mark.parametrize(\n+ 'labels', (None, [0, 1], [0, 1, 2]),\n+ ids=['labels None', 'binary classification', 'three way classification']...
0c4910f05a85d78afcfe357dc5d367793a98fb6c
diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst index 2a671808b6354..bc280b23cd154 100644 --- a/doc/whats_new/v0.23.rst +++ b/doc/whats_new/v0.23.rst @@ -196,12 +196,18 @@ Changelog ...................... - |Fix| Fixed a bug in :func:`metrics.mean_squared_error` to not ignore - argument `squared` wh...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sktime__sktime-1356@3354ef3
sktime/sktime
Python
1,356
Add date time dummy extractor
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at our contribution guide: https://github.com/alan-turing-institute/sktime/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs Closes https://github.com/alan-turing-institute/sktime/issues/1273 <!-- Example: Fixes #1234. See a...
2021-08-27T14:16:20Z
[ENH] Calendar Feature Extractor **Is your feature request related to a problem? Please describe.** I would like to use sktime in the context of tree based models for time series. In general, these models need some data preparation to make them useful for time series. One data prepation step involves creating calendar...
Yes that would be a great addition! In terms of design, the main issue is how to integrate this into the pipeline. The workflow for featurizers is slightly different compared to standard series-to-series transformers. During prediction, you first need to generate features before calling the predict method of the fo...
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\nI would like to use sktime in the context of tree based models for time series. In general, these models need some data preparation to make them useful for time series. One data prepation step involves creating calendar dummy featu...
7e7fd368df7b2ddcd12d693a7579f6134e71611e
{ "head_commit": "3354ef30bbbcbe514ef1d559c6f1b95dbca1bb1f", "head_commit_message": "DocstringFix", "patch_to_review": "diff --git a/sktime/transformations/series/calendardummies.py b/sktime/transformations/series/calendardummies.py\nnew file mode 100644\nindex 00000000000..d2339ba8db9\n--- /dev/null\n+++ b/sktim...
[ { "diff_hunk": "@@ -0,0 +1,251 @@\n+#!/usr/bin/env python3 -u\n+# -*- coding: utf-8 -*-\n+# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)\n+\"\"\"Extract calendar features from datetimeindex.\"\"\"\n+__author__ = [\"Daniel Bartling\"]\n+__all__ = [\"CalendarDummies\"]\n+\n+import warning...
856a65183002089c123ebf2f0842fc23a601360c
diff --git a/docs/source/api_reference/transformations.rst b/docs/source/api_reference/transformations.rst index 2cce9c5e94d..d073053ea8a 100644 --- a/docs/source/api_reference/transformations.rst +++ b/docs/source/api_reference/transformations.rst @@ -271,6 +271,17 @@ Missing value imputation Imputer +Datetim...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-16403@0a5b9b7
scikit-learn/scikit-learn
Python
16,403
ENH add the possibility to pass array-like for max and min in IterativeImputer
#### Reference Issues/PRs Resolves #16349 #### What does this implement/fix? The current implementation of `impute.IterativeImputer` only allows the specification of a single pair of (min, max) values to which all imputed features will be clipped. However, in many practical applications, different features might...
2020-02-06T17:01:08Z
Provide different max and min values for each feature with IterativeImputer Currently, `impute.IterativeImputer` only allows the specification of a single set of min and max values to be used to set limits on the imputed values of all features. In many practical problems, however, different features can have very diffe...
Is scaling features before imputation good enough? @jnothman I tried doing z-scaling (subtract mean, divide by SD) but using a Bayesian ridge regression model, I would still sometimes get feature values which didn't make sense. A substantial number of my features are percentages and are bound to [0, 100], some are p...
[ { "body": "Currently, `impute.IterativeImputer` only allows the specification of a single set of min and max values to be used to set limits on the imputed values of all features. In many practical problems, however, different features can have very different ranges. I am proposing to modify `IterativeImputer` ...
d4a3ac4252401a20368c405976ff3db6f30995ac
{ "head_commit": "0a5b9b72d9de48fb23c9b72027f7d4fc3577b50d", "head_commit_message": "Added description to what's new", "patch_to_review": "diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst\nindex 45219b8346b35..ea5ef8e230545 100644\n--- a/doc/whats_new/v0.23.rst\n+++ b/doc/whats_new/v0.23.rst\n@@ -51...
[ { "diff_hunk": "@@ -581,6 +580,37 @@ def fit_transform(self, X, y=None):\n self.n_iter_ = 0\n return super()._concatenate_indicator(Xt, X_indicator)\n \n+ # If min or max value are (scalar) None, convert them to - or + inf", "line": null, "original_line": 583, "origina...
1b79ff2a65eef08e9ae978ad04812e5e59056a32
diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst index 9eb4a82f0de20..05fc125fc8b13 100644 --- a/doc/whats_new/v0.23.rst +++ b/doc/whats_new/v0.23.rst @@ -155,6 +155,13 @@ Changelog - |Enhancement| :func:`gaussian_process.kernels.Matern` returns the RBF kernel when ``nu=np.inf``. :pr:`15503` by :user:...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-17443@9e8e528
scikit-learn/scikit-learn
Python
17,443
ENH Add CalibrationDisplay plotting 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs closes #8425 #### What does this implement/fix? Explain your changes. ...
2020-06-04T11:31:34Z
Add calibration curve to plotting module I think it would be nice to have something like ```python def plot_calibration_curve(y_true, prob_y_pred, n_bins=5, ax=None): prop_true, prop_pred = calibration_curve(y_true, prob_y_pred, n_bins=n_bins) if ax is None: ax = plt.gca() ax.plot([0, 1], [0...
should plot functions return the artist? or the axes? hm... Maybe adding a histogram as in http://scikit-learn.org/stable/auto_examples/calibration/plot_compare_calibration.html would also be nice ```python def plot_calibration_curve(y_true, y_prob, n_bins=5, ax=None, hist=True, normalize=False): prob_true, prob_...
[ { "body": "I think it would be nice to have something like\r\n\r\n```python\r\ndef plot_calibration_curve(y_true, prob_y_pred, n_bins=5, ax=None):\r\n prop_true, prop_pred = calibration_curve(y_true, prob_y_pred, n_bins=n_bins)\r\n if ax is None:\r\n ax = plt.gca()\r\n ax.plot([0, 1], [0, 1], ':...
c3db2cdbf5244229af2c5eb54f9216a69f77a146
{ "head_commit": "9e8e5286829474bd56d147460de51f12ddccffe3", "head_commit_message": "add reliability diagram", "patch_to_review": "diff --git a/doc/modules/calibration.rst b/doc/modules/calibration.rst\nindex cfc185c854edb..912920e495587 100644\n--- a/doc/modules/calibration.rst\n+++ b/doc/modules/calibration.rst...
[ { "diff_hunk": "@@ -5,130 +5,290 @@\n \n When performing classification one often wants to predict not only the class\n label, but also the associated probability. This probability gives some\n-kind of confidence on the prediction. This example demonstrates how to display\n-how well calibrated the predicted pro...
b25f03b1f79cd7bbf8afca1ef1e877292589e328
diff --git a/doc/modules/calibration.rst b/doc/modules/calibration.rst index d0a9737dac612..1fcd1d501d100 100644 --- a/doc/modules/calibration.rst +++ b/doc/modules/calibration.rst @@ -30,11 +30,25 @@ approximately 80% actually belong to the positive class. Calibration curves ------------------ -The following plot ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-16493@72ddb27
scikit-learn/scikit-learn
Python
16,493
MAINT change default value for min/max of IterativeImputer
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2020-02-20T04:33:00Z
Change default valuefor min/max in the experimental IterativeImputer In the IterativeImputer, `min_value` and `max_value` are defaulted to `None`. Internally, if they are `None` min and max value will be affected to `-np.inf` and `np.inf`, respectively. We should change this behaviour and make that the default of `m...
[ { "body": "In the IterativeImputer, `min_value` and `max_value` are defaulted to `None`. Internally, if they are `None` min and max value will be affected to `-np.inf` and `np.inf`, respectively.\r\n\r\nWe should change this behaviour and make that the default of `min_value=-np.inf` and `max_value=np.inf` direc...
b4e215c01c00e9e6128351ac0af391f3502d22e3
{ "head_commit": "72ddb2733dbc8af43c24cfaf0416f3132dd1f38a", "head_commit_message": "default value for min/max", "patch_to_review": "diff --git a/sklearn/impute/_iterative.py b/sklearn/impute/_iterative.py\nindex fb3d4470c8e6e..ff88968e20bab 100644\n--- a/sklearn/impute/_iterative.py\n+++ b/sklearn/impute/_iterat...
[ { "diff_hunk": "@@ -565,8 +565,8 @@ def fit_transform(self, X, y=None):\n \n self.imputation_sequence_ = []\n \n- self._min_value = -np.inf if self.min_value is None else self.min_value\n- self._max_value = np.inf if self.max_value is None else self.max_value\n+ self._min_value = se...
a2a361e7e911c4e4db7410ac5c86be493977b088
diff --git a/doc/whats_new/v0.24.rst b/doc/whats_new/v0.24.rst index 2554d136c13ea..8661f8138f003 100644 --- a/doc/whats_new/v0.24.rst +++ b/doc/whats_new/v0.24.rst @@ -47,6 +47,15 @@ Changelog :mod:`sklearn.module` ..................... +:mod:`sklearn.impute` +..................... + +- |Fix| replace the default v...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Code Refactoring / Architectural Improvement" }
scikit-learn__scikit-learn-16187@0dfc0f7
scikit-learn/scikit-learn
Python
16,187
MAINT/EXA replaced deprecated NavigationToolbar2TkAgg
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs Fixes : #16160 <!-- Example: Fixes #1234. See also #3456. Please use ke...
2020-01-23T20:53:40Z
Import Error in Libsvm GUI example #### Describe the bug The Libsvm GUI example (`examples/applications/svm_gui.py`) throws an import error in local installation and execution. The matplotlib 2.x `NavigationToolbar2TkAgg` has changed its name in matplotlib 3.x. The example should probably be modified to work with bo...
Since we don't have strict matplotlib minimum version requirement, let's [update the import](https://stackoverflow.com/questions/50330320/what-to-use-instead-of-navigationtoolbar2tkagg) and leave a comment near the import e.g. `# requires matplotlib >= 3.0` In this case, we also need to update our CI then. It makes pro...
[ { "body": "#### Describe the bug\r\nThe Libsvm GUI example (`examples/applications/svm_gui.py`) throws an import error in local installation and execution.\r\nThe matplotlib 2.x `NavigationToolbar2TkAgg` has changed its name in matplotlib 3.x.\r\nThe example should probably be modified to work with both version...
fd12d5684ad224ad7760374b1dcca2821c644feb
{ "head_commit": "0dfc0f72e8dd636acbd119901219ff8212d13c94", "head_commit_message": "BUG replaced deprecated NavigationToolbar2TkAgg", "patch_to_review": "diff --git a/examples/applications/svm_gui.py b/examples/applications/svm_gui.py\nindex 46b7f7369a0fe..b6e3a512c29fb 100644\n--- a/examples/applications/svm_gu...
[ { "diff_hunk": "@@ -24,7 +24,7 @@\n matplotlib.use('TkAgg')\n \n from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\n-from matplotlib.backends.backend_tkagg import NavigationToolbar2TkAgg\n+from matplotlib.backends.backend_tkagg import NavigationToolbar2Tk", "line": null, "original_line": 2...
be7abbb8292fc789bc85d5c9d69ad10931b3122a
diff --git a/examples/applications/svm_gui.py b/examples/applications/svm_gui.py index 46b7f7369a0fe..d085851422e18 100644 --- a/examples/applications/svm_gui.py +++ b/examples/applications/svm_gui.py @@ -22,9 +22,14 @@ import matplotlib matplotlib.use('TkAgg') - from matplotlib.backends.backend_tkagg import Figur...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-16182@08a043c
scikit-learn/scikit-learn
Python
16,182
BUG max_depth=1 should be decision stump in HistGradientBoosti…
#### Reference Issues/PRs Fixes #16124 #### What does this implement/fix? Explain your changes. Modified the validation in TreeGrower to allow max_depth value as 1.
2020-01-23T10:11:04Z
Off-by-one in HistGradientBoosting max_depth Right now HistGradientBoostingClassifier doesn't allow max_depth=1. Either this is an issue just in the validation, or there's an off-by-one in the code. Max-depth 1 should be a stump, i.e. a single split, and should totally be allowed. cc @NicolasHug
The convention for the depth is that depth=1 corresponds to a single (non-splitted) node which would predict the average target so there's no point in allowing that uhm this is not the convention in the other tree algorithm. We might want to homogenize it. FWIW, the parameter is properly documented: > The maximum de...
[ { "body": "Right now HistGradientBoostingClassifier doesn't allow max_depth=1.\r\nEither this is an issue just in the validation, or there's an off-by-one in the code. Max-depth 1 should be a stump, i.e. a single split, and should totally be allowed.\r\n\r\ncc @NicolasHug ", "number": 16124, "title": "O...
fd12d5684ad224ad7760374b1dcca2821c644feb
{ "head_commit": "08a043c467998e740399ba88e694500d97c91121", "head_commit_message": "Fixed the test for max_depth in test_gradient_boosting.py", "patch_to_review": "diff --git a/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py b/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py\nindex cb7...
[ { "diff_hunk": "@@ -689,8 +689,7 @@ class HistGradientBoostingRegressor(RegressorMixin, BaseHistGradientBoosting):\n than 1. If None, there is no maximum limit.\n max_depth : int or None, optional (default=None)\n The maximum depth of each tree. The depth of a tree is the number of\n- ...
06aab9ed62be6b506d5b4115532ad2642eb8481b
diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst index 08cd80a7ae24f..a524ff3a58e29 100644 --- a/doc/whats_new/v0.23.rst +++ b/doc/whats_new/v0.23.rst @@ -90,6 +90,13 @@ Changelog :user:`Reshama Shaikh <reshamas>`, and :user:`Chiara Marmo <cmarmo>`. +- |Fix| Changed the convention for `max_depth`...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-16245@9efc1e1
scikit-learn/scikit-learn
Python
16,245
ENH Add 'if_binary' option to drop argument of OneHotEncoder
Fixes #12502
2020-01-27T17:39:46Z
RFC Behavior of OneHotEncoder on binary features Right now OneHotEncoder expands every bindary feature into two features afaik. I'm not sure if this is a great/convenient behavior. I think it might be nicer if (optionally?) it'd use a single column - that's particularly natural if the feature was already ``0`` and ``1...
I agree. Using a single feature in case of binary makes sense. In the multinomial case, as far as I have read, models like linear regression and GLM, which uses maximum likelihood will have issues due to singularities. There are LeaveOneOut encoders for handling such model requirements. I think, keeping just one featur...
[ { "body": "Right now OneHotEncoder expands every bindary feature into two features afaik.\r\nI'm not sure if this is a great/convenient behavior. I think it might be nicer if (optionally?) it'd use a single column - that's particularly natural if the feature was already ``0`` and ``1``\r\nOtherwise that either ...
06b1a19465adfad78d14cc2ae56c21ead5c92475
{ "head_commit": "9efc1e179c2ec15a517f8b7229abc2ccc515d852", "head_commit_message": "add isinstance of str condition", "patch_to_review": "diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst\nindex 1941aacb7a7b0..79e521538d8c7 100644\n--- a/doc/whats_new/v0.23.rst\n+++ b/doc/whats_new/v0.23.rst\n@@ -11...
[ { "diff_hunk": "@@ -398,6 +398,15 @@ def test_one_hot_encoder_feature_names_drop(drop, expected_names):\n assert_array_equal(expected_names, feature_names)\n \n \n+def test_one_hot_encoder_drop_equals_if_binary():\n+ X = [['Male', 1], ['Female', 3], ['Female', 2]]\n+ expected = np.array([[1., 1., 0., ...
bbf87fc2a0c7e7dd437f9b6049be070f971c2837
diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst index 45219b8346b35..b5346e9f17774 100644 --- a/doc/whats_new/v0.23.rst +++ b/doc/whats_new/v0.23.rst @@ -184,6 +184,11 @@ Changelog - |Efficiency| :class:`preprocessing.OneHotEncoder` is now faster at transforming. :pr:`15762` by `Thomas Fan`_. +- |F...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sanic-org__sanic-3016@0c7f586
sanic-org/sanic
Python
3,016
Fix incompatible type annotation of `get` method in the `HTTPMethodView` class
Resolves #2916 Use `getattr` to try getting the `get` handler to avoid the typing annotation incompatibility issue.
2024-12-18T08:59:19Z
mypy error type for async get function in HTTPMethodView ### Is there an existing issue for this? - [X] I have searched the existing issues ### Describe the bug Mypy throws an error overriding the signature of the get method, as it is described only for synchronous execution. ``` error: Signature of "get" incomp...
PR welcome :wink: That did not solve the problem for me. `mypy` still complains and I have no idea why. It works if `None` is removed from the type definition. ```python get: Union[Callable[..., Any], Coroutine[..., Any]] ``` I cannot explain this behavior. @ahopkins The problem is here when we are using...
[ { "body": "### Is there an existing issue for this?\n\n- [X] I have searched the existing issues\n\n### Describe the bug\n\nMypy throws an error overriding the signature of the get method, as it is described only for synchronous execution.\r\n\r\n```\r\nerror: Signature of \"get\" incompatible with supertype \"...
1d8425b0b8817420c9b91d93d3839f11fdc9022f
{ "head_commit": "0c7f5861d057c8e1d259aae2b99e3116f2bb3c7f", "head_commit_message": "Remove incompatible type annotation of `get` method in the view class", "patch_to_review": "diff --git a/sanic/views.py b/sanic/views.py\nindex bdd48dc4cc..4bdd232ca0 100644\n--- a/sanic/views.py\n+++ b/sanic/views.py\n@@ -115,8 ...
[ { "diff_hunk": "@@ -146,9 +144,11 @@ def __init_subclass__(\n \n def dispatch_request(self, request: Request, *args, **kwargs):\n \"\"\"Dispatch request to appropriate handler method.\"\"\"\n- handler = getattr(self, request.method.lower(), None)\n- if not handler and request.method ==...
eb459873d9588ced9950ae78d56907d1dc998d5f
diff --git a/sanic/views.py b/sanic/views.py index bdd48dc4cc..3df123d07b 100644 --- a/sanic/views.py +++ b/sanic/views.py @@ -115,8 +115,6 @@ def get(self, request: Request): to `"/v"`. """ - get: Optional[Callable[..., Any]] - decorators: List[Callable[[Callable[..., Any]], Callable[..., Any]]...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sanic-org__sanic-2670@4e50c49
sanic-org/sanic
Python
2,670
Increase KEEP_ALIVE_TIMEOUT default to 120 seconds
Sanic has used 5 second timeout to quickly close idle connections, for no particular reason, as idle connections use very little resources. This PR increases it to 80 seconds, slightly larger than Nginx default of 75 s, to avoid a problem with a request failing when Sanic has closed the connection but Nginx hasn't noti...
2023-02-01T16:17:39Z
Send keep-alive header and increase the default timeout ### Is there an existing issue for this? - [X] I have searched the existing issues ### Is your feature request related to a problem? Please describe. Nginx doesn't notice Sanic closing its keep-alive connection by timeout, and then another request will fa...
Related issue #2531 Yes, that is for ASGI server to handle. I do not want to change any defaults. If someone needs to change they have the ability to. When we overhaul timeouts next qtr we can address what our defaults will be. There is no reason to keep the default so low (5 seconds currently) and there are clear perf...
[ { "body": "### Is there an existing issue for this?\r\n\r\n- [X] I have searched the existing issues\r\n\r\n### Is your feature request related to a problem? Please describe.\r\n\r\nNginx doesn't notice Sanic closing its keep-alive connection by timeout, and then another request will fail for no good reason. Hi...
6848ff24d81e5c07ca12c66958237f15db4705df
{ "head_commit": "4e50c498c4fe30eb25a371abe3923b39690296be", "head_commit_message": "120 seconds instead, to match Caddy as well", "patch_to_review": "diff --git a/sanic/config.py b/sanic/config.py\nindex 4316773d5e..7ac1613a5e 100644\n--- a/sanic/config.py\n+++ b/sanic/config.py\n@@ -50,7 +50,7 @@\n \"INSPEC...
[ { "diff_hunk": "@@ -50,7 +50,7 @@\n \"INSPECTOR_TLS_KEY\": _default,\n \"INSPECTOR_TLS_CERT\": _default,\n \"INSPECTOR_API_KEY\": \"\",\n- \"KEEP_ALIVE_TIMEOUT\": 5, # 5 seconds\n+ \"KEEP_ALIVE_TIMEOUT\": 120, # Two minutes matches Caddy, exceeds Nginx default", "line": null, "origin...
a14277eed1f79df74544fd8c3332b9a2930ceee2
diff --git a/sanic/config.py b/sanic/config.py index 4316773d5e..9345768ba6 100644 --- a/sanic/config.py +++ b/sanic/config.py @@ -43,14 +43,14 @@ "DEPRECATION_FILTER": "once", "FORWARDED_FOR_HEADER": "X-Forwarded-For", "FORWARDED_SECRET": None, - "GRACEFUL_SHUTDOWN_TIMEOUT": 15.0, # 15 sec + "GRA...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
sktime__sktime-1770@8b46ee6
sktime/sktime
Python
1,770
[ENH] Forecaster convenience method to return forecast residuals
This PR implements a frequently requested convenience method (`predict_residuals`) for forecasters to return forecast residuals. See also #1105. Tests for `predict_residuals` are also included (checks whether indices are correct). FYI @ngupta23, @AngelPone, is this what you were looking for?
2021-12-17T19:49:48Z
Forecaster interface: getting in-sample forecasts, getting residuals **Is your feature request related to a problem? Please describe.** I think there should be a method or property to obtain in-sample fitted value or residuals, which are important in many forecasting methods, such as forecast combination. **Describ...
Ok, I think there are two requests in there, and a proposed way of addressing these. The two requests: residuals and in-sample values. Regarding residuals, I fully agree that there should be an easy way to return them! But, I don't think this is a concern of the `BaseForecaster`. There also already is a way t...
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\nI think there should be a method or property to obtain in-sample fitted value or residuals, which are important in many forecasting methods, such as forecast combination.\r\n\r\n**Describe the solution you'd like**\r\n\r\nAdd a met...
3f2d1ca8ea190c9fa61876ab7687361b90da2009
{ "head_commit": "8b46ee6abd0cea3aa513945e3ff33d6692bcc1c8", "head_commit_message": "typos in error msg", "patch_to_review": "diff --git a/sktime/forecasting/base/_base.py b/sktime/forecasting/base/_base.py\nindex cc4b5397592..17b505a3178 100644\n--- a/sktime/forecasting/base/_base.py\n+++ b/sktime/forecasting/ba...
[ { "diff_hunk": "@@ -631,6 +637,48 @@ def update_predict_single(\n alpha=alpha,\n )\n \n+ def predict_residuals(self, y, X=None, fh=None):", "line": null, "original_line": 640, "original_start_line": null, "path": "sktime/forecasting/base/_base.py", "start_line": null, ...
9409ae748a7139439f662aba58bcbd43573e9aca
diff --git a/sktime/forecasting/base/_base.py b/sktime/forecasting/base/_base.py index 0c2aa20ff74..5ff9d1d9311 100644 --- a/sktime/forecasting/base/_base.py +++ b/sktime/forecasting/base/_base.py @@ -8,11 +8,17 @@ class name: BaseForecaster Scitype defining methods: fitting - fit(y, X=None, fh=None) ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-16076@e2d9f8b
scikit-learn/scikit-learn
Python
16,076
[MRG] BUG ensure object array are properly casted when dtype=object
closes #16036 Fix a bug where calling `np.array(..., dtype=object)` will create a N-D array while algorithms are expecting a 1-D array with objects inside (similar to a list).
2020-01-09T16:22:20Z
Using dbscan with precomputed neighbors gives an error in 0.22.X, but not in 0.21.3. #### Description Using dbscan with precomputed neighbors gives an error in 0.22.X, but not in 0.21.3. I am not sure if this is an intended change or not, but could not see anything on this in the release history. If this is due ...
The regression was introduced in https://github.com/scikit-learn/scikit-learn/pull/10482 In 0.21.3, `neighborhoods` was a 1-D numpy array of numpy arrays. In 0.22, this is a ~~2-D sparse matrix~~ a 2-D numpy array. I was wrong. The regression was introduced after in: https://github.com/scikit-learn/scikit-learn/pull...
[ { "body": "#### Description\r\n\r\nUsing dbscan with precomputed neighbors gives an error in 0.22.X, but not in 0.21.3. \r\n\r\nI am not sure if this is an intended change or not, but could not see anything on this in the release history. If this is due to a mistake on my part on how to us precomputed neighbors...
4fe4d27eb1b88cc799199f2176ac734bbc16ca31
{ "head_commit": "e2d9f8ba979450c3e1cfc9cd0e1b3361a12f0de3", "head_commit_message": "(#16036) refactoring with new function _to_object_array()", "patch_to_review": "diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst\nindex 53c416c506614..a6e9d62c439e3 100644\n--- a/doc/whats_new/v0.23.rst\n+++ b/doc/w...
[ { "diff_hunk": "@@ -276,15 +276,21 @@ def _radius_neighbors_from_graph(graph, radius, return_distance):\n indices = indices.astype(np.intp, copy=no_filter_needed)\n \n if return_distance:\n- neigh_dist = np.array(np.split(data, indptr[1:-1]), dtype=object)\n- neigh_ind = np.array(np.split(indi...
6415d4b5e5c2b1460f62bd2f9de1b1318c25125e
diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst index 53c416c506614..56799e7ad77e1 100644 --- a/doc/whats_new/v0.23.rst +++ b/doc/whats_new/v0.23.rst @@ -118,6 +118,15 @@ Changelog when `y=None`. :pr: `15918` by :user: `Luca Kubin <lkubin>`. +:mod:`sklearn.neighbors` +...............................
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-16069@6b58160
scikit-learn/scikit-learn
Python
16,069
ENH Add verbose option to VotingClassifier and VotingRegre…
#### Reference Issues/PRs Fixes #10360 If merged closes #14772, #15991, #10365, #10974 #### What does this implement/fix? Explain your changes. Add a boolean verbose option to `VotingClassifier` and `VotingRegressor`. Follows the example of #11364.
2020-01-09T10:59:55Z
Verbose VotingClassifier Sometimes the fitting procedure lasts a long time when using many voters. Therefore it would be nice to get some feedback. I think it could be done by just passing the "verbose" keyword to the Parallel() call in line 186 of the current stable voting_classifier.py and adding it to `VotingCla...
Sounds fair enough @mohdsanadzakirizvi, @shivani-1521, there are now two PRs open for this, by each of you: #10367, #10365. Neither of you have included a test which ensures that no verbosity is used by default / with verbose=0. Both of your implementations would fail such a test. The test should appear in `sklearn/ens...
[ { "body": "Sometimes the fitting procedure lasts a long time when using many voters. Therefore it would be nice to get some feedback. \r\n\r\nI think it could be done by just passing the \"verbose\" keyword to the Parallel() call in line 186 of the current stable voting_classifier.py and adding it to `VotingCla...
eb1244963dea7d54ce5262aa67fe2476a68a4b18
{ "head_commit": "6b58160026394c4ffdeeaf99681b1fe57be51647", "head_commit_message": "nitpicks", "patch_to_review": "diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst\nindex 53c416c506614..b23a1fab704bf 100644\n--- a/doc/whats_new/v0.23.rst\n+++ b/doc/whats_new/v0.23.rst\n@@ -67,6 +67,16 @@ Changelog\...
[ { "diff_hunk": "@@ -513,6 +514,29 @@ def test_check_estimators_voting_estimator(estimator):\n check_no_attributes_set_in_init(estimator.__class__.__name__, estimator)\n \n \n+@pytest.mark.parametrize(\n+ \"estimator\",\n+ [VotingRegressor(\n+ estimators=[('lr', LinearRegression()),\n+ ...
271453f6d7ef1a0f127fd3c1e9a34c2fe928e61d
diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst index 53c416c506614..b23a1fab704bf 100644 --- a/doc/whats_new/v0.23.rst +++ b/doc/whats_new/v0.23.rst @@ -67,6 +67,16 @@ Changelog `ValueError` for arguments `n_classes < 1` OR `length < 1`. :pr:`16006` by :user:`Rushabh Vasani <rushabh-v>`. +:mod:`...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sktime__sktime-243@1e1fed9
sktime/sktime
Python
243
Added resizing transformer and tutorial for use and problem it solves
Good day. Added resizing transformer and tutorial that describes error that is caused by inequal sized time series + use of transformer. #### PR checklist for new estimators - [x] I have added unit tests and made sure they pass locally. - [x] I have updated the existing example notebooks or provided a new o...
2020-04-14T19:17:00Z
extending existing estimators to samples of unequal length time series Hello. I have found that some methods raise errors if I feed unequal sized time-series datasets into them. My task is to train a classifier on unequal sized decreasing traces of optimization processes to catch an early stop (that's for motivatio...
Hi, thanks again for reaching out! Do you have a particular algorithm in mind that you want to extend to handle unequal-length series? As @mloning says, it would be good if you could state which estimators/methods this affects and which you are going to work on, as well as how your fix would look like (as algorithm o...
[ { "body": "Hello.\r\n\r\nI have found that some methods raise errors if I feed unequal sized time-series datasets into them.\r\nMy task is to train a classifier on unequal sized decreasing traces of optimization processes to catch an early stop (that's for motivation). I'll try to fix them and make a pull reque...
c545afed2d5d3b737ad63e8a05581624ef7f577e
{ "head_commit": "1e1fed96daab12e2b81071c5b389a3a61f70db90", "head_commit_message": "Added resizing transformer and tutorial that describes error that is caused by inequal sized time series + use of transformer", "patch_to_review": "diff --git a/examples/resizing_tutorial.ipynb b/examples/resizing_tutorial.ipynb\...
[ { "diff_hunk": "@@ -0,0 +1,45 @@\n+import numpy as np\n+import pandas as pd\n+from scipy import interpolate\n+\n+from sktime.transformers.base import BaseTransformer\n+\n+\n+\n+\n+class TSResizeTransform(BaseTransformer):\n+ \"\"\"Transformer that get casual dataframe of time series and resizes \n+ ...
fc9b4229cd576517016e506679400ef7fe29f8dc
diff --git a/examples/resizing_tutorial.ipynb b/examples/resizing_tutorial.ipynb new file mode 100644 index 00000000000..11b481234e0 --- /dev/null +++ b/examples/resizing_tutorial.ipynb @@ -0,0 +1,403 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sanic-org__sanic-2608@9af14b9
sanic-org/sanic
Python
2,608
Deprecate Conditions and Triggers Saved in `handler` Callable; Save Condition in `signal.extra` Instead
closes #2581 The change in last version of this PR is authored by @ahopkins. Thank you!
2022-11-27T09:58:26Z
A signal handler cannot be a method on an object **Describe the bug** <!-- A clear and concise description of what the bug is, make sure to paste any exceptions and tracebacks. --> If I try and register a method on an object as a signal handler, an exception is thrown because it is not possible to set an attribute on...
Added code tags for readability.
[ { "body": "**Describe the bug**\r\n<!-- A clear and concise description of what the bug is, make sure to paste any exceptions and tracebacks. -->\r\nIf I try and register a method on an object as a signal handler, an exception is thrown because it is not possible to set an attribute on a bound method\r\n```\r\n...
b276b91c21256b43f07792221d99aa28cb5bd3f5
{ "head_commit": "9af14b9a5b91db986122242f19a3b746640266dd", "head_commit_message": "Save conditions and triggers in dicts", "patch_to_review": "diff --git a/sanic/signals.py b/sanic/signals.py\nindex 3b662684c0..b4a62c2147 100644\n--- a/sanic/signals.py\n+++ b/sanic/signals.py\n@@ -86,6 +86,8 @@ def __init__(sel...
[ { "diff_hunk": "@@ -86,6 +86,8 @@ def __init__(self) -> None:\n )\n self.allow_fail_builtin = True\n self.ctx.loop = None\n+ self.triggers: Dict[SignalHandler, str] = dict()\n+ self.conditions: Dict[SignalHandler, Optional[dict]] = dict()", "line": null, "original_l...
e2c3d0e102443a3f877e79acf436d80afa06ca35
diff --git a/sanic/signals.py b/sanic/signals.py index 3b662684c0..5710f1edc7 100644 --- a/sanic/signals.py +++ b/sanic/signals.py @@ -154,9 +154,7 @@ async def _dispatch( try: for signal in signals: params.pop("__trigger__", None) - requirements = getattr( - ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sanic-org__sanic-2578@6138edf
sanic-org/sanic
Python
2,578
Add GenericCreator for loading SSL certs in processes
Resolves #2577
2022-10-19T17:21:31Z
Certificates not created with `mkcert` or `trustme` raise a RuntimeError The `CertLoader` class in `sanic-org/sanic/sanic/worker/loader.py` checks the creator of the certificate. If the creator is not `mkcert` or `trustme` then it raises a `RuntimeError`. This will prevent Sanic from running with certificates from any ...
[ { "body": "The `CertLoader` class in `sanic-org/sanic/sanic/worker/loader.py` checks the creator of the certificate. If the creator is not `mkcert` or `trustme` then it raises a `RuntimeError`. This will prevent Sanic from running with certificates from any other sources.\r\n", "number": 2577, "title": ...
3f4663b9f8715119130efe1bfe517f70b356939e
{ "head_commit": "6138edf537c13fba4ec945d5116feaff9856cf63", "head_commit_message": "Add to unit test", "patch_to_review": "diff --git a/sanic/worker/loader.py b/sanic/worker/loader.py\nindex abdcc9870a..309e930f75 100644\n--- a/sanic/worker/loader.py\n+++ b/sanic/worker/loader.py\n@@ -16,6 +16,7 @@\n cast,\n...
[ { "diff_hunk": "@@ -109,18 +110,28 @@ class CertLoader:\n _creator_class: Type[CertCreator]\n \n def __init__(self, ssl_data: Dict[str, Union[str, os.PathLike]]):\n+ self._ssl_data = ssl_data\n+\n creator_name = ssl_data.get(\"creator\")\n- if creator_name not in (\"mkcert\", \"tru...
e7b65616af982229bbd41645f5852fc773e77450
diff --git a/sanic/worker/loader.py b/sanic/worker/loader.py index abdcc9870a..344593dbdc 100644 --- a/sanic/worker/loader.py +++ b/sanic/worker/loader.py @@ -5,18 +5,10 @@ from importlib import import_module from pathlib import Path -from typing import ( - TYPE_CHECKING, - Any, - Callable, - Dict, - ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-15918@ab53a91
scikit-learn/scikit-learn
Python
15,918
[MRG] Make cross_val_predict support method="predict_proba" and y=None
#### Reference Issues/PRs Fixes #15855 #### Description `cross_val_predict` raises exception when passing `method="predict_proba"` and `y=None` #### What does this implement/fix? Explain your changes. The problem is due to the fact that when `method in ['decision_function', 'predict_proba', 'predict_log_p...
2019-12-18T16:50:17Z
cross_val_predict raises error when method="predict_proba" and y=None #### Description I found a weird behavior in the function `cross_val_predict` when passing `method="predict_proba"` and `y=None`, while using a custom estimator. I believe that the problem is due to the local variable `encode` that is defined into...
Please provide a full stack trace. I'm not sure if this is related to #15805 This is the full stack trace ``` Traceback (most recent call last): File "sklearn_bug_test.py", line 23, in <module> y_proba_hat = cross_val_predict(te, data, method='predict_proba') File "/home/lucakubin/anaconda3/lib/python3.7/s...
[ { "body": "\r\n#### Description\r\nI found a weird behavior in the function `cross_val_predict` when passing `method=\"predict_proba\"` and `y=None`, while using a custom estimator. I believe that the problem is due to the local variable `encode` that is defined into the function `cross_val_predict` (it should ...
06e9a3fe39e0f5bcd46c4b8a65323a53286f8374
{ "head_commit": "ab53a9145a116dd793a06d7d4dd478406d5bd6f3", "head_commit_message": "Added entry in change log", "patch_to_review": "diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst\nindex 30cf098eee768..c10fcadf5d425 100644\n--- a/doc/whats_new/v0.23.rst\n+++ b/doc/whats_new/v0.23.rst\n@@ -94,6 +94...
[ { "diff_hunk": "@@ -972,6 +975,18 @@ def test_cross_val_predict_unbalanced():\n decimal=12)\n \n \n+def test_cross_val_predict_y_none():\n+ # ensure that cross_val_predict works when y is None\n+ mock_classifier = MockClassifier(allow_nd=True)\n+ X = np.random.random((100,...
03930ce3adc7757063a188784ebabbd908430a77
diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst index 30cf098eee768..c10fcadf5d425 100644 --- a/doc/whats_new/v0.23.rst +++ b/doc/whats_new/v0.23.rst @@ -94,6 +94,10 @@ Changelog type and details. :pr:`15622` by :user:`Gregory Morse <GregoryMorse>`. +- |Fix| :func: `cross_val_predict` supports `m...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-15888@465fa64
scikit-learn/scikit-learn
Python
15,888
MNT Raise erorr when normalize is invalid in confusion_matrix
Fixes #15886
2019-12-14T11:42:01Z
confusion_matrix doesn't validate normalize keyword ```python import numpy as np from sklearn.metrics import confusion_matrix confusion_matrix(np.random.randint(0, 5, size=100), np.random.randint(0, 5, size=100), normalize='ohnodontdoit') ``` should raise an error but runs fine with no normaliz...
True we forgot to move the checking which is actually happening in `plot_confusion_matrix` (l. 187). This should be moved in `confusion_matrix`.
[ { "body": "```python\r\nimport numpy as np\r\nfrom sklearn.metrics import confusion_matrix\r\nconfusion_matrix(np.random.randint(0, 5, size=100),\r\n np.random.randint(0, 5, size=100), normalize='ohnodontdoit')\r\n```\r\n\r\nshould raise an error but runs fine with no normalization. I found this...
41747f6ecd6d3fe5d25229838554eae3d3083957
{ "head_commit": "465fa64ded457ae3eca641ae9086c119d8f35863", "head_commit_message": "remove", "patch_to_review": "diff --git a/sklearn/metrics/_classification.py b/sklearn/metrics/_classification.py\nindex 322ac3409722f..6e6bc839dc95d 100644\n--- a/sklearn/metrics/_classification.py\n+++ b/sklearn/metrics/_classi...
[ { "diff_hunk": "@@ -283,6 +283,10 @@ def confusion_matrix(y_true, y_pred, labels=None, sample_weight=None,\n \n check_consistent_length(y_true, y_pred, sample_weight)\n \n+ if normalize not in {'true', 'pred', 'all', None}:", "line": null, "original_line": 286, "original_start_line": null, ...
d531f7347143d650e8a720719f2f6259b0200978
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index af08b832e9f6f..19a8327783b20 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -15,6 +15,13 @@ This is a bug-fix release to primarily resolve some packaging issues in version Changelog --------- +:mod:`sklearn.metrics` +..........
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
sanic-org__sanic-2262@43ec5fa
sanic-org/sanic
Python
2,262
Noisy exceptions - force logging of all exceptions
Resolves #2241. The purpose of this PR is to allow all exceptions to be logged, regardless of them being "quiet" or not.
2021-10-03T16:56:47Z
Noisy exceptions ``` $ sanic ... --no-quiet ``` This (plus a corresponding config) might be nice to have when debugging to ignore `quiet=True` on exceptions. I do not think it should be included in `--debug`. The alternative might be to have different layers of verbosity in logging. And `-vv` would log out whe...
Suggesting `--noisy-exceptions` or something else that (a) uses no negation and (b) is more specific. I was thinking about making it such that we could have different levels of verbosity across the whole app by using different amounts of `v`s (`-vvv` > `-vv` > `-v`), but `-v` is already in use to check the module ver...
[ { "body": "```\r\n$ sanic ... --no-quiet\r\n```\r\n\r\nThis (plus a corresponding config) might be nice to have when debugging to ignore `quiet=True` on exceptions. I do not think it should be included in `--debug`. \r\n\r\nThe alternative might be to have different layers of verbosity in logging. And `-vv` wou...
71cc30e5cd409fc2a835d15df2e52e2d03bf67b8
{ "head_commit": "43ec5fadbdb32260b1476a468d92e7e3a7ba36a5", "head_commit_message": "Added tests", "patch_to_review": "diff --git a/sanic/__main__.py b/sanic/__main__.py\nindex 027bf8793d..2ebb9de0dc 100644\n--- a/sanic/__main__.py\n+++ b/sanic/__main__.py\n@@ -96,6 +96,11 @@ def main():\n help=\"number o...
[ { "diff_hunk": "@@ -890,7 +890,8 @@ async def _websocket_handler(\n try:\n await fut\n except Exception as e:\n- self.error_handler.log(request, e)\n+ noisy = self.error_handler.noisy\n+ self.error_handler._log(request, e, noisy)", "line": null, ...
7e4b8016014df67806e77078ffaf79c5b2aef748
diff --git a/sanic/__main__.py b/sanic/__main__.py index 027bf8793d..7903c7285e 100644 --- a/sanic/__main__.py +++ b/sanic/__main__.py @@ -96,6 +96,11 @@ def main(): help="number of worker processes [default 1]\n ", ) parser.add_argument("-d", "--debug", dest="debug", action="store_true") + parser...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-16326@73c0eca
scikit-learn/scikit-learn
Python
16,326
ENH Add min_categories parameter for each feature to CategoricalNB
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2020-01-30T19:37:38Z
CategoricalNB bug with categories present in test but absent in train #### Description Calling predict() / predict_proba() / predict_log_proba() on CategoricalNB model throws IndexError. #### Steps/Code to Reproduce ``` import numpy as np from sklearn.datasets import make_classification from sklearn.naive_bayes...
Some categories are present during testing but never seen during training. We should probably have a strategy to handle unknown categories or at least raise a proper error message. Any ideas/suggestions on a strategy to handle unknown categories? Otherwise, I'd like to submit a PR raising a proper error for such insta...
[ { "body": "#### Description\r\nCalling predict() / predict_proba() / predict_log_proba() on CategoricalNB model throws IndexError.\r\n\r\n#### Steps/Code to Reproduce\r\n```\r\nimport numpy as np\r\nfrom sklearn.datasets import make_classification\r\nfrom sklearn.naive_bayes import CategoricalNB\r\nfrom sklearn...
87eea7d409592e6b586bf2c9c1749f57c94c055b
{ "head_commit": "73c0eca4c24641d20560d95344794d62b85520e2", "head_commit_message": "DOC: from suggestion, remove extra word\n\nCo-Authored-By: Joel Nothman <joel.nothman@gmail.com>", "patch_to_review": "diff --git a/sklearn/naive_bayes.py b/sklearn/naive_bayes.py\nindex dd1d9586db6e1..b1016a4c7f0b0 100644\n--- a...
[ { "diff_hunk": "@@ -1031,6 +1031,16 @@ class CategoricalNB(_BaseDiscreteNB):\n Prior probabilities of the classes. If specified the priors are not\n adjusted according to the data.\n \n+ min_categories : int or array-like or None, default=None", "line": null, "original_line": 1034, ...
7304106aa69e5a2403033d3e5588ceefacdf2637
diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst index 04e10be72cd54..fcc55e68bb985 100644 --- a/doc/whats_new/v0.23.rst +++ b/doc/whats_new/v0.23.rst @@ -621,6 +621,11 @@ Changelog :mod:`sklearn.naive_bayes` ............................. +- |Enhancement| Adds a parameter `min_categories` to + :class...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
sanic-org__sanic-2302@747cb46
sanic-org/sanic
Python
2,302
Add route context
This PR implements the idea discussed in #2300. It is an initial PR meant to explore the concept and idea of passing value to the route context using the suggestion from @Tronic to use a `ctx_` prefix in the route kwargs. ```python @app.route("/", ctx_foo=123) async def handler(request: Request): ``` Closes #2...
2021-11-07T09:51:56Z
Labeling / tagging routes **Is your feature request related to a problem? Please describe.** Some of my routes requires authentication and some of them don't (such as home page). I'm currently using a middleware and hard-code URLs that requires authentication, however it would be better to have a property on routes wh...
The routing decorators need no more parameters, that gets convoluted quite quickly. Instead I would recommend stacking more decorators. Something like: ```python def requires_auth(handler): handler.requires_auth = True # Check for this flag in your middleware return handler @requires_auth @bp.get('/...
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\nSome of my routes requires authentication and some of them don't (such as home page). I'm currently using a middleware and hard-code URLs that requires authentication, however it would be better to have a property on routes when re...
080d41627ad46656547f41b6a6dcdbcb7bc90ab9
{ "head_commit": "747cb46d2f7975a301c7bc7057cf282605c17184", "head_commit_message": "Add route context", "patch_to_review": "diff --git a/sanic/app.py b/sanic/app.py\nindex baee112e20..1018c1daed 100644\n--- a/sanic/app.py\n+++ b/sanic/app.py\n@@ -384,12 +384,16 @@ def _apply_route(self, route: FutureRoute) -> Li...
[ { "diff_hunk": "@@ -65,6 +74,7 @@ def route(\n static: bool = False,\n version_prefix: str = \"/v\",\n error_format: Optional[str] = None,\n+ **kwargs,", "line": null, "original_line": 77, "original_start_line": null, "path": "sanic/mixins/routes.py", "start_li...
8a3008f6595cf8d0a645b1e01c7179d255875ed6
diff --git a/sanic/app.py b/sanic/app.py index 7c74038354..751d1800c6 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -382,12 +382,16 @@ def _apply_route(self, route: FutureRoute) -> List[Route]: websocket_handler.is_websocket = True # type: ignore params["handler"] = websocket_handler + ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
sktime__sktime-1660@20cd928
sktime/sktime
Python
1,660
Add inv_var method into AutoEnsembleForecaster
<!-- Thanks for contributing a pull request! Please ensure you have taken a look at our contribution guide: https://github.com/alan-turing-institute/sktime/blob/main/CONTRIBUTING.md --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fixes) to create link to ...
2021-11-28T08:19:20Z
[ENH] AutoEnsembleForeacaster should have a method to use inverse error as weights **Describe the solution you'd like** `AutoEnsembleForeacaster` should be able to automatically calculate internally the error of the forecasters and use the inverse error as weights. Credits to @RNKuhns who came up with this idea :) ...
@aiwalter are you working on this? If not, I can help. While I suggest to add this `inverse-error` method into `EnsembleForecaster` instead of `AutoEnsembleForecaster`, such as `EnsembleForecaster(forecasters, weights='inverse-error')`. If added into `AutoEnsembleForecaster`, `method` and `regressor` may be confused....
[ { "body": "**Describe the solution you'd like**\r\n`AutoEnsembleForeacaster` should be able to automatically calculate internally the error of the forecasters and use the inverse error as weights. Credits to @RNKuhns who came up with this idea :)\r\n\r\nThere should be a `method=\"inverse-error\"` added.\r\n", ...
d6ea9865b54c3097c528d81ac599d67e20bb3404
{ "head_commit": "20cd928288555b78827954abb4517cdad45b0680", "head_commit_message": "refine docstring", "patch_to_review": "diff --git a/sktime/forecasting/compose/_ensemble.py b/sktime/forecasting/compose/_ensemble.py\nindex d5ee0b2509d..a80b9dba9c3 100644\n--- a/sktime/forecasting/compose/_ensemble.py\n+++ b/sk...
[ { "diff_hunk": "@@ -39,15 +39,23 @@\n class AutoEnsembleForecaster(_HeterogenousEnsembleForecaster):\n \"\"\"Automatically find best weights for the ensembled forecasters.\n \n- The AutoEnsembleForecaster uses a meta-model (regressor) to calculate the optimal\n- weights for ensemble aggregation with m...
6c0b0e67ff82c78d09231229f9f5beb6b746620d
diff --git a/sktime/forecasting/compose/_column_ensemble.py b/sktime/forecasting/compose/_column_ensemble.py index 65ba91981b4..56bbe0ccf01 100644 --- a/sktime/forecasting/compose/_column_ensemble.py +++ b/sktime/forecasting/compose/_column_ensemble.py @@ -21,11 +21,11 @@ class ColumnEnsembleForecaster(_HeterogenousEns...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-15622@ea538bb
scikit-learn/scikit-learn
Python
15,622
Yield stack trace information in resilient mode model_selection warnings
Fixes #15621 Now a stack trace will be included in the FitFailedWarning so that not having early termination will still allow proper analysis of errors. Note: this change could break functionality where the warning message is parsed and assumes a 2 line message with the warning tag line and the specific Python ex...
2019-11-13T19:01:07Z
GridSearchCV does not allow errors in underlying fit function to be properly displayed (does not catch error in best estimator) #### Description If the underlying fit() function constantly throws an error, GridSeachCV will raise a FitFailedWarning which does not show a stack trace and thus has destroyed any hope of ge...
Yes, it's a difficult balance... resilience vs early failure. We of course allow the user to choose which with error_score. I agree that a traceback should be provided.
[ { "body": "#### Description\r\nIf the underlying fit() function constantly throws an error, GridSeachCV will raise a FitFailedWarning which does not show a stack trace and thus has destroyed any hope of getting details of the error. Using code patterns such as `with warnings.catch_warnings` does not help as th...
dc111489a1a13b025e0d787c6a0369c1786654dc
{ "head_commit": "ea538bb3cc78d0355d3a391e07bdea5cb240e474", "head_commit_message": "Update test_validation.py", "patch_to_review": "diff --git a/sklearn/exceptions.py b/sklearn/exceptions.py\nindex 95a876b88be4d..0a6e8c0e65d54 100644\n--- a/sklearn/exceptions.py\n+++ b/sklearn/exceptions.py\n@@ -135,7 +135,12 @@...
[ { "diff_hunk": "@@ -135,7 +135,12 @@ class FitFailedWarning(RuntimeWarning):\n ... gs.fit(X, y) # This will raise a ValueError since C is < 0\n ... except ValueError:\n ... pass\n- ... print(repr(w[-1].message))\n+ ... msg = repr(w[-1].message)\n+ ... # if m...
4a6919e80a85cd87ab7216ad91c66f78577a9dff
diff --git a/doc/whats_new/v0.23.rst b/doc/whats_new/v0.23.rst index e7b9fdd24989d..30cf098eee768 100644 --- a/doc/whats_new/v0.23.rst +++ b/doc/whats_new/v0.23.rst @@ -85,6 +85,15 @@ Changelog :class:`linear_model.RidgeClassifierCV`. :pr:`15653` by :user:`Jérôme Dockès <jeromedockes>`. +:mod:`sklearn.model_sel...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
sanic-org__sanic-2432@f0c7b34
sanic-org/sanic
Python
2,432
Expose scope parameter in request object
From #2417
2022-04-18T14:27:56Z
Expose ASGI scope on Request object **Is your feature request related to a problem? Please describe.** I'm trying to write an application framework that works across ASGI compatible server implementations and to do this I'd like to make the ASGI scope available to users. Sanic does not make the scope publicly availabl...
That's a good idea, and sounds easy enough that we can probably squeeze that in for the upcoming release. You'll probably need to handle the case where the server isn't being run via ASGI and thus there is no `_asgi_app` with some informative error message, but from what I can tell it seems like the project is moving a...
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\nI'm trying to write an application framework that works across ASGI compatible server implementations and to do this I'd like to make the ASGI scope available to users. Sanic does not make the scope publicly available though. \r\n\...
78b6723149f07c50e2381f5ed9b69590ba2eb1fc
{ "head_commit": "f0c7b3430d93b9aedb1cd67e4d3c27c8e7668332", "head_commit_message": "remove indentation", "patch_to_review": "diff --git a/sanic/request.py b/sanic/request.py\nindex 5f0de3625f..5987335287 100644\n--- a/sanic/request.py\n+++ b/sanic/request.py\n@@ -14,6 +14,7 @@\n \n from sanic_routing.route impor...
[ { "diff_hunk": "@@ -819,6 +820,15 @@ def url_for(self, view_name: str, **kwargs) -> str:\n view_name, _external=True, _scheme=scheme, _server=netloc, **kwargs\n )\n \n+ @property\n+ def scope(self) -> Optional[ASGIScope]:\n+ \"\"\"\n+ :return: the URL", "line": null, ...
1679ac8663168403704e9fad6f34ac73382805ea
diff --git a/sanic/models/protocol_types.py b/sanic/models/protocol_types.py index 85d8343bdd..14bc275cbf 100644 --- a/sanic/models/protocol_types.py +++ b/sanic/models/protocol_types.py @@ -2,6 +2,8 @@ from typing import Any, AnyStr, TypeVar, Union +from sanic.models.asgi import ASGIScope + if sys.version_info...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-15846@83e35b3
scikit-learn/scikit-learn
Python
15,846
Do not shadow public functions with deprecated modules
Fix #15842. This can happen for: - sklearn.decomposition.dict_learning - sklearn.inspection.partial_dependence Unfortunately this solution will always trigger the import of those two deprecated module (catching the FutureWarning). Subsequent imports (by the user) will therefore no longer see the warning as it...
2019-12-09T14:58:45Z
dict_learning and partial_dependence functions can be shadowed by deprecated module imports Since scikit-learn 0.22, the `dict_learning` function is defined in `sklearn/decomposition/_dict_learning.py` and exposed as `sklearn.decomposition.dict_learning` in the `sklearn/decomposition/__init__.py` file. At the same t...
We saw that before with @thomasjpfan This is only an issue with pytest discovery. If you run the test files independently, you shouldn't get errors. I thought we fixed that by bumping the minimal pytest version, but looking at the git blame and my commit history, I cannot find where/if this was actually done :/ T...
[ { "body": "Since scikit-learn 0.22, the `dict_learning` function is defined in `sklearn/decomposition/_dict_learning.py` and exposed as `sklearn.decomposition.dict_learning` in the `sklearn/decomposition/__init__.py` file.\r\n\r\nAt the same time we also have a `sklearn/decomposition/dict_learning.py` deprecate...
556eb9246d1290ea248f2e3b3581dc53e75b8061
{ "head_commit": "83e35b38f0c164f36e66e94b252a3d9fc32db930", "head_commit_message": "Improve phrasing", "patch_to_review": "diff --git a/sklearn/decomposition/__init__.py b/sklearn/decomposition/__init__.py\nindex 93a51b04f38d2..6646382dc1ef8 100644\n--- a/sklearn/decomposition/__init__.py\n+++ b/sklearn/decompos...
[ { "diff_hunk": "@@ -1,8 +1,21 @@\n \"\"\"The :mod:`sklearn.inspection` module includes tools for model inspection.\"\"\"\n-from ._partial_dependence import partial_dependence\n-from ._partial_dependence import plot_partial_dependence\n-from ._partial_dependence import PartialDependenceDisplay\n-from ._permutati...
36cfc41e4b210baec8c58572ab816c1f5a716688
diff --git a/sklearn/decomposition/__init__.py b/sklearn/decomposition/__init__.py index c8b93ea2e4f9c..42f661171eafe 100644 --- a/sklearn/decomposition/__init__.py +++ b/sklearn/decomposition/__init__.py @@ -4,19 +4,33 @@ this module can be regarded as dimensionality reduction techniques. """ -from ._nmf import NM...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Refactoring / Architectural Improvement" }
scikit-learn__scikit-learn-15597@0897b99
scikit-learn/scikit-learn
Python
15,597
[MRG] require scipy in setup
Could fix #15595. This requires scipy in setup.py, but I'm sure we shouldn't do this. This is a starting point for us to figure out what to do. Feel free to change or open another PR.
2019-11-11T15:21:59Z
sklearn/utils/_cython_blas.pyx fails to cythonize if scipy is not installed in the env Now that we don't cythonize before creating the sdist, using the sdist fails to properly install the package if the freshly created environment doesn't include scipy. `pip install scikit-learnxxx.tar.gz` on an environment which ha...
`dgemm` is cimported from scipy and if cython can't find (scipy isn't installed) it it will assume it's a python thing? Isn't scipy a build dependency anyway? the way to specify build dependencies is to use `pyproject.toml`, which we've decided not to include in this release. Should we then error and tell users to i...
[ { "body": "Now that we don't cythonize before creating the sdist, using the sdist fails to properly install the package if the freshly created environment doesn't include scipy.\r\n\r\n`pip install scikit-learnxxx.tar.gz` on an environment which has numpy and cython, will fail while trying to cythonize `sklearn...
ad57efa729c535cb18c82db5263d4c924e0ba12d
{ "head_commit": "0897b99310ab7c8e76354e99e4f1b61a543fe444", "head_commit_message": "require scipy in setup", "patch_to_review": "diff --git a/setup.py b/setup.py\nindex dc0791f609ca6..00f8587a86ba7 100755\n--- a/setup.py\n+++ b/setup.py\n@@ -11,6 +11,7 @@\n from distutils.command.clean import clean as Clean\n fr...
[ { "diff_hunk": "@@ -183,24 +184,24 @@ def configuration(parent_package='', top_path=None):\n return config\n \n \n-def get_numpy_status():\n+def get_package_status(package, min_version):\n \"\"\"\n- Returns a dictionary containing a boolean specifying whether NumPy\n+ Returns a dictionary containi...
f1cb8e90e0194297a29f0adb40b6a69cf231cb04
diff --git a/setup.py b/setup.py index dc0791f609ca6..799545c984bf4 100755 --- a/setup.py +++ b/setup.py @@ -11,6 +11,7 @@ from distutils.command.clean import clean as Clean from pkg_resources import parse_version import traceback +import importlib try: import builtins except ImportError: @@ -183,24 +184,41 @...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Dependency Updates & Env Compatibility" }
sanic-org__sanic-2246@9c753d1
sanic-org/sanic
Python
2,246
Account for BP with exception handler but no routes
See [discussion](https://github.com/sanic-org/sanic/issues/2202#issuecomment-927693978). If a BP has an exception handler and no routes assigned, it could inadvertently attach the handler to the global scope. This would be an unintended and difficult to debug consequence. Fixes #2242
2021-09-27T09:55:45Z
Blueprint exceptions are sometimes handled by other blueprint's exception handlers **Describe the bug** Exceptions thrown from within one blueprint are sometimes handled by the exception handler of another, unrelated blueprint instead of by its own. I have not had time to check whether this happens all the time or onl...
[ { "body": "**Describe the bug**\r\nExceptions thrown from within one blueprint are sometimes handled by the exception handler of another, unrelated blueprint instead of by its own. I have not had time to check whether this happens all the time or only if specific conditions are met, but I have attached a code s...
6ffc4d9756798ddb9ca18a7b1c7ca66e9ce8e441
{ "head_commit": "9c753d1671f6929a079b1088a2d1a3c071db0597", "head_commit_message": "Account for BP with exception handler but no routes", "patch_to_review": "diff --git a/sanic/blueprints.py b/sanic/blueprints.py\nindex 31809acf74..57426a865a 100644\n--- a/sanic/blueprints.py\n+++ b/sanic/blueprints.py\n@@ -337,...
[ { "diff_hunk": "@@ -337,10 +337,11 @@ def register(self, app, options):\n middleware.append(app._apply_middleware(future, route_names))\n \n # Exceptions\n- for future in self._future_exceptions:\n- exception_handlers.append(\n- app._apply_exception_handl...
794be5a40dc2591bec95cb7e136afc7178fb9bdc
diff --git a/sanic/blueprints.py b/sanic/blueprints.py index 31809acf74..fd7332aaf0 100644 --- a/sanic/blueprints.py +++ b/sanic/blueprints.py @@ -331,21 +331,22 @@ def register(self, app, options): route_names = [route.name for route in routes if route] - # Middleware if route_names: + ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-15557@6003644
scikit-learn/scikit-learn
Python
15,557
[MRG+2] Allowing Gaussian process kernels on structured data - updated
Fixes #13936. This PR is a from-scratch refresh of #13954 (with all previous modifications incorporated) based on the latest master branch. Made the Gaussian process regressor and classifier compatible with generic kernels on arbitrary data. Specifically: 1. Added a `requires_vector_input` property to all the bu...
2019-11-07T00:03:59Z
GaussianProcessRegressor unnecessarily forcing training samples to be array_like The current interface precludes the application of the GPR module to cases where the training samples are sequences, trees, graphs etc. In fact, GPR should not care about whether its input are fixed-length feature vectors or not --- that s...
If you'd like to submit a pull request implementing that support (perhaps with an example demonstrating a custom kernel) I think it would be well received OK. I'm working on it.
[ { "body": "The current interface precludes the application of the GPR module to cases where the training samples are sequences, trees, graphs etc. In fact, GPR should not care about whether its input are fixed-length feature vectors or not --- that should be handled by the kernel.\r\n\r\nExpected usage scenario...
c96e0958da46ebef482a4084cdda3285d5f5ad23
{ "head_commit": "60036443656a599a103562c68e94c4fd774ee8bc", "head_commit_message": "documentation update", "patch_to_review": "diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst\nindex 525ae77311064..4d5ee03853e16 100644\n--- a/doc/whats_new/v0.22.rst\n+++ b/doc/whats_new/v0.22.rst\n@@ -405,6 +405,15...
[ { "diff_hunk": "@@ -0,0 +1,172 @@\n+\"\"\"\n+==========================================================================\n+Gaussian processes on discrete data structures\n+==========================================================================\n+\n+This example illustrates the use of Gaussian processes for re...
28904c0fc756f430f315375b9d55c0d10f38fe3a
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index 525ae77311064..4d5ee03853e16 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -405,6 +405,15 @@ Changelog estimator's constructor but not stored as attributes on the instance. :pr:`14464` by `Joel Nothman`_. +- |Feature| G...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-15530@d0c9912
scikit-learn/scikit-learn
Python
15,530
ENH Consistent checks for sample weights in linear models
#### Reference Issues/PRs Fixes #15358 for `linear_model`. #### What is done in this PR: Use `_check_sample_weight` throughout linear models.
2019-11-03T19:00:01Z
Use _check_sample_weight to consistently validate sample_weight We recently introduced `utils.validation._check_sample_weight` which returns a validated `sample_weight` array. We should use it consistently throughout the code base, instead of relying on custom and adhoc checks like `check_consistent_lenght` or `chec...
@NicolasHug I could give it a try. Furthermore, should `_check_sample_weight` also guarantee non-negativeness and sum(sw) > 0 ? I think for the above mentioned estimators @NicolasHug intended this as an easier refactoring issues for new contributors, but if you want to look into it feel free to open PRs. > (I left-o...
[ { "body": "We recently introduced `utils.validation._check_sample_weight` which returns a validated `sample_weight` array.\r\n\r\nWe should use it consistently throughout the code base, instead of relying on custom and adhoc checks like `check_consistent_lenght` or `check_array` (which are now handled by `_chec...
f0b694d15b538e81e6d2118f0c656b0220103a75
{ "head_commit": "d0c99121fbb1eeb7994c9ae9f2c1b8e01c8ec8c4", "head_commit_message": "Revert moving check_X_y", "patch_to_review": "diff --git a/sklearn/linear_model/_base.py b/sklearn/linear_model/_base.py\nindex ef53aa6037c86..d9b2fa387be85 100644\n--- a/sklearn/linear_model/_base.py\n+++ b/sklearn/linear_model/...
[ { "diff_hunk": "@@ -262,7 +261,7 @@ def ridge_regression(X, y, alpha, sample_weight=None, solver='auto',\n assumed to be specific to the targets. Hence they must correspond in\n number.\n \n- sample_weight : float or numpy array of shape (n_samples,), default=None\n+ sample_weight : float ...
5716dae46ef2dfb99790ca417ce0579189062bcb
diff --git a/sklearn/linear_model/_base.py b/sklearn/linear_model/_base.py index ef53aa6037c86..d9b2fa387be85 100644 --- a/sklearn/linear_model/_base.py +++ b/sklearn/linear_model/_base.py @@ -34,7 +34,7 @@ from ..utils.fixes import sparse_lsqr from ..utils._seq_dataset import ArrayDataset32, CSRDataset32 from ..uti...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Refactoring / Architectural Improvement" }
sanic-org__sanic-2150@af6787e
sanic-org/sanic
Python
2,150
Allow blueprints and groups to be infinitely reusable
The main purpose of this PR is to allow blueprints and blueprint groups to be more composable and reusable when applied to multiple groups. See issue #2113 for further discussion. Resolves #2113 --- This PR does _not_ really introduce anything new. The difference is only in the time at which we are applying a...
2021-06-01T06:44:41Z
Reuse of blueprint groups causes duplicate route errors **Describe the bug** When adding a blueprint to multiple groups, the router seems to club `url_prefix`es together in an unexpected way, resulting in duplicate route errors. ``` Traceback (most recent call last): File "/home/jraymond/Development/sanic-org...
Problem appears [to be here](https://github.com/sanic-org/sanic/blob/e21521f45c0b58bac619a9111fd47426e208bf08/sanic/blueprint_group.py#L176). Not sure if there's an obvious fix, but the API for blueprint groups doesn't indicate that the op is destructive. Can try to come up with sth if nobody beats me to the punch Than...
[ { "body": "**Describe the bug**\r\n\r\nWhen adding a blueprint to multiple groups, the router seems to club `url_prefix`es together in an unexpected way, resulting in duplicate route errors.\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/jraymond/Development/sanic-org/bugreport/bugreport/app...
108a4a99c7e12561b35b62e26ecfc33c77db802d
{ "head_commit": "af6787ee32ec12d2e0fe6fe5df64f34fe7878fb9", "head_commit_message": "Merge branch 'main' into reusable-blueprints", "patch_to_review": "diff --git a/sanic/app.py b/sanic/app.py\nindex 002c92dcf9..ec9027b512 100644\n--- a/sanic/app.py\n+++ b/sanic/app.py\n@@ -420,7 +420,33 @@ def blueprint(self, bl...
[ { "diff_hunk": "@@ -187,35 +187,14 @@ def __len__(self) -> int:\n \"\"\"\n return len(self._blueprints)\n \n- def _sanitize_blueprint(self, bp: \"sanic.Blueprint\") -> \"sanic.Blueprint\":\n- \"\"\"\n- Sanitize the Blueprint Entity to override the Version and strict slash\n- ...
1e330f6200f440aa4528355df5f0d7454ef4b078
diff --git a/sanic/app.py b/sanic/app.py index 002c92dcf9..ec9027b512 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -420,7 +420,33 @@ def blueprint(self, blueprint, **options): """ if isinstance(blueprint, (list, tuple, BlueprintGroup)): for item in blueprint: - self.blue...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-15495@173006f
scikit-learn/scikit-learn
Python
15,495
[MRG] Standardize sample weights validation in BaseDecisionTree
#### Reference Issues/PRs Fixes #15358 for BaseDecisionTree #### What does this implement/fix? Explain your changes. Replaces custom validation logic with standardized method `utils.validation._check_sample_weight` (relatively newly introduced). #### Any other comments? Two things to check: 1. the new valid...
2019-11-02T20:17:27Z
Use _check_sample_weight to consistently validate sample_weight We recently introduced `utils.validation._check_sample_weight` which returns a validated `sample_weight` array. We should use it consistently throughout the code base, instead of relying on custom and adhoc checks like `check_consistent_lenght` or `chec...
@NicolasHug I could give it a try. Furthermore, should `_check_sample_weight` also guarantee non-negativeness and sum(sw) > 0 ? I think for the above mentioned estimators @NicolasHug intended this as an easier refactoring issues for new contributors, but if you want to look into it feel free to open PRs. > (I left-o...
[ { "body": "We recently introduced `utils.validation._check_sample_weight` which returns a validated `sample_weight` array.\r\n\r\nWe should use it consistently throughout the code base, instead of relying on custom and adhoc checks like `check_consistent_lenght` or `check_array` (which are now handled by `_chec...
b13b02c311c18c2041782bcdaadd08b8fd3f216b
{ "head_commit": "173006fa94b126779153cd04d853789c93db500a", "head_commit_message": "Standardize sample weights validation in BaseDecisionTree\n\nCo-authored-by: Sallie Walecka <sallie.walecka@gmail.com>", "patch_to_review": "diff --git a/sklearn/tree/_classes.py b/sklearn/tree/_classes.py\nindex c0b1192eafc32..b...
[ { "diff_hunk": "@@ -266,18 +267,7 @@ def fit(self, X, y, sample_weight=None, check_input=True,\n \"or larger than 1\").format(max_leaf_nodes))\n \n if sample_weight is not None:\n- if (getattr(sample_weight, \"dtype\", None) != DOUBLE or\n- not...
80391ff6485d4a033bce2793b48d9c88e3e2540e
diff --git a/sklearn/tree/_classes.py b/sklearn/tree/_classes.py index c0b1192eafc32..5173d286967c6 100644 --- a/sklearn/tree/_classes.py +++ b/sklearn/tree/_classes.py @@ -32,6 +32,7 @@ from ..utils import Bunch from ..utils import check_array from ..utils import check_random_state +from ..utils.validation import _...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Code Refactoring / Architectural Improvement" }
scikit-learn__scikit-learn-15375@daa7f50
scikit-learn/scikit-learn
Python
15,375
[MRG] BUG Fixes voting named_estiamtor bug
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2019-10-28T14:10:16Z
VotingClassifier.named_estimators_ has a wrong value if some estimator is None #### Steps/Code to Reproduce ```python import numpy as np from sklearn.linear_model import LogisticRegression from sklearn.naive_bayes import GaussianNB from sklearn.ensemble import RandomForestClassifier, VotingClassifier X = np.a...
it seems the issue is due to [this code block](https://github.com/scikit-learn/scikit-learn/blob/0.21.X/sklearn/ensemble/voting.py#L104:L106) ```python self.named_estimators_ = Bunch() for k, e in zip(self.estimators, self.estimators_): self.named_estimators_[k[0]] = e ``` `self.estimators` should be replac...
[ { "body": "#### Steps/Code to Reproduce\r\n\r\n```python\r\nimport numpy as np\r\nfrom sklearn.linear_model import LogisticRegression\r\nfrom sklearn.naive_bayes import GaussianNB\r\nfrom sklearn.ensemble import RandomForestClassifier, VotingClassifier\r\n\r\nX = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], ...
5756a9934b2859b3525b76164ba3ec95a30a03f1
{ "head_commit": "daa7f507517a9b7cb66dfd6fc0545706ab6fbbae", "head_commit_message": "DOC Adds to whats_new", "patch_to_review": "diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst\nindex 91a1d9eb90dcd..f1ff286ba4c07 100644\n--- a/doc/whats_new/v0.22.rst\n+++ b/doc/whats_new/v0.22.rst\n@@ -714,6 +714,1...
[ { "diff_hunk": "@@ -560,3 +560,21 @@ def test_deprecate_none_transformer(Voter, BaseEstimator):\n \"Use the string 'drop' instead.\")\n with pytest.warns(DeprecationWarning, match=msg):\n est.fit(X, y)\n+\n+\n+# TODO: Remove drop pparametrize in 0.24 when None is removed in Voting*", ...
8b8c4e30a80c8e5cb14e497fb3604de9dac80854
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index 91a1d9eb90dcd..9e39bdfec99e7 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -714,6 +714,14 @@ Changelog - ``optimize.newton_cg` - ``random.random_choice_csc`` +:mod:`sklearn.voting` +..................... + +- |Fix| The ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-15257@89045f2
scikit-learn/scikit-learn
Python
15,257
[MRG+1] Batching in nmf/sparse_dot to prevent MemoryError
#### 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 --> Fi...
2019-10-15T09:12:17Z
MemoryError when using NMF's multiplicative update solver #### Description MemoryError when using NMF's multiplicative update solver with method="Kullback_leibler". The program tries to assign a matrix with size (# nonzero elements, rank) in function _special_sparse_dot (in decomposition/nmf.py) and sums the columns. ...
That is indeed a bug, thanks for the report and the short reproducing example. PR most welcome ! The loop will be very slow, so we might need to do some batching or some cython here.
[ { "body": "#### Description\r\nMemoryError when using NMF's multiplicative update solver with method=\"Kullback_leibler\". The program tries to assign a matrix with size (# nonzero elements, rank) in function _special_sparse_dot (in decomposition/nmf.py) and sums the columns. On my machine, this results in a Me...
d0d8f204675fd2718d373f8cde5ae12707521061
{ "head_commit": "89045f2ccf2da6a85707a3a8fa432c51db5b33cd", "head_commit_message": "Avoid multiple statements on one line", "patch_to_review": "diff --git a/sklearn/decomposition/nmf.py b/sklearn/decomposition/nmf.py\nindex 0cf663e123861..d0a00bf5e8018 100644\n--- a/sklearn/decomposition/nmf.py\n+++ b/sklearn/de...
[ { "diff_hunk": "@@ -170,7 +169,19 @@ def _special_sparse_dot(W, H, X):\n \"\"\"Computes np.dot(W, H), only where X is non zero.\"\"\"\n if sp.issparse(X):\n ii, jj = X.nonzero()\n- dot_vals = np.multiply(W[ii, :], H.T[jj, :]).sum(axis=1)\n+ n_vals = ii.shape[0]\n+ dot_vals =...
fd9645df81be7afa7c44f9911c5e123488933905
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index 12e57622f52cd..d149adb6f5104 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -160,6 +160,10 @@ Changelog underlying :class:`linear_model.LassoLars` when `algorithm='lasso_lars'`. :issue:`12650` by `Adrin Jalali`_. +- |Eff...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Performance Optimizations" }
scikit-learn__scikit-learn-15099@1a3c8e1
scikit-learn/scikit-learn
Python
15,099
[MRG] Fixed n_support_ attr for OneClassSVM and SVR
Closes https://github.com/scikit-learn/scikit-learn/pull/14799 Closes https://github.com/scikit-learn/scikit-learn/pull/15034 Fixes https://github.com/scikit-learn/scikit-learn/issues/14774 @amueller I think this is enough? ~~(That doesn't fix the nonsense that the attribute has size 2 (i.e. 2 classes) for On...
2019-09-26T18:26:41Z
OneClassSVM n_support_ returns incorrect value #### Description Example: OneClassSVM n_support returns incorrect values> 0 #### Steps/Code to Reproduce Example: ```python from sklearn.svm import OneClassSVM X = [[0], [0.44], [0.45], [0.46], [1]] clf = OneClassSVM().fit(X) clf.n_support_ ``` #### Exp...
you forgot one line in your reproduction script, I think? doesn't look like ``random_state`` exists any more also ;) https://scikit-learn.org/dev/modules/generated/sklearn.svm.OneClassSVM.html#sklearn.svm.OneClassSV oops, edited @eugeniaft i'm just being picky ;) I'm working on this issue. WiMLDS sprint. same issue f...
[ { "body": "#### Description\r\n Example: OneClassSVM n_support returns incorrect values> 0\r\n\r\n#### Steps/Code to Reproduce\r\n\r\nExample:\r\n```python\r\nfrom sklearn.svm import OneClassSVM\r\n\r\nX = [[0], [0.44], [0.45], [0.46], [1]]\r\nclf = OneClassSVM().fit(X)\r\nclf.n_support_\r\n```\r\n\r\n#### Expe...
c4f372c2de33db77e4dbc5a136d1443a20a3cb45
{ "head_commit": "1a3c8e1b22451643a3fc51f0e6a12a1f612d2ca5", "head_commit_message": "Fixed size", "patch_to_review": "diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst\nindex 24056ad94486a..b1679c670e918 100644\n--- a/doc/whats_new/v0.22.rst\n+++ b/doc/whats_new/v0.22.rst\n@@ -532,6 +532,10 @@ Change...
[ { "diff_hunk": "@@ -484,6 +484,17 @@ def coef_(self):\n def _get_coef(self):\n return safe_sparse_dot(self._dual_coef_, self.support_vectors_)\n \n+ @property\n+ def n_support_(self):\n+ check_is_fitted(self)", "line": null, "original_line": 489, "original_start_line": null,...
86340408fb1e7bdaf99b30a43d2b9207c527bf55
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index a2d4a8dac7a9b..260229a04a19d 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -532,6 +532,10 @@ Changelog Now in these cases, fit() will fail with an Exception. :pr:`14286` by :user:`Alex Shacked <alexshacked>`. +- |Fix| T...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-15096@fb691e8
scikit-learn/scikit-learn
Python
15,096
MRG clone parameters in gridsearch etc
Fixed #10063 without going through the pain of #8350. I don't see a case where this could change behavior, as we immediately call ``fit`` after setting the steps, but maybe I'm missing something. This not only removes possible confusion of users (see #8350 on how the stored estimators are quite hard to interpret)...
2019-09-26T17:13:08Z
GridSearchCV saves all fitted estimator in cv_results['params'] when params are estimators #### Description I use GridSearchCV to optimize the hyperparameters of a pipeline. I set the param grid by inputing transformers or estimators at different steps of the pipeline, following the Pipeline documentation: > A step...
A solution could be to clone the estimator after set_param call in _fit_and_score, and return the new cloned estimator. However it would break any function that use _fit_and_score and expect to keep using the same estimator instance than passed in _fit_and_score.. Hmm... I agree this is a bit of an issue. But I think i...
[ { "body": "#### Description\r\nI use GridSearchCV to optimize the hyperparameters of a pipeline. I set the param grid by inputing transformers or estimators at different steps of the pipeline, following the Pipeline documentation:\r\n\r\n> A step’s estimator may be replaced entirely by setting the parameter wit...
e424ab17bb73472a829faca3dfdc599a9d6df56b
{ "head_commit": "fb691e8d9f0814cb23bd892d799ed61fea12b185", "head_commit_message": "add more tests", "patch_to_review": "diff --git a/sklearn/model_selection/_search.py b/sklearn/model_selection/_search.py\nindex 80e78e6b7f913..4b52c97901223 100644\n--- a/sklearn/model_selection/_search.py\n+++ b/sklearn/model_s...
[ { "diff_hunk": "@@ -198,6 +198,21 @@ def test_grid_search():\n assert_raises(ValueError, grid_search.fit, X, y)\n \n \n+def test_grid_search_pipeline_steps():\n+ pipe = Pipeline([('regressor', LinearRegression())])\n+ param_grid = {'regressor': [LinearRegression(), Ridge()]}\n+ grid_search = GridSe...
9da28a7dbfaccf2071550f84802a3f00f71785eb
diff --git a/sklearn/model_selection/_search.py b/sklearn/model_selection/_search.py index 80e78e6b7f913..4b52c97901223 100644 --- a/sklearn/model_selection/_search.py +++ b/sklearn/model_selection/_search.py @@ -730,8 +730,10 @@ def evaluate_candidates(candidate_params): self.best_params_ = results["param...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-15084@b733971
scikit-learn/scikit-learn
Python
15,084
[MRG] MAINT add base class for voting and stacking
closes #15056 Create a base class for Voting* and Stacking*. They both are an ensemble of multiple learners type. They could share the `get_params`, `set_params` and validation of `estimators` (as well as the fitted attributes then). This base class could be contrasted with the ensemble of single learner type s...
2019-09-24T17:25:41Z
VotingClassifier and roc_auc TypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe' and #### Description VotingClassifier TypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe' #### Steps/Code to Reproduce ```python f...
`Ridge` and `LinearRegression` are not classifiers, which makes them incompatible with `VotingClassifier`. > Ridge and LinearRegression are not classifiers, which makes them incompatible with VotingClassifier. +1 though maybe we should return a better error message. Shall we check the base estimators with `sklearn.b...
[ { "body": "#### Description\r\nVotingClassifier\r\nTypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'\r\n\r\n#### Steps/Code to Reproduce\r\n```python\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.preprocessing import StandardScaler, ...
5e4b2757d61563889672e395d9e92d9372d357f6
{ "head_commit": "b7339714db705be9e6a5e8f9f2e59992d1dafedb", "head_commit_message": "remove parameters from base class", "patch_to_review": "diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst\nindex ca92bcd57ed97..b2653f8c5565f 100644\n--- a/doc/whats_new/v0.22.rst\n+++ b/doc/whats_new/v0.22.rst\n@@ -...
[ { "diff_hunk": "@@ -236,6 +236,11 @@ Changelog\n :user:`Matt Hancock <notmatthancock>` and\n :pr:`5963` by :user:`Pablo Duboue <DrDub>`.\n \n+- |Fix| Enforce underlying estimator to be the same type than voting estimator.", "line": null, "original_line": 239, "original_start_line": null, "pa...
bf8cc385e4f43462fa86a2ff2a3034c5c305141e
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index ca92bcd57ed97..e8aa8a49794f8 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -236,6 +236,13 @@ Changelog :user:`Matt Hancock <notmatthancock>` and :pr:`5963` by :user:`Pablo Duboue <DrDub>`. +- |Fix| Stacking and Voting e...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-15277@594e3a6
scikit-learn/scikit-learn
Python
15,277
[MRG] Makes linting a dependency for most azure jobs
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2019-10-16T18:28:13Z
Use linting to for a requirement for some jobs on azure Now that there are 8 jobs on azure, may we use linting as a dependency on some of these jobs to save resources? For example the following will always run: 1. `Linux32 py35_ubuntu_atlas_32bit` 2. `Linux pylatest_pip_openblas_pandas` 3. `macOS pylatest_conda_mk...
+1 We may even just run one of them? Linting is very easy to check/fix locally I'm okay with this >
[ { "body": "Now that there are 8 jobs on azure, may we use linting as a dependency on some of these jobs to save resources? For example the following will always run:\r\n\r\n1. `Linux32 py35_ubuntu_atlas_32bit`\r\n2. `Linux pylatest_pip_openblas_pandas`\r\n3. `macOS pylatest_conda_mkl`\r\n4. `Windows py37_conda_...
70351e6efca51de0ec2a2834831d67f024a9525b
{ "head_commit": "594e3a63e3aac8d2ea529524e56d2403de981634", "head_commit_message": "STY Fixed", "patch_to_review": "diff --git a/azure-pipelines.yml b/azure-pipelines.yml\nindex 9eca835865868..b614046317a10 100644\n--- a/azure-pipelines.yml\n+++ b/azure-pipelines.yml\n@@ -1,9 +1,49 @@\n # Adapted from https://gi...
[ { "diff_hunk": "@@ -1,9 +1,49 @@\n # Adapted from https://github.com/pandas-dev/pandas/blob/master/azure-pipelines.yml\n jobs:\n+- job: linting\n+ displayName: Linting\n+ pool:\n+ vmImage: ubuntu-16.04\n+ steps:\n+ - bash: echo \"##vso[task.prependpath]$CONDA/bin\"\n+ displayName: Add conda to PAT...
add87dc4d612ed61e7779fda4c85355b1b5a7b23
diff --git a/.circleci/config.yml b/.circleci/config.yml index de08f2d5622f5..04c8979fa0d6a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -91,11 +91,8 @@ jobs: name: dependencies command: sudo pip install flake8 - run: - name: flake8 - command: ./build_to...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Test Suite / CI Enhancements" }
scikit-learn__scikit-learn-14999@3244ba0
scikit-learn/scikit-learn
Python
14,999
[MRG] Using one single random seed for warm start in HGBDT
#### Reference Issues/PRs Discussion from #14034. **This PR is for the histogram-based version of GBDT.** #### What does this implement/fix? Explain your changes. One single random seed is used instead of several ones. It is needed to save it for warm starting, so that every time there is some sort of RNG, the...
2019-09-17T07:06:27Z
data leak in GBDT due to warm start (This is about the non-histogram-based version of GBDTs) X is split into train and validation data with `train_test_split(random_state=self.random_state)`. As @johannfaouzi noted, in a warm starting context, this will produce a leak if If `self.random_state` is a `RandomState` ...
After discussing with @amueller , maybe the best option would be to: - store a seed attribute e.g. `_train_val_split_seed` that would be generated **once**, the first time `fit` is called - pass this seed as the `random_state` parameter to `train_test_split()`. - add a small test making sure this parameter stays...
[ { "body": "(This is about the non-histogram-based version of GBDTs)\r\n\r\nX is split into train and validation data with `train_test_split(random_state=self.random_state)`.\r\n\r\nAs @johannfaouzi noted, in a warm starting context, this will produce a leak if If `self.random_state` is a `RandomState` instance:...
d2476fb679f05e80c56e8b151ff0f6d7a470e4ae
{ "head_commit": "3244ba0035d5ee1bde18e56f20a0f930c4404217", "head_commit_message": "Fix dtype when generating random seed for 32 bit versions", "patch_to_review": "diff --git a/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py b/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py\nindex b5c...
[ { "diff_hunk": "@@ -169,22 +169,16 @@ def _get_rng(rng_type):\n gb_1 = GradientBoosting(n_iter_no_change=5, max_iter=2,\n random_state=random_state)\n gb_1.fit(X, y)\n- train_val_seed_1 = gb_1._train_val_split_seed\n- small_trainset_seed_1 = gb_1._small_trainset_seed\n+...
333be5aad01b8d3ee5d0a0490d5fdff37010d702
diff --git a/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py b/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py index b5c2d2b77f841..e9db7b781b44b 100644 --- a/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py +++ b/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py @@ ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14931@b58ddea
scikit-learn/scikit-learn
Python
14,931
DOC Fix "Duplicate labels" & "Duplicate .. target" sphinx warn
#### Reference Issues/PRs Fixes #11533 #### What does this implement/fix? Explain your changes. 1. ```duplicate label coding-guidelines``` fixed removing the section coding-guidelines from ```contributing.rst``` (this was a duplicate of the same section in ```develop.rst```) 2. ```duplicate label ``` in "wh...
2019-09-09T12:42:12Z
Duplicate Label warnings in sphinx When building the docs, we get several "duplicate label" warnings. I think that's because we ``include`` some files that are also in the toctree, so the files are there twice. I think it's mostly the datasets, maybe also the whatsnew?
I think @jeremiedbb was tackling the datasets. What's new is harder to fix nicely... Some warnings are still present on current master: ``` scikit-learn/doc/developers/contributing.rst:774: WARNING: duplicate label coding-guidelines, other instance in /home/cmarmo/software/scikit-learn/doc/developers/develop.rst ...
[ { "body": "When building the docs, we get several \"duplicate label\" warnings. I think that's because we ``include`` some files that are also in the toctree, so the files are there twice. I think it's mostly the datasets, maybe also the whatsnew?", "number": 11533, "title": "Duplicate Label warnings in...
fbb2c7c7007dc373c462e39ab273a183a8823d58
{ "head_commit": "b58ddea5efe3d83fb50bb115c3e666df2714f205", "head_commit_message": "Rename .inc to .rst : Duplicate labels warnings will stay there but manual maintenance is avoided.", "patch_to_review": "diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst\nindex e6ccabb18944e..53c3401...
[ { "diff_hunk": "@@ -24,8 +24,8 @@ Legend for changelogs\n - |API|: you will need to change your code to have the same effect in the\n future; or a feature will be removed in the future.\n \n-.. include:: whats_new/v0.22.rst\n-.. include:: whats_new/v0.21.rst\n+.. include:: whats_new/v0.22.inc\n+.. include:: w...
a26b5b98527f0cb4726e538653ceb6373d43ea08
diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst index e6ccabb18944e..53c340136ba53 100644 --- a/doc/developers/contributing.rst +++ b/doc/developers/contributing.rst @@ -349,7 +349,7 @@ complies with the following rules before marking a PR as ``[MRG]``. The for any system, but please ...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
scikit-learn__scikit-learn-14983@f23a42f
scikit-learn/scikit-learn
Python
14,983
[MGR] Fix RepeatedKFold and RepeatedStratifiedKFold __repr__ string
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs Fixes #14970. #### What does this implement/fix? Explain your changes...
2019-09-14T15:31:18Z
RepeatedKFold and RepeatedStratifiedKFold do not show correct __repr__ string #### Description `RepeatedKFold` and `RepeatedStratifiedKFold` do not show correct \_\_repr\_\_ string. #### Steps/Code to Reproduce ```python >>> from sklearn.model_selection import RepeatedKFold, RepeatedStratifiedKFold >>> repr(...
The `__repr__` is not defined in the `_RepeatedSplit` class from which these cross-validation are inheriting. A possible fix should be: ```diff diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index ab681e89c..8a16f68bc 100644 --- a/sklearn/model_selection/_split.py +++ b/sklear...
[ { "body": "#### Description\r\n\r\n`RepeatedKFold` and `RepeatedStratifiedKFold` do not show correct \\_\\_repr\\_\\_ string.\r\n\r\n#### Steps/Code to Reproduce\r\n\r\n```python\r\n>>> from sklearn.model_selection import RepeatedKFold, RepeatedStratifiedKFold\r\n>>> repr(RepeatedKFold())\r\n>>> repr(RepeatedSt...
06632c0d185128a53c57ccc73b25b6408e90bb89
{ "head_commit": "f23a42f2950d213ae6dcb2eb9778b75c7f2baa88", "head_commit_message": "Added blank lines around new test function", "patch_to_review": "diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py\nindex c49a3ce6aea4e..ceee1a08146ab 100644\n--- a/sklearn/model_selection/_split....
[ { "diff_hunk": "@@ -980,6 +980,18 @@ def test_repeated_cv_value_errors():\n assert_raises(ValueError, cv, n_repeats=1.5)\n \n \n+def test_repeated_cv_repr():", "line": null, "original_line": 983, "original_start_line": null, "path": "sklearn/model_selection/tests/test_split.py", "sta...
0d9fd1cc8ad05d967129c37aaad7c8c77c5217ef
diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index c49a3ce6aea4e..ceee1a08146ab 100644 --- a/sklearn/model_selection/_split.py +++ b/sklearn/model_selection/_split.py @@ -1163,6 +1163,9 @@ def get_n_splits(self, X=None, y=None, groups=None): **self.cvargs) ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14902@892f09d
scikit-learn/scikit-learn
Python
14,902
Fix buffer dtype mismatch in isotonic regression
Fixes https://github.com/scikit-learn/scikit-learn/issues/15004 Error replay: ``` from sklearn import isotonic import numpy as np m = isotonic.IsotonicRegression() m.fit(np.zeros((10,),dtype='float32'), np.zeros((10,),dtype='int64')) ``` Gives ``` File "sklearn/_isotonic.pyx", line 66, in sklearn._isotonic....
2019-09-06T06:23:50Z
Numpy float32 giving buffer mismatch error (as double) in Cython code of Isotonic regression #### Description The `_make_unique` method in `_isotonic.pyx` throws buffer mismatch error (only when using float 32, which seems to be recast as double). The error doesn't come up when using float64 (Larger story: I am usi...
[ { "body": "#### Description\r\nThe `_make_unique` method in `_isotonic.pyx` throws buffer mismatch error (only when using float 32, which seems to be recast as double). The error doesn't come up when using float64\r\n\r\n(Larger story: I am using CalibratedClassifierCV with isotonic calibration with the probabi...
d369a5f294bed106135216325bbc12a85f161a3d
{ "head_commit": "892f09d631b84592c489d3068f3838467496df40", "head_commit_message": "fix mismatched dtype problem. added test.", "patch_to_review": "diff --git a/sklearn/isotonic.py b/sklearn/isotonic.py\nindex 6e473334ad1c8..aa70b15cff769 100644\n--- a/sklearn/isotonic.py\n+++ b/sklearn/isotonic.py\n@@ -324,10 +...
[ { "diff_hunk": "@@ -385,19 +385,19 @@ def test_isotonic_ymin_ymax():\n -0.896, -0.377, -1.327, 0.180])\n y = isotonic_regression(x, y_min=0., y_max=0.1)\n \n- assert(np.all(y >= 0))\n- assert(np.all(y <= 0.1))\n+ assert (np.all(y >= 0))", "line": null, "original_line": 388...
a4db4871983c10c63e3854e090f402f3e84b96d0
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index 8987ee1cc359b..4514072736640 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -452,6 +452,14 @@ Changelog with a target matrix `Y` in which the first column was constant. :issue:`13609` by :user:`Camila Williamson <camilaagw...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14908@adc99dd
scikit-learn/scikit-learn
Python
14,908
TST Improve error message in DummyClassifier
Fix #14903 Add to the error message the constant value passed and the real possible values in the data when the constant value is not in the training data.
2019-09-06T12:22:44Z
Error could be improved with DummyClassifier constant strategy when constant value not in training data ```py from sklearn.dummy import DummyClassifier clf = DummyClassifier(strategy='constant', constant='not-in-dataset') clf.fit([[1., 2.]], ['class1']) ``` Error: ``` ------------------------------------------...
ok, I am looking at this issue @LakshKD we are having the scikit-learn sprint at EuroScipy. Unless you are here too, would you mind trying to find another issue to work on? Hopefully you don't mind too much. Basically I think this issue is ideal for someone who is getting started with scikit-learn and I see you are ...
[ { "body": "```py\r\nfrom sklearn.dummy import DummyClassifier\r\nclf = DummyClassifier(strategy='constant', constant='not-in-dataset')\r\nclf.fit([[1., 2.]], ['class1'])\r\n```\r\n\r\nError:\r\n```\r\n---------------------------------------------------------------------------\r\nValueError ...
a1f514f2e1f20f71f282d867ae0e8db3a5c4a13c
{ "head_commit": "adc99dd93638c3a03eb351ee8b780a98eb397e24", "head_commit_message": "Fix flake8 warning", "patch_to_review": "diff --git a/sklearn/dummy.py b/sklearn/dummy.py\nindex ab79321bd4fa3..e8f9bce210015 100644\n--- a/sklearn/dummy.py\n+++ b/sklearn/dummy.py\n@@ -143,13 +143,17 @@ def fit(self, X, y, sampl...
[ { "diff_hunk": "@@ -143,13 +143,17 @@ def fit(self, X, y, sample_weight=None):\n self.n_classes_,\n self.class_prior_) = class_distribution(y, sample_weight)\n \n- if (self.strategy == \"constant\" and\n- any(constant[k] not in self.classes_[k]\n- for k...
481dde1767f12d2ba474147e3e331dc6420c0821
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index 8987ee1cc359b..3feb5d2476313 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -112,6 +112,13 @@ Changelog need to store the entire dense matrix at once. :pr:`13960` by :user:`Scott Gigante <scottgigante>`. +:mod:`sklearn.d...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Documentation Updates" }
scikit-learn__scikit-learn-14869@1c82068
scikit-learn/scikit-learn
Python
14,869
FIX switch to binary_crossentropy if a binary problem
Fixes #14858. Raise a warning and switch to `binary_crossentropy` if it's a binary classification problem and `categorical_crossentropy` is given.
2019-09-02T16:28:25Z
HGBC with categorical_crossentropy fails silently on binary classification ```python import numpy as np from sklearn.experimental import enable_hist_gradient_boosting from sklearn.ensemble import HistGradientBoostingClassifier X = [[1, 0], [1, 0], [1, 0], [0, 1], [1, 1]] y = [1, 1, 1, 0, ...
Thanks for the report, I think changing ```py self.n_trees_per_iteration_ = 1 if n_classes <= 2 else n_classes ``` to ``` self.n_trees_per_iteration_ = n_classes ``` would make categorical-crossentropy behave like the log loss. But I think we want to error in this case: categorical-crossentropy will be ...
[ { "body": "```python\r\nimport numpy as np\r\nfrom sklearn.experimental import enable_hist_gradient_boosting\r\nfrom sklearn.ensemble import HistGradientBoostingClassifier\r\n\r\nX = [[1, 0],\r\n [1, 0],\r\n [1, 0],\r\n [0, 1],\r\n [1, 1]]\r\ny = [1, 1, 1, 0, 1]\r\ngb = HistGradientBoostingClass...
1018f9f98c80fb42e30ab5fd42b554322a057fbf
{ "head_commit": "1c820684616424fd406f2470264c294054cc340b", "head_commit_message": "switch to raising an error", "patch_to_review": "diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst\nindex ce3174218679f..f935ad5d04056 100644\n--- a/doc/whats_new/v0.22.rst\n+++ b/doc/whats_new/v0.22.rst\n@@ -136,6 +...
[ { "diff_hunk": "@@ -1045,4 +1045,10 @@ def _get_loss(self):\n else:\n return _LOSSES['categorical_crossentropy']()\n \n+ if (self.loss == 'categorical_crossentropy' and", "line": 1042, "original_line": 1048, "original_start_line": null, "path": "sklearn/ensembl...
472dfae970e597cb7cc3ba027ab622443f5d9fcf
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index ce3174218679f..f935ad5d04056 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -136,6 +136,9 @@ Changelog avoid any data leak. :pr:`13933` by `Nicolas Hug`_. - |Fix| Fixed a bug where early stopping would break with string ...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-15080@90ba0eb
scikit-learn/scikit-learn
Python
15,080
[MRG] Replace DeprecationWarning with FutureWarning
closes https://github.com/scikit-learn/scikit-learn/issues/9857 This PR replaces `DeprecationWarning` with a newly created `SklearnDeprecationWarning` (similar to numpy's `VisibleDeprecationWarning`). This fixes the custom filter issue raised in #9857 (custom filter are bad basically) The downside is that user...
2019-09-24T13:35:03Z
Should not call `warnings.filterwarnings` in a library #### Description Importing sklearn changes the current warning filters, making it very difficult to debug warnings using standard Python syntax, e.g `-W` command flag. #### Steps/Code to Reproduce The module `sklearn.cross_validation` is deprecated, and im...
This issue leads to other confusion, e.g. https://github.com/scikit-learn/scikit-learn/issues/7963 You're right that we may be being bad citizens. We've forcibly shown the DeprecationWarnings for a long time now. And I can't see an easy way to determine whether the user has tried to override default settings. The pr...
[ { "body": "#### Description\r\n\r\nImporting sklearn changes the current warning filters, making it very difficult to debug warnings using standard Python syntax, e.g `-W` command flag.\r\n\r\n#### Steps/Code to Reproduce\r\n\r\nThe module `sklearn.cross_validation` is deprecated, and importing it results in a ...
546c42d3a06eceb34c577dd8babc191571b74b87
{ "head_commit": "90ba0ebe3c0f6ee981cc3fe3a43c9467d840feb4", "head_commit_message": "Merge branch 'master' of github.com:scikit-learn/scikit-learn into visibledepwarnings", "patch_to_review": "diff --git a/build_tools/azure/test_script.cmd b/build_tools/azure/test_script.cmd\nindex f1e516d81fd99..9c5be1b50d494 10...
[ { "diff_hunk": "@@ -102,10 +102,10 @@ Other `pytest` options that may become useful include:\n statements\n - ``--tb=short`` or ``--tb=line`` to control the length of the logs\n \n-Since our continuous integration tests will error if ``DeprecationWarning``\n-or ``FutureWarning`` aren't properly caught, it...
e21998ec122947214deac84c5aa8e27f9148a611
diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst index d2c8355d1fc7c..b8db85672d6f3 100644 --- a/doc/developers/contributing.rst +++ b/doc/developers/contributing.rst @@ -826,7 +826,8 @@ E.g., renaming an attribute ``labels_`` to ``classes_`` can be done as:: def labels_(self): ...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-15427@efc7e24
scikit-learn/scikit-learn
Python
15,427
FIX raise an error in CountVectorizer with a custom token pattern that captures several group
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2019-11-01T02:35:22Z
CountVectorizer token_pattern issue with multi Alternative regex pattern. #### Description When using the custom token_pattern with CountVectorize returns no feature names. Am i missing something or #### Steps/Code to Reproduce ```python from sklearn.feature_extraction.text import CountVectorizer corpus = [ ...
It seems we have a bug (or feature) through the use of `re.findall`. The contents of the capturing group `([0-9]{1,3})` is being returned as the token. Make it non-capturing `(?:[0-9]{1,3})` as one solution. I think this is probably historically a bug, but whether users have exploited it is hard to tell, so we may not ...
[ { "body": "#### Description\r\nWhen using the custom token_pattern with CountVectorize returns no feature names. Am i missing something or \r\n\r\n#### Steps/Code to Reproduce\r\n```python\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\ncorpus = [\r\n 'This is the first document.',\r\n ...
160debe468890e1dd90b610d5505eb118481cbcf
{ "head_commit": "efc7e240b634403ff7a0c3a09ca298a1a1faf49d", "head_commit_message": "updating CountVectorizer and TfidfVectorizer docs to match", "patch_to_review": "diff --git a/sklearn/feature_extraction/tests/test_text.py b/sklearn/feature_extraction/tests/test_text.py\nindex 25c353aae5276..069876521b86f 10064...
[ { "diff_hunk": "@@ -351,6 +351,30 @@ def test_fit_countvectorizer_twice():\n assert X1.shape[1] != X2.shape[1]\n \n \n+def test_countvectorizer_custom_token_pattern():\n+ corpus = [\n+ 'This is the 1st document in my corpus.',\n+ 'This document is the 2nd sample.',\n+ 'And this is th...
d21ea58004a96bc64c1a1e098893728a493cf417
diff --git a/doc/whats_new/v0.24.rst b/doc/whats_new/v0.24.rst index 9db5535415af5..15fc5ddfa5331 100644 --- a/doc/whats_new/v0.24.rst +++ b/doc/whats_new/v0.24.rst @@ -252,6 +252,11 @@ Changelog values for one categorical feature. :pr:`17367` by :user:`Peng Yu <yupbank>` and :user:`Chiara Marmo <cmarmo>`. +- |...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14898@fabeef5
scikit-learn/scikit-learn
Python
14,898
[MRG] API Replace scorer brier_score_loss with neg_brier_score
Reference Issues/PRs Fixes #13887 What does this implement/fix? Explain your changes. Introduced new scorer neg_brier_score to reflect the real behavior of the scorer Added deprecation of brier_loss_score (not sure about the versions mentioned in the deprecation message 😕) Updated documentation to reflect chang...
2019-09-06T00:32:56Z
Documentation section 3.3.1.1 has incorrect description of brier_score_loss In the documentation, section 3.3.1.1. "Common cases: predefined values" includes the remark > All scorer objects follow the convention that higher return values are better than lower return values. As far as I can tell, this is true for...
Indeed this is probably the right course of action. Please feel free to open a PR if your wish. @Sycor4x I'll gladly work on it if you're not already doing it @qdeffense Thank you. I had planned to start these revisions if this suggestion were well-received; however, I've just come down with a cold and won't be able ...
[ { "body": "In the documentation, section 3.3.1.1. \"Common cases: predefined values\" includes the remark\r\n\r\n> All scorer objects follow the convention that higher return values are better than lower return values. \r\n\r\nAs far as I can tell, this is true for all of the listed metrics, **except** the `bri...
d2476fb679f05e80c56e8b151ff0f6d7a470e4ae
{ "head_commit": "fabeef51d1a2eb743e14a46bd5ae7444ef7556a5", "head_commit_message": "remove valid_scorers method", "patch_to_review": "diff --git a/doc/modules/model_evaluation.rst b/doc/modules/model_evaluation.rst\nindex 0a22488a1dbb4..a487756036bdd 100644\n--- a/doc/modules/model_evaluation.rst\n+++ b/doc/modu...
[ { "diff_hunk": "@@ -61,7 +61,7 @@ Scoring Function\n 'accuracy' :func:`metrics.accuracy_score`\n 'balanced_accuracy' :func:`metrics.balanced_accuracy_score`\n 'average_precision' :func:`metrics.average_precision_score`\n-'brier_score_l...
3dc496b09ca4aef47ae0924f6e916a91a6134b03
diff --git a/doc/modules/model_evaluation.rst b/doc/modules/model_evaluation.rst index 56fba2e2d5f5a..7f0553c30a3e3 100644 --- a/doc/modules/model_evaluation.rst +++ b/doc/modules/model_evaluation.rst @@ -61,7 +61,7 @@ Scoring Function 'accuracy' :func:`metrics.accuracy...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Documentation Updates" }
scikit-learn__scikit-learn-14987@15375f4
scikit-learn/scikit-learn
Python
14,987
MAINT Make fastica call FastICA
~~NOMRG, I think there's a bug in fastica that needs to be fixed first~~ Closes #14988 This PR makes `fastica` call `FastICA`. Following the discussion in #14988 I have created a private `_unmixing` attribute and clarified the docstring of the `components_` attribute.
2019-09-15T16:08:36Z
Inconsistency between fastica and FastICA `fastica` returns `W` which is, according to the docs "the unmixing matrix" `FastICA` has a `components_` attribute which is also "the unmixing matrix" But they are not equal when `whiten` is True: ```py if whiten == True: self.components_ = np.dot(unmixing, whiteni...
sources = np.dot(self.components_, X.T) with the current code (always and no matter what is the value of whiten) It does apply the unmixing transformation to the data (taking into account the whitening done prior to calling the fastica code). are you still confused? Sorry I'm still confused. This is unrelated to `so...
[ { "body": "`fastica` returns `W` which is, according to the docs \"the unmixing matrix\"\r\n\r\n`FastICA` has a `components_` attribute which is also \"the unmixing matrix\"\r\n\r\nBut they are not equal when `whiten` is True:\r\n\r\n```py\r\nif whiten == True:\r\n\tself.components_ = np.dot(unmixing, whitening...
d92f12a137827b0e6357a133db3de6a3c3f34bf7
{ "head_commit": "15375f470cd8e29746edeff584ccb74acc99a9b4", "head_commit_message": "removed comments", "patch_to_review": "diff --git a/sklearn/decomposition/fastica_.py b/sklearn/decomposition/fastica_.py\nindex dffce0dc0d8bc..85682b84883f5 100644\n--- a/sklearn/decomposition/fastica_.py\n+++ b/sklearn/decompos...
[ { "diff_hunk": "@@ -431,7 +348,10 @@ def my_g(x):\n Attributes\n ----------\n components_ : 2D array, shape (n_components, n_features)\n- The unmixing matrix.\n+ The linear operator to apply to the data to get the independent\n+ sources. This is equal to the unmixing matrix when...
8efc49f1f01aaea32d535060986729ca20ec6b9a
diff --git a/sklearn/decomposition/fastica_.py b/sklearn/decomposition/fastica_.py index dffce0dc0d8bc..c191f5e41ab41 100644 --- a/sklearn/decomposition/fastica_.py +++ b/sklearn/decomposition/fastica_.py @@ -226,11 +226,9 @@ def my_g(x): K is 'None'. W : array, shape (n_components, n_components) - ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14878@e848158
scikit-learn/scikit-learn
Python
14,878
API Improves error msg when passing non-arrays to SimpleImputer
Fixes #14877. An alternative would be calling ``asarray`` but that would be less informative imho. Still needs a regression test. Probably one for list and one for dataframe?
2019-09-03T22:39:43Z
DataFrames not properly validated in SimpleImputer ```python import pandas as pd from sklearn.impute import SimpleImputer SimpleImputer().fit(pd.DataFrame({'a': ['b', 'c']})) ``` is not validated correctly: ```pythontb --------------------------------------------------------------------------- ValueError ...
[ { "body": "```python\r\nimport pandas as pd\r\nfrom sklearn.impute import SimpleImputer\r\n\r\nSimpleImputer().fit(pd.DataFrame({'a': ['b', 'c']}))\r\n```\r\nis not validated correctly:\r\n\r\n```pythontb\r\n---------------------------------------------------------------------------\r\nValueError ...
b02217d8a5651760353e310701e749c1eaece6df
{ "head_commit": "e8481582000ab9f1e991f03658fe74ceae5f2f17", "head_commit_message": "improve error message when passing non-arrays", "patch_to_review": "diff --git a/sklearn/impute/_base.py b/sklearn/impute/_base.py\nindex f7be7fd49cb64..034908414a63b 100644\n--- a/sklearn/impute/_base.py\n+++ b/sklearn/impute/_b...
[ { "diff_hunk": "@@ -199,9 +199,9 @@ def _validate_input(self, X):\n force_all_finite=force_all_finite, copy=self.copy)\n except ValueError as ve:\n if \"could not convert\" in str(ve):\n- raise ValueError(\"Cannot use {0} strategy with non-numeric \...
0e9f67d6da6fce13ae5cf0aae3155c8574f3ec77
diff --git a/sklearn/impute/_base.py b/sklearn/impute/_base.py index 8c8b83878bae3..0f8c452b1e7d5 100644 --- a/sklearn/impute/_base.py +++ b/sklearn/impute/_base.py @@ -182,9 +182,9 @@ def _validate_input(self, X): force_all_finite=force_all_finite, copy=self.copy) except ValueErro...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14815@7519f14
scikit-learn/scikit-learn
Python
14,815
MAINT: Remove redundant code in MLP
Closes https://github.com/scikit-learn/scikit-learn/issues/14807 Closes https://github.com/scikit-learn/scikit-learn/issues/11952 Alternative to https://github.com/scikit-learn/scikit-learn/pull/10665 This makes sure that it's possible to use a custom activation function registering new ones in `sklearn.neural...
2019-08-26T19:03:04Z
Can I use leaky-relu function for MLPs? The Leaky-ReLU activation function for MLPs (max(x, alpha *x) where alpha is a small number around 0.01) is rumoured to work better than ReLU in some cases. Unfortunately, I din't find any way to use if tor MPLClassifier or MLPRegressor. I can try to implement it myself, but I am...
See #10665 Please provide a fully reproducible code snippet. I have tried to add Leaky Relu function in _base.py file . I am attaching it. ```py """Utilities for the neural network modules """ # Author: Issam H. Laradji <issam.laradji@gmail.com> # License: BSD 3 clause import numpy as np from scipy.spec...
[ { "body": "The Leaky-ReLU activation function for MLPs (max(x, alpha *x) where alpha is a small number around 0.01) is rumoured to work better than ReLU in some cases. Unfortunately, I din't find any way to use if tor MPLClassifier or MLPRegressor. I can try to implement it myself, but I am still not familiar e...
628f34fa7281b4e4da356d47f657a5ce561c7128
{ "head_commit": "7519f1412eeb6ab99d5ba0dfdafc1f893642ca9a", "head_commit_message": "Don't publicaly re-export ACTIVATIONS variable from sklearn.neural_network._base", "patch_to_review": "diff --git a/sklearn/neural_network/multilayer_perceptron.py b/sklearn/neural_network/multilayer_perceptron.py\nindex 0cb94de7...
[ { "diff_hunk": "@@ -97,6 +97,10 @@ def _forward_pass(self, activations):\n activations : list, length = n_layers - 1\n The ith element of the list holds the values of the ith layer.\n \"\"\"\n+ # local import to allow custom activations set via this\n+ # private variabl...
75a8be8d540da59098f276519a3b56e410fcc6d7
diff --git a/sklearn/neural_network/multilayer_perceptron.py b/sklearn/neural_network/multilayer_perceptron.py index 0cb94de71b3a6..11e682a448240 100644 --- a/sklearn/neural_network/multilayer_perceptron.py +++ b/sklearn/neural_network/multilayer_perceptron.py @@ -414,11 +414,10 @@ def _validate_hyperparameters(self): ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-14764@e9f89bf
scikit-learn/scikit-learn
Python
14,764
[MRG] Weights parameter of datasets.make_classification changed to array-like from list only - Issue 14760
#### Fixes #14760 #### What does this implement/fix? The weights parameter can be a list or array, not just a list, e.g. " `weights` is array-like or None " in docstring.
2019-08-24T17:02:34Z
datasets :: make_classification() weights parameter should be a sequence (not just a list). ### `weights` should be passed as list or array (not just list) in `sklearn\datasets\samples_generator.py :: make_classification`: If there is a pertinent reason that `weights` must be a list, while *all other iterable parame...
sounds good, please open a PR
[ { "body": "### `weights` should be passed as list or array (not just list) in `sklearn\\datasets\\samples_generator.py :: make_classification`:\r\n If there is a pertinent reason that `weights` must be a list, while *all other iterable parameters are arrays*, then it should be mentioned in the docstring. Otherw...
af2bad4f34e938cb16ada0ae19cc713a275682d6
{ "head_commit": "e9f89bfc23936d8d887c2ab15bddb432a298676b", "head_commit_message": "Added coverage for weiths resizing in `test_make_classification_weights_array_or_list_ok` as per @NicolasHug.", "patch_to_review": "diff --git a/sklearn/datasets/samples_generator.py b/sklearn/datasets/samples_generator.py\nindex...
[ { "diff_hunk": "@@ -146,6 +146,46 @@ def test_make_classification_informative_features():\n n_clusters_per_class=2)\n \n \n+@pytest.mark.parametrize(\n+ 'weights, err_type, err_msg',\n+ [\n+ ([], ValueError,\n+ \"Weights specified but incompatible with number of classes.\"),\n+...
11a179d47e7d983ace3334390d18ac9544dfda0e
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index e4421ef97c41e..e3cb36371ad9b 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -85,6 +85,10 @@ Changelog :func:`datasets.fetch_20newsgroups` and :func:`datasets.fetch_olivetti_faces` . :pr:`14259` by :user:`Sourav Singh <sour...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14787@bbc853b
scikit-learn/scikit-learn
Python
14,787
[MRG] Change default dataset for `plot_johnson_lindenstrauss_bound.py`
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs Closes #12649 #### What does this implement/fix? Explain your chan...
2019-08-24T19:19:01Z
`plot_johnson_lindenstrauss_bound.py` projects a 64 dim data into 300, 1000, and 10000 Trying to fix warnings in our examples, not sure what to do with this one: `examples/plot_johnson_lindenstrauss_bound.py` projects the data which has 64 features into a 300, 1000, and 10000 dimensional space, which results in the ...
We could decide to use the twenty news groups dataset by default. It requires a data fetch. This is why it's not enabled by default. However there are many other examples that already use this dataset so +1 for using 20 newsgroups by default in this example. We change the handling of the command line flags to use the d...
[ { "body": "Trying to fix warnings in our examples, not sure what to do with this one:\r\n\r\n`examples/plot_johnson_lindenstrauss_bound.py` projects the data which has 64 features into a 300, 1000, and 10000 dimensional space, which results in the following warning:\r\n\r\n```\r\nDataDimensionalityWarning: The ...
ec5a9fcf4f4e3cc4748f7145a58292be1e662edb
{ "head_commit": "bbc853bfc34448e9681d2fa0eb80351af65cc91a", "head_commit_message": "fix doctsring", "patch_to_review": "diff --git a/examples/plot_johnson_lindenstrauss_bound.py b/examples/plot_johnson_lindenstrauss_bound.py\nindex 988de0fe2735b..931aad82ca93f 100644\n--- a/examples/plot_johnson_lindenstrauss_bo...
[ { "diff_hunk": "@@ -102,27 +102,26 @@\n # Empirical validation\n # ====================\n #\n-# We validate the above bounds on the digits dataset or on the 20 newsgroups\n-# text document (TF-IDF word frequencies) dataset:\n-#\n-# - for the digits dataset, some 8x8 gray level pixels data for 500\n-# handwrit...
fe59bf568ea2d3d8f47533d66d94b68835a1d749
diff --git a/examples/plot_johnson_lindenstrauss_bound.py b/examples/plot_johnson_lindenstrauss_bound.py index 988de0fe2735b..b981c14fbf132 100644 --- a/examples/plot_johnson_lindenstrauss_bound.py +++ b/examples/plot_johnson_lindenstrauss_bound.py @@ -102,27 +102,26 @@ # Empirical validation # ==================== ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14652@11a12a8
scikit-learn/scikit-learn
Python
14,652
[DOC] Comments clarifying the effect of the random_state parameter
Fixes #14587 The use of the random_state parameter might be confusing since it applies to the solver but not ot the the cross-validation generator. Comments have been added to make it clearer.
2019-08-14T09:34:43Z
random_state in LogisticRegressionCV does not seem to work Hi all, While trying to do logistic regression with cross validation (LogisticRegressionCV), I noticed that changing the random_state does not seem to have any impact on the results. On the other hand, shuffling the data set using pandas sample function does...
The default CV is StratifiedKFold (5) which is not shuffled Hi Joel, Ok, thanks for the clarification. IMHO, it would be nice to state something in the documentation for the `random_state` parameter, something like: > Note that this parameter has by default no impact on the results since the default cross vali...
[ { "body": "Hi all,\r\n\r\nWhile trying to do logistic regression with cross validation (LogisticRegressionCV), I noticed that changing the random_state does not seem to have any impact on the results. On the other hand, shuffling the data set using pandas sample function does lead to small differences as expect...
06dc44c9653a12219c28d00fb4a538d3f57e548d
{ "head_commit": "11a12a8a5f8df4a5308caa66c06df5fc38d03e69", "head_commit_message": "[DOC] Comments clarifying the effect of the random_state parameter (#14587)", "patch_to_review": "diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py\nindex 432a5a7db3c0d..8e9c3b4b0f832 100644\n--- a/...
[ { "diff_hunk": "@@ -1814,7 +1814,10 @@ class LogisticRegressionCV(LogisticRegression, BaseEstimator,\n If int, random_state is the seed used by the random number generator;\n If RandomState instance, random_state is the random number generator;\n If None, the random number generator is t...
abef486d019b32fd1a55aa8d1835cf8d5168bfa7
diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py index 432a5a7db3c0d..f80fbbfbe3542 100644 --- a/sklearn/linear_model/logistic.py +++ b/sklearn/linear_model/logistic.py @@ -1814,7 +1814,9 @@ class LogisticRegressionCV(LogisticRegression, BaseEstimator, If int, random_state is th...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14660@850cd0a
scikit-learn/scikit-learn
Python
14,660
clarify that sklearn.metric.pairwise doesn't provide callables for pairwise_kernel
Fixes #10890. Closes #13111. Changing the current behavior in the suggested way just means that computations are unnecessarily slower because the user didn't read the docstring carefully.
2019-08-14T21:09:46Z
`_pairwise_callable` function doesn't work with pairwise metrics functions from sklearn itself #### Description `metrics.pairwise` functions (`rbf_kernel` for instance) throw error due to unexpected 1-D array instead of 2-D array when called from _pairwise_callable. I discovered the bug when I have been using `sk...
There are a few things in this issue. Here is what I could spot (I may have missed a few things because there is a lot of text in-between ...): * the doc is inaccurate. A PR fixing that would be more than welcome! * you expect to pass `kernel=rbf_kernel` and it does not work. Without having looked at it in detail, yo...
[ { "body": "#### Description\r\n\r\n`metrics.pairwise` functions (`rbf_kernel` for instance) throw error due to unexpected 1-D array instead of 2-D array when called from _pairwise_callable.\r\n\r\nI discovered the bug when I have been using `sklearn.kernel_approximation.Nystroem` with `sklearn.metrics.pairwise....
538a2f51ab9c445cc6a8dc714f814c2783d4e0c7
{ "head_commit": "850cd0a19156d4b5460794e8fb6d7d25f4280b46", "head_commit_message": "backticks", "patch_to_review": "diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py\nindex b25c428da9e43..bb499192fd373 100644\n--- a/sklearn/metrics/pairwise.py\n+++ b/sklearn/metrics/pairwise.py\n@@ -1678,8 +...
[ { "diff_hunk": "@@ -1678,8 +1678,11 @@ def pairwise_kernels(X, Y=None, metric=\"linear\", filter_params=False,\n If metric is \"precomputed\", X is assumed to be a kernel matrix.\n Alternatively, if metric is a callable function, it is called on each\n pair of instances (rows) and the re...
2d0b8c9f286185374b1f8b69c1929cb79b1be04c
diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py index b25c428da9e43..519fccab71969 100644 --- a/sklearn/metrics/pairwise.py +++ b/sklearn/metrics/pairwise.py @@ -1678,8 +1678,11 @@ def pairwise_kernels(X, Y=None, metric="linear", filter_params=False, If metric is "precomputed", X is assu...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14809@1321128
scikit-learn/scikit-learn
Python
14,809
[MRG] Updating SKF user_guide example
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs Fixes #14714 <!-- Example: Fixes #1234. See also #3456. Please use keyw...
2019-08-26T07:01:04Z
Improve example on StratifiedKFold in user guide The user guide currently has the following example: ```python >>> from sklearn.model_selection import StratifiedKFold >>> X = np.ones(10) >>> y = [0, 0, 0, 0, 1, 1, 1, 1, 1, 1] >>> skf = StratifiedKFold(n_splits=3) >>> for train, test in skf...
see #14560 for an example from the regression case. @amueller I made an attempt to create a good example. Please give your comments. ``` from sklearn.datasets import make_classification from sklearn.model_selection import StratifiedKFold, KFold from collections import Counter X, y = make_classification(n_sampl...
[ { "body": "The user guide currently has the following example:\r\n```python\r\n >>> from sklearn.model_selection import StratifiedKFold\r\n \r\n >>> X = np.ones(10)\r\n >>> y = [0, 0, 0, 0, 1, 1, 1, 1, 1, 1]\r\n >>> skf = StratifiedKFold(n_splits=3)\r\n >>> for train, test in skf.split(X, y):\r\...
505c2be1878a8ca8e8963bf476e4e0f5c55fdd69
{ "head_commit": "132112882d436b4e2226a497e033a4b37823f7b6", "head_commit_message": "More description", "patch_to_review": "diff --git a/doc/modules/cross_validation.rst b/doc/modules/cross_validation.rst\nindex e42d7f8514438..dedb7df8ed984 100644\n--- a/doc/modules/cross_validation.rst\n+++ b/doc/modules/cross_v...
[ { "diff_hunk": "@@ -534,19 +534,35 @@ Stratified k-fold\n folds: each set contains approximately the same percentage of samples of each\n target class as the complete set.\n \n-Example of stratified 3-fold cross-validation on a dataset with 10 samples from\n-two slightly unbalanced classes::\n+Example of strati...
97739f80b81ed6bdeacaeb3b2af00f6468bb7530
diff --git a/doc/modules/cross_validation.rst b/doc/modules/cross_validation.rst index e42d7f8514438..fc064770f2719 100644 --- a/doc/modules/cross_validation.rst +++ b/doc/modules/cross_validation.rst @@ -534,19 +534,30 @@ Stratified k-fold folds: each set contains approximately the same percentage of samples of each ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Documentation Updates" }
secdev__scapy-4352@4093936
secdev/scapy
Python
4,352
Rewrite arch/linux
This rewrites most of the arch/linux code that handles the loading of `conf.ifaces`, `conf.route` and `conf.route6`, in order to use a RTNETLINK socket (instead of the current reading of `/proc/net/XXX`). Among those: - the read_routes(6) functions - the linux interfaces provider - arch/linux util functions Th...
2024-04-14T21:30:43Z
IPv4 routing table is missing entries for additional addresses on the loopback interface ### Brief description Scapy IPv4 routing table is missing additional addresses configured on the `lo` interface. ### Scapy version 2.5.0 ### Python version 3.11.2 ### Operating system Debian bookworm 12.2 running kernel 6.1....
[ { "body": "### Brief description\n\nScapy IPv4 routing table is missing additional addresses configured on the `lo` interface.\n\n### Scapy version\n\n2.5.0\n\n### Python version\n\n3.11.2\n\n### Operating system\n\nDebian bookworm 12.2 running kernel 6.1.52-1\n\n### Additional environment information\n\n_No re...
cd2fed92557810265693d716558f0cd34eddb006
{ "head_commit": "409393610f2bca06dc6ecd1e17633753d4d3091e", "head_commit_message": "Rewrite arch/linux: interfaces/routes loading\n\nThis rewrites much of the arch/linux code, in order to use a RTNETLINK\nsocket instead of reading /proc/net/XXX.\n\nAmong those:\n- the read_routes(6) functions\n- the linux interfac...
[ { "diff_hunk": "@@ -0,0 +1,851 @@\n+# SPDX-License-Identifier: GPL-2.0-only\n+# This file is part of Scapy\n+# See https://scapy.net/ for more information\n+# Copyright (C) Gabriel Potter\n+\n+\"\"\"\n+This files implements the rtnetlink API that is used to read the network\n+configuration of the machine.\n+\"\...
7161b136dd3f8522041f6072eee428fb93e9fdcb
diff --git a/.config/mypy/mypy_check.py b/.config/mypy/mypy_check.py index 5db49a4a0c3..371d93c3487 100644 --- a/.config/mypy/mypy_check.py +++ b/.config/mypy/mypy_check.py @@ -63,57 +63,56 @@ "--ignore-missing-imports", # config "--follow-imports=skip", # Remove eventually - "--config-file=" + os.pa...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14800@eac5a1e
scikit-learn/scikit-learn
Python
14,800
ENH Verify md5-checksums received from openml arff file metadata
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2019-08-24T21:11:05Z
Validate MD5 checksum of downloaded ARFF in fetch_openml `fetch_openml` downloads the `data_set_description` from openml.org which includes an `md5_checksum` field. This should correspond to the MD5 checksum of the downloaded ARFF data. We should (optionally?) use `hashlib` to verify that the MD5 matches.
I'll give this a go. thanks. you may need to hack the md5s currently in sklearn/datasets/tests/data/openml to match the truncated ARFF data there Picking this to work on while in NYC WiMLDS Sprint Aug 24, 2019 I think this check should be optional. What do other core developers think? Forcing the verification ensures ...
[ { "body": "`fetch_openml` downloads the `data_set_description` from openml.org which includes an `md5_checksum` field. This should correspond to the MD5 checksum of the downloaded ARFF data. We should (optionally?) use `hashlib` to verify that the MD5 matches.", "number": 11816, "title": "Validate MD5 c...
acb8ac5145cfd88fdbd2d381b34883b2c212c8c5
{ "head_commit": "eac5a1edf290f57662de4bc467921c85dd52b26b", "head_commit_message": "Test should not modify local test-suite shared file", "patch_to_review": "diff --git a/sklearn/datasets/_openml.py b/sklearn/datasets/_openml.py\nindex 112cd9c0e525e..454df78ab4646 100644\n--- a/sklearn/datasets/_openml.py\n+++ b...
[ { "diff_hunk": "@@ -1190,3 +1191,44 @@ def test_fetch_openml_with_ignored_feature(monkeypatch, gzip_response):\n # so we assert that we don't have the ignored feature in the final Bunch\n assert dataset['data'].shape == (101, 16)\n assert 'animal' not in dataset['feature_names']\n+\n+\n+@pytest.mark...
d5bebcf7a2d708905f31a83607817ad12925a8d9
diff --git a/doc/whats_new/v0.24.rst b/doc/whats_new/v0.24.rst index a647de6dac628..ba137fb76698f 100644 --- a/doc/whats_new/v0.24.rst +++ b/doc/whats_new/v0.24.rst @@ -224,6 +224,11 @@ Changelog :meth:`tree.DecisionTreeRegressor.fit`, and has not effect. :pr:`17614` by :user:`Juan Carlos Alfaro Jiménez <alfaro96...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Test Suite / CI Enhancements" }
scikit-learn__scikit-learn-14358@dfcd0aa
scikit-learn/scikit-learn
Python
14,358
DOC More notes about the difference between the three base scorers
Closes #10247 summarize the difference of the three base scorers, though this is not always the case (e.g., when needs_threshold is True, we'll still accept the output of predict_proba when decision_function is not available, but in this case, users can set needs_proba to True instead)
2019-07-14T12:33:39Z
Assymetry of roc_auc_score #### Description For binary tasks with wrapped down custom scoring functions by the `metrics.make_scorerer`-scheme `roc_auc_score` is behaving unexpectedly. When requiring the probability output from a binary classifier, which is a shape( n , 2) object, while the training/testing lables are ...
Yes, `roc_auc_score(y_true1, y_proba)` fails, but `make_scorer(roc_auc_score, needs_proba=True)(clf, X_test, y_test)` does not. Both are in accordance with documented and expected behaviour. I do not understand how you find that `make_scorer(roc_auc_score, needs_proba=True)(clf, X_test, y_test)` behaves correctly: I g...
[ { "body": "#### Description\r\nFor binary tasks with wrapped down custom scoring functions by the `metrics.make_scorerer`-scheme `roc_auc_score` is behaving unexpectedly. When requiring the probability output from a binary classifier, which is a shape( n , 2) object, while the training/testing lables are an exp...
98e0866318e4c6792096c2b354484b5db8d67fca
{ "head_commit": "dfcd0aaac68b4731165572160437d5c616e4e9f4", "head_commit_message": "maybe?", "patch_to_review": "diff --git a/sklearn/metrics/scorer.py b/sklearn/metrics/scorer.py\nindex 087ade8c3642f..d8d59a1b13e2a 100644\n--- a/sklearn/metrics/scorer.py\n+++ b/sklearn/metrics/scorer.py\n@@ -449,6 +449,16 @@ de...
[ { "diff_hunk": "@@ -449,6 +449,16 @@ def make_scorer(score_func, greater_is_better=True, needs_proba=False,\n >>> from sklearn.svm import LinearSVC\n >>> grid = GridSearchCV(LinearSVC(), param_grid={'C': [1, 10]},\n ... scoring=ftwo_scorer)\n+\n+ Notes\n+ -----\n+ If ``n...
be659df74d3d16c7d4c1bcce1dea0fc1dd7ef2cc
diff --git a/sklearn/metrics/scorer.py b/sklearn/metrics/scorer.py index 087ade8c3642f..e70d2ef76d803 100644 --- a/sklearn/metrics/scorer.py +++ b/sklearn/metrics/scorer.py @@ -449,6 +449,16 @@ def make_scorer(score_func, greater_is_better=True, needs_proba=False, >>> from sklearn.svm import LinearSVC >>> gri...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14427@0f2047d
scikit-learn/scikit-learn
Python
14,427
[MGE] MAINT Adds cwd to PYTHONPATH in assert_run_python_script
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2019-07-20T18:23:50Z
test_imports_strategies fails unless sklearn is installed So I ran make in a fresh environment and ``test_imports_strategies`` fails because it doesn't find sklearn. I'm not entirely sure if this should be considered a bug, but previously all tests worked without installing sklearn.
[ { "body": "So I ran make in a fresh environment and ``test_imports_strategies`` fails because it doesn't find sklearn.\r\n\r\nI'm not entirely sure if this should be considered a bug, but previously all tests worked without installing sklearn.", "number": 14418, "title": "test_imports_strategies fails u...
3dc43a5c5faad88120925074c9e925a77c4d5a8b
{ "head_commit": "0f2047d520e89ecfc3816be72991dd31c8adf708", "head_commit_message": "MAINT Adds shell=True", "patch_to_review": "diff --git a/sklearn/utils/testing.py b/sklearn/utils/testing.py\nindex 8913d5c92e0ca..3660aa1a279a7 100644\n--- a/sklearn/utils/testing.py\n+++ b/sklearn/utils/testing.py\n@@ -881,6 +8...
[ { "diff_hunk": "@@ -881,6 +881,7 @@ def assert_run_python_script(source_code, timeout=60):\n 'cwd': cwd,\n 'stderr': STDOUT,\n 'env': env,\n+ 'shell': True", "line": null, "original_line": 884, "original_start_line": null, "path": "sklearn/utils/tes...
0bbe57e4f00d6d7336b8c750ab6503f5dc087307
diff --git a/sklearn/utils/testing.py b/sklearn/utils/testing.py index 8913d5c92e0ca..666ef0e95837d 100644 --- a/sklearn/utils/testing.py +++ b/sklearn/utils/testing.py @@ -877,10 +877,14 @@ def assert_run_python_script(source_code, timeout=60): cmd = [sys.executable, source_file] cwd = op.normpath(op...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Test Suite / CI Enhancements" }
scikit-learn__scikit-learn-14591@a1b9471
scikit-learn/scikit-learn
Python
14,591
don't overwrite precompute=True in lassocv
Fixes #11014, alternative to #11021 Unfortunately this can't be tested (in a way I can see) because ``LassoCV`` doesn't store the underlying model
2019-08-07T18:48:58Z
LassoCV always sets precompute to False before fitting the chosen alpha value I'm using a very large data-set. After fitting 100 x 3-fold cross-validated LASSOs at lightning speed (a few seconds total), LassoCV stalls at the final hurdle: fitting a LASSO with the chosen alpha value to the whole data-set (waiting over h...
From a quick glance at your description it seems like you have a good grasp of what is happening and it could well be a bug (I am not a Lasso expert so don't take my word for it). It would help a lot if you could provide a stand-alone snippet to reproduce the problem. Please read http://matthewrocklin.com/blog/work...
[ { "body": "I'm using a very large data-set. After fitting 100 x 3-fold cross-validated LASSOs at lightning speed (a few seconds total), LassoCV stalls at the final hurdle: fitting a LASSO with the chosen alpha value to the whole data-set (waiting over half an hour - it should only take approximately 50% longer ...
71c3afb29a369b1c58a94d0f3c0596c6c3c3e216
{ "head_commit": "a1b9471fe7d6383f9dd9de3cec29e64a55f6b79c", "head_commit_message": "Merge pull request #35 from thomasjpfan/pr/14591\n\nTST Adds test to precompute", "patch_to_review": "diff --git a/sklearn/linear_model/coordinate_descent.py b/sklearn/linear_model/coordinate_descent.py\nindex 646839a0a3ae6..d698...
[ { "diff_hunk": "@@ -865,3 +865,23 @@ def test_sparse_input_convergence_warning():\n Lasso(max_iter=1000).fit(sparse.csr_matrix(X, dtype=np.float32), y)\n \n assert not record.list\n+\n+\n+@pytest.mark.parametrize(\"precompute, inner_precompute\", [\n+ (True, True),\n+ ('auto', False),\n+ (F...
653126369aca4e9c8d6a6ec94c8bba7d94459518
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index 05ba3c40a76b1..c1fedb932672f 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -197,6 +197,9 @@ Changelog and non-contiguous arrays and makes a conversion instead of failing. :pr:`14458` by :user:`Guillaume Lemaitre <glemaitr...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Performance Optimizations" }
scikit-learn__scikit-learn-14526@2968ee1
scikit-learn/scikit-learn
Python
14,526
MRG add dendrogram example
Fixes #6788, fixes #3464. This PR stores the distances in the AgglomerativeClustering object if they are computed, and adds an example to plot the corresponding dendrogram. It's based on #3464 with some fixes. We don't have access to the number of data points per node, but that is easy to compute. If there's a b...
2019-07-30T21:29:56Z
dendrogram question Hi, I'm running a AgglomerativeClustering algorithm. For further analysis, I would like to plot a dendrogram, but scikit-learn currently does not provide a dendrogram plot. How would you suggest to plot the dendrogram and cut the dendrogram to get x number of clusters/groups? Thanks, Arnold
For the plotting-part, Michael Waskoms [seaborn](https://stanford.edu/~mwaskom/software/seaborn/examples/structured_heatmap.html) could be interesting. [This](http://docs.scipy.org/doc/scipy-0.14.0/reference/cluster.hierarchy.html#module-scipy.cluster.hierarchy) should help you. @AlexanderFabisch thanks, from the den...
[ { "body": "Hi,\n\nI'm running a AgglomerativeClustering algorithm. For further analysis, I would like to plot a dendrogram, but scikit-learn currently does not provide a dendrogram plot. How would you suggest to plot the dendrogram and cut the dendrogram to get x number of clusters/groups?\n\nThanks,\nArnold\n"...
7e022a7e8ba0f95b65d9acade559da95115ad9e5
{ "head_commit": "2968ee1f4f27f3c47ecc4ac03669a7cc5cd7b1f4", "head_commit_message": "add dendrogram example", "patch_to_review": "diff --git a/examples/cluster/plot_agglomerative_dendrogram.py b/examples/cluster/plot_agglomerative_dendrogram.py\nnew file mode 100644\nindex 0000000000000..5735a4bb18063\n--- /dev/n...
[ { "diff_hunk": "@@ -0,0 +1,53 @@\n+# Authors: Mathew Kallada, Andreas Mueller\n+# License: BSD 3 clause\n+\"\"\"\n+=========================================\n+Plot Hierarachical Clustering Dendrogram\n+=========================================\n+This example plots the corresponding dendrogram of a hierarchical ...
47220ed8b2e529239684c434fc7e21d9efde4f6f
diff --git a/doc/modules/clustering.rst b/doc/modules/clustering.rst index e92eda558896a..85aad00639149 100644 --- a/doc/modules/clustering.rst +++ b/doc/modules/clustering.rst @@ -603,6 +603,18 @@ Single linkage can also perform well on non-globular data. * :ref:`sphx_glr_auto_examples_cluster_plot_digits_linkage.py...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-14279@a7414fa
scikit-learn/scikit-learn
Python
14,279
[MRG] Add link to ColumnTransformer and user guide to make_column_transformer documentation
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs Fixes #14127 <!-- Example: Fixes #1234. See also #3456. Please use keyw...
2019-07-06T19:53:41Z
add link to ColumnTransformer and user guide to make_column_transformer documentation Right now the documentation of ``make_column_transformer`` is pretty bare-bones, it doesn't even really describe the arguments. We should probably link more explicitly to the ColumnTransformer docs. We should also link to the user gu...
Hi - can I take this issue ? This will be my first contribution . Thanks Sure @getgaurav2 I would like to take up this issue #WiMLDS It's already being worked on @KenitoInc :) @adrinjalali - can you please confirm if the expectation is to modify the make_column_transformer section in doc/modules/compose.rst to...
[ { "body": "Right now the documentation of ``make_column_transformer`` is pretty bare-bones, it doesn't even really describe the arguments.\r\nWe should probably link more explicitly to the ColumnTransformer docs. We should also link to the user guide.\r\nAlternatively we could copy and paste the ColumnTransform...
4de89cd4868935da6a3802e3ee72c9d6254a2f49
{ "head_commit": "a7414faa9ce9cac20944f3570704cbbbdd21d1c7", "head_commit_message": "Fixes # 14127 - Made changes after running flake8", "patch_to_review": "diff --git a/doc/modules/compose.rst b/doc/modules/compose.rst\nindex 0ac33ce7a4d4a..caa23ecede107 100644\n--- a/doc/modules/compose.rst\n+++ b/doc/modules/...
[ { "diff_hunk": "@@ -713,9 +713,28 @@ def make_column_transformer(*transformers, **kwargs):\n be given names automatically based on their types. It also does not allow\n weighting with ``transformer_weights``.\n \n+ Read more in the :ref:`User Guide <make_column_transformer>`.\n+\n Parameters\n ...
106f969ead9cc621cfd373f7a1be784ba8b82f3c
diff --git a/doc/modules/compose.rst b/doc/modules/compose.rst index 0ac33ce7a4d4a..caa23ecede107 100644 --- a/doc/modules/compose.rst +++ b/doc/modules/compose.rst @@ -496,6 +496,8 @@ the transformation:: [0.5, 0.5], [1. , 0. ]]) +.. _make_column_transformer: + The :func:`~sklearn.compose.make_c...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
scikit-learn__scikit-learn-14336@9928626
scikit-learn/scikit-learn
Python
14,336
[MRG+1] Fix KernelCenterer requires square input but doesn't error on non-square
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs Fix #14240 <!-- Example: Fixes #1234. See also #3456. Please use keywo...
2019-07-13T17:49:37Z
KernelCenterer requires square input but doesn't error on non-square I'm pretty sure the KernelCenter should check that the input is square. Actually it has ``pairwise=True`` so it's a bit weird that it works on non-square training data and I think we should throw an error instead. Also common tests should probably...
Hi, is anyone working on this? I added some code to throw a ValueError when KernelCenterer.fit() is called on a non-square kernel matrix. However, this causes some unit tests to fail (output attached). [KernelCenterer_FailedTests.txt](https://github.com/scikit-learn/scikit-learn/files/3383244/KernelCenterer_FailedTest...
[ { "body": "I'm pretty sure the KernelCenter should check that the input is square.\r\nActually it has ``pairwise=True`` so it's a bit weird that it works on non-square training data and I think we should throw an error instead.\r\n\r\nAlso common tests should probably check that ``pairwise=True`` estimators err...
3896d4903b651cbd1f4b45e8f440d308858681b4
{ "head_commit": "992862663b262b7a40a4e6827e754e066c43d97e", "head_commit_message": "Add test validity check to _check_transformer", "patch_to_review": "diff --git a/sklearn/preprocessing/data.py b/sklearn/preprocessing/data.py\nindex 823eedc8b7dd9..ccc3e3ca2edac 100644\n--- a/sklearn/preprocessing/data.py\n+++ b...
[ { "diff_hunk": "@@ -1059,7 +1063,8 @@ def _check_transformer(name, transformer_orig, X, y):\n assert _num_samples(X_pred3) == n_samples\n \n # raises error on malformed input for transform\n- if hasattr(X, 'T') and not _safe_tags(transformer, \"stateless\"):\n+ if hasattr(X, 'T...
f602c4ade471095791ae0d2468448420faff973a
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index 3c3e07ec249b3..7533f2eb78661 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -142,7 +142,10 @@ Changelog ``decision_function_shape='ovr'``, and the number of target classes > 2. :pr:`12557` by `Adrin Jalali`_. - +- |Enhan...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14212@9e87c65
scikit-learn/scikit-learn
Python
14,212
Change documentation cross_val_predict
closes #14199 Change of the cross_val_predict documentation in order to recommend the user to be careful for computing performances on the predictions provided by this function which can lead to different results than cross_val due to a pooling instead of an averaging strategy.
2019-06-28T16:58:26Z
cross_val_predict documentation Hi, I don't know if this should go in issue but I think that we should update the documentation concerning the cross_val_predict function Currently we can read : ``` It is not appropriate to pass these predictions into an evaluation metric. Use :func:`cross_validate` to meas...
It seems to be a somewhat controversial statement. See for instance the conversation on "Why is cross_val_predict discouraged?" at https://mail.python.org/pipermail/scikit-learn/2019-April/thread.html#3069 It certainly needs to be used with caution and with the understanding that it will often not yield the same val...
[ { "body": "Hi,\r\nI don't know if this should go in issue but I think that we should update the documentation concerning the cross_val_predict function\r\nCurrently we can read :\r\n```\r\n It is not appropriate to pass these predictions into an evaluation\r\n metric. Use :func:`cross_validate` to measure...
71bc5ab38d3b0eb79f651b3be2272da90b8beb8f
{ "head_commit": "9e87c65c295cddb95dc251e68d545b6b4138a7a0", "head_commit_message": "Change documentation cross_val_predict", "patch_to_review": "diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py\nindex 7ca80c9e0927a..7a20b64b6a43c 100644\n--- a/sklearn/model_selection/_...
[ { "diff_hunk": "@@ -625,8 +625,12 @@ def cross_val_predict(estimator, X, y=None, groups=None, cv=None,\n pre_dispatch='2*n_jobs', method='predict'):\n \"\"\"Generate cross-validated estimates for each input data point\n \n- It is not appropriate to pass these predictions into an eva...
888a47f31ddfcfa07031a6db763fc4ae19aa08ee
diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index 7ca80c9e0927a..cf98899c95536 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -625,8 +625,14 @@ def cross_val_predict(estimator, X, y=None, groups=None, cv=None, ...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
scikit-learn__scikit-learn-14205@22dcbb0
scikit-learn/scikit-learn
Python
14,205
[MRG] Remove BLAS infos from show_versions and build log
Fixes #14096 - remove BLAS infos from `show_versions()` - remove BLAS from the dependencies in advanced installations doc - remove BLAS infos displayed in the build log
2019-06-27T14:19:17Z
scikit-learn 0.21.x not linking MKL BLAS While building scikit-learn from sources with MKL BLAS support it is not linking to MKL libraries. Such behavior started from 0.21.0 release (0.21.2 checked also). > user@pc:~/scikit-learn-0.21.0/build$ egrep -ir 'mkl_rt' (empty) > user@pc:~/scikit-learn-0.20.3/build/lib....
> While building scikit-learn from sources with MKL BLAS support it is not linking to MKL libraries Since 0.21 scikit-learn is not linked to a BLAS at build time but uses the BLAS linked to scipy. > However both reports in the beginning of building process This report shows which BLAS would be linked if we wan...
[ { "body": "While building scikit-learn from sources with MKL BLAS support it is not linking to MKL libraries. Such behavior started from 0.21.0 release (0.21.2 checked also).\r\n\r\n> user@pc:~/scikit-learn-0.21.0/build$ egrep -ir 'mkl_rt'\r\n(empty)\r\n\r\n> user@pc:~/scikit-learn-0.20.3/build/lib.linux-x86_64...
f339609ab80ee79924cc739edc774182f4870c7c
{ "head_commit": "22dcbb0f7d63e39d19c75881d39b9cd252af8413", "head_commit_message": "revert tests modif", "patch_to_review": "diff --git a/README.rst b/README.rst\nindex a8188dba6d150..a409972f7b71f 100644\n--- a/README.rst\n+++ b/README.rst\n@@ -58,13 +58,6 @@ scikit-learn 0.21 and later require Python 3.5 or ne...
[ { "diff_hunk": "@@ -193,55 +193,27 @@ Installing build dependencies\n Linux\n -----\n \n-Installing from source requires you to have installed the scikit-learn runtime\n-dependencies, Python development headers and a working C/C++ compiler.\n-Under Debian-based operating systems, which include Ubuntu::\n+Instal...
5598754cce0a2bb238e806d7b12da1373ba2a589
diff --git a/README.rst b/README.rst index a8188dba6d150..a409972f7b71f 100644 --- a/README.rst +++ b/README.rst @@ -58,13 +58,6 @@ scikit-learn 0.21 and later require Python 3.5 or newer. For running the examples Matplotlib >= 1.5.1 is required. A few examples require scikit-image >= 0.12.3, a few examples require p...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Dependency Updates & Env Compatibility" }
scikit-learn__scikit-learn-14646@6f5407e
scikit-learn/scikit-learn
Python
14,646
[MRG] Adds Plotting API to Partial Dependence
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2019-08-13T20:37:06Z
Add Display object for plot_partial_dependence Seems that Andy and I agree that we don't need a display object for plot_tree, opinions from other core devs are welcomed. We'll need to return a Display object in plot_partial_dependence, I don't think this breaks current API (because currently we return nothing). ping ...
Yup. I’ll finish this. 😆
[ { "body": "Seems that Andy and I agree that we don't need a display object for plot_tree, opinions from other core devs are welcomed.\r\nWe'll need to return a Display object in plot_partial_dependence, I don't think this breaks current API (because currently we return nothing).\r\nping @thomasjpfan do you want...
78c06e504cf7a9e9d9b2a1c3894a9ccadf2bbbea
{ "head_commit": "6f5407ee6b26e48b532f5661d00342bd3e48e8b9", "head_commit_message": "CLN Fixes bugs", "patch_to_review": "diff --git a/doc/modules/classes.rst b/doc/modules/classes.rst\nindex e3b0c7f06c419..229501affb5bf 100644\n--- a/doc/modules/classes.rst\n+++ b/doc/modules/classes.rst\n@@ -664,6 +664,12 @@ Pl...
[ { "diff_hunk": "@@ -0,0 +1,110 @@\n+\"\"\"\n+=========================================\n+Partial Dependence with Visualization API\n+=========================================\n+The :func:`~sklearn.inspection.plot_partial_dependence` function returns a\n+:class:`~sklearn.inspection.PartialDependenceDisplay` obje...
42e0c9bc75b291046202dde3da35868f7e4e25f9
diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst index 4b24c7089a5a8..47857979abf3f 100644 --- a/doc/developers/contributing.rst +++ b/doc/developers/contributing.rst @@ -1037,53 +1037,3 @@ make this task easier and faster (in no particular order). <https://git-scm.com/docs/git-grep#_...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
secdev__scapy-1681@33a7303
secdev/scapy
Python
1,681
Small 0 and empty string handling cases
fixes https://github.com/secdev/scapy/issues/1679 fixes https://github.com/secdev/scapy/issues/1680
2018-11-02T21:37:17Z
Setting IP length to 0 breaks bytes() packet cast #### Brief description If you create a packet and set the IP length to zero and try to see the bytes of the packet, scapy crashes. IP is affected by this. #### Environment - Scapy version: 2.4.0 - Python version: 3.5.2 - Operating System: Ubuntu 16.0...
This behavior is expected. Flags are not strings in the real world, they are numeral. When you assign a string to a flag, you expect scapy to do name-resolution for you. It is expected to return an error if the name resolution failed. If you wanted to set an invalid value, use the numeral assignment The name resolut...
[ { "body": "#### Brief description\r\n\r\nIf you create a packet and set the IP length to zero and try to see the bytes of the packet, scapy crashes. \r\nIP is affected by this. \r\n\r\n#### Environment\r\n\r\n- Scapy version: 2.4.0\r\n- Python version: 3.5.2\r\n- Operating System: Ubuntu 16.04\r\n\r\n####...
4996c705da447f560747fa48353817cacf563969
{ "head_commit": "33a7303f16482a593ede04681b9919eb28824ade", "head_commit_message": "Small 0 and empty string handling cases", "patch_to_review": "diff --git a/scapy/fields.py b/scapy/fields.py\nindex 9af9b70d212..8b411580e09 100644\n--- a/scapy/fields.py\n+++ b/scapy/fields.py\n@@ -1736,6 +1736,8 @@ class FlagVa...
[ { "diff_hunk": "@@ -1736,14 +1736,16 @@ class FlagValue(object):\n __slots__ = [\"value\", \"names\", \"multi\"]\n \n def _fixvalue(self, value):\n+ if value is None or value == \"\":", "line": null, "original_line": 1739, "original_start_line": null, "path": "scapy/fields.py", ...
c34acb525571a70c3de976fb99d83de8a66ec289
diff --git a/scapy/fields.py b/scapy/fields.py index 9af9b70d212..52db4da55a4 100644 --- a/scapy/fields.py +++ b/scapy/fields.py @@ -1736,6 +1736,8 @@ class FlagValue(object): __slots__ = ["value", "names", "multi"] def _fixvalue(self, value): + if not value: + return 0 if isinsta...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
secdev__scapy-1970@48b706a
secdev/scapy
Python
1,970
Fix FCSField
- fixes https://github.com/secdev/scapy/issues/1969
2019-04-02T17:43:50Z
bytes(packet) modifies packet #### Brief description Running `bytes(packet)` causes `packet` to be extended (by padding?) each time it's called. #### Environment - Scapy version: `scapy===git-archive.dev5c9a7789d` - Python version: `3.6.7` - Operating System: `Ubuntu Bionic` #### How to reproduce Sim...
Please share the original packet/way you built it/pcap file (or in last resort, `pkt.command()`) so that we can reproduce ```python import scapy.all sniff = scapy.all.sniff(offline="./dot11example.pcap") bytes(sniff[0]) bytes(sniff[0]) bytes(sniff[0]) ``` [example.zip](https://github.com/secdev/scapy/files/303...
[ { "body": "#### Brief description\r\nRunning `bytes(packet)` causes `packet` to be extended (by padding?) each time it's called.\r\n\r\n#### Environment\r\n\r\n- Scapy version: `scapy===git-archive.dev5c9a7789d`\r\n- Python version: `3.6.7`\r\n- Operating System: `Ubuntu Bionic`\r\n\r\n#### How to reprodu...
5c9a7789db63c5972698d8b2a0eb033b61a186c5
{ "head_commit": "48b706a3b760764535b004cd57ed0917ce603c12", "head_commit_message": "Fix FCSField consistency & add tests", "patch_to_review": "diff --git a/scapy/fields.py b/scapy/fields.py\nindex b982d316124..78b0ff71660 100644\n--- a/scapy/fields.py\n+++ b/scapy/fields.py\n@@ -412,7 +412,9 @@ def getfield(self...
[ { "diff_hunk": "@@ -1684,3 +1684,29 @@ m = MSBExtendedField(\"foo\", None)\n r = m.m2i(None, data_129[\"str_with_fx\"])\n assert(r == data_129[\"extended\"])\n \n+\n+############\n+############\n++ FCSField\n+\n+= FCSField: basic test\n+\n+class TestPacket(Packet):\n+ fields_desc = [\n+ ByteField(\"a\...
969115f8150b329a7865493a83bc9f5b5620f9a0
diff --git a/scapy/fields.py b/scapy/fields.py index b982d316124..78b0ff71660 100644 --- a/scapy/fields.py +++ b/scapy/fields.py @@ -412,7 +412,9 @@ def getfield(self, pkt, s): val = self.m2i(pkt, struct.unpack(self.fmt, s[-self.sz:])[0]) def _post_dissect(self, s): - self.raw_packet_cach...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
secdev__scapy-1983@76fa845
secdev/scapy
Python
1,983
Backward compatibility: Add Deprecated fields
Rationale: Scapy is pretty bad at keeping things backward compatible. Fields are renamed often for consistency, therefore breaking older stuff. Moreover, because the release schedule is so slow, people aren't warned of changes. This PR is an attempt to improve this by: - implementing `alias_fields` that redirects t...
2019-04-12T17:30:18Z
RadioTap Dummy Channel vs. Frequency confusion #### Brief description RadioTap layer seems to confuse what the Frequency is vs. what the Channel is. #### Environment - `scapy===git-archive.deve44bd373f` - `3.6` - `Ubuntu 18.04` #### How to reproduce - Simply capture 802.11 traffic and check out the "...
Hi & thanks for the report Could you please share a pcap or a packet as bytes/hex so that we can reproduce ? We recently did several overhauls to RadioTap, it could have broken something. Thanks ! Sure. Attached [example.zip](https://github.com/secdev/scapy/files/3050616/example.zip) That's not correct. In re...
[ { "body": "#### Brief description\r\nRadioTap layer seems to confuse what the Frequency is vs. what the Channel is.\r\n\r\n#### Environment\r\n\r\n- `scapy===git-archive.deve44bd373f`\r\n- `3.6`\r\n- `Ubuntu 18.04`\r\n\r\n#### How to reproduce\r\n- Simply capture 802.11 traffic and check out the \"Channel...
e8f6f9ba0544f2bb26ce420620cf47f1737fd10d
{ "head_commit": "76fa84510c62f34a0d00d339312aa34eed6cf007", "head_commit_message": "Add version tag", "patch_to_review": "diff --git a/scapy/layers/dot11.py b/scapy/layers/dot11.py\nindex 397d4ff8d52..ab18230a95c 100644\n--- a/scapy/layers/dot11.py\n+++ b/scapy/layers/dot11.py\n@@ -247,6 +247,11 @@ def guess_pay...
[ { "diff_hunk": "@@ -70,6 +72,7 @@ class Packet(six.with_metaclass(Packet_metaclass, BasePacket,\n ]\n name = None\n fields_desc = []\n+ deprecated_fields = None", "line": null, "original_line": 75, "original_start_line": null, "path": "scapy/packet.py", "start_line": null, ...
32d22d57fc0bd7d570c1c184c0a812d110a5eb4d
diff --git a/scapy/layers/dot11.py b/scapy/layers/dot11.py index 397d4ff8d52..ab18230a95c 100644 --- a/scapy/layers/dot11.py +++ b/scapy/layers/dot11.py @@ -247,6 +247,11 @@ def guess_payload_class(self, pay): class RadioTap(Packet): name = "RadioTap dummy" + deprecated_fields = { + "Channel": ("Chann...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14197@65671ac
scikit-learn/scikit-learn
Python
14,197
FIX introduce a refresh_cache param to `fetch_...` functions.
This kinda fixes #14177. This does not change the warning message. But it introduces a `refresh_cache` parameter to the `fetch_...` functions that download and persist the data using `joblib`. The proposal is to add this parameter, with some variation after reviews: ``` + refresh_cache : str or bool, opti...
2019-06-26T13:21:34Z
Better warning message with deprecation of sklearn.externals._joblib When loading the olivetti dataset, I got the deprecation warning: ```python "sklearn.externals.joblib is deprecated in 0.21 and will be removed " "in 0.23. Please import this functionality directly from joblib, " "which can ...
Another point which we could improve is to tell the user where those data are located. I don't think most people know where to go and delete the files. We are just mentioned the following: ``` Specify another download and cache folder for the datasets. By default all scikit-learn data is stored in ‘~/scikit_learn_d...
[ { "body": "When loading the olivetti dataset, I got the deprecation warning:\r\n\r\n```python\r\n \"sklearn.externals.joblib is deprecated in 0.21 and will be removed \"\r\n \"in 0.23. Please import this functionality directly from joblib, \"\r\n \"which can be installed with: pip install jobl...
91819d58275adf1bb05944b9e51ff3133cebc7f9
{ "head_commit": "65671ac58f30e23f1464affce332627108f34475", "head_commit_message": "remove param", "patch_to_review": "diff --git a/sklearn/datasets/base.py b/sklearn/datasets/base.py\nindex 0b8f73c86117b..f519862b72d56 100644\n--- a/sklearn/datasets/base.py\n+++ b/sklearn/datasets/base.py\n@@ -10,6 +10,7 @@\n i...
[ { "diff_hunk": "@@ -919,3 +920,25 @@ def _fetch_remote(remote, dirname=None):\n \"file may be corrupted.\".format(file_path, checksum,\n remote.checksum))\n return file_path\n+\n+\n+def _refresh_cache(path):", "line": null, ...
6cf82540cd35f34f320076263d41c959b4f1f91d
diff --git a/doc/whats_new/v0.21.rst b/doc/whats_new/v0.21.rst index 2e1c639e267b7..cf3302ad62c00 100644 --- a/doc/whats_new/v0.21.rst +++ b/doc/whats_new/v0.21.rst @@ -12,6 +12,18 @@ Version 0.21.3 Changelog --------- +:mod:`sklearn.datasets` +....................... + +- |Fix| :func:`datasets.fetch_california_hou...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14024@6c4057f
scikit-learn/scikit-learn
Python
14,024
BUG Fix zero division error in GBDTs
Fixes #14018 Probably also #14014 Non-regression test fails on master.
2019-06-04T15:15:31Z
Zero division error in HistGradientBoosting ```python from sklearn.datasets import fetch_openml from sklearn.model_selection import cross_val_score from sklearn.experimental import enable_hist_gradient_boosting from sklearn.ensemble import HistGradientBoostingClassifier import numpy as np # one hundred plants...
I am just adding the traceback ```pytb --------------------------------------------------------------------------- ZeroDivisionError Traceback (most recent call last) <ipython-input-3-b0953fbb1d6e> in <module> ----> 1 clf.fit(X, y) ~/Documents/code/toolbox/scikit-learn/sklearn/ensemb...
[ { "body": "```python\r\nfrom sklearn.datasets import fetch_openml\r\nfrom sklearn.model_selection import cross_val_score\r\nfrom sklearn.experimental import enable_hist_gradient_boosting\r\nfrom sklearn.ensemble import HistGradientBoostingClassifier\r\n\r\nimport numpy as np\r\n\r\n# one hundred plants - margin...
4a6264db68b28a2e65efdecc459233911c9aee95
{ "head_commit": "6c4057f0ed1e4d8d418777fff9b1f5bd24fbec8e", "head_commit_message": "added comment", "patch_to_review": "diff --git a/sklearn/ensemble/_hist_gradient_boosting/grower.py b/sklearn/ensemble/_hist_gradient_boosting/grower.py\nindex 691d10f16ac61..a6fbf61772e22 100644\n--- a/sklearn/ensemble/_hist_gra...
[ { "diff_hunk": "@@ -18,6 +18,9 @@\n from .types import PREDICTOR_RECORD_DTYPE\n \n \n+EPS = 1e-15 # to avoid zero division errors", "line": null, "original_line": 21, "original_start_line": null, "path": "sklearn/ensemble/_hist_gradient_boosting/grower.py", "start_line": null, "text": "...
a45e00b7e4487a04b2135a495dc4c77c3e33a493
diff --git a/sklearn/ensemble/_hist_gradient_boosting/grower.py b/sklearn/ensemble/_hist_gradient_boosting/grower.py index d6836c2bd4c75..7eec680082e97 100644 --- a/sklearn/ensemble/_hist_gradient_boosting/grower.py +++ b/sklearn/ensemble/_hist_gradient_boosting/grower.py @@ -16,6 +16,10 @@ from .predictor import Tree...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-13772@3995316
scikit-learn/scikit-learn
Python
13,772
[MRG] Save sample_weight_arr instead of sample_weight in KernelDensity
#### Reference Issues/PRs Fixes #13692 #### What does this implement/fix? Explain your changes. Saves the sample_weight_arr instead of sample_weight. This enables the KernelDensity model object to be dumped into a pickle file. Also adds the relevant test for this.
2019-05-03T00:42:27Z
Saving KernelDensity with sample_weight #### Description Type Error when saving to file Kernel Density Estimation with sample weight #### Steps/Code to Reproduce Example: ```python import numpy as np from sklearn.neighbors import KernelDensity data = np.reshape([1., 2., 3., 1., 2., 3.], (-1, 2)) kde = Kern...
Thanks for the report. `__getstate__` should be storing `self.sample_weight_arr`, not `self.sample_weight`. Would you like to submit a Pull Request fixing this (and adding a test in accordance with your snippet above)? If @Dathiou is not working on this, I would like to work on this @jnothman @aditya1702 Thank you both...
[ { "body": "#### Description\r\n Type Error when saving to file Kernel Density Estimation with sample weight\r\n\r\n#### Steps/Code to Reproduce\r\n\r\nExample:\r\n```python\r\nimport numpy as np\r\nfrom sklearn.neighbors import KernelDensity\r\ndata = np.reshape([1., 2., 3., 1., 2., 3.], (-1, 2))\r\nkde = Kerne...
a300e7c0cd9afb2c64b774b126d132dbd4c3d741
{ "head_commit": "3995316c45ed2640bf963c1c3d090dc23b6843e6", "head_commit_message": "DOC add what's new", "patch_to_review": "diff --git a/doc/whats_new/v0.21.rst b/doc/whats_new/v0.21.rst\nindex b2d28f3efb0f2..24453de2b9a7c 100644\n--- a/doc/whats_new/v0.21.rst\n+++ b/doc/whats_new/v0.21.rst\n@@ -7,7 +7,7 @@\n V...
[ { "diff_hunk": "@@ -223,3 +223,22 @@ def test_pickling(tmpdir):\n scores_pickled = kde.score_samples(X)\n \n assert_allclose(scores, scores_pickled)\n+\n+\n+def test_pickling_with_sample_weights(tmpdir):", "line": null, "original_line": 228, "original_start_line": null, "path": "sklearn/...
5539ff8a80bd54abf5bd0044d2414d3326d7930e
diff --git a/doc/whats_new/v0.21.rst b/doc/whats_new/v0.21.rst index b2d28f3efb0f2..24453de2b9a7c 100644 --- a/doc/whats_new/v0.21.rst +++ b/doc/whats_new/v0.21.rst @@ -7,7 +7,7 @@ Version 0.21.1 ============== -**May 2019** +**17 May 2019** This is a bug-fix release with some minor documentation improvements ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-14114@fa174dc
scikit-learn/scikit-learn
Python
14,114
[MRG] FIX solve consistency between predict and predict_proba in AdaBoost
closes #14084 closes #2974 compute the probabilities in AdaBoostClassifier as specified in "Multiclass AdaBoost"
2019-06-18T13:20:20Z
AdaBoost's "SAMME" algorithm uses 'predict' while fitting and 'predict_proba' while predicting probas Subj. This seems to me to be a wrong approach, moreover this drives to such mistakes: <pre> AdaBoostClassifier(algorithm="SAMME", base_estimator=SVC()).fit(trainX, trainY).predict_proba(testX) ------------------------...
(Not an AdaBoost expert) Why is it wrong? How else would you define `predict_proba`? The idea of using only predictions during training and use afterwards probas of base_estimators is strange. The base_estimator can return -0.1 and 0.9 or -0.9 and 0.1. They will have same predictions and different probas - but you d...
[ { "body": "Subj. This seems to me to be a wrong approach, moreover this drives to such mistakes:\n\n<pre>\nAdaBoostClassifier(algorithm=\"SAMME\", base_estimator=SVC()).fit(trainX, trainY).predict_proba(testX)\n---------------------------------------------------------------------------\nNotImplementedError ...
7b8cbc875b862ebb81a9b3415bdee235cca99ca6
{ "head_commit": "fa174dc4366e0899936f03b04950586453efbd38", "head_commit_message": "DOC add whats new", "patch_to_review": "diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst\nindex 85b8c330bd9fe..04fdf6a510e66 100644\n--- a/doc/whats_new/v0.22.rst\n+++ b/doc/whats_new/v0.22.rst\n@@ -55,6 +55,11 @@ C...
[ { "diff_hunk": "@@ -748,6 +749,24 @@ class in ``classes_``, respectively.\n else:\n yield pred / norm\n \n+ @staticmethod\n+ def _compute_proba_from_decision(decision, n_classes):\n+ \"\"\"Compute probabilities from the decision function.\n+\n+ This is based eq. (...
0542f5aa67992c9600fce6e5910039ef1844bb5a
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index d123855c1ece8..3dc356be9ab1d 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -84,6 +84,11 @@ Changelog preserve the class balance of the original training set. :pr:`14194` by :user:`Johann Faouzi <johannfaouzi>`. +- |Fix|...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-13704@4d6a93b
scikit-learn/scikit-learn
Python
13,704
[MRG] Changed VarianceThreshold behaviour when threshold is zero. See #13691
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs Fixes #13691 #### What does this implement/fix? Explain your changes. ...
2019-04-23T15:57:53Z
VarianceThreshold doesn't remove feature with zero variance #### Description When calling VarianceThreshold().fit_transform() on certain inputs, it fails to remove a column that has only one unique value. #### Steps/Code to Reproduce ```python import numpy as np from sklearn.feature_selection import VarianceThre...
On closer inspection this is just caused by floating point error in calculating the variance, and therefore not a bug with sklearn. It is resolvable by setting the variance threshold to e.g. 1e-33 rather than 0. We should probably avoid 0 as a default. I'd be happy to deprecate the current default and change it to np.f...
[ { "body": "#### Description\r\nWhen calling VarianceThreshold().fit_transform() on certain inputs, it fails to remove a column that has only one unique value.\r\n\r\n#### Steps/Code to Reproduce\r\n```python\r\nimport numpy as np\r\nfrom sklearn.feature_selection import VarianceThreshold\r\n\r\nworks_correctly ...
57726672b52421aca17123cc313136a340344d0d
{ "head_commit": "4d6a93b8d37432d1647aad74cbd966165fc779c5", "head_commit_message": "Update v0.22.rst", "patch_to_review": "diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst\nindex 6cc93ecdfe358..dda9adbc2e79e 100644\n--- a/doc/whats_new/v0.22.rst\n+++ b/doc/whats_new/v0.22.rst\n@@ -57,7 +57,6 @@ Cha...
[ { "diff_hunk": "@@ -57,16 +57,22 @@ Changelog\n ``decision_function_shape='ovr'``, and the number of target classes > 2.\n :pr:`12557` by `Adrin Jalali`_.\n \n-\n :mod:`sklearn.cluster`\n ..................\n \n - |Enhancement| :class:`cluster.SpectralClustering` now accepts a ``n_components`` \n paramete...
c958c9532e39c8662aab4caba909b23c6e248a30
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index 6cc93ecdfe358..7e82b36ac2ee7 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -57,7 +57,6 @@ Changelog ``decision_function_shape='ovr'``, and the number of target classes > 2. :pr:`12557` by `Adrin Jalali`_. - :mod:`sklea...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-13688@c79dbd1
scikit-learn/scikit-learn
Python
13,688
[MRG] DOC: Add SLEP and Governance in Dev Docs
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> Reference SLEP and Governance in Dev Docs as per #13268, also resuming work from #13634 which was clo...
2019-04-22T06:32:37Z
reference SLEP and Governance in dev docs the Scikit-Learn Enhancement Proposal is mentioned in the recently merged Governance document (doc/governance.rst), but nowhere else I can see. The Governance doc is only mentioned in About. These are both things new contributors should be aware of. We should add: * SLEP and S...
Hi @jnothman , can I work on the above issue? > Hi @jnothman , can I work on the above issue? I actually started over this, @thegaribguy can you please pick up another issue ? @LakshKD I was about to raise a PR as I finished the issue, you could have commented here atleast to let us know if the issue was taken al...
[ { "body": "the Scikit-Learn Enhancement Proposal is mentioned in the recently merged Governance document (doc/governance.rst), but nowhere else I can see. The Governance doc is only mentioned in About. These are both things new contributors should be aware of. We should add:\r\n* SLEP and Scikit-learn Enhancmen...
8edd9f9f1597094a1f8024f4d091f21e9c1fa66a
{ "head_commit": "c79dbd109a17299fdbba1287f0b48bca487d39c5", "head_commit_message": "Remove trailing underscores", "patch_to_review": "diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst\nindex b2987bbea7c83..0ea5e25933c1e 100644\n--- a/doc/developers/contributing.rst\n+++ b/doc/develop...
[ { "diff_hunk": "@@ -675,6 +675,19 @@ General Concepts\n but not maintained by the core developer team.\n See https://scikit-learn-contrib.github.io.\n \n+ scikit-learn enhancement proposals\n+ SLEP\n+ SLEPs\n+ Changes to the API principles and changes to dependencies or supported...
90d8970704bc27885b6617204d72b200ed247329
diff --git a/doc/developers/contributing.rst b/doc/developers/contributing.rst index b2987bbea7c83..34a5f63919c44 100644 --- a/doc/developers/contributing.rst +++ b/doc/developers/contributing.rst @@ -40,6 +40,10 @@ ticket to the `GitHub issue tracker <https://github.com/scikit-learn/scikit-learn/issues>`_. You are a...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Documentation Updates" }
scikit-learn__scikit-learn-14446@4f24030
scikit-learn/scikit-learn
Python
14,446
FEA Allow passing custom covariance estimators to LDA
Fixes #14436 Plug-in any covariance estimator into Fisher discriminants This PR allows the user to plug-in any sklearn covariance estimator into LDA and QDA. This option is only possible with the "lsqr" and "eigen" solver of LDA and for the "lsqr" solver of QDA (initially only an "svd" solver was available for QDA s...
2019-07-23T12:45:37Z
Linear and Quadratic discriminant analysis could be more modular to allow for user specific estimation of covariance By default sample estimate is used to estimate the covariance in Fisher discriminant such as LDA and QDA. However it could be useful to make the API a bit more general so that any estimator of covariance...
@hugorichard if you have a ready PR, I'd say submit and we can see how we feel about it then.
[ { "body": "By default sample estimate is used to estimate the covariance in Fisher discriminant such as LDA and QDA. However it could be useful to make the API a bit more general so that any estimator of covariance can be plugged in (I know that Ledoit-Wolf is already implemented). \r\n\r\nWhat I propose is to ...
ab3dc9fdf31f35854b390168ac68fb304951305f
{ "head_commit": "4f24030d072ad586be3bea0c68e9ce115d67ec42", "head_commit_message": "correct docs issues", "patch_to_review": "diff --git a/sklearn/discriminant_analysis.py b/sklearn/discriminant_analysis.py\nindex 7a0bdcf398aa2..3438c6ce9b2bb 100644\n--- a/sklearn/discriminant_analysis.py\n+++ b/sklearn/discrimi...
[ { "diff_hunk": "@@ -25,47 +25,63 @@\n from .utils.extmath import softmax\n from .preprocessing import StandardScaler\n \n-\n __all__ = ['LinearDiscriminantAnalysis', 'QuadraticDiscriminantAnalysis']\n \n \n-def _cov(X, shrinkage=None):\n- \"\"\"Estimate covariance matrix (using optional shrinkage).\n-\n+def ...
e4cdb5fa98b303d8a2381e0b7c5da7ce2222497a
diff --git a/doc/modules/lda_qda.rst b/doc/modules/lda_qda.rst index c3ac94dedefa9..e8f25d2c66930 100644 --- a/doc/modules/lda_qda.rst +++ b/doc/modules/lda_qda.rst @@ -163,8 +163,8 @@ transformed class means :math:`\mu^*_k`). This :math:`L` corresponds to the :func:`~discriminant_analysis.LinearDiscriminantAnalysis.t...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Code Refactoring / Architectural Improvement" }
scikit-learn__scikit-learn-13536@9b80875
scikit-learn/scikit-learn
Python
13,536
[MRG+1] Fix/pipeline param error msg
#### Reference Issues/PRs Fixes #13534 #### What does this implement/fix? Explain your changes. The error message for passing a sample_weight is unclear. A check has been introduced for when the step name is not found in the fit_params_steps that raises a TypeError. #### Any other comments? - Is the wording o...
2019-03-28T08:05:48Z
improve error message when passing sample_weight to Pipeline Many estimators take a parameter named `sample_weight`. `Pipeline` does not, since it wants its `fit` parameters to be prefixed by the step name with a `__` delimiter: ```pytb >>> from sklearn.pipeline import make_pipeline >>> from sklearn.linear_model i...
There is some code in gradient boosting that checks for the current error message, so that should be updated to reflect a changed error message too. (Arguably, this should be a TypeError, not a ValueError, since the user has passed the wrong parameter names, but I'm ambivalent to whether we fix that.) I'd like to ta...
[ { "body": "Many estimators take a parameter named `sample_weight`. `Pipeline` does not, since it wants its `fit` parameters to be prefixed by the step name with a `__` delimiter:\r\n\r\n```pytb\r\n>>> from sklearn.pipeline import make_pipeline\r\n>>> from sklearn.linear_model import LogisticRegression\r\n>>> cl...
c863ed3d57e3b5ceeb4e7e8001c96aad7110c605
{ "head_commit": "9b808754d2942f5a2e6a1336f06d37962663e203", "head_commit_message": "Added test for sample_weight parameter error message", "patch_to_review": "diff --git a/sklearn/pipeline.py b/sklearn/pipeline.py\nindex d1d03656d2a62..411e5d4f40818 100644\n--- a/sklearn/pipeline.py\n+++ b/sklearn/pipeline.py\n@...
[ { "diff_hunk": "@@ -253,6 +253,13 @@ def _fit(self, X, y=None, **fit_params):\n fit_params_steps = {name: {} for name, step in self.steps\n if step is not None}\n for pname, pval in fit_params.items():\n+ if '__' not in pname:\n+ raise TypeEr...
92bde96e3cf946efa7dc81abb487fd6de7b126ad
diff --git a/sklearn/ensemble/gradient_boosting.py b/sklearn/ensemble/gradient_boosting.py index 253cc60ea8ef2..44fb670c5c2d0 100644 --- a/sklearn/ensemble/gradient_boosting.py +++ b/sklearn/ensemble/gradient_boosting.py @@ -1489,7 +1489,9 @@ def fit(self, X, y, sample_weight=None, monitor=None): e...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-13653@1be879d
scikit-learn/scikit-learn
Python
13,653
[MRG] Replace absolute imports with relative ones
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs Fixes #13629 #### What does this implement/fix? Explain your changes...
2019-04-16T03:33:00Z
Remove absolute imports In a lot of files, we're still using absolute imports for scikit-learn tools. These should be relative import instead. ``` ~/dev/sklearn(branch:master*) » git grep "from sklearn" sklearn | grep -v test | grep -v ">>>" sklearn/base.py:from sklearn.utils import _IS_32BIT sklearn/calibrati...
Will resolve this Hi @aditya1702 - would you mind if I worked on some of these ? For instance, I could take the bottom of the list from `/sklearn/tree/` and `/sklearn/utils/` ? @scouvreur I was almost finished with the task before you commented. Was AFK and created a pull request now
[ { "body": "In a lot of files, we're still using absolute imports for scikit-learn tools. These should be relative import instead.\r\n\r\n```\r\n~/dev/sklearn(branch:master*) » git grep \"from sklearn\" sklearn | grep -v test | grep -v \">>>\" \r\n\r\nsklearn/base.py:from sklearn.utils import _IS_32BIT\r\nsklear...
f20eaeb58de039e2a59e2c63f555df2d0e7ad418
{ "head_commit": "1be879d772b6aa38586433ffdd2e515bd904f8a7", "head_commit_message": "add a . before import", "patch_to_review": "diff --git a/sklearn/base.py b/sklearn/base.py\nindex 167baaf2b7ebd..d13619617bde4 100644\n--- a/sklearn/base.py\n+++ b/sklearn/base.py\n@@ -12,7 +12,7 @@\n import numpy as np\n \n from...
[ { "diff_hunk": "@@ -33,23 +33,23 @@ class NotFittedError(ValueError, AttributeError):\n NotFittedError('This LinearSVC instance is not fitted yet'...)\n \n .. versionchanged:: 0.18\n- Moved from sklearn.utils.validation.\n+ Moved from .utils.validation.\n \"\"\"\n \n \n class ChangedBeha...
f5752b6c1208bee6aaec27326c74a54e96788960
diff --git a/sklearn/base.py b/sklearn/base.py index 167baaf2b7ebd..d13619617bde4 100644 --- a/sklearn/base.py +++ b/sklearn/base.py @@ -12,7 +12,7 @@ import numpy as np from . import __version__ -from sklearn.utils import _IS_32BIT +from .utils import _IS_32BIT _DEFAULT_TAGS = { 'non_deterministic': False,...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Code Refactoring / Architectural Improvement" }
scikit-learn__scikit-learn-13726@fb12eff
scikit-learn/scikit-learn
Python
13,726
[MRG] Fix n_components kwarg missing in SpectralClustering. See #13698
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs Fixes #13698 <!-- Example: Fixes #1234. See also #3456. Please use key...
2019-04-25T19:27:07Z
n_components kwarg missing in SpectralClustering The `n_components` kwarg defined in the `spectral_clustering` function allow the user to choose how many eigenvalues/eigenvectors should be used in the classification. However this kwarg cannot be accessed/modified when using `SpectralClustering` class, and is set to de...
I don't know the history of this. Maybe someone wants to go digging to find out whether this was a reasoned choice by the developers I looked at the code, and obviously `n_components` is not a instance variable of the `SpectralClustering` class, and when an instance of `SpectralClustering` class calls fit, `n_component...
[ { "body": "The `n_components` kwarg defined in the `spectral_clustering` function allow the user to choose how many eigenvalues/eigenvectors should be used in the classification.\r\nHowever this kwarg cannot be accessed/modified when using `SpectralClustering` class, and is set to default (`n_components` = `nb_...
22b0eabfd04fa554768568a8b309fae8115102ce
{ "head_commit": "fb12eff7bd3330c6de65b0885e39cfab361558b6", "head_commit_message": "fix doctest failure", "patch_to_review": "diff --git a/sklearn/cluster/spectral.py b/sklearn/cluster/spectral.py\nindex 75757ae907717..c48117b87f1b9 100644\n--- a/sklearn/cluster/spectral.py\n+++ b/sklearn/cluster/spectral.py\n@@...
[ { "diff_hunk": "@@ -425,12 +428,14 @@ class SpectralClustering(BaseEstimator, ClusterMixin):\n https://www1.icsi.berkeley.edu/~stellayu/publication/doc/2003kwayICCV.pdf\n \"\"\"\n \n- def __init__(self, n_clusters=8, eigen_solver=None, random_state=None,\n- n_init=10, gamma=1., affi...
ce1c3cb368df467ee71dbc13a6674467e5112318
diff --git a/doc/whats_new/v0.22.rst b/doc/whats_new/v0.22.rst index 0518d6c9e0de4..6cc93ecdfe358 100644 --- a/doc/whats_new/v0.22.rst +++ b/doc/whats_new/v0.22.rst @@ -57,6 +57,16 @@ Changelog ``decision_function_shape='ovr'``, and the number of target classes > 2. :pr:`12557` by `Adrin Jalali`_. + +:mod:`skle...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-13497@a18cb3d
scikit-learn/scikit-learn
Python
13,497
Fix _estimate_mi discrete_features str and value check
#### Reference Issues/PRs Fixes #13481 #### What does this implement/fix? Explain your changes. In `_estimate_mi` the parameter `discrete_features` can be a string value 'auto' as well as an array of indices or a boolean mask. Code initially checks if `discrete_features == 'auto'` which will error in future v...
2019-03-23T14:28:08Z
Comparing string to array in _estimate_mi In ``_estimate_mi`` there is ``discrete_features == 'auto'`` but discrete features can be an array of indices or a boolean mask. This will error in future versions of numpy. Also this means we never test this function with discrete features != 'auto', it seems?
I'll take this @hermidalc go for it :) i'm not sure ,but i think user will change the default value if it seem to be array or boolean mask....bcz auto is default value it is not fixed. I haven't understood, @punkstar25
[ { "body": "In ``_estimate_mi`` there is ``discrete_features == 'auto'`` but discrete features can be an array of indices or a boolean mask.\r\nThis will error in future versions of numpy.\r\nAlso this means we never test this function with discrete features != 'auto', it seems?", "number": 13481, "title...
26f690961a52946dd2f53bf0fdd4264b2ae5be90
{ "head_commit": "a18cb3d2434f784d01f889707cdd8fdb61c8accd", "head_commit_message": "discrete_features str and value check", "patch_to_review": "diff --git a/sklearn/feature_selection/mutual_info_.py b/sklearn/feature_selection/mutual_info_.py\nindex d5d1b7fb59db9..3a32261e5b61d 100644\n--- a/sklearn/feature_sele...
[ { "diff_hunk": "@@ -247,8 +247,11 @@ def _estimate_mi(X, y, discrete_features='auto', discrete_target=False,\n X, y = check_X_y(X, y, accept_sparse='csc', y_numeric=not discrete_target)\n n_samples, n_features = X.shape\n \n- if discrete_features == 'auto':\n- discrete_features = issparse(X)\n...
433fa02bb496350a0bea6fc9fa114e49229a5de4
diff --git a/sklearn/feature_selection/mutual_info_.py b/sklearn/feature_selection/mutual_info_.py index d5d1b7fb59db9..2085352a231b5 100644 --- a/sklearn/feature_selection/mutual_info_.py +++ b/sklearn/feature_selection/mutual_info_.py @@ -10,7 +10,7 @@ from ..preprocessing import scale from ..utils import check_ran...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-13496@c32ca56
scikit-learn/scikit-learn
Python
13,496
[MRG] ENH iForest - expose warm_start (#13451)
#### Reference Issues/PRs Fixes #13451 #### What does this implement/fix? Explain your changes. This PR exposes `warm_start` in the `sklearn.ensemble.IsolationForest`. It also adds a test ` sklearn/ensemble/tests/test_iforest.py` to check whether iterative addition of iTrees to an iForest works as expected. #...
2019-03-23T09:46:59Z
Expose warm_start in Isolation forest It seems to me that `sklearn.ensemble.IsolationForest` supports incremental addition of new trees with the `warm_start` parameter of its parent class, `sklearn.ensemble.BaseBagging`. Even though this parameter is not exposed in `__init__()` , it gets inherited from `BaseBagging`...
+1 to expose `warm_start` in `IsolationForest`, unless there was a good reason for not doing so in the first place. I could not find any related discussion in the IsolationForest PR #4163. ping @ngoix @agramfort? no objection > PR welcome @petibear. Feel free to ping me when it’s ready for reviews :). OK, I'm workin...
[ { "body": "It seems to me that `sklearn.ensemble.IsolationForest` supports incremental addition of new trees with the `warm_start` parameter of its parent class, `sklearn.ensemble.BaseBagging`.\r\n\r\nEven though this parameter is not exposed in `__init__()` , it gets inherited from `BaseBagging` and one can us...
3aefc834dce72e850bff48689bea3c7dff5f3fad
{ "head_commit": "c32ca5634fbd1e933d31aa26edc9d8082da68d78", "head_commit_message": "Incorporates comments from PR #13496\n\n* versionadded=0.21\n\n* adition in whatsnew\n\n* test using iris dataset", "patch_to_review": "diff --git a/doc/whats_new/v0.21.rst b/doc/whats_new/v0.21.rst\nindex 1c68efd38570c..7902a99f...
[ { "diff_hunk": "@@ -295,6 +295,28 @@ def test_score_samples():\n clf2.score_samples([[2., 2.]]))\n \n \n+@pytest.mark.filterwarnings('ignore:default contamination')\n+@pytest.mark.filterwarnings('ignore:behaviour=\"old\"')\n+def test_iforest_warmstart():\n+ \"\"\"Test iterative additio...
479bb3c9a4e0923802dda18a8f83c45ac09afff8
diff --git a/doc/modules/outlier_detection.rst b/doc/modules/outlier_detection.rst index b27b0c8a59643..c061feb0b1d7c 100644 --- a/doc/modules/outlier_detection.rst +++ b/doc/modules/outlier_detection.rst @@ -252,6 +252,19 @@ This algorithm is illustrated below. :align: center :scale: 75% +.. _iforest_warm_st...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
scikit-learn__scikit-learn-13454@ee53c2b
scikit-learn/scikit-learn
Python
13,454
Updated error message to remove deprecated n_values
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2019-03-16T00:04:44Z
Confusing error message in OrdinalEncoder when passing single list of categories Small example: ```py In [38]: from sklearn.preprocessing import OrdinalEncoder In [39]: X = np.array([['L', 'M', 'S', 'M', 'L']], dtype=object).T In [40]: ohe = OrdinalEncoder(categories=['S', 'M', 'L']) In [41]: ohe.fit(X) ...
Just out of curiosity. First timer here! Are you looking for a fix just on writing up an error message similar to the more recently updated error messages in other parts of the same file? Hi, I'd like to take this one up. This is my first time contributing. Will make the change and submit a PR.
[ { "body": "Small example:\r\n\r\n```py\r\nIn [38]: from sklearn.preprocessing import OrdinalEncoder \r\n\r\nIn [39]: X = np.array([['L', 'M', 'S', 'M', 'L']], dtype=object).T\r\n\r\nIn [40]: ohe = OrdinalEncoder(categories=['S', 'M', 'L'])\r\n\r\nIn [41]: ohe.fit(X)\r\n...\r\nValueError: Shape mismatch: if n_va...
85206250ceac6341c0ca1d4fd89dfd127e3e8e6b
{ "head_commit": "ee53c2b0725762ea09093a98be7b5885f521b76f", "head_commit_message": "Added test for error message on OrdinalEncoder", "patch_to_review": "diff --git a/sklearn/preprocessing/_encoders.py b/sklearn/preprocessing/_encoders.py\nindex 6c3df0f22178e..7c4b056c9b855 100644\n--- a/sklearn/preprocessing/_en...
[ { "diff_hunk": "@@ -571,7 +571,7 @@ def _legacy_fit_transform(self, X):\n \" 'auto', int or array of ints, got %r\"\n % type(self._n_values))\n if n_values.ndim < 1 or n_values.shape[0] != X.shape[1]:\n- raise ValueError(...
623640e26aff733d2fd9142bea318f0134196f63
diff --git a/sklearn/preprocessing/_encoders.py b/sklearn/preprocessing/_encoders.py index 6c3df0f22178e..d62a7ad060507 100644 --- a/sklearn/preprocessing/_encoders.py +++ b/sklearn/preprocessing/_encoders.py @@ -81,7 +81,7 @@ def _fit(self, X, handle_unknown='error'): if self._categories != 'auto': ...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-13628@9f95d0e
scikit-learn/scikit-learn
Python
13,628
[MRG] FIX Correct brier_score_loss when there's only one class in y_true
closes #8459, closes #9300, closes #9301, closes #9562, closes #11245 Correct brier_score_loss when there's only one class in y_true. This is an ugly solution, but will fix existing bugs, and avoid backward incompatibility. Remove some redundant code in calibration_curve and brier_score_loss.
2019-04-12T14:38:20Z
brier_score_loss returns incorrect value when all y_true values are True/1 ```python In [7]: brier_score_loss(np.array([1, 1, 1]), np.array([1, 1, 1])) Out[7]: 1.0 In [8]: brier_score_loss(np.array([0, 0, 0]), np.array([0, 0, 0])) Out[8]: 0.0 In [9]: brier_score_loss(np.array([True, True, True]), np.array([1, ...
I have made a tentative pull request [here](https://github.com/scikit-learn/scikit-learn/pull/9301). I'm still experiencing this issue in `0.19.1`. PR #9980 seems to address this, but #9300 and #9980 do not reference each other. This comment should fix that. Thanks. Duplicate issue of #9300, #8459 Sorry, just amended ...
[ { "body": "```python\r\nIn [7]: brier_score_loss(np.array([1, 1, 1]), np.array([1, 1, 1]))\r\nOut[7]: 1.0\r\n\r\nIn [8]: brier_score_loss(np.array([0, 0, 0]), np.array([0, 0, 0]))\r\nOut[8]: 0.0\r\n\r\nIn [9]: brier_score_loss(np.array([True, True, True]), np.array([1, 1, 1]))\r\nOut[9]: 1.0\r\n\r\nIn [10]: bri...
6a3fc959b684e2f4b2fab28b27d5fa4018acb6a3
{ "head_commit": "9f95d0e9cefc2a60c52413d115a11a89f5f81cdb", "head_commit_message": "DOC parameter description", "patch_to_review": "diff --git a/doc/whats_new/v0.21.rst b/doc/whats_new/v0.21.rst\nindex 3175fca4747f6..5a23c452dcd42 100644\n--- a/doc/whats_new/v0.21.rst\n+++ b/doc/whats_new/v0.21.rst\n@@ -397,6 +3...
[ { "diff_hunk": "@@ -2353,8 +2334,10 @@ def brier_score_loss(y_true, y_prob, sample_weight=None, pos_label=None):\n Sample weights.\n \n pos_label : int or str, default=None\n- Label of the positive class. If None, the maximum label is used as\n- positive class\n+ Label of the po...
4c2eda0a9a349550de9ae92c97476a4a8bc52328
diff --git a/doc/whats_new/v0.21.rst b/doc/whats_new/v0.21.rst index 92794b8854e64..ba095eedf1331 100644 --- a/doc/whats_new/v0.21.rst +++ b/doc/whats_new/v0.21.rst @@ -480,7 +480,11 @@ Support for Python 3.4 and below has been officially dropped. and now it returns NaN and raises :class:`exceptions.UndefinedMetricW...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
scikit-learn__scikit-learn-13472@e4e6de7
scikit-learn/scikit-learn
Python
13,472
[MRG] Fix GBDT init parameter when it's a pipeline
<!-- 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/master/CONTRIBUTING.md#pull-request-checklist --> #### Reference Issues/PRs <!-- Example: Fixes #1234. See also #3456. Please use keywords (e.g., Fi...
2019-03-18T22:15:59Z
GradientBoostingRegressor initial estimator does not play together with Pipeline Using a pipeline as the initial estimator of GradientBoostingRegressor doesn't work due to incompatible signatures. ```python import sklearn import sklearn.pipeline import sklearn.ensemble import sklearn.decomposition import sklear...
[ { "body": "Using a pipeline as the initial estimator of GradientBoostingRegressor doesn't work due to incompatible signatures.\r\n\r\n```python\r\nimport sklearn\r\nimport sklearn.pipeline\r\nimport sklearn.ensemble\r\nimport sklearn.decomposition\r\nimport sklearn.linear_model\r\nimport numpy as np\r\ninit = s...
3b35104c93cb53f67fb5f52ae2fece76ef7144da
{ "head_commit": "e4e6de735ff869c6b60d39e97593f347af53202c", "head_commit_message": "better handling", "patch_to_review": "diff --git a/sklearn/ensemble/gradient_boosting.py b/sklearn/ensemble/gradient_boosting.py\nindex ba089fc30cc3b..edc1ad3ef4c12 100644\n--- a/sklearn/ensemble/gradient_boosting.py\n+++ b/sklea...
[ { "diff_hunk": "@@ -1484,7 +1484,7 @@ def fit(self, X, y, sample_weight=None, monitor=None):\n else:\n try:\n self.init_.fit(X, y, sample_weight=sample_weight)\n- except TypeError:\n+ except (TypeError, ValueError):", "line": null...
f1124f92088315e3952f0c705be2176ea665b3ee
diff --git a/sklearn/ensemble/gradient_boosting.py b/sklearn/ensemble/gradient_boosting.py index ed8622cc823c7..ff32e5ac1e811 100644 --- a/sklearn/ensemble/gradient_boosting.py +++ b/sklearn/ensemble/gradient_boosting.py @@ -1476,20 +1476,25 @@ def fit(self, X, y, sample_weight=None, monitor=None): raw...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }