Commit Graph

569 Commits

Author SHA1 Message Date
MechCoder 41cbfded7c Add check for sample_weights 2015-10-23 00:06:07 -04:00
MechCoder 80e22b3ddf Patch liblinear for sample_weights in LogisticRegression(and CV) 2015-10-23 00:00:31 -04:00
Andreas Mueller 5d3bb933e0 Merge pull request #5008 from TomDLT/logistic_multiclass
[MRG+1] fix logistic regression class weights
2015-10-22 12:44:37 +02:00
TomDLT d439dc4d9e FIX class_weight in LogisticRegression and LogisticRegressionCV 2015-10-21 17:41:39 +02:00
Arnaud Rachez 5db2adf93c MAINT Removed deprecated stuff. 2015-10-21 10:24:23 +02:00
Raghav R V e3afc0e8c9 MAINT move custom error/warning classes into sklearn.exceptions
ENH NonBLASDotWarning -> EfficiencyWarning; Improve error message
DOC Add exceptions module to modules/classes.rst
MAINT Move ConvergenceWarning, UndefinedMetricWarning et al into exceptions
MAINT Remove ChangedBehaviorWarning from base
DOC/FIX Improve DataConversionWarning's docstring
2015-10-19 22:35:35 +02:00
Andreas Mueller 31a5a5ff12 Fixed warnings for DataDimensionalityWarning, decision_function and decision_function_shape. 2015-10-14 15:38:07 -04:00
Jiali Mei 85223b9bcc a common test to check if classifiers fail when fed regression targets 2015-10-14 14:46:13 -04:00
Tom DLT d972da2403 FIX temporary fix for sparse ridge with intercept fitting 2015-10-13 10:12:19 +02:00
Olivier Grisel da9a7cd95f Merge pull request #5362 from MechCoder/lasso_fix
[MRG] Lasso and ElasticNet should handle non-integer dtypes for fit_intercept=False
2015-10-12 13:31:33 +02:00
Vighnesh Birodkar 735dd1fdca Fix warnings during tests 2015-10-08 14:52:21 -04:00
MechCoder 1d5b473705 Lasso and ElasticNet should handle non-float dtypes for fit_intercept=False 2015-10-07 16:49:28 -04:00
Andrew Lamb 176427e284 Fix SGD partial_fit multiclass w/ average.
See https://github.com/scikit-learn/scikit-learn/issues/5246#issuecomment-140062688.

`_fit_multiclass` was setting `self.intercept_` to a single element of the intercept, instead of the entire intercept.
2015-10-07 11:39:57 +02:00
Olivier Grisel 10259822fd Merge pull request #5337 from ogrisel/fix-coordinate-descent-memory-layout
[MRG+1] FIX consistency of memory layout for linear CD solver
2015-10-05 10:50:35 +02:00
Olivier Grisel 808fa6450e FIX consistency of memory layout for linear CD solver 2015-10-04 18:32:05 +02:00
Rohan Ramanath f8486a5b25 fixes scikit-learn/scikit-learn#5329 2015-10-01 21:42:27 -07:00
vstolbunov ebd5dbc68a Fixed syntax and combined two test functions 2015-09-15 12:40:08 -04:00
vstolbunov 942ff5c654 Updated logistic regression tests with sag solver 2015-09-15 12:40:08 -04:00
Valentin Stolbunov 1a15fdc4f5 Added handling of sample weights in logistic.py
* Updated _check_solver_option to include sample_weight check
* Updated all calls to _check_solver_option()
* Updated documentation of class_weight throughout logistic.py
* Added sample_weight parameter to logistic_regression_path.
* Added handling of sample weights to logistic_regression_path.
* Added sample_weight parameter to _log_reg_scoring_path.
* Added handling of sample weights to _log_reg_scoring_path.
* Added sample_weight parameter to fit() in the LogisticRegression class.
* Added handling of sample sample weights in LogisticRegression.fit()
* Added sample_weight parameter to fit() in the LogisticRegressionCV class.
* Added handling of sample weights in LogisticRegressionCV.fit()
* Added test_logistic_regressioncv_sample_weights, which:
  * tests that a ValueError is raised if liblinear is used with
    sample weights
  * tests that passing sample weights as np.ones(y.shape[0]) is
    the same as not passing them (default None)
  * tests that using both lbfgs and newton-cg solvers with
    sample weights yields the same results
  * tests that passing class weights to scale one class is the
    same as passing sample weights for the training data of just
    that class
* Fixed bug with *= in logistic_regression_path.
* Fixed bug in test_logistic_regressioncv_sample_weights where
  no data was created prior to fitting.
* Changes to accepted sample_weight type.
* Fixed bug in naming of sample_weight when passed from
  _log_reg_scoring_path to logistic_regression_path.
* Fixed issue of sample_weight=None being converted to np.array()
  and then not being reconigzed as None.
* Added tests for LogisticRegression
* Attempting to fix same issue as 9d3becf by instead implementing
  if statement in bagging.py.
* Added TODO to eliminate check for liblinear w/ sample weights
  in bagging.py
2015-09-15 12:40:08 -04:00
TomDLT 94eb61960a ENH add sag solver in LogisticRegression and Ridge 2015-09-10 13:28:02 -04:00
Danny Sullivan 4ceffe05a1 Adding Implementation of SAG 2015-09-10 13:27:04 -04:00
Vighnesh Birodkar 2f099334f9 MAINT deprecate 1d input arrays for all estimators
Passing 1D arrays to check_array, without setting `ensure_2d` to false now
raises a deprecation warning before reshaping it. This will later throw an
error.

All Scaler classes also throw warnings when 1D arrays are passed.

All unit tests/doctests are modified to ensure that no 1D arrays are passed,
except in explicit 1D array tests where the warnings have been silenced.

Additional tests are also included which check for different 1D array cases.

2D array tests with one samples and one features are also added and where
they failed, `check_array` call has been modified to give a more useful error
message
2015-09-09 15:49:58 +02:00
Gael Varoquaux 4f713cec21 Merge pull request #5182 from MechCoder/predict_proba_fix
[MRG + 2] predict_proba should use the softmax function in the multinomial case
2015-08-30 21:44:11 +01:00
MechCoder c85f2ad596 Add non regression test 2015-08-30 11:44:58 -04:00
Gael Varoquaux 190abde442 Merge pull request #4881 from sonnyhu/weighted_least_squares
[MRG + 1] add sample_weight into LinearRegression
2015-08-30 16:35:00 +01:00
Gael Varoquaux 6e735f5968 Merge pull request #4767 from trevorstephens/passive-aggressive_cw
[MRG + 1] Add class_weight to PA Classifier, remove from PA Regressor
2015-08-30 16:25:51 +01:00
MechCoder c3cfebe4d6 [BUG] predict_proba should use the softmax function in the multinomial case 2015-08-28 17:06:20 -04:00
Alexandre Gramfort a8585a4b0d pep8 + simplify positive test 2015-08-28 21:43:46 +02:00
mhg d3dec94963 comparison test of Lasso and LassoLars under positive restriction refactored and commented 2015-08-28 13:16:23 +09:00
mhg 98fefd1278 tests for comparison of results for Lasso and LarsLasso added. 2015-08-26 11:44:48 +09:00
mhg 38451a3ea3 tests of positive option for estimator classes condensed. 2015-08-25 15:17:27 +09:00
mhg bbbca0238a tests of positive option for estimator classes 2015-08-25 15:15:28 +09:00
mhg 535536e537 merge with upstream/master 2015-08-25 14:07:56 +09:00
mhg 7d4e8e1563 test lars_path positive constraint. 2015-08-25 13:51:42 +09:00
Arthur Mensch 2ed0c22c17 Added check_input in Lasso for DictLearning performance 2015-08-20 11:36:24 +02:00
Sonny Hu a88f6ecf9d add sample_weight into LinearRegression 2015-08-13 14:32:07 -04:00
Arthur Mensch fead69a4ac Bugfix : type in cd changed for read only memmap compatibility 2015-07-31 12:12:40 +02:00
unknown 0241370e68 Fixed test to check for capital No 2015-07-11 13:37:13 -05:00
unknown 3c8c492efd fixed newlines, comments 2015-07-11 13:25:20 -05:00
unknown a1391c2450 if there are no inliers, raise ValueError
mentioning possible cause being residual_threshold too low along
with the residual_threshold,
and a test that the ValueError occurs
2015-07-11 12:39:05 -05:00
MechCoder 1886f2bc43 [MRG] [BUG] Pass penaly to the final logistic regression fit 2015-06-24 13:18:25 +05:30
Andreas Mueller 32b2f8e592 Merge pull request #4838 from trevorstephens/ridge_sw
[MRG+1] Add sample_weight support to RidgeClassifier
2015-06-09 11:22:50 -04:00
trevorstephens 2f69574393 add sample_weight to RidgeClassifier 2015-06-08 21:33:56 -07:00
trevorstephens ee7887970e add class_weight to PA cls, remove from PA reg
rebase on top of #4347

improve error message

update error msg
2015-06-06 08:57:17 -07:00
Sonny Hu 92f9c9e274 fix RidgeCV when cv != None
add a test for sample_weight

add a comment for test_ridgecv_sample_weight

make sure coef_ are the same
2015-06-06 08:32:58 -04:00
Gael Varoquaux 01aff46402 Merge pull request #4347 from amueller/class_weight_auto
[MRG+1] Use more natural class_weight="auto" heuristic
2015-06-01 16:15:37 -04:00
Andreas Mueller eedc1cddab Use more natural class_weight="auto" heuristic 2015-06-01 12:49:53 -04:00
Andreas Mueller a8626b36a6 TST/COSMIT remove nose call boilerplate 2015-05-28 14:54:01 -04:00
TomDLT fc9d7befe1 FIX use random_state in LogisticRegression 2015-05-27 16:59:12 +02:00
TomDLT 355dc7c8f1 ENH improve parameter check in LogisticRegression 2015-05-27 10:16:36 +02:00