Commit Graph

42 Commits

Author SHA1 Message Date
pierretallotte ce9dedb1a3 FIX Convert the negative indices to positive ones in ColumnTransformer._get_column_indices (#13017) 2019-01-22 22:22:40 +08:00
Rüdiger Busche d300f406ae MAINT Simplify super() calls (#12812) 2019-01-10 22:27:06 +01:00
Andreas Mueller 952ef6637a MRG Drop legacy python / remove six dependencies (#12639) 2019-01-03 15:50:05 +02:00
Dowon 0e5feb6bf7 DOC improving import convenience in class examples (#12846) 2018-12-23 09:37:43 +08:00
Hanmin Qin aae4e337d2 FIX Fix error in make_column_transformer when columns is pandas.Index (#12704)
Fixes #12703
2018-12-03 21:22:32 +11:00
Bartosz Michałowski fa98a72dcc MNT Replaced all occurrences of assert_true and assert_false with assert (#12588) 2018-11-28 09:16:26 +08:00
Adrin Jalali a816af7d1d API Change the tuple order in make_column_transformer (#12626) 2018-11-21 11:07:12 +08:00
Thomas Moreau d25da1be20 FIX make joblib utils private, and remove mentions of externals.joblib (#12345) 2018-11-20 10:53:52 +11:00
Hanmin Qin 43e3a02085
MNT Remove unused assert_true imports (#12560) 2018-11-11 11:08:37 +08:00
Yaroslav Halchenko 362cb3bcab TST autoreplace assert_true(...==...) with plain assert (#12547) 2018-11-11 09:05:34 +08:00
Andreas Mueller 0ad873646b [MRG] ENH apply sparse_threshold even if all columns are sparse (#12304) 2018-10-14 17:18:23 +11:00
Adrin Jalali 58228cb6d3 [MRG+1] ColumnTransformer fix having mixed types in a single passthrough (#12200)
* fix having mixed types in a single passthrough

* use check_array

* add comment

* Reference the relevant issue in the test

* don't force finite on check_array

* add the whats_new entry

* modify whats_new entry for a [probably] better description.

* raise a value error if columns can't be stacked.

* test the custom ValueError

* take sparse.hstack out of try/catch

* improve whats_new entry

* add comment for the dtype conversion

* change the tests to use an np of dtype 'O' instead
2018-10-04 09:37:39 -04:00
Lily Xiong 0b58bc395d DOC Improve ColumnTransformer docstrings (#12206) 2018-09-30 08:47:28 +10:00
Joel Nothman b886da5d3d MAINT update comment 2018-09-26 15:18:59 +10:00
Hanmin Qin e63feeb91e DOC More specific about the limitation of make_column_transformer (#12163) 2018-09-26 13:58:51 +10:00
Joris Van den Bossche 09851aca9e TST update make_column_transformer test + add comment (#12156)
Follow-up on https://github.com/scikit-learn/scikit-learn/pull/12152
And added comment why transformer_weights is not passed through, see
https://github.com/scikit-learn/scikit-learn/pull/11183#pullrequestreview-125539051
for more discussion
2018-09-25 23:08:21 +08:00
janvanrijn e58f366e03 ColumnTransformer generalization to work on empty lists (#12084) 2018-09-25 17:03:32 +02:00
Jan Koch 661a8b42bd add sparse_threshold to make_columns_transformer (#12152)
fixes issue #12149
2018-09-25 10:43:05 -04:00
Vinayak Mehta f15ebb953b [MRG] Convert ColumnTransformer input list to numpy array (#12104)
<!--
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., 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
-->
Fixes #12096.

#### What does this implement/fix? Explain your changes.
Converts the input list for ColumnTransformer to a numpy array.

Added a check inside `transform` and `fit_transform` to check if the input `X` is a list, if it is then it gets converted to a numpy array.

#### Any other comments?
Should this conversion be documented in the docstrings for ColumnTransfomer's `fit`, `transform` and `fit_transform`?

<!--
Please be aware that we are a loose team of volunteers so patience is
necessary; assistance handling other issues is very welcome. We value
all user contributions, no matter how minor they are. If we are slow to
review, either the pull request needs some benchmarking, tinkering,
convincing, etc. or more likely the reviewers are simply busy. In either
case, we ask for your understanding during the review process.
For more information, see our FAQ on this topic:
http://scikit-learn.org/dev/faq.html#why-is-my-pull-request-not-getting-any-attention.

Thanks for contributing!
-->
2018-09-25 10:37:16 -04:00
Joris Van den Bossche 4035e60a6f [MRG +1] ColumnTransformer: store evaluated function column specifier during fit (#12107) 2018-09-21 13:22:34 +02:00
Hanmin Qin 9b8fd0b0d0 DOC Correct default n_jobs & reference the glossary (#11808)
Also improves the glossary entry for n_jobs.
2018-08-18 19:57:10 +10:00
Olivier Grisel 40e6c43cb4
Joblib 0.12.2 (#11741)
* joblib 0.12.2

* Export _joblib's register_parallel_backend

* Use latest version of coverage
2018-08-03 12:34:25 +02:00
Tom Augspurger e3984fb382 ENH Make _hstack a method inside ColumnTransformer (#11689)
This lets subclasses re-use more of sklearn.compose._column_transformer.
xref https://github.com/dask/dask-ml/pull/315
2018-07-27 09:06:38 +08:00
Joris Van den Bossche cf897de0ab ENH Add sparse_threshold keyword to ColumnTransformer (#11614)
Reasoning: when eg OneHotEncoder is used as part of ColumnTransformer it would cause the final result to be a sparse matrix. As this is a typical case when we have mixed dtype data, it means that many pipeline will have to deal with sparse data implicitly, even if you have only some categorical features with low cardinality. 
Idea was first to change default of `OneHotEncoder` sparse to False, but based on gitter discussion (https://gitter.im/scikit-learn/dev?at=5b4e5a69a94c5255523bc9fc) we decided to let ColumnTransformer switch between both based on a threshold. The user still has full control if he/she wants always or never sparse.
2018-07-25 22:03:04 +10:00
Tom Augspurger 2887892a24 DOC Update make_transformer docs for new default (#11658) 2018-07-23 22:23:34 +08:00
Thomas Fan 06ac22d06f BUG: Fixes _BaseCompostion._set_params broken where there are no estimators (#11333) 2018-07-20 04:13:55 -05:00
Joris Van den Bossche 277e1250c2 Change default of ColumnTransformer remainder from passthrough to drop (#11603) 2018-07-18 09:57:15 +02:00
Joris Van den Bossche 9caa982605 [MRG + 1] ENH: allow to pass callable as column specifier in ColumnTransformer (#11592)
* define select_types callable factory

* include dtype column selector example

* support selector function for remainder=passthrough (already worked for drop)

* add docstring to example file. apparently sphinx fails if missing

* remove example and select_dtype factory

* generalize callable case (all specification types) + add tests

* add docstring
2018-07-17 22:27:52 +02:00
Joel Nothman 14e7c328df Restructure access to vendored/site Joblib (#11471)
In order to fix #11408, this swaps `joblib` and `_joblib`. It however, allows users to access joblib's `Memory` or `Parallel` functionality without accessing `sklearn.externals._joblib` by importing `Memory`, `Parallel`, etc. into `sklearn.utils`.
2018-07-17 18:02:11 +02:00
Thomas Fan 895dfd3f5c ENH Adds transformer support in ColumnTransformer.remainder (#11315) 2018-06-26 23:27:47 +10:00
Joel Nothman 14764061f8
[MRG] DOC fix some sphinx warnings (#11241) 2018-06-21 20:43:21 +10:00
Joris Van den Bossche 007aa710bd FEA Refactor CategoricalEncoder into OneHotEncoder and OrdinalEncoder (#10523)
Deprecated some OneHotEncoder behaviour
2018-06-21 19:27:41 +10:00
Joel Nothman 4008fb7210
MAINT clarifications in ColumnTransformer._update_transformers (#11323) 2018-06-20 19:14:56 +10:00
Joel Nothman 90a2c57951 EXA Move examples to examples/compose (#11216) 2018-06-11 15:06:21 +08:00
Guillaume Lemaitre 41651a1619 [MRG] FIX passthrough parameter from make_column_transformer to ColumnTransformer (#11183) 2018-06-06 11:29:29 +02:00
Joris Van den Bossche 4e166e2982 BUG: ColumnTransformer with remainder='passthrough' and array-like of strings as columns (#11184) 2018-06-06 11:23:18 +02:00
Jason Wolosonovich 71c8d34f3e DOC Added cross-referencing of factory functions with their class counterparts (#11168) 2018-06-01 10:37:55 +08:00
Joris Van den Bossche 0b6308c270 FEA Add ColumnTransformer for heterogeneous data (#9012) 2018-05-30 07:49:21 +10:00
James Bourbeau 580a150b96 DOC Fixes code formatting in TransformedTargetRegressor docstring (#10950) 2018-04-12 08:44:08 +08:00
Loïc Estève 20661b5018
TST: only run doctests on numpy 1.14. (#10835)
Fix doctests due to numpy 1.14 formatting changes.
2018-03-27 07:44:40 +02:00
Hanmin Qin 95c76318a6 DOC Fix typo in TransformedTargetRegressor 2018-03-16 23:13:55 +08:00
Joel Nothman b43fce5a49 MNT Add sklearn.compose and move TransformedTargetRegressor to it (#10719) 2018-03-16 21:27:03 +08:00