2012-05-06 04:46:10 +08:00
|
|
|
import os
|
2010-03-06 18:52:19 +08:00
|
|
|
from os.path import join
|
2010-04-22 20:17:56 +08:00
|
|
|
import warnings
|
2010-03-06 18:52:19 +08:00
|
|
|
|
2010-12-13 05:19:22 +08:00
|
|
|
|
2010-09-01 02:36:20 +08:00
|
|
|
def configuration(parent_package='', top_path=None):
|
2010-01-06 01:48:30 +08:00
|
|
|
from numpy.distutils.misc_util import Configuration
|
2010-09-28 18:40:58 +08:00
|
|
|
from numpy.distutils.system_info import get_info, BlasNotFoundError
|
2012-01-07 00:08:30 +08:00
|
|
|
import numpy
|
2010-04-22 20:17:56 +08:00
|
|
|
|
2012-05-06 04:46:10 +08:00
|
|
|
libraries = []
|
|
|
|
|
if os.name == 'posix':
|
|
|
|
|
libraries.append('m')
|
|
|
|
|
|
2011-09-03 19:00:08 +08:00
|
|
|
config = Configuration('sklearn', parent_package, top_path)
|
2010-04-29 17:52:30 +08:00
|
|
|
|
2012-05-09 19:49:24 +08:00
|
|
|
config.add_subpackage('__check_build')
|
2015-11-05 23:49:26 +08:00
|
|
|
config.add_subpackage('_build_utils')
|
2010-09-28 18:40:58 +08:00
|
|
|
config.add_subpackage('svm')
|
2010-03-19 17:31:18 +08:00
|
|
|
config.add_subpackage('datasets')
|
2011-07-29 06:28:00 +08:00
|
|
|
config.add_subpackage('datasets/tests')
|
2010-10-05 15:20:44 +08:00
|
|
|
config.add_subpackage('feature_extraction')
|
|
|
|
|
config.add_subpackage('feature_extraction/tests')
|
2010-08-27 19:47:16 +08:00
|
|
|
config.add_subpackage('cluster')
|
|
|
|
|
config.add_subpackage('cluster/tests')
|
2010-09-08 17:18:58 +08:00
|
|
|
config.add_subpackage('covariance')
|
|
|
|
|
config.add_subpackage('covariance/tests')
|
2013-07-24 01:27:50 +08:00
|
|
|
config.add_subpackage('cross_decomposition')
|
2011-04-04 21:14:49 +08:00
|
|
|
config.add_subpackage('decomposition')
|
|
|
|
|
config.add_subpackage('decomposition/tests')
|
2011-12-06 05:30:28 +08:00
|
|
|
config.add_subpackage("ensemble")
|
|
|
|
|
config.add_subpackage("ensemble/tests")
|
2010-03-25 16:10:39 +08:00
|
|
|
config.add_subpackage('feature_selection')
|
2010-08-19 03:22:32 +08:00
|
|
|
config.add_subpackage('feature_selection/tests')
|
2010-03-19 17:31:18 +08:00
|
|
|
config.add_subpackage('utils')
|
2010-08-19 03:22:32 +08:00
|
|
|
config.add_subpackage('utils/tests')
|
|
|
|
|
config.add_subpackage('externals')
|
2011-07-19 22:23:22 +08:00
|
|
|
config.add_subpackage('mixture')
|
|
|
|
|
config.add_subpackage('mixture/tests')
|
2010-11-25 06:54:17 +08:00
|
|
|
config.add_subpackage('gaussian_process')
|
|
|
|
|
config.add_subpackage('gaussian_process/tests')
|
2011-09-07 01:09:35 +08:00
|
|
|
config.add_subpackage('neighbors')
|
2013-07-23 23:59:06 +08:00
|
|
|
config.add_subpackage('neural_network')
|
2013-07-27 02:24:56 +08:00
|
|
|
config.add_subpackage('preprocessing')
|
2016-02-11 21:09:53 +08:00
|
|
|
config.add_subpackage('preprocessing/tests')
|
2011-05-18 14:31:39 +08:00
|
|
|
config.add_subpackage('manifold')
|
2010-12-13 05:19:22 +08:00
|
|
|
config.add_subpackage('metrics')
|
2012-03-05 22:25:53 +08:00
|
|
|
config.add_subpackage('semi_supervised')
|
2011-08-02 18:28:05 +08:00
|
|
|
config.add_subpackage("tree")
|
2011-10-07 06:30:19 +08:00
|
|
|
config.add_subpackage("tree/tests")
|
|
|
|
|
config.add_subpackage('metrics/tests')
|
2011-09-30 20:48:01 +08:00
|
|
|
config.add_subpackage('metrics/cluster')
|
|
|
|
|
config.add_subpackage('metrics/cluster/tests')
|
Main Commits - Major
--------------------
* ENH Reogranize classes/fn from grid_search into search.py
* ENH Reogranize classes/fn from cross_validation into split.py
* ENH Reogranize cls/fn from cross_validation/learning_curve into validate.py
* MAINT Merge _check_cv into check_cv inside the model_selection module
* MAINT Update all the imports to point to the model_selection module
* FIX use iter_cv to iterate throught the new style/old style cv objs
* TST Add tests for the new model_selection members
* ENH Wrap the old-style cv obj/iterables instead of using iter_cv
* ENH Use scipy's binomial coefficient function comb for calucation of nCk
* ENH Few enhancements to the split module
* ENH Improve check_cv input validation and docstring
* MAINT _get_test_folds(X, y, labels) --> _get_test_folds(labels)
* TST if 1d arrays for X introduce any errors
* ENH use 1d X arrays for all tests;
* ENH X_10 --> X (global var)
Minor
-----
* ENH _PartitionIterator --> _BaseCrossValidator;
* ENH CVIterator --> CVIterableWrapper
* TST Import the old SKF locally
* FIX/TST Clean up the split module's tests.
* DOC Improve documentation of the cv parameter
* COSMIT consistently hyphenate cross-validation/cross-validator
* TST Calculate n_samples from X
* COSMIT Use separate lines for each import.
* COSMIT cross_validation_generator --> cross_validator
Commits merged manually
-----------------------
* FIX Document the random_state attribute in RandomSearchCV
* MAINT Use check_cv instead of _check_cv
* ENH refactor OVO decision function, use it in SVC for sklearn-like
decision_function shape
* FIX avoid memory cost when sampling from large parameter grids
ENH Major to Minor incremental enhancements to the model_selection
Squashed commit messages - (For reference)
Major
-----
* ENH p --> n_labels
* FIX *ShuffleSplit: all float/invalid type errors at init and int error at split
* FIX make PredefinedSplit accept test_folds in constructor; Cleanup docstrings
* ENH+TST KFold: make rng to be generated at every split call for reproducibility
* FIX/MAINT KFold: make shuffle a public attr
* FIX Make CVIterableWrapper private.
* FIX reuse len_cv instead of recalculating it
* FIX Prevent adding *SearchCV estimators from the old grid_search module
* re-FIX In all_estimators: the sorting to use only the 1st item (name)
To avoid collision between the old and the new GridSearch classes.
* FIX test_validate.py: Use 2D X (1D X is being detected as a single sample)
* MAINT validate.py --> validation.py
* MAINT make the submodules private
* MAINT Support old cv/gs/lc until 0.19
* FIX/MAINT n_splits --> get_n_splits
* FIX/TST test_logistic.py/test_ovr_multinomial_iris:
pass predefined folds as an iterable
* MAINT expose BaseCrossValidator
* Update the model_selection module with changes from master
- From #5161
- - MAINT remove redundant p variable
- - Add check for sparse prediction in cross_val_predict
- From #5201 - DOC improve random_state param doc
- From #5190 - LabelKFold and test
- From #4583 - LabelShuffleSplit and tests
- From #5300 - shuffle the `labels` not the `indxs` in LabelKFold + tests
- From #5378 - Make the GridSearchCV docs more accurate.
- From #5458 - Remove shuffle from LabelKFold
- From #5466(#4270) - Gaussian Process by Jan Metzen
- From #4826 - Move custom error / warnings into sklearn.exception
Minor
-----
* ENH Make the KFold shuffling test stronger
* FIX/DOC Use the higher level model_selection module as ref
* DOC in check_cv "y : array-like, optional"
* DOC a supervised learning problem --> supervised learning problems
* DOC cross-validators --> cross-validation strategies
* DOC Correct Olivier Grisel's name ;)
* MINOR/FIX cv_indices --> kfold
* FIX/DOC Align the 'See also' section of the new KFold, LeaveOneOut
* TST/FIX imports on separate lines
* FIX use __class__ instead of classmethod
* TST/FIX import directly from model_selection
* COSMIT Relocate the random_state documentation
* COSMIT remove pass
* MAINT Remove deprecation warnings from old tests
* FIX correct import at test_split
* FIX/MAINT Move P_sparse, X, y defns to top; rm unused W_sparse, X_sparse
* FIX random state to avoid doctest failure
* TST n_splits and split wrapping of _CVIterableWrapper
* FIX/MAINT Use multilabel indicator matrix directly
* TST/DOC clarify why we conflate classes 0 and 1
* DOC add comment that this was taken from BaseEstimator
* FIX use of labels is not needed in stratified k fold
* Fix cross_validation reference
* Fix the labels param doc
FIX/DOC/MAINT Addressing the review comments by Arnaud and Andy
COSMIT Sort the members alphabetically
COSMIT len_cv --> n_splits
COSMIT Merge 2 if; FIX Use kwargs
DOC Add my name to the authors :D
DOC make labels parameter consistent
FIX Remove hack for boolean indices; + COSMIT idx --> indices; DOC Add Returns
COSMIT preds --> predictions
DOC Add Returns and neatly arrange X, y, labels
FIX idx(s)/ind(s)--> indice(s)
COSMIT Merge if and else to elif
COSMIT n --> n_samples
COSMIT Use bincount only once
COSMIT cls --> class_i / class_i (ith class indices) -->
perm_indices_class_i
FIX/ENH/TST Addressing the final reviews
COSMIT c --> count
FIX/TST make check_cv raise ValueError for string cv value
TST nested cv (gs inside cross_val_score) works for diff cvs
FIX/ENH Raise ValueError when labels is None for label based cvs;
TST if labels is being passed correctly to the cv and that the
ValueError is being propagated to the cross_val_score/predict and grid
search
FIX pass labels to cross_val_score
FIX use make_classification
DOC Add Returns; COSMIT Remove scaffolding
TST add a test to check the _build_repr helper
REVERT the old GS/RS should also be tested by the common tests.
ENH Add a tuple of all/label based CVS
FIX raise VE even at get_n_splits if labels is None
FIX Fabian's comments
PEP8
2015-06-05 03:45:10 +08:00
|
|
|
config.add_subpackage('model_selection')
|
|
|
|
|
config.add_subpackage('model_selection/tests')
|
2011-04-01 06:08:30 +08:00
|
|
|
|
2015-03-11 02:55:36 +08:00
|
|
|
# add cython extension module for isotonic regression
|
2013-03-08 20:38:57 +08:00
|
|
|
config.add_extension(
|
|
|
|
|
'_isotonic',
|
|
|
|
|
sources=['_isotonic.c'],
|
|
|
|
|
include_dirs=[numpy.get_include()],
|
|
|
|
|
libraries=libraries,
|
|
|
|
|
)
|
|
|
|
|
|
2010-09-27 22:16:52 +08:00
|
|
|
# some libs needs cblas, fortran-compiled BLAS will not be sufficient
|
2010-06-23 22:04:08 +08:00
|
|
|
blas_info = get_info('blas_opt', 0)
|
2010-07-24 07:16:24 +08:00
|
|
|
if (not blas_info) or (
|
2012-12-17 06:28:10 +08:00
|
|
|
('NO_ATLAS_INFO', 1) in blas_info.get('define_macros', [])):
|
2010-06-07 22:18:26 +08:00
|
|
|
config.add_library('cblas',
|
2010-12-13 05:19:22 +08:00
|
|
|
sources=[join('src', 'cblas', '*.c')])
|
2010-09-28 21:02:33 +08:00
|
|
|
warnings.warn(BlasNotFoundError.__doc__)
|
2010-09-28 18:40:58 +08:00
|
|
|
|
|
|
|
|
# the following packages depend on cblas, so they have to be build
|
|
|
|
|
# after the above.
|
2010-11-25 21:53:55 +08:00
|
|
|
config.add_subpackage('linear_model')
|
2010-09-06 22:15:53 +08:00
|
|
|
config.add_subpackage('utils')
|
2010-09-01 15:13:48 +08:00
|
|
|
|
2010-05-06 17:10:19 +08:00
|
|
|
# add the test directory
|
2010-09-12 06:23:58 +08:00
|
|
|
config.add_subpackage('tests')
|
2010-05-06 17:10:19 +08:00
|
|
|
|
2010-01-06 01:48:30 +08:00
|
|
|
return config
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
from numpy.distutils.core import setup
|
|
|
|
|
setup(**configuration(top_path='').todict())
|