├── docs ├── source │ ├── api_overview.rst │ ├── api_ibex_frame.rst │ ├── _static │ │ ├── logo.ico │ │ ├── logo.jpeg │ │ ├── got_frame.jpeg │ │ ├── github-pages.png │ │ └── read_the_docs.png │ ├── api_ibex_trans.rst │ ├── api_ibex_frame_mixin.rst │ ├── api_ibex_transformer_example.rst │ ├── api_ibex_regressor_example.rst │ ├── api_ibex_sklearn_svm_svc.rst │ ├── api_ibex_sklearn_svm_svr.rst │ ├── api_ibex_sklearn_mixture_gmm.rst │ ├── api_ibex_sklearn_svm_nusvc.rst │ ├── api_ibex_sklearn_svm_nusvr.rst │ ├── api_class.rst.jinja2 │ ├── api_ibex_sklearn_cluster_birch.rst │ ├── api_ibex_sklearn_covariance_oas.rst │ ├── api_ibex_sklearn_manifold_mds.rst │ ├── api_ibex_sklearn_manifold_tsne.rst │ ├── api_ibex_sklearn_mixture_dpgmm.rst │ ├── api_ibex_sklearn_mixture_vbgmm.rst │ ├── api_ibex_sklearn_cluster_dbscan.rst │ ├── api_ibex_sklearn_cluster_kmeans.rst │ ├── api_ibex_sklearn_manifold_isomap.rst │ ├── api_ibex_sklearn_svm_linearsvc.rst │ ├── api_ibex_sklearn_svm_linearsvr.rst │ ├── api_ibex_sklearn_decomposition_nmf.rst │ ├── api_ibex_sklearn_decomposition_pca.rst │ ├── api_ibex_sklearn_linear_model_lars.rst │ ├── api_ibex_sklearn_linear_model_lasso.rst │ ├── api_ibex_sklearn_linear_model_ridge.rst │ ├── api_ibex_sklearn_svm_oneclasssvm.rst │ ├── api_ibex_sklearn_cluster_meanshift.rst │ ├── api_ibex_sklearn_feature_selection_rfe.rst │ ├── api_ibex_sklearn_linear_model_larscv.rst │ ├── api_ibex_sklearn_naive_bayes_basenb.rst │ ├── api_ibex_sklearn_pipeline_pipeline.rst │ ├── api_ibex_sklearn_calibration_linearsvc.rst │ ├── api_ibex_sklearn_covariance_mincovdet.rst │ ├── api_ibex_sklearn_cross_decomposition_cca.rst │ ├── api_ibex_sklearn_decomposition_fastica.rst │ ├── api_ibex_sklearn_dummy_baseestimator.rst │ ├── api_ibex_sklearn_feature_selection_rfecv.rst │ ├── api_ibex_sklearn_linear_model_lassocv.rst │ ├── api_ibex_sklearn_linear_model_ridgecv.rst │ ├── api_ibex_sklearn_neighbors_lshforest.rst │ ├── api_ibex_sklearn_preprocessing_imputer.rst │ ├── api_ibex_sklearn_covariance_graphlasso.rst │ ├── api_ibex_sklearn_covariance_ledoitwolf.rst │ ├── api_ibex_sklearn_decomposition_kernelpca.rst │ ├── api_ibex_sklearn_decomposition_sparsepca.rst │ ├── api_ibex_sklearn_dummy_dummyregressor.rst │ ├── api_ibex_sklearn_ensemble_baseensemble.rst │ ├── api_ibex_sklearn_linear_model_elasticnet.rst │ ├── api_ibex_sklearn_linear_model_lassolars.rst │ ├── api_ibex_sklearn_linear_model_perceptron.rst │ ├── api_ibex_sklearn_naive_bayes_gaussiannb.rst │ ├── api_ibex_sklearn_pipeline_featureunion.rst │ ├── api_ibex_sklearn_preprocessing_binarizer.rst │ ├── api_ibex_sklearn_calibration_labelencoder.rst │ ├── api_ibex_sklearn_cluster_minibatchkmeans.rst │ ├── api_ibex_sklearn_covariance_graphlassocv.rst │ ├── api_ibex_sklearn_cross_decomposition_plssvd.rst │ ├── api_ibex_sklearn_decomposition_sparsecoder.rst │ ├── api_ibex_sklearn_dummy_dummyclassifier.rst │ ├── api_ibex_sklearn_grid_search_basesearchcv.rst │ ├── api_ibex_sklearn_grid_search_gridsearchcv.rst │ ├── api_ibex_sklearn_isotonic_baseestimator.rst │ ├── api_ibex_sklearn_kernel_ridge_kernelridge.rst │ ├── api_ibex_sklearn_linear_model_lassolarscv.rst │ ├── api_ibex_sklearn_linear_model_lassolarsic.rst │ ├── api_ibex_sklearn_mixture_gaussianmixture.rst │ ├── api_ibex_sklearn_multiclass_baseestimator.rst │ ├── api_ibex_sklearn_naive_bayes_bernoullinb.rst │ ├── api_ibex_sklearn_neighbors_kerneldensity.rst │ ├── api_ibex_sklearn_preprocessing_normalizer.rst │ ├── api_ibex_sklearn_calibration_baseestimator.rst │ ├── api_ibex_sklearn_calibration_labelbinarizer.rst │ ├── api_ibex_sklearn_decomposition_truncatedsvd.rst │ ├── api_ibex_sklearn_ensemble_baggingregressor.rst │ ├── api_ibex_sklearn_ensemble_isolationforest.rst │ ├── api_ibex_sklearn_ensemble_votingclassifier.rst │ ├── api_ibex_sklearn_feature_selection_selectfdr.rst │ ├── api_ibex_sklearn_feature_selection_selectfpr.rst │ ├── api_ibex_sklearn_feature_selection_selectfwe.rst │ ├── api_ibex_sklearn_grid_search_baseestimator.rst │ ├── api_ibex_sklearn_kernel_approximation_nystroem.rst │ ├── api_ibex_sklearn_kernel_ridge_baseestimator.rst │ ├── api_ibex_sklearn_linear_model_ardregression.rst │ ├── api_ibex_sklearn_linear_model_bayesianridge.rst │ ├── api_ibex_sklearn_linear_model_elasticnetcv.rst │ ├── api_ibex_sklearn_linear_model_sgdclassifier.rst │ ├── api_ibex_sklearn_linear_model_sgdregressor.rst │ ├── api_ibex_sklearn_multiclass_labelbinarizer.rst │ ├── api_ibex_sklearn_multioutput_baseestimator.rst │ ├── api_ibex_sklearn_naive_bayes_basediscretenb.rst │ ├── api_ibex_sklearn_naive_bayes_baseestimator.rst │ ├── api_ibex_sklearn_naive_bayes_labelbinarizer.rst │ ├── api_ibex_sklearn_naive_bayes_multinomialnb.rst │ ├── api_ibex_sklearn_neighbors_nearestcentroid.rst │ ├── api_ibex_sklearn_neural_network_bernoullirbm.rst │ ├── api_ibex_sklearn_neural_network_mlpregressor.rst │ ├── api_ibex_sklearn_pipeline__basecomposition.rst │ ├── api_ibex_sklearn_preprocessing_labelencoder.rst │ ├── api_ibex_sklearn_preprocessing_maxabsscaler.rst │ ├── api_ibex_sklearn_preprocessing_minmaxscaler.rst │ ├── api_ibex_sklearn_preprocessing_robustscaler.rst │ ├── api_ibex_sklearn_tree_extratreeregressor.rst │ ├── api_ibex_sklearn_cluster_spectralclustering.rst │ ├── api_ibex_sklearn_covariance_ellipticenvelope.rst │ ├── api_ibex_sklearn_covariance_shrunkcovariance.rst │ ├── api_ibex_sklearn_decomposition_factoranalysis.rst │ ├── api_ibex_sklearn_decomposition_incrementalpca.rst │ ├── api_ibex_sklearn_decomposition_randomizedpca.rst │ ├── api_ibex_sklearn_ensemble_adaboostregressor.rst │ ├── api_ibex_sklearn_ensemble_baggingclassifier.rst │ ├── api_ibex_sklearn_feature_selection_selectkbest.rst │ ├── api_ibex_sklearn_linear_model_huberregressor.rst │ ├── api_ibex_sklearn_linear_model_multitasklasso.rst │ ├── api_ibex_sklearn_linear_model_randomizedlasso.rst │ ├── api_ibex_sklearn_linear_model_ransacregressor.rst │ ├── api_ibex_sklearn_linear_model_ridgeclassifier.rst │ ├── api_ibex_sklearn_manifold_spectralembedding.rst │ ├── api_ibex_sklearn_model_selection_gridsearchcv.rst │ ├── api_ibex_sklearn_multioutput_classifierchain.rst │ ├── api_ibex_sklearn_neighbors_nearestneighbors.rst │ ├── api_ibex_sklearn_neural_network_mlpclassifier.rst │ ├── api_ibex_sklearn_preprocessing_kernelcenterer.rst │ ├── api_ibex_sklearn_preprocessing_labelbinarizer.rst │ ├── api_ibex_sklearn_preprocessing_onehotencoder.rst │ ├── api_ibex_sklearn_preprocessing_standardscaler.rst │ ├── api_ibex_sklearn_tree_extratreeclassifier.rst │ ├── api_ibex_sklearn_cluster_affinitypropagation.rst │ ├── api_ibex_sklearn_cluster_featureagglomeration.rst │ ├── api_ibex_sklearn_cluster_spectralbiclustering.rst │ ├── api_ibex_sklearn_cluster_spectralcoclustering.rst │ ├── api_ibex_sklearn_cross_decomposition_plscanonical.rst │ ├── api_ibex_sklearn_ensemble_adaboostclassifier.rst │ ├── api_ibex_sklearn_ensemble_extratreesregressor.rst │ ├── api_ibex_sklearn_isotonic_isotonicregression.rst │ ├── api_ibex_sklearn_kernel_approximation_rbfsampler.rst │ ├── api_ibex_sklearn_linear_model_linearregression.rst │ ├── api_ibex_sklearn_linear_model_multitasklassocv.rst │ ├── api_ibex_sklearn_multiclass__constantpredictor.rst │ ├── api_ibex_sklearn_multiclass_onevsoneclassifier.rst │ ├── api_ibex_sklearn_neighbors_localoutlierfactor.rst │ ├── api_ibex_sklearn_random_projection_baseestimator.rst │ ├── api_ibex_sklearn_semi_supervised_labelspreading.rst │ ├── api_ibex_sklearn_tree_decisiontreeclassifier.rst │ ├── api_ibex_sklearn_tree_decisiontreeregressor.rst │ ├── api_ibex_sklearn_calibration__sigmoidcalibration.rst │ ├── api_ibex_sklearn_calibration_isotonicregression.rst │ ├── api_ibex_sklearn_covariance_empiricalcovariance.rst │ ├── api_ibex_sklearn_cross_decomposition_plsregression.rst │ ├── api_ibex_sklearn_ensemble_extratreesclassifier.rst │ ├── api_ibex_sklearn_ensemble_randomforestregressor.rst │ ├── api_ibex_sklearn_ensemble_randomtreesembedding.rst │ ├── api_ibex_sklearn_feature_extraction_dictvectorizer.rst │ ├── api_ibex_sklearn_feature_extraction_featurehasher.rst │ ├── api_ibex_sklearn_feature_selection_selectfrommodel.rst │ ├── api_ibex_sklearn_gaussian_process_gaussianprocess.rst │ ├── api_ibex_sklearn_grid_search_randomizedsearchcv.rst │ ├── api_ibex_sklearn_kernel_approximation_baseestimator.rst │ ├── api_ibex_sklearn_linear_model_logisticregression.rst │ ├── api_ibex_sklearn_linear_model_ridgeclassifiercv.rst │ ├── api_ibex_sklearn_linear_model_theilsenregressor.rst │ ├── api_ibex_sklearn_multiclass_onevsrestclassifier.rst │ ├── api_ibex_sklearn_neighbors_kneighborsclassifier.rst │ ├── api_ibex_sklearn_neighbors_kneighborsregressor.rst │ ├── api_ibex_sklearn_semi_supervised_labelpropagation.rst │ ├── api_ibex_sklearn_cluster_agglomerativeclustering.rst │ ├── api_ibex_sklearn_decomposition_dictionarylearning.rst │ ├── api_ibex_sklearn_decomposition_minibatchsparsepca.rst │ ├── api_ibex_sklearn_discriminant_analysis_baseestimator.rst │ ├── api_ibex_sklearn_discriminant_analysis_standardscaler.rst │ ├── api_ibex_sklearn_ensemble_randomforestclassifier.rst │ ├── api_ibex_sklearn_feature_selection_selectpercentile.rst │ ├── api_ibex_sklearn_linear_model_logisticregressioncv.rst │ ├── api_ibex_sklearn_linear_model_multitaskelasticnet.rst │ ├── api_ibex_sklearn_manifold_locallylinearembedding.rst │ ├── api_ibex_sklearn_mixture_bayesiangaussianmixture.rst │ ├── api_ibex_sklearn_model_selection_randomizedsearchcv.rst │ ├── api_ibex_sklearn_multiclass_outputcodeclassifier.rst │ ├── api_ibex_sklearn_multioutput_multioutputestimator.rst │ ├── api_ibex_sklearn_multioutput_multioutputregressor.rst │ ├── api_ibex_sklearn_preprocessing_functiontransformer.rst │ ├── api_ibex_sklearn_preprocessing_multilabelbinarizer.rst │ ├── api_ibex_sklearn_preprocessing_polynomialfeatures.rst │ ├── api_ibex_sklearn_preprocessing_quantiletransformer.rst │ ├── api_ibex_sklearn_calibration_calibratedclassifiercv.rst │ ├── api_ibex_sklearn_feature_selection_variancethreshold.rst │ ├── api_ibex_sklearn_linear_model_multitaskelasticnetcv.rst │ ├── api_ibex_sklearn_multioutput_multioutputclassifier.rst │ ├── api_ibex_sklearn_ensemble_gradientboostingclassifier.rst │ ├── api_ibex_sklearn_ensemble_gradientboostingregressor.rst │ ├── api_ibex_sklearn_kernel_approximation_skewedchi2sampler.rst │ ├── api_ibex_sklearn_neighbors_radiusneighborsclassifier.rst │ ├── api_ibex_sklearn_neighbors_radiusneighborsregressor.rst │ ├── api_ibex_sklearn_random_projection_baserandomprojection.rst │ ├── api_ibex_sklearn_kernel_approximation_additivechi2sampler.rst │ ├── api_ibex_sklearn_linear_model_orthogonalmatchingpursuit.rst │ ├── api_ibex_sklearn_decomposition_latentdirichletallocation.rst │ ├── api_ibex_sklearn_feature_selection_genericunivariateselect.rst │ ├── api_ibex_sklearn_gaussian_process_gaussianprocessregressor.rst │ ├── api_ibex_sklearn_linear_model_passiveaggressiveregressor.rst │ ├── api_ibex_sklearn_random_projection_sparserandomprojection.rst │ ├── api_ibex_sklearn_decomposition_minibatchdictionarylearning.rst │ ├── api_ibex_sklearn_gaussian_process_gaussianprocessclassifier.rst │ ├── api_ibex_sklearn_linear_model_orthogonalmatchingpursuitcv.rst │ ├── api_ibex_sklearn_linear_model_passiveaggressiveclassifier.rst │ ├── api_ibex_sklearn_linear_model_randomizedlogisticregression.rst │ ├── api_ibex_sklearn_random_projection_gaussianrandomprojection.rst │ ├── api_ibex_tensorflow_contrib_keras_wrappers_scikit_learn_keras_classifier.rst │ ├── api_ibex_tensorflow_contrib_keras_wrappers_scikit_learn_keras_regressor.rst │ ├── api_ibex_sklearn_discriminant_analysis_lineardiscriminantanalysis.rst │ ├── api_ibex_sklearn_discriminant_analysis_quadraticdiscriminantanalysis.rst │ ├── index.rst │ ├── spelling_wordlist.txt │ ├── xgboost.rst │ ├── api_ibex.rst │ ├── sklearn.rst │ ├── api.rst.jinja2 │ ├── examples.rst │ ├── frame_adapter.rst │ ├── pipelines.rst │ ├── overview.rst │ ├── input_verification_and_output_processing.rst │ ├── feature_union.rst │ ├── extending.rst │ ├── tensorflow.rst │ └── function_transformer.rst ├── requirements.txt └── Makefile ├── ibex ├── tensorflow │ ├── contrib │ │ ├── keras │ │ │ ├── __init__.py │ │ │ └── wrappers │ │ │ │ └── __init__.py │ │ └── __init__.py │ └── __init__.py ├── sklearn │ ├── _predict_star.py │ ├── _preprocessing.py │ ├── _feature_importances.py │ ├── _pipeline.py │ ├── _feature_selection.py │ ├── _cluster.py │ ├── _regression_coef_intercept.py │ ├── _classification_coef_intercept.py │ ├── _cross_val_predict.py │ └── _decomposition.py ├── __init__.py ├── xgboost │ └── __init__.py ├── _xy_estimator.py ├── _utils.py └── _function_transformer.py ├── .coveragerc ├── .readthedocs.yml ├── .gitignore ├── .landscape.yaml ├── .travis.yml ├── LICENSE.txt ├── scripts └── analyze_system_sklearn.py ├── setup.py └── README.rst /docs/source/api_overview.rst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ibex/tensorflow/contrib/keras/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/source/api_ibex_frame.rst: -------------------------------------------------------------------------------- 1 | ``frame`` 2 | ============ 3 | 4 | .. autofunction:: ibex.frame 5 | -------------------------------------------------------------------------------- /docs/source/_static/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atavory/ibex/HEAD/docs/source/_static/logo.ico -------------------------------------------------------------------------------- /docs/source/_static/logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atavory/ibex/HEAD/docs/source/_static/logo.jpeg -------------------------------------------------------------------------------- /docs/source/api_ibex_trans.rst: -------------------------------------------------------------------------------- 1 | ``trans`` 2 | ========================== 3 | 4 | .. autofunction:: ibex.trans 5 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | 3 | branch = True 4 | 5 | [report] 6 | 7 | include = 8 | */site-packages/*/ibex/* 9 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | requirements_file: docs/requirements.txt 2 | 3 | python: 4 | setup_py_install: true 5 | 6 | -------------------------------------------------------------------------------- /docs/source/_static/got_frame.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atavory/ibex/HEAD/docs/source/_static/got_frame.jpeg -------------------------------------------------------------------------------- /docs/source/_static/github-pages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atavory/ibex/HEAD/docs/source/_static/github-pages.png -------------------------------------------------------------------------------- /docs/source/_static/read_the_docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atavory/ibex/HEAD/docs/source/_static/read_the_docs.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | dist 3 | *.pyc 4 | *.sw? 5 | */__pycache__ 6 | .* 7 | *egg-info* 8 | Untitled*.* 9 | htmlcov 10 | -------------------------------------------------------------------------------- /.landscape.yaml: -------------------------------------------------------------------------------- 1 | max-line-length: 120 2 | ignore-paths: 3 | - test 4 | - scripts 5 | python-targets: 6 | - 2 7 | - 3 8 | -------------------------------------------------------------------------------- /ibex/tensorflow/contrib/keras/wrappers/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Wrappers for :mod:`tensorflow.contrib.keras.wrappers`. 3 | """ 4 | 5 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | six 2 | numpy 3 | scipy 4 | sklearn 5 | pandas 6 | pyenchant 7 | sphinxcontrib-spelling 8 | sphinxcontrib-fulltoc 9 | sphinxcontrib-plantuml 10 | -------------------------------------------------------------------------------- /docs/source/api_ibex_frame_mixin.rst: -------------------------------------------------------------------------------- 1 | ``ibex.FrameMixin`` 2 | ========================================== 3 | 4 | .. autoclass:: ibex.FrameMixin 5 | :members: 6 | :special-members: 7 | -------------------------------------------------------------------------------- /ibex/sklearn/_predict_star.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | 4 | import functools 5 | import inspect 6 | 7 | import pandas as pd 8 | from sklearn import base 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/source/api_ibex_transformer_example.rst: -------------------------------------------------------------------------------- 1 | Transformer Example 2 | ========================================== 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.PCA 5 | :members: 6 | :special-members: 7 | -------------------------------------------------------------------------------- /docs/source/api_ibex_regressor_example.rst: -------------------------------------------------------------------------------- 1 | Regressor Example 2 | ========================================== 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.LinearRegression 5 | :members: 6 | :special-members: 7 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_svm_svc.rst: -------------------------------------------------------------------------------- 1 | ``SVC`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.svm.SVC 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_svm_svr.rst: -------------------------------------------------------------------------------- 1 | ``SVR`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.svm.SVR 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_mixture_gmm.rst: -------------------------------------------------------------------------------- 1 | ``GMM`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.mixture.GMM 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_svm_nusvc.rst: -------------------------------------------------------------------------------- 1 | ``NuSVC`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.svm.NuSVC 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_svm_nusvr.rst: -------------------------------------------------------------------------------- 1 | ``NuSVR`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.svm.NuSVR 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_class.rst.jinja2: -------------------------------------------------------------------------------- 1 | ``{{ class_name }}`` 2 | ============================================================================ 3 | 4 | .. autoclass:: {{ full_class_name }} 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | 9 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cluster_birch.rst: -------------------------------------------------------------------------------- 1 | ``Birch`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cluster.Birch 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_covariance_oas.rst: -------------------------------------------------------------------------------- 1 | ``OAS`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.covariance.OAS 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_manifold_mds.rst: -------------------------------------------------------------------------------- 1 | ``MDS`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.manifold.MDS 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_manifold_tsne.rst: -------------------------------------------------------------------------------- 1 | ``TSNE`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.manifold.TSNE 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_mixture_dpgmm.rst: -------------------------------------------------------------------------------- 1 | ``DPGMM`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.mixture.DPGMM 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_mixture_vbgmm.rst: -------------------------------------------------------------------------------- 1 | ``VBGMM`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.mixture.VBGMM 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cluster_dbscan.rst: -------------------------------------------------------------------------------- 1 | ``DBSCAN`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cluster.DBSCAN 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cluster_kmeans.rst: -------------------------------------------------------------------------------- 1 | ``KMeans`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cluster.KMeans 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_manifold_isomap.rst: -------------------------------------------------------------------------------- 1 | ``Isomap`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.manifold.Isomap 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_svm_linearsvc.rst: -------------------------------------------------------------------------------- 1 | ``LinearSVC`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.svm.LinearSVC 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_svm_linearsvr.rst: -------------------------------------------------------------------------------- 1 | ``LinearSVR`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.svm.LinearSVR 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_nmf.rst: -------------------------------------------------------------------------------- 1 | ``NMF`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.NMF 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_pca.rst: -------------------------------------------------------------------------------- 1 | ``PCA`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.PCA 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_lars.rst: -------------------------------------------------------------------------------- 1 | ``Lars`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.Lars 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_lasso.rst: -------------------------------------------------------------------------------- 1 | ``Lasso`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.Lasso 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_ridge.rst: -------------------------------------------------------------------------------- 1 | ``Ridge`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.Ridge 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_svm_oneclasssvm.rst: -------------------------------------------------------------------------------- 1 | ``OneClassSVM`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.svm.OneClassSVM 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cluster_meanshift.rst: -------------------------------------------------------------------------------- 1 | ``MeanShift`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cluster.MeanShift 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_selection_rfe.rst: -------------------------------------------------------------------------------- 1 | ``RFE`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_selection.RFE 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_larscv.rst: -------------------------------------------------------------------------------- 1 | ``LarsCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.LarsCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_naive_bayes_basenb.rst: -------------------------------------------------------------------------------- 1 | ``BaseNB`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.naive_bayes.BaseNB 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_pipeline_pipeline.rst: -------------------------------------------------------------------------------- 1 | ``Pipeline`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.pipeline.Pipeline 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_calibration_linearsvc.rst: -------------------------------------------------------------------------------- 1 | ``LinearSVC`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.calibration.LinearSVC 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_covariance_mincovdet.rst: -------------------------------------------------------------------------------- 1 | ``MinCovDet`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.covariance.MinCovDet 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cross_decomposition_cca.rst: -------------------------------------------------------------------------------- 1 | ``CCA`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cross_decomposition.CCA 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_fastica.rst: -------------------------------------------------------------------------------- 1 | ``FastICA`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.FastICA 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_dummy_baseestimator.rst: -------------------------------------------------------------------------------- 1 | ``BaseEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.dummy.BaseEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_selection_rfecv.rst: -------------------------------------------------------------------------------- 1 | ``RFECV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_selection.RFECV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_lassocv.rst: -------------------------------------------------------------------------------- 1 | ``LassoCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.LassoCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_ridgecv.rst: -------------------------------------------------------------------------------- 1 | ``RidgeCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.RidgeCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neighbors_lshforest.rst: -------------------------------------------------------------------------------- 1 | ``LSHForest`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neighbors.LSHForest 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_imputer.rst: -------------------------------------------------------------------------------- 1 | ``Imputer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.Imputer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_covariance_graphlasso.rst: -------------------------------------------------------------------------------- 1 | ``GraphLasso`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.covariance.GraphLasso 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_covariance_ledoitwolf.rst: -------------------------------------------------------------------------------- 1 | ``LedoitWolf`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.covariance.LedoitWolf 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_kernelpca.rst: -------------------------------------------------------------------------------- 1 | ``KernelPCA`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.KernelPCA 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_sparsepca.rst: -------------------------------------------------------------------------------- 1 | ``SparsePCA`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.SparsePCA 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_dummy_dummyregressor.rst: -------------------------------------------------------------------------------- 1 | ``DummyRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.dummy.DummyRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_baseensemble.rst: -------------------------------------------------------------------------------- 1 | ``BaseEnsemble`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.BaseEnsemble 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_elasticnet.rst: -------------------------------------------------------------------------------- 1 | ``ElasticNet`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.ElasticNet 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_lassolars.rst: -------------------------------------------------------------------------------- 1 | ``LassoLars`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.LassoLars 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_perceptron.rst: -------------------------------------------------------------------------------- 1 | ``Perceptron`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.Perceptron 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_naive_bayes_gaussiannb.rst: -------------------------------------------------------------------------------- 1 | ``GaussianNB`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.naive_bayes.GaussianNB 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_pipeline_featureunion.rst: -------------------------------------------------------------------------------- 1 | ``FeatureUnion`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.pipeline.FeatureUnion 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_binarizer.rst: -------------------------------------------------------------------------------- 1 | ``Binarizer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.Binarizer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_calibration_labelencoder.rst: -------------------------------------------------------------------------------- 1 | ``LabelEncoder`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.calibration.LabelEncoder 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cluster_minibatchkmeans.rst: -------------------------------------------------------------------------------- 1 | ``MiniBatchKMeans`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cluster.MiniBatchKMeans 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_covariance_graphlassocv.rst: -------------------------------------------------------------------------------- 1 | ``GraphLassoCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.covariance.GraphLassoCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cross_decomposition_plssvd.rst: -------------------------------------------------------------------------------- 1 | ``PLSSVD`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cross_decomposition.PLSSVD 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_sparsecoder.rst: -------------------------------------------------------------------------------- 1 | ``SparseCoder`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.SparseCoder 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_dummy_dummyclassifier.rst: -------------------------------------------------------------------------------- 1 | ``DummyClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.dummy.DummyClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_grid_search_basesearchcv.rst: -------------------------------------------------------------------------------- 1 | ``BaseSearchCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.grid_search.BaseSearchCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_grid_search_gridsearchcv.rst: -------------------------------------------------------------------------------- 1 | ``GridSearchCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.grid_search.GridSearchCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_isotonic_baseestimator.rst: -------------------------------------------------------------------------------- 1 | ``BaseEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.isotonic.BaseEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_kernel_ridge_kernelridge.rst: -------------------------------------------------------------------------------- 1 | ``KernelRidge`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.kernel_ridge.KernelRidge 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_lassolarscv.rst: -------------------------------------------------------------------------------- 1 | ``LassoLarsCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.LassoLarsCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_lassolarsic.rst: -------------------------------------------------------------------------------- 1 | ``LassoLarsIC`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.LassoLarsIC 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_mixture_gaussianmixture.rst: -------------------------------------------------------------------------------- 1 | ``GaussianMixture`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.mixture.GaussianMixture 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_multiclass_baseestimator.rst: -------------------------------------------------------------------------------- 1 | ``BaseEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.multiclass.BaseEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_naive_bayes_bernoullinb.rst: -------------------------------------------------------------------------------- 1 | ``BernoulliNB`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.naive_bayes.BernoulliNB 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neighbors_kerneldensity.rst: -------------------------------------------------------------------------------- 1 | ``KernelDensity`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neighbors.KernelDensity 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_normalizer.rst: -------------------------------------------------------------------------------- 1 | ``Normalizer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.Normalizer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_calibration_baseestimator.rst: -------------------------------------------------------------------------------- 1 | ``BaseEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.calibration.BaseEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_calibration_labelbinarizer.rst: -------------------------------------------------------------------------------- 1 | ``LabelBinarizer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.calibration.LabelBinarizer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_truncatedsvd.rst: -------------------------------------------------------------------------------- 1 | ``TruncatedSVD`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.TruncatedSVD 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_baggingregressor.rst: -------------------------------------------------------------------------------- 1 | ``BaggingRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.BaggingRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_isolationforest.rst: -------------------------------------------------------------------------------- 1 | ``IsolationForest`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.IsolationForest 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_votingclassifier.rst: -------------------------------------------------------------------------------- 1 | ``VotingClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.VotingClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_selection_selectfdr.rst: -------------------------------------------------------------------------------- 1 | ``SelectFdr`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_selection.SelectFdr 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_selection_selectfpr.rst: -------------------------------------------------------------------------------- 1 | ``SelectFpr`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_selection.SelectFpr 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_selection_selectfwe.rst: -------------------------------------------------------------------------------- 1 | ``SelectFwe`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_selection.SelectFwe 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_grid_search_baseestimator.rst: -------------------------------------------------------------------------------- 1 | ``BaseEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.grid_search.BaseEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_kernel_approximation_nystroem.rst: -------------------------------------------------------------------------------- 1 | ``Nystroem`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.kernel_approximation.Nystroem 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_kernel_ridge_baseestimator.rst: -------------------------------------------------------------------------------- 1 | ``BaseEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.kernel_ridge.BaseEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_ardregression.rst: -------------------------------------------------------------------------------- 1 | ``ARDRegression`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.ARDRegression 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_bayesianridge.rst: -------------------------------------------------------------------------------- 1 | ``BayesianRidge`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.BayesianRidge 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_elasticnetcv.rst: -------------------------------------------------------------------------------- 1 | ``ElasticNetCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.ElasticNetCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_sgdclassifier.rst: -------------------------------------------------------------------------------- 1 | ``SGDClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.SGDClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_sgdregressor.rst: -------------------------------------------------------------------------------- 1 | ``SGDRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.SGDRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_multiclass_labelbinarizer.rst: -------------------------------------------------------------------------------- 1 | ``LabelBinarizer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.multiclass.LabelBinarizer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_multioutput_baseestimator.rst: -------------------------------------------------------------------------------- 1 | ``BaseEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.multioutput.BaseEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_naive_bayes_basediscretenb.rst: -------------------------------------------------------------------------------- 1 | ``BaseDiscreteNB`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.naive_bayes.BaseDiscreteNB 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_naive_bayes_baseestimator.rst: -------------------------------------------------------------------------------- 1 | ``BaseEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.naive_bayes.BaseEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_naive_bayes_labelbinarizer.rst: -------------------------------------------------------------------------------- 1 | ``LabelBinarizer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.naive_bayes.LabelBinarizer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_naive_bayes_multinomialnb.rst: -------------------------------------------------------------------------------- 1 | ``MultinomialNB`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.naive_bayes.MultinomialNB 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neighbors_nearestcentroid.rst: -------------------------------------------------------------------------------- 1 | ``NearestCentroid`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neighbors.NearestCentroid 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neural_network_bernoullirbm.rst: -------------------------------------------------------------------------------- 1 | ``BernoulliRBM`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neural_network.BernoulliRBM 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neural_network_mlpregressor.rst: -------------------------------------------------------------------------------- 1 | ``MLPRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neural_network.MLPRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_pipeline__basecomposition.rst: -------------------------------------------------------------------------------- 1 | ``_BaseComposition`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.pipeline._BaseComposition 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_labelencoder.rst: -------------------------------------------------------------------------------- 1 | ``LabelEncoder`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.LabelEncoder 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_maxabsscaler.rst: -------------------------------------------------------------------------------- 1 | ``MaxAbsScaler`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.MaxAbsScaler 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_minmaxscaler.rst: -------------------------------------------------------------------------------- 1 | ``MinMaxScaler`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.MinMaxScaler 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_robustscaler.rst: -------------------------------------------------------------------------------- 1 | ``RobustScaler`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.RobustScaler 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_tree_extratreeregressor.rst: -------------------------------------------------------------------------------- 1 | ``ExtraTreeRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.tree.ExtraTreeRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cluster_spectralclustering.rst: -------------------------------------------------------------------------------- 1 | ``SpectralClustering`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cluster.SpectralClustering 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_covariance_ellipticenvelope.rst: -------------------------------------------------------------------------------- 1 | ``EllipticEnvelope`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.covariance.EllipticEnvelope 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_covariance_shrunkcovariance.rst: -------------------------------------------------------------------------------- 1 | ``ShrunkCovariance`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.covariance.ShrunkCovariance 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_factoranalysis.rst: -------------------------------------------------------------------------------- 1 | ``FactorAnalysis`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.FactorAnalysis 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_incrementalpca.rst: -------------------------------------------------------------------------------- 1 | ``IncrementalPCA`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.IncrementalPCA 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_randomizedpca.rst: -------------------------------------------------------------------------------- 1 | ``RandomizedPCA`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.RandomizedPCA 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_adaboostregressor.rst: -------------------------------------------------------------------------------- 1 | ``AdaBoostRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.AdaBoostRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_baggingclassifier.rst: -------------------------------------------------------------------------------- 1 | ``BaggingClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.BaggingClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_selection_selectkbest.rst: -------------------------------------------------------------------------------- 1 | ``SelectKBest`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_selection.SelectKBest 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_huberregressor.rst: -------------------------------------------------------------------------------- 1 | ``HuberRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.HuberRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_multitasklasso.rst: -------------------------------------------------------------------------------- 1 | ``MultiTaskLasso`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.MultiTaskLasso 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_randomizedlasso.rst: -------------------------------------------------------------------------------- 1 | ``RandomizedLasso`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.RandomizedLasso 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_ransacregressor.rst: -------------------------------------------------------------------------------- 1 | ``RANSACRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.RANSACRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_ridgeclassifier.rst: -------------------------------------------------------------------------------- 1 | ``RidgeClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.RidgeClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_manifold_spectralembedding.rst: -------------------------------------------------------------------------------- 1 | ``SpectralEmbedding`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.manifold.SpectralEmbedding 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_model_selection_gridsearchcv.rst: -------------------------------------------------------------------------------- 1 | ``GridSearchCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.model_selection.GridSearchCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_multioutput_classifierchain.rst: -------------------------------------------------------------------------------- 1 | ``ClassifierChain`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.multioutput.ClassifierChain 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neighbors_nearestneighbors.rst: -------------------------------------------------------------------------------- 1 | ``NearestNeighbors`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neighbors.NearestNeighbors 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neural_network_mlpclassifier.rst: -------------------------------------------------------------------------------- 1 | ``MLPClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neural_network.MLPClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_kernelcenterer.rst: -------------------------------------------------------------------------------- 1 | ``KernelCenterer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.KernelCenterer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_labelbinarizer.rst: -------------------------------------------------------------------------------- 1 | ``LabelBinarizer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.LabelBinarizer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_onehotencoder.rst: -------------------------------------------------------------------------------- 1 | ``OneHotEncoder`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.OneHotEncoder 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_standardscaler.rst: -------------------------------------------------------------------------------- 1 | ``StandardScaler`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.StandardScaler 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_tree_extratreeclassifier.rst: -------------------------------------------------------------------------------- 1 | ``ExtraTreeClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.tree.ExtraTreeClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cluster_affinitypropagation.rst: -------------------------------------------------------------------------------- 1 | ``AffinityPropagation`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cluster.AffinityPropagation 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cluster_featureagglomeration.rst: -------------------------------------------------------------------------------- 1 | ``FeatureAgglomeration`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cluster.FeatureAgglomeration 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cluster_spectralbiclustering.rst: -------------------------------------------------------------------------------- 1 | ``SpectralBiclustering`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cluster.SpectralBiclustering 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cluster_spectralcoclustering.rst: -------------------------------------------------------------------------------- 1 | ``SpectralCoclustering`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cluster.SpectralCoclustering 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cross_decomposition_plscanonical.rst: -------------------------------------------------------------------------------- 1 | ``PLSCanonical`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cross_decomposition.PLSCanonical 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_adaboostclassifier.rst: -------------------------------------------------------------------------------- 1 | ``AdaBoostClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.AdaBoostClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_extratreesregressor.rst: -------------------------------------------------------------------------------- 1 | ``ExtraTreesRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.ExtraTreesRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_isotonic_isotonicregression.rst: -------------------------------------------------------------------------------- 1 | ``IsotonicRegression`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.isotonic.IsotonicRegression 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_kernel_approximation_rbfsampler.rst: -------------------------------------------------------------------------------- 1 | ``RBFSampler`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.kernel_approximation.RBFSampler 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_linearregression.rst: -------------------------------------------------------------------------------- 1 | ``LinearRegression`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.LinearRegression 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_multitasklassocv.rst: -------------------------------------------------------------------------------- 1 | ``MultiTaskLassoCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.MultiTaskLassoCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_multiclass__constantpredictor.rst: -------------------------------------------------------------------------------- 1 | ``_ConstantPredictor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.multiclass._ConstantPredictor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_multiclass_onevsoneclassifier.rst: -------------------------------------------------------------------------------- 1 | ``OneVsOneClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.multiclass.OneVsOneClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neighbors_localoutlierfactor.rst: -------------------------------------------------------------------------------- 1 | ``LocalOutlierFactor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neighbors.LocalOutlierFactor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_random_projection_baseestimator.rst: -------------------------------------------------------------------------------- 1 | ``BaseEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.random_projection.BaseEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_semi_supervised_labelspreading.rst: -------------------------------------------------------------------------------- 1 | ``LabelSpreading`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.semi_supervised.LabelSpreading 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_tree_decisiontreeclassifier.rst: -------------------------------------------------------------------------------- 1 | ``DecisionTreeClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.tree.DecisionTreeClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_tree_decisiontreeregressor.rst: -------------------------------------------------------------------------------- 1 | ``DecisionTreeRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.tree.DecisionTreeRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /ibex/tensorflow/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Wrappers for :mod:`tensorflow`. 3 | 4 | 5 | This module loads corresponding modules in ``tensorflow`` on demand, just 6 | as ``tensorflow`` does. Its contents might depend on those of the ``tensorflow`` 7 | in your system when it is loaded. 8 | 9 | """ 10 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_calibration__sigmoidcalibration.rst: -------------------------------------------------------------------------------- 1 | ``_SigmoidCalibration`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.calibration._SigmoidCalibration 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_calibration_isotonicregression.rst: -------------------------------------------------------------------------------- 1 | ``IsotonicRegression`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.calibration.IsotonicRegression 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_covariance_empiricalcovariance.rst: -------------------------------------------------------------------------------- 1 | ``EmpiricalCovariance`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.covariance.EmpiricalCovariance 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cross_decomposition_plsregression.rst: -------------------------------------------------------------------------------- 1 | ``PLSRegression`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cross_decomposition.PLSRegression 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_extratreesclassifier.rst: -------------------------------------------------------------------------------- 1 | ``ExtraTreesClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.ExtraTreesClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_randomforestregressor.rst: -------------------------------------------------------------------------------- 1 | ``RandomForestRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.RandomForestRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_randomtreesembedding.rst: -------------------------------------------------------------------------------- 1 | ``RandomTreesEmbedding`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.RandomTreesEmbedding 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_extraction_dictvectorizer.rst: -------------------------------------------------------------------------------- 1 | ``DictVectorizer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_extraction.DictVectorizer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_extraction_featurehasher.rst: -------------------------------------------------------------------------------- 1 | ``FeatureHasher`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_extraction.FeatureHasher 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_selection_selectfrommodel.rst: -------------------------------------------------------------------------------- 1 | ``SelectFromModel`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_selection.SelectFromModel 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_gaussian_process_gaussianprocess.rst: -------------------------------------------------------------------------------- 1 | ``GaussianProcess`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.gaussian_process.GaussianProcess 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_grid_search_randomizedsearchcv.rst: -------------------------------------------------------------------------------- 1 | ``RandomizedSearchCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.grid_search.RandomizedSearchCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_kernel_approximation_baseestimator.rst: -------------------------------------------------------------------------------- 1 | ``BaseEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.kernel_approximation.BaseEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_logisticregression.rst: -------------------------------------------------------------------------------- 1 | ``LogisticRegression`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.LogisticRegression 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_ridgeclassifiercv.rst: -------------------------------------------------------------------------------- 1 | ``RidgeClassifierCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.RidgeClassifierCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_theilsenregressor.rst: -------------------------------------------------------------------------------- 1 | ``TheilSenRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.TheilSenRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_multiclass_onevsrestclassifier.rst: -------------------------------------------------------------------------------- 1 | ``OneVsRestClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.multiclass.OneVsRestClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neighbors_kneighborsclassifier.rst: -------------------------------------------------------------------------------- 1 | ``KNeighborsClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neighbors.KNeighborsClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neighbors_kneighborsregressor.rst: -------------------------------------------------------------------------------- 1 | ``KNeighborsRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neighbors.KNeighborsRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_semi_supervised_labelpropagation.rst: -------------------------------------------------------------------------------- 1 | ``LabelPropagation`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.semi_supervised.LabelPropagation 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_cluster_agglomerativeclustering.rst: -------------------------------------------------------------------------------- 1 | ``AgglomerativeClustering`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.cluster.AgglomerativeClustering 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_dictionarylearning.rst: -------------------------------------------------------------------------------- 1 | ``DictionaryLearning`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.DictionaryLearning 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_minibatchsparsepca.rst: -------------------------------------------------------------------------------- 1 | ``MiniBatchSparsePCA`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.MiniBatchSparsePCA 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_discriminant_analysis_baseestimator.rst: -------------------------------------------------------------------------------- 1 | ``BaseEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.discriminant_analysis.BaseEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_discriminant_analysis_standardscaler.rst: -------------------------------------------------------------------------------- 1 | ``StandardScaler`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.discriminant_analysis.StandardScaler 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_randomforestclassifier.rst: -------------------------------------------------------------------------------- 1 | ``RandomForestClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.RandomForestClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_selection_selectpercentile.rst: -------------------------------------------------------------------------------- 1 | ``SelectPercentile`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_selection.SelectPercentile 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_logisticregressioncv.rst: -------------------------------------------------------------------------------- 1 | ``LogisticRegressionCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.LogisticRegressionCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_multitaskelasticnet.rst: -------------------------------------------------------------------------------- 1 | ``MultiTaskElasticNet`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.MultiTaskElasticNet 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_manifold_locallylinearembedding.rst: -------------------------------------------------------------------------------- 1 | ``LocallyLinearEmbedding`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.manifold.LocallyLinearEmbedding 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_mixture_bayesiangaussianmixture.rst: -------------------------------------------------------------------------------- 1 | ``BayesianGaussianMixture`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.mixture.BayesianGaussianMixture 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_model_selection_randomizedsearchcv.rst: -------------------------------------------------------------------------------- 1 | ``RandomizedSearchCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.model_selection.RandomizedSearchCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_multiclass_outputcodeclassifier.rst: -------------------------------------------------------------------------------- 1 | ``OutputCodeClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.multiclass.OutputCodeClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_multioutput_multioutputestimator.rst: -------------------------------------------------------------------------------- 1 | ``MultiOutputEstimator`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.multioutput.MultiOutputEstimator 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_multioutput_multioutputregressor.rst: -------------------------------------------------------------------------------- 1 | ``MultiOutputRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.multioutput.MultiOutputRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_functiontransformer.rst: -------------------------------------------------------------------------------- 1 | ``FunctionTransformer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.FunctionTransformer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_multilabelbinarizer.rst: -------------------------------------------------------------------------------- 1 | ``MultiLabelBinarizer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.MultiLabelBinarizer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_polynomialfeatures.rst: -------------------------------------------------------------------------------- 1 | ``PolynomialFeatures`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.PolynomialFeatures 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_preprocessing_quantiletransformer.rst: -------------------------------------------------------------------------------- 1 | ``QuantileTransformer`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.preprocessing.QuantileTransformer 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_calibration_calibratedclassifiercv.rst: -------------------------------------------------------------------------------- 1 | ``CalibratedClassifierCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.calibration.CalibratedClassifierCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_selection_variancethreshold.rst: -------------------------------------------------------------------------------- 1 | ``VarianceThreshold`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_selection.VarianceThreshold 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_multitaskelasticnetcv.rst: -------------------------------------------------------------------------------- 1 | ``MultiTaskElasticNetCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.MultiTaskElasticNetCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_multioutput_multioutputclassifier.rst: -------------------------------------------------------------------------------- 1 | ``MultiOutputClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.multioutput.MultiOutputClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_gradientboostingclassifier.rst: -------------------------------------------------------------------------------- 1 | ``GradientBoostingClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.GradientBoostingClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_ensemble_gradientboostingregressor.rst: -------------------------------------------------------------------------------- 1 | ``GradientBoostingRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.ensemble.GradientBoostingRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_kernel_approximation_skewedchi2sampler.rst: -------------------------------------------------------------------------------- 1 | ``SkewedChi2Sampler`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.kernel_approximation.SkewedChi2Sampler 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neighbors_radiusneighborsclassifier.rst: -------------------------------------------------------------------------------- 1 | ``RadiusNeighborsClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neighbors.RadiusNeighborsClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_neighbors_radiusneighborsregressor.rst: -------------------------------------------------------------------------------- 1 | ``RadiusNeighborsRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.neighbors.RadiusNeighborsRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_random_projection_baserandomprojection.rst: -------------------------------------------------------------------------------- 1 | ``BaseRandomProjection`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.random_projection.BaseRandomProjection 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_kernel_approximation_additivechi2sampler.rst: -------------------------------------------------------------------------------- 1 | ``AdditiveChi2Sampler`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.kernel_approximation.AdditiveChi2Sampler 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_orthogonalmatchingpursuit.rst: -------------------------------------------------------------------------------- 1 | ``OrthogonalMatchingPursuit`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.OrthogonalMatchingPursuit 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_latentdirichletallocation.rst: -------------------------------------------------------------------------------- 1 | ``LatentDirichletAllocation`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.LatentDirichletAllocation 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_feature_selection_genericunivariateselect.rst: -------------------------------------------------------------------------------- 1 | ``GenericUnivariateSelect`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.feature_selection.GenericUnivariateSelect 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_gaussian_process_gaussianprocessregressor.rst: -------------------------------------------------------------------------------- 1 | ``GaussianProcessRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.gaussian_process.GaussianProcessRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_passiveaggressiveregressor.rst: -------------------------------------------------------------------------------- 1 | ``PassiveAggressiveRegressor`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.PassiveAggressiveRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_random_projection_sparserandomprojection.rst: -------------------------------------------------------------------------------- 1 | ``SparseRandomProjection`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.random_projection.SparseRandomProjection 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /ibex/tensorflow/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Wrappers for :mod:`tensorflow.contrib`. 3 | 4 | 5 | This module loads corresponding modules in ``tensorflow.contrib`` on demand, just 6 | as ``tensorflow`` does. Its contents might depend on those of the ``tensorflow.contrib`` 7 | in your system when it is loaded. 8 | 9 | """ 10 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_decomposition_minibatchdictionarylearning.rst: -------------------------------------------------------------------------------- 1 | ``MiniBatchDictionaryLearning`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.decomposition.MiniBatchDictionaryLearning 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_gaussian_process_gaussianprocessclassifier.rst: -------------------------------------------------------------------------------- 1 | ``GaussianProcessClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.gaussian_process.GaussianProcessClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_orthogonalmatchingpursuitcv.rst: -------------------------------------------------------------------------------- 1 | ``OrthogonalMatchingPursuitCV`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.OrthogonalMatchingPursuitCV 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_passiveaggressiveclassifier.rst: -------------------------------------------------------------------------------- 1 | ``PassiveAggressiveClassifier`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.PassiveAggressiveClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_linear_model_randomizedlogisticregression.rst: -------------------------------------------------------------------------------- 1 | ``RandomizedLogisticRegression`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.linear_model.RandomizedLogisticRegression 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_random_projection_gaussianrandomprojection.rst: -------------------------------------------------------------------------------- 1 | ``GaussianRandomProjection`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.random_projection.GaussianRandomProjection 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_tensorflow_contrib_keras_wrappers_scikit_learn_keras_classifier.rst: -------------------------------------------------------------------------------- 1 | ``KerasClassifier`` 2 | ========================================== 3 | 4 | .. autoclass:: ibex.tensorflow.contrib.keras.wrappers.scikit_learn.KerasClassifier 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/source/api_ibex_tensorflow_contrib_keras_wrappers_scikit_learn_keras_regressor.rst: -------------------------------------------------------------------------------- 1 | ``KerasRegressor`` 2 | ========================================== 3 | 4 | .. autoclass:: ibex.tensorflow.contrib.keras.wrappers.scikit_learn.KerasRegressor 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_discriminant_analysis_lineardiscriminantanalysis.rst: -------------------------------------------------------------------------------- 1 | ``LinearDiscriminantAnalysis`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.discriminant_analysis.LinearDiscriminantAnalysis 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/api_ibex_sklearn_discriminant_analysis_quadraticdiscriminantanalysis.rst: -------------------------------------------------------------------------------- 1 | ``QuadraticDiscriminantAnalysis`` 2 | ============================================================================ 3 | 4 | .. autoclass:: ibex.sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis 5 | :members: 6 | :special-members: 7 | :show-inheritance: 8 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../../README.rst 2 | 3 | 4 | Contents 5 | ======== 6 | 7 | .. toctree:: 8 | :hidden: 9 | 10 | self 11 | 12 | .. toctree:: 13 | :maxdepth: 3 14 | 15 | overview 16 | frame_adapter 17 | input_verification_and_output_processing 18 | function_transformer 19 | pipelines 20 | feature_union 21 | sklearn 22 | tensorflow 23 | xgboost 24 | extending 25 | examples 26 | api 27 | 28 | 29 | Indexes and tables 30 | ================== 31 | 32 | * :ref:`genindex` 33 | * :ref:`modindex` 34 | * :ref:`search` 35 | 36 | -------------------------------------------------------------------------------- /docs/source/spelling_wordlist.txt: -------------------------------------------------------------------------------- 1 | sklearn 2 | scikit 3 | func 4 | args 5 | Todo 6 | Ami 7 | Tavory 8 | Shahar 9 | Azulay 10 | Tali 11 | Raveh 12 | Sadka 13 | ted 14 | None 15 | subobjects 16 | Iterable 17 | iterable 18 | cv 19 | multiclass 20 | mixin 21 | mixins 22 | Movielens 23 | metadata 24 | Halko 25 | al 26 | scipy 27 | linalg 28 | mle 29 | svd 30 | Minka 31 | svd 32 | svd 33 | arpack 34 | svd 35 | postprocessing 36 | arpack 37 | Halko 38 | al 39 | tol 40 | svd 41 | arpack 42 | svd 43 | arpack 44 | mle 45 | svd 46 | mle 47 | svd 48 | arpack 49 | svd 50 | Regressor 51 | scipy 52 | linalg 53 | lstsq 54 | dtype 55 | pred 56 | wrt 57 | 58 | -------------------------------------------------------------------------------- /docs/source/xgboost.rst: -------------------------------------------------------------------------------- 1 | .. _xgboost: 2 | 3 | ``xgboost`` 4 | =========== 5 | 6 | .. versionadded:: 1.2 7 | 8 | 9 | Wrapping up :mod:`xgboost` is straightforward (it has only two scikit-learn type estimators: :class:`xgboost.XGBClassifier` and :class:`xgboost.XGBRegressor`). The :mod:`ibex.xgboost` section in the API describes the (straightforward) Ibex corresponding classes. 10 | 11 | 12 | .. note:: 13 | 14 | Ibex does not *require* the installation of :mod:`xgboost`. If ``xgboost`` is not installed on the system, though, then this module will not be available. 15 | 16 | 17 | .. tip:: 18 | 19 | Ibex does not modify the code of ``xgboost`` in any way. It is absolutely possibly to ``import`` and use both ``xgboost`` and ``ibex.xgboost`` simultaneously. 20 | 21 | 22 | .. seealso:: 23 | 24 | See :mod:`ibex.xgboost` in :ref:`api`. 25 | 26 | 27 | -------------------------------------------------------------------------------- /ibex/sklearn/_preprocessing.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | 4 | import inspect 5 | 6 | import pandas as pd 7 | from sklearn import base 8 | from sklearn import decomposition as orig 9 | 10 | from .._adapter import frame_ex 11 | from .._utils import ( 12 | get_lowest_level_column_names, 13 | set_lowest_level_column_names 14 | ) 15 | 16 | 17 | def polynomial_feautures_transform_imp(self, base_ret): 18 | def pow_str(c, p): 19 | if p == 0: 20 | return '' 21 | if p == 1: 22 | return c 23 | return c + '^' + str(p) 24 | 25 | cols = [] 26 | for power in self.powers_: 27 | label = ' '.join([pow_str(c, p) for c, p in zip(self.x_columns, power) if pow_str(c, p)]) 28 | if not label: 29 | label = '1' 30 | cols.append(label) 31 | set_lowest_level_column_names(base_ret, cols) 32 | 33 | return base_ret 34 | 35 | 36 | polynomial_feautures_transform_imp_doc = """ 37 | foo 38 | """ 39 | -------------------------------------------------------------------------------- /docs/source/api_ibex.rst: -------------------------------------------------------------------------------- 1 | ``ibex`` 2 | -------- 3 | 4 | .. automodule:: ibex 5 | 6 | 7 | :class:`ibex.FrameMixin` 8 | 9 | :func:`ibex.frame` 10 | 11 | :func:`ibex.trans` 12 | 13 | 14 | ``sklearn`` 15 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 | 17 | 18 | .. toctree:: 19 | :maxdepth: 3 20 | 21 | api_overview 22 | api_sklearn 23 | 24 | .. automodule:: ibex.sklearn 25 | 26 | 27 | ``preprocessing`` 28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 29 | 30 | .. automodule:: ibex.sklearn.preprocessing 31 | 32 | :class:`ibex.sklearn.preprocessing.FunctionTransformer` 33 | 34 | 35 | ``pipeline`` 36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 37 | 38 | .. automodule:: ibex.sklearn.pipeline 39 | 40 | :func:`ibex.sklearn.pipeline.make_union` 41 | 42 | :func:`ibex.sklearn.pipeline.make_pipeline` 43 | 44 | :class:`ibex.sklearn.pipeline.FeatureUnion` 45 | 46 | :class:`ibex.sklearn.pipeline.Pipeline` 47 | 48 | 49 | 50 | ``model_selection`` 51 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 52 | 53 | .. automodule:: ibex.sklearn.model_selection 54 | 55 | 56 | :func:`ibex.sklearn.model_selection.cross_val_predict` 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /ibex/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Pandas adapters for sklearn-type estimators 3 | """ 4 | 5 | 6 | from ._base import * 7 | from ._adapter import * 8 | from ._function_transformer import * 9 | import sklearn 10 | 11 | 12 | __all__ = [] 13 | 14 | __version__ = '0.1.0' 15 | 16 | __all__ += ['__version__'] 17 | 18 | __all__ += ['FrameMixin'] 19 | 20 | __all__ += ['frame', 'frame_ex'] 21 | 22 | __all__ += ['trans'] 23 | 24 | __all__ += ['sklearn'] 25 | 26 | 27 | def trans(func=None, in_cols=None, out_cols=None, pass_y=False, kw_args=None): 28 | """ 29 | Arguments: 30 | 31 | func: One of: 32 | 33 | * ``None`` 34 | * a callable 35 | * a step 36 | 37 | in_cols: One of: 38 | 39 | * ``None`` 40 | * a string 41 | * a list of strings 42 | 43 | out_cols: 44 | 45 | pass_y: Boolean indicating whether to pass the ``y`` argument to 46 | 47 | kw_args: 48 | 49 | Returns: 50 | 51 | An :py:class:`sklearn.preprocessing.FunctionTransformer` object. 52 | 53 | See the `documentation `_ for examples. 54 | """ 55 | 56 | from ibex.sklearn import preprocessing 57 | 58 | return preprocessing.FunctionTransformer(func, in_cols, out_cols, pass_y, kw_args) 59 | 60 | __all__ += ['trans'] 61 | 62 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | python: 4 | - "2.7" 5 | - "3.5" 6 | 7 | install: 8 | - sudo apt-get update 9 | - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then 10 | wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; 11 | else 12 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; 13 | fi 14 | - bash miniconda.sh -b -p $HOME/miniconda 15 | - export PATH="$HOME/miniconda/bin:$PATH" 16 | - hash -r 17 | - conda config --add channels conda-forge 18 | - conda config --set always_yes yes --set changeps1 no 19 | - conda update -q conda 20 | - conda info -a 21 | - sudo pip install python-coveralls 22 | - sudo pip install codecov 23 | - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then 24 | conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION six numpy scipy scikit-learn=0.17 pandas coverage jupyter seaborn xgboost tensorflow; 25 | else 26 | conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION six numpy scipy scikit-learn pandas coverage jupyter seaborn xgboost tensorflow; 27 | fi 28 | - source activate test-environment 29 | - python setup.py install 30 | 31 | script: 32 | - python test/_test.py 33 | - coverage run test/_test.py 34 | 35 | after_success: 36 | - coverage report -m 37 | - coveralls 38 | - codecov 39 | 40 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2017, Ami Tavory, Shahar Azulay 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /ibex/xgboost/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Wrappers for :mod:`xgboost`. 3 | 4 | 5 | .. versionadded:: 1.2 6 | 7 | 8 | Example: 9 | 10 | >>> import pandas as pd 11 | >>> import numpy as np 12 | >>> from ibex.sklearn import datasets 13 | >>> from ibex.xgboost import XGBRegressor as PdXGBRegressor 14 | >>> from ibex.xgboost import XGBClassifier as PdXGBClassifier 15 | 16 | >>> iris = datasets.load_iris() 17 | >>> features = iris['feature_names'] 18 | >>> iris = pd.DataFrame( 19 | ... np.c_[iris['data'], iris['target']], 20 | ... columns=features+['class']) 21 | 22 | >>> iris[features] 23 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) 24 | 0 5.1 3.5 1.4 0.2 25 | 1 4.9 3.0 1.4 0.2 26 | 2 4.7 3.2 1.3 0.2 27 | 3 4.6 3.1 1.5 0.2 28 | 4 5.0 3.6 1.4 0.2 29 | ... 30 | 31 | >>> PdXGBRegressor().fit(iris[features], iris['class']).predict(iris[features]) 32 | 0 0.000140 33 | 1 0.013568 34 | 2 -0.004346 35 | 3 0.005156 36 | 4 0.000140 37 | ... 38 | 39 | >>> PdXGBClassifier().fit(iris[features], iris['class']).predict(iris[features]) 40 | 0 0... 41 | 1 0... 42 | 2 0... 43 | 3 0... 44 | 4 0... 45 | ... 46 | 47 | """ 48 | 49 | 50 | from __future__ import absolute_import 51 | 52 | import xgboost 53 | 54 | from .._adapter import frame 55 | 56 | 57 | XGBClassifier = frame(xgboost.XGBClassifier) 58 | XGBRegressor = frame(xgboost.XGBRegressor) 59 | 60 | 61 | __all__ = ['XGBClassifier', 'XGBRegressor'] 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /ibex/sklearn/_feature_importances.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | 4 | import pandas as pd 5 | 6 | 7 | def feature_importances_(self, base_ret): 8 | return pd.Series(base_ret, index=self.x_columns) 9 | 10 | 11 | def get_feature_importances_docs( 12 | orig, 13 | name, 14 | est, 15 | kwargs, 16 | is_regressor, 17 | is_classifier, 18 | is_transformer, 19 | is_clusterer, 20 | has_dataframe_y): 21 | return r""" 22 | Example: 23 | 24 | >>> import pandas as pd 25 | >>> import numpy as np 26 | >>> from ibex.sklearn import datasets 27 | >>> from ibex.sklearn.ensemble import RandomForestClassifier as PdRandomForestClassifier 28 | 29 | >>> iris = datasets.load_iris() 30 | >>> features = iris['feature_names'] 31 | >>> iris = pd.DataFrame( 32 | ... np.c_[iris['data'], iris['target']], 33 | ... columns=features+['class']) 34 | 35 | >>> iris[features] 36 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) 37 | 0 5.1 3.5 1.4 0.2 38 | 1 4.9 3.0 1.4 0.2 39 | 2 4.7 3.2 1.3 0.2 40 | 3 4.6 3.1 1.5 0.2 41 | 4 5.0 3.6 1.4 0.2 42 | ... 43 | 44 | >>> clf = PdRandomForestClassifier(random_state=42).fit(iris[features], iris['class']) 45 | >>> 46 | >>> clf.feature_importances_ 47 | sepal length (cm) 0.129268 48 | sepal width (cm) 0.015822 49 | petal length (cm) 0.444740 50 | petal width (cm) 0.410169 51 | dtype: float64 52 | 53 | """ 54 | 55 | 56 | -------------------------------------------------------------------------------- /ibex/sklearn/_pipeline.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | 4 | import operator 5 | 6 | import six 7 | 8 | from .._base import Pipeline as PdPipeline 9 | from .._base import FeatureUnion as PdFeatureUnion 10 | 11 | 12 | def make_pipeline(*estimators): 13 | """ 14 | Creates a pipeline from estimators. 15 | 16 | Arguments: 17 | 18 | transformers: Iterable of estimators. 19 | 20 | Returns: 21 | 22 | A :class:`ibex.sklearn.pipeline.Pipeline` object. 23 | 24 | Example: 25 | 26 | >>> from ibex.sklearn import preprocessing 27 | >>> from ibex.sklearn import linear_model 28 | >>> from ibex.sklearn import pipeline 29 | >>> 30 | >>> pipeline.make_pipeline(preprocessing.StandardScaler(), linear_model.LinearRegression()) 31 | Pipeline(...) 32 | 33 | """ 34 | estimators = list(estimators) 35 | 36 | if len(estimators) > 1: 37 | return six.moves.reduce(operator.or_, estimators[1:], estimators[0]) 38 | 39 | name = type(estimators[0]).__name__.lower() 40 | return PdPipeline([(name, estimators[0])]) 41 | 42 | 43 | def make_union(*transformers): 44 | """ 45 | Creates a union from transformers. 46 | 47 | Arguments: 48 | 49 | transformers: Iterable of transformers. 50 | 51 | Returns: 52 | 53 | A :class:`ibex.sklearn.pipeline.FeatureUnion` object. 54 | 55 | Example: 56 | 57 | >>> from ibex.sklearn import preprocessing as pd_preprocessing 58 | >>> from ibex.sklearn import pipeline as pd_pipeline 59 | 60 | >>> trn = pd_pipeline.make_union( 61 | ... pd_preprocessing.StandardScaler(), 62 | ... pd_preprocessing.MaxAbsScaler()) 63 | 64 | """ 65 | 66 | transformers = list(transformers) 67 | 68 | if len(transformers) > 1: 69 | return six.moves.reduce(operator.add, transformers[1:], transformers[0]) 70 | 71 | name = type(transformers[0]).__name__.lower() 72 | return PdFeatureUnion([(name, transformers[0])]) 73 | -------------------------------------------------------------------------------- /docs/source/sklearn.rst: -------------------------------------------------------------------------------- 1 | .. _sklearn: 2 | 3 | ``sklearn`` 4 | =========== 5 | 6 | General Idea 7 | ------------ 8 | 9 | Ibex lazily wraps :mod:`sklearn`. When a module starting with ``ibex.sklearn`` is ``import``-ed, Ibex will load the corresponding module from ``sklearn``, wrap the estimator classes using :func:`ibex.frame`, and load the result. For example say we start with 10 | 11 | >>> import sklearn 12 | >>> import ibex 13 | 14 | :mod:`sklearn.linear_model` is part of ``sklearn``, 15 | therefore :mod:`ibex.sklearn` will have a counterpart. 16 | 17 | >>> 'linear_model' in sklearn.__all__ 18 | True 19 | >>> 'linear_model' in ibex.sklearn.__all__ 20 | True 21 | >>> from ibex.sklearn import linear_model as pd_linear_model 22 | 23 | ``foo`` is not part of ``sklearn``, 24 | therefore :mod:`ibex.sklearn` will not have a counterpart. 25 | 26 | >>> 'foo' in sklearn.__all__ 27 | False 28 | >>> 'foo' in ibex.sklearn.__all__ 29 | False 30 | >>> # Next line won't work! 31 | >>> from ibex.sklearn import foo # doctest: +SKIP 32 | 33 | As noted above, Ibex wraps the estimator classes it finds in the module: 34 | 35 | >>> from sklearn import linear_model 36 | >>> linear_model.LinearRegression() 37 | LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=False) 38 | >>> pd_linear_model.LinearRegression() 39 | Adapter[LinearRegression](copy_X=True, fit_intercept=True, n_jobs=1, normalize=False) 40 | 41 | .. tip:: 42 | 43 | Ibex does not modify the code of ``sklearn`` in any way. It is absolutely possibly to ``import`` and use both ``sklearn`` and ``ibex.sklearn`` simultaneously. 44 | 45 | 46 | Differences From ``sklearn`` 47 | ---------------------------- 48 | 49 | Since :class:`pandas.DataFrame` and :class:`pandas.Series` are not identical to :class:`numpy.array` s (which is the reason to use the former), some changes are made in ``ibex.sklearn`` relative to the corresponding elements in ``sklearn``. :mod:`ibex.sklearn` in 50 | :ref:`api` lists the differences. 51 | -------------------------------------------------------------------------------- /docs/source/api.rst.jinja2: -------------------------------------------------------------------------------- 1 | .. _api: 2 | 3 | API 4 | === 5 | 6 | 7 | ``ibex`` 8 | -------- 9 | 10 | Module Doc 11 | ~~~~~~~~~~~~~ 12 | 13 | .. automodule:: ibex 14 | 15 | 16 | Members 17 | ~~~~~~~~~~~~~~~ 18 | 19 | * :func:`ibex.frame` 20 | 21 | * :class:`ibex.FrameMixin` 22 | 23 | * :func:`ibex.trans` 24 | 25 | 26 | ``sklearn`` 27 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 | 29 | Module Doc 30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 31 | 32 | .. automodule:: ibex.sklearn 33 | 34 | 35 | {% for module, classes in sklearn_modules|dictsort %} 36 | 37 | ``{{ module }}`` 38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | 41 | Module Doc 42 | ****************************************** 43 | 44 | .. automodule:: ibex.sklearn.{{ module }} 45 | 46 | 47 | Members 48 | ****************************************** 49 | 50 | {% for class in classes|sort %} 51 | * :class:`{{ class }}` 52 | {% endfor %} 53 | 54 | {% endfor %} 55 | 56 | 57 | 58 | ``tensorflow`` 59 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | 61 | Module Doc 62 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 63 | 64 | 65 | .. note:: 66 | 67 | Ibex does not *require* the installation of :mod:`tensorflow`. If ``tensorflow`` is not installed on the system, though, then this module will not be available. 68 | 69 | 70 | .. automodule:: ibex.tensorflow 71 | 72 | 73 | ``contrib.keras.wrappers.scikit_learn`` 74 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 75 | 76 | 77 | Module Doc 78 | ****************************************** 79 | 80 | .. automodule:: ibex.tensorflow.contrib.keras.wrappers.scikit_learn 81 | 82 | 83 | Notable Members 84 | ****************************************** 85 | 86 | * :class:`ibex.tensorflow.contrib.keras.wrappers.scikit_learn.KerasClassifier` 87 | 88 | * :class:`ibex.tensorflow.contrib.keras.wrappers.scikit_learn.KerasRegressor` 89 | 90 | 91 | ``xgboost`` 92 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 | 94 | Module Doc 95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 96 | 97 | 98 | .. note:: 99 | 100 | Ibex does not *require* the installation of :mod:`xgboost`. If ``xgboost`` is not installed on the system, though, then this module will not be available. 101 | 102 | 103 | .. automodule:: ibex.xgboost 104 | -------------------------------------------------------------------------------- /docs/source/examples.rst: -------------------------------------------------------------------------------- 1 | .. _examples: 2 | 3 | Examples 4 | ======== 5 | 6 | 7 | `Transforming Features In The Iris Dataset `_ 8 | 9 | This is a version of part of the :mod:`sklearn` example `Feature importances with forests of trees `_. It illustrates retaining the semantic meaning of features as they are transformed. 10 | 11 | `Feature Importance In The Iris Dataset `_ 12 | 13 | This is a version of the :mod:`sklearn` example `Feature importances with forests of trees `_. It illustrates the consistent use of :mod:`pandas` data structures throughout the process. 14 | 15 | 16 | `Plotting Cross-Validated Predictions In The Boston Dataset `_ 17 | 18 | This is a version of the :mod:`sklearn` example `Plotting Cross-Validated Predictions `_. It further illustrates the consistent use of :mod:`pandas` data structures and :mod:`seaborn`, as well as using :mod:`ibex.xgboost`. 19 | 20 | `Confidence Intervals In The Digits Dataset `_ 21 | 22 | This is a version of the :mod:`sklearn` example `Pipelining: chaining a PCA and a logistic regression `_. It illustrates the use of pipelines. 23 | 24 | `Simple Row-Aggregating Features In The Movielens Dataset `_ 25 | 26 | This shows how to use :mod:`pandas`-munging estimators utilizing features which span multiple rows (instances). Pandas excels (no pun intended) in these kinds of operations. 27 | 28 | `Nonnegative Matrix Farcotization In The Movielens Dataset `_ 29 | 30 | This shows how to use :mod:`pandas`-munging estimators utilizing features which span multiple rows (instances), this time using `nonnegative matrix factorization `_. 31 | 32 | 33 | `Tensorflow/Keras Classification In The Iris Dataset `_ 34 | 35 | This example shows how to use :class:`ibex.tensorflow.contrib.keras.wrappers.scikit_learn.KerasClassifier`. 36 | -------------------------------------------------------------------------------- /ibex/_xy_estimator.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | 4 | import inspect 5 | import os 6 | import types 7 | 8 | import six 9 | import numpy as np 10 | import pandas as pd 11 | 12 | from ._utils import get_wrapped_y, update_wrapped_y 13 | from ._base import InOpChecker 14 | 15 | 16 | _in_ops = InOpChecker(__file__) 17 | 18 | 19 | def make_estimator(estimator, ind): 20 | ind = ind.copy() 21 | 22 | def get_set_params(est): 23 | base_attr = getattr(estimator, '__init__') 24 | if six.PY3: 25 | args = list(inspect.signature(base_attr).parameters) 26 | else: 27 | args = inspect.getargspec(base_attr)[0] 28 | orig_args = est.get_params() 29 | args = {arg: orig_args[arg] for arg in args if arg in orig_args} 30 | return args 31 | 32 | class _Adapter(type(estimator)): 33 | def fit(self, X, *args, **kwargs): 34 | self.__run(super(_Adapter, self).fit, 'fit', X, *args, **kwargs) 35 | return self 36 | 37 | def predict(self, X, *args, **kwargs): 38 | return self.__run(super(_Adapter, self).predict, 'predict', X, *args, **kwargs) 39 | 40 | def fit_predict(self, X, *args, **kwargs): 41 | return self.__run(super(_Adapter, self).fit_predict, 'fit_predict', X, *args, **kwargs) 42 | 43 | def __run(self, fn, name, X, *args, **kwargs): 44 | if self in _in_ops: 45 | return fn(X, *args, **kwargs) 46 | 47 | op_ind = ind[X[:, 0].astype(int)] 48 | X_ = pd.DataFrame(X[:, 1:], index=op_ind) 49 | 50 | y = get_wrapped_y(name, args) 51 | if y is not None: 52 | args = list(args)[:] 53 | if len(y.shape) == 1: 54 | update_wrapped_y(args, pd.Series(y, index=op_ind)) 55 | else: 56 | update_wrapped_y(args, pd.DataFrame(y, index=op_ind)) 57 | 58 | _in_ops.add(self) 59 | try: 60 | res = fn(X_, *args, **kwargs) 61 | finally: 62 | _in_ops.remove(self) 63 | 64 | return self.__process_wrapped_call_res(res) 65 | 66 | def __process_wrapped_call_res(self, res): 67 | if isinstance(res, pd.Series): 68 | return res.as_matrix() 69 | 70 | if isinstance(res, pd.DataFrame): 71 | return res.values 72 | 73 | if isinstance(res, types.GeneratorType): 74 | return (self.__process_wrapped_call_res(r) for r in res) 75 | 76 | return res 77 | 78 | return _Adapter(**get_set_params(estimator)) 79 | 80 | 81 | def make_xy(X, y): 82 | X_ = np.c_[range(len(X)), X.as_matrix()] 83 | y_ = y.values if y is not None else None 84 | return X_, y_ 85 | -------------------------------------------------------------------------------- /ibex/_utils.py: -------------------------------------------------------------------------------- 1 | import functools 2 | 3 | import six 4 | import pandas as pd 5 | import numpy as np 6 | 7 | 8 | _wrap_msg = """ 9 | .. note:: 10 | 11 | The documentation following is of the class wrapped by this class. There 12 | are some changes, in particular: 13 | 14 | * A parameter ``X`` denotes a :class:`pandas.DataFrame`. 15 | 16 | * A parameter ``y`` denotes a :class:`pandas.Series`. 17 | 18 | -------------------------------- 19 | 20 | """ 21 | 22 | 23 | def verify_x_type(X): 24 | if not isinstance(X, pd.DataFrame): 25 | raise TypeError('Expected pandas.DataFrame; got %s' % type(X)) 26 | 27 | 28 | def verify_y_type(y): 29 | if y is None: 30 | return 31 | 32 | if not isinstance(y, (pd.DataFrame, pd.Series)): 33 | raise TypeError('Expected pandas.DataFrame or pandas.Series; got %s' % type(y)) 34 | 35 | 36 | def update_class_wrapper(new_class, orig_class): 37 | if six.PY3: 38 | orig_doc = orig_class.__doc__ 39 | if orig_doc is None: 40 | orig_doc = '' 41 | new_class.__doc__ = _wrap_msg + orig_doc 42 | 43 | 44 | def update_method_wrapper(new_class, orig_class, method_name): 45 | functools.update_wrapper(getattr(new_class, method_name), getattr(orig_class, method_name)) 46 | orig_doc = getattr(orig_class, method_name).__doc__ 47 | if orig_doc is None: 48 | orig_doc = '' 49 | getattr(new_class, method_name).__doc__ = _wrap_msg + orig_doc 50 | 51 | 52 | _have_y_fn_names = [ 53 | 'fit', 54 | 'fit_predict', 55 | 'fit_transform', 56 | 'inverse_transform', 57 | 'partial_fit', 58 | 'score', 59 | 'transform', 60 | ] 61 | 62 | 63 | def get_wrapped_y(name, args): 64 | if name not in _have_y_fn_names: 65 | return None 66 | 67 | if len(args) < 1: 68 | return None 69 | 70 | if isinstance(args[0], (pd.Series, pd.DataFrame, np.ndarray)): 71 | return args[0] 72 | 73 | return None 74 | 75 | 76 | def update_wrapped_y(args, y): 77 | args[0] = y 78 | 79 | 80 | wrapped_fn_names = [ 81 | 'fit_transform', 82 | 'predict_proba', 83 | 'sample_y', 84 | 'score_samples', 85 | 'score', 86 | 'staged_predict_proba', 87 | 'apply', 88 | 'bic', 89 | 'perplexity', 90 | 'fit', 91 | 'decision_function', 92 | 'aic', 93 | 'partial_fit', 94 | 'predict', 95 | 'radius_neighbors', 96 | 'staged_decision_function', 97 | 'staged_predict', 98 | 'inverse_transform', 99 | 'fit_predict', 100 | 'kneighbors', 101 | 'predict_log_proba', 102 | 'transform', 103 | ] 104 | 105 | 106 | def get_lowest_level_column_names(df): 107 | return df.columns 108 | 109 | 110 | def set_lowest_level_column_names(df, columns): 111 | df.columns = columns 112 | -------------------------------------------------------------------------------- /docs/source/frame_adapter.rst: -------------------------------------------------------------------------------- 1 | .. _adapting: 2 | 3 | Adapting Estimators 4 | =================== 5 | 6 | This chapter describes a low-level function, :func:`ibex.frame`, which transforms `estimators conforming to the sickit-learn protocol `_ to :mod:`pandas`-aware estimators. 7 | 8 | .. tip:: 9 | 10 | This chapter describes interfaces required for writing a :mod:`pandas`-aware estimator from scratch, or for adapting an estimator to be ``pandas``-aware. As all of :mod:`sklearn` is wrapped by Ibex, this can be skipped if you're not planning on doing either. 11 | 12 | The ``frame`` function takes an estimator, and returns an `adapter `_ of that estimator. This adapter does the 13 | same thing as the adapted class, except that: 14 | 15 | 1. It expects to take :class:`pandas.DataFrame` and :class:`pandas.Series` objects, not :class:`numpy.array` objects. It performs verifications on these inputs, 16 | and processes the outputs, as described in :ref:`verification_and_processing`. 17 | 18 | 2. It supports two additional operators: ``|`` for pipelining (see :ref:`pipeline`), and ``+`` for feature unions (see :ref:`feature_union`). 19 | 20 | Suppose we start with: 21 | 22 | >>> from sklearn import linear_model 23 | >>> from sklearn import preprocessing 24 | >>> from sklearn import base 25 | >>> from ibex import frame 26 | 27 | We can use ``frame`` to adapt an object: 28 | 29 | >>> prd = frame(linear_model.LinearRegression()) 30 | >>> prd 31 | Adapter[LinearRegression](copy_X=True, fit_intercept=True, n_jobs=1, normalize=False) 32 | 33 | We can use ``frame`` to adapt a class: 34 | 35 | >>> PdLinearRegression = frame(linear_model.LinearRegression) 36 | >>> PdStandardScaler = frame(preprocessing.StandardScaler) 37 | 38 | Once we adapt a class, it behaves pretty much like the underlying one. We can construct it in whatever ways it the underlying class supports, for example: 39 | 40 | >>> PdLinearRegression() 41 | Adapter[LinearRegression](copy_X=True, fit_intercept=True, n_jobs=1, normalize=False) 42 | >>> PdLinearRegression(fit_intercept=False) 43 | Adapter[LinearRegression](copy_X=True, fit_intercept=False, n_jobs=1, normalize=False) 44 | 45 | It has the same name as the underlying class: 46 | 47 | >>> PdLinearRegression.__name__ 48 | 'LinearRegression' 49 | 50 | It subclasses the same mixins of the underlying class: 51 | 52 | >>> isinstance(PdLinearRegression(), base.RegressorMixin) 53 | True 54 | >>> isinstance(PdLinearRegression(), base.TransformerMixin) 55 | False 56 | >>> isinstance(PdStandardScaler(), base.RegressorMixin) 57 | False 58 | >>> isinstance(PdStandardScaler(), base.TransformerMixin) 59 | True 60 | 61 | As can be seen above, though, the string and representation is modified, to signify this is an adapted type: 62 | 63 | >>> PdLinearRegression() 64 | Adapter[LinearRegression](copy_X=True, fit_intercept=True, n_jobs=1, normalize=False) 65 | >>> linear_model.LinearRegression() 66 | LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=False) 67 | 68 | | 69 | | 70 | 71 | Of course, the imposition to decorate every class (not to mention object) via ``frame``, can become annoying. 72 | 73 | .. image:: _static/got_frame.jpeg 74 | 75 | If a library is used often enough, it might pay to wrap it once. Ibex does this (nearly completely) automatically for :mod:`sklearn` (see :ref:`sklearn`). 76 | 77 | -------------------------------------------------------------------------------- /docs/source/pipelines.rst: -------------------------------------------------------------------------------- 1 | .. _pipeline: 2 | 3 | Pipelining 4 | ========== 5 | 6 | A pipeline is a sequential composition of a number of transformers, and a final estimator. Ibex allows pipeline compositions in both the original ``sklearn`` explicit way, as well as a more succinct pipeline-syntax version. 7 | 8 | In this chapter we'll use the following Iris dataset: 9 | 10 | >>> import numpy as np 11 | >>> from sklearn import datasets 12 | >>> import pandas as pd 13 | >>> 14 | >>> iris = datasets.load_iris() 15 | >>> features, iris = iris['feature_names'], pd.DataFrame( 16 | ... np.c_[iris['data'], iris['target']], 17 | ... columns=iris['feature_names']+['class']) 18 | >>> 19 | >>> iris.columns 20 | Index([...'sepal length (cm)', ...'sepal width (cm)', ...'petal length (cm)', 21 | ...'petal width (cm)', ...'class'], 22 | dtype='object') 23 | 24 | We'll also use SVC and PCA: 25 | 26 | >>> from ibex.sklearn.svm import SVC as PdSVC 27 | >>> from ibex.sklearn.decomposition import PCA as PdPCA 28 | 29 | 30 | ``sklearn`` Alternative 31 | ----------------------- 32 | 33 | Using :class:`sklearn.pipeline.Pipeline`, we can create a pipeline of steps: 34 | 35 | >>> from sklearn.pipeline import Pipeline 36 | >>> 37 | >>> clf = Pipeline([('pca', PdPCA(n_components=2)), ('svm', PdSVC(kernel="linear"))]) 38 | 39 | Note how the step names can be exactly specified. The name of the second step is ``'svm'``, even though that is unrelated to the name of the class. 40 | 41 | >>> clf.steps 42 | [('pca', Adapter[PCA](... 43 | ...)), ('svm', Adapter[SVC](... 44 | ... 45 | ... 46 | ...))] 47 | 48 | .. tip:: 49 | 50 | Steps' names are important, as they are `used by `_ 51 | :meth:`sklearn.pipeline.Pipeline.set_params` and :meth:`sklearn.pipeline.Pipeline.get_params`. 52 | 53 | 54 | 55 | .. pipeline_pipeline_syntax_alternative: 56 | 57 | Pipeline-Syntax Alternative 58 | --------------------------- 59 | 60 | Using the pipeline syntax, we can use ``|`` to create a pipeline: 61 | 62 | >>> clf = PdPCA(n_components=2) | PdSVC(kernel="linear") 63 | 64 | Note that the name of the second step is ``'svc'``: 65 | 66 | >>> clf.steps 67 | [('pca', Adapter[PCA](... 68 | ...)), ('svc', Adapter[SVC](... 69 | ... 70 | ... 71 | ...))] 72 | 73 | This is `because the name of the class (in lowercase) `_ is ``'svc'``: 74 | 75 | >>> PdSVC.__name__.lower() 76 | 'svc' 77 | 78 | In fact, this is exactly the behavior of :func:`sklearn.pipeline.make_pipeline`. The ``make_pipeline`` function, however, does not allow using same-class objects, as the names would be duplicated. Ibex allows this by detecting this, and numbering same-class steps: 79 | 80 | >>> from ibex import trans 81 | >>> 82 | >>> (trans(np.sin) | trans(np.cos)). steps 83 | [('functiontransformer_0', FunctionTransformer(... 84 | ...)), ('functiontransformer_1', FunctionTransformer(... 85 | ...))] 86 | >>> 87 | >>> (trans(np.sin) | trans(np.cos) | trans(np.tan)). steps 88 | [('functiontransformer_0', FunctionTransformer(... 89 | ...)), ('functiontransformer_1', FunctionTransformer(... 90 | ...)), ('functiontransformer_2', FunctionTransformer(... 91 | ...))] 92 | 93 | This alternative, therefore, is more succinct, but allows less control over the steps' names. 94 | 95 | -------------------------------------------------------------------------------- /docs/source/overview.rst: -------------------------------------------------------------------------------- 1 | Overview 2 | ========= 3 | Goals 4 | ----- 5 | 6 | Ibex library aims for two (somewhat independent) goals: 7 | 8 | The first, primary goal, is providing `pandas `_ adapters for `estimators conforming to the sickit-learn protocol `_, in particular those of `scikit-learn `_ itself 9 | 10 | .. uml:: 11 | :caption: Relation of Ibex to some other packages in the scientific python stack. 12 | 13 | skinparam monochrome true 14 | skinparam shadowing false 15 | 16 | skinparam package { 17 | FontColor #777777 18 | BorderColor lightgrey 19 | } 20 | 21 | package "Plotting" { 22 | [seaborn] 23 | [bokeh] 24 | [matplotlib] 25 | } 26 | 27 | package "Machine Learning" { 28 | [sklearn] 29 | [**ibex**] 30 | } 31 | 32 | package "Data Structures" { 33 | [numpy] 34 | [pandas] 35 | } 36 | 37 | [sklearn] -> [numpy] : interfaced by 38 | [matplotlib] -> [numpy] : interfaced by 39 | [pandas] ..> [numpy] : implemented over 40 | [seaborn] -> [pandas] : interfaced by 41 | [bokeh] -> [pandas] : interfaced by 42 | [seaborn] ..-> [matplotlib] : implemented over 43 | [**ibex**] -> [pandas] : interfaced by 44 | [**ibex**] ..-> [sklearn] : implemented over 45 | 46 | 47 | Consider the preceding UML figure. :mod:`numpy` is a (highly efficient) low-level data structure (strictly speaking, it is more of a buffer interface). both :mod:`matplotlib` and :mod:`sklearn` provide a ``numpy`` interface. Subsequently, :mod:`pandas` provided a higher-level interface to ``numpy``, and some plotting libraries, e.g., :mod:`seaborn` provide a ``pandas`` interface to plotting, while being implemented by ``matplotlib``, but . Similarly, the first aim of Ibex is to provide a ``pandas`` interface to machine learning, while being implemented by ``sklearn``. 48 | 49 | The second goal is providing easier, and more succinct ways of combining estimators, features, and pipelines. 50 | 51 | Motivation 52 | ---------- 53 | 54 | Interface 55 | --------- 56 | 57 | Ibex has a very small interface. The core library has a single public class and two functions. The rest of the library is a (mainly auto-generated) wrapper for :mod:`sklearn`, with nearly all of the classes and functions having a straightforward correspondence to ``sklearn``. 58 | 59 | :py:class:`ibex.FrameMixin` is a mixin class providing both some utilities for :mod:`pandas` support for higher-up classes, as well as pipeline and feature operators. It is described in :ref:`adapting`. :py:func:`ibex.frame` is a function taking an 60 | `estimator conforming to the sickit-learn protocol `_ (either an object or a class), and returning a ``pandas``-aware estimator (correspondingly, an object or a class). If estimators are already wrapped (which is the case for all of ``sklearn``), it is not necessary to be concerned with these at all. 61 | 62 | :py:func:`ibex.trans` is a utility function that creates an estimator applying a regular Python function, or a different estimator, to a :class:`pandas.DataFrame`, optionally specifying the input and output columns. Again, you do not need to use it if you are just planning on using ``sklearn`` estimators. 63 | 64 | Ibex (mostly automatically) wraps all of :py:mod:`sklearn` in :py:mod:`ibex.sklearn`. In almost all cases (except those noted explicitly), the wrapping has a direct correspondence with ``sklearn``. 65 | 66 | 67 | Documentation Structure 68 | ----------------------- 69 | 70 | :py:mod:`sklearn.preprocessing` 71 | 72 | :py:mod:`ibex.sklearn.preprocessing` 73 | 74 | :py:class:`sklearn.preprocessing.FunctionTransformer` 75 | 76 | :py:class:`ibex.sklearn.preprocessing.FunctionTransformer` 77 | 78 | :py:class:`ibex.sklearn.pipeline.FeatureUnion` 79 | -------------------------------------------------------------------------------- /ibex/sklearn/_feature_selection.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | 4 | import functools 5 | import inspect 6 | 7 | import pandas as pd 8 | from sklearn import base 9 | 10 | 11 | def transform(self, base_ret): 12 | if isinstance(base_ret, pd.DataFrame): 13 | base_ret.columns = self.x_columns[self.get_support(indices=True)] 14 | return base_ret 15 | 16 | 17 | def get_transform_doc( 18 | orig, 19 | name, 20 | est, 21 | kwargs, 22 | is_regressor, 23 | is_classifier, 24 | is_transformer, 25 | is_clusterer, 26 | has_dataframe_y): 27 | """ 28 | Example: 29 | 30 | >>> import pandas as pd 31 | >>> import numpy as np 32 | >>> from ibex.sklearn import datasets 33 | >>> from ibex.sklearn.feature_selection import SelectKBest as PdSelectKBest 34 | 35 | >>> iris = datasets.load_iris() 36 | >>> features = iris['feature_names'] 37 | >>> iris = pd.DataFrame( 38 | ... np.c_[iris['data'], iris['target']], 39 | ... columns=features+['class']) 40 | 41 | >>> iris[features] 42 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) 43 | 0 5.1 3.5 1.4 0.2 44 | 1 4.9 3.0 1.4 0.2 45 | 2 4.7 3.2 1.3 0.2 46 | 3 4.6 3.1 1.5 0.2 47 | 4 5.0 3.6 1.4 0.2 48 | ... 49 | 50 | >>> PdSelectKBest(k=1).fit(iris[features], iris['class']).transform(iris[features]) 51 | petal length (cm) 52 | 0 1.4 53 | 1 1.4 54 | 2 1.3 55 | 3 1.5 56 | 4 1.4 57 | ... 58 | 59 | """ 60 | 61 | 62 | def fit_transform(self, base_ret): 63 | if isinstance(base_ret, pd.DataFrame): 64 | base_ret.columns = self.x_columns[self.get_support(indices=True)] 65 | return base_ret 66 | 67 | 68 | 69 | def get_fit_transform_doc( 70 | orig, 71 | name, 72 | est, 73 | kwargs, 74 | is_regressor, 75 | is_classifier, 76 | is_transformer, 77 | is_clusterer, 78 | has_dataframe_y): 79 | """ 80 | Example: 81 | 82 | >>> import pandas as pd 83 | >>> import numpy as np 84 | >>> from ibex.sklearn import datasets 85 | >>> from ibex.sklearn.feature_selection import SelectKBest as PdSelectKBest 86 | 87 | >>> iris = datasets.load_iris() 88 | >>> features = iris['feature_names'] 89 | >>> iris = pd.DataFrame( 90 | ... np.c_[iris['data'], iris['target']], 91 | ... columns=features+['class']) 92 | 93 | >>> iris[features] 94 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) 95 | 0 5.1 3.5 1.4 0.2 96 | 1 4.9 3.0 1.4 0.2 97 | 2 4.7 3.2 1.3 0.2 98 | 3 4.6 3.1 1.5 0.2 99 | 4 5.0 3.6 1.4 0.2 100 | ... 101 | 102 | >>> PdSelectKBest(k=1).fit(iris[features], iris['class']).transform(iris[features]) 103 | petal length (cm) 104 | 0 1.4 105 | 1 1.4 106 | 2 1.3 107 | 3 1.5 108 | 4 1.4 109 | ... 110 | 111 | """ 112 | 113 | -------------------------------------------------------------------------------- /docs/source/input_verification_and_output_processing.rst: -------------------------------------------------------------------------------- 1 | .. _verification_and_processing: 2 | 3 | Verification and Processing 4 | ======================================== 5 | 6 | Since ``sklearn`` is defined in terms of :class:`numpy.ndarray` (and not :class:`pandas.DataFrame`), Ibex estimators perform verification and processing on their inputs and outputs. 7 | 8 | In this chapter we'll use a ``DataFrame`` ``X``, with columns ``'a'`` and ``'b'``, and (implied) index ``1, 2, 3``. 9 | 10 | >>> import pandas as pd 11 | >>> X = pd.DataFrame({'a': [1, 2], 'b': [3, 4]}) 12 | 13 | a scaling transformer ``trn`` which is ``fit``-ted on ``X`` 14 | 15 | >>> from ibex.sklearn import preprocessing as pd_preprocessing 16 | >>> trn = pd_preprocessing.StandardScaler().fit(X) 17 | 18 | and a linear-regression predictor ``prd`` which is also ``fit``-ted on ``X`` 19 | 20 | >>> from ibex.sklearn import linear_model as pd_linear_model 21 | >>> prd = pd_linear_model.LinearRegression().fit(X, pd.Series([3, 4])) 22 | 23 | 24 | Input Verification 25 | ------------------ 26 | 27 | Following the call to ``fit``, we can apply further methods of ``trn`` to any ``DataFrame`` with the same column-set. For example, this is OK 28 | 29 | >>> X_1 = pd.DataFrame({'a': [1, 2, 3], 'b': [3, 4, 5]}) 30 | >>> trn.transform(X_1) 31 | a b 32 | 0 -1... -1... 33 | 1 1... 1... 34 | 2 3... 3... 35 | 36 | but this is not 37 | 38 | >>> X_2 = X_1.rename(columns={'b': 'c'}) 39 | >>> trn.transform(X_2) 40 | Traceback (most recent call last): 41 | ... 42 | KeyError: "...'b'...not in index" 43 | 44 | | 45 | 46 | Once an estimator has been ``fit``-ed, the order of columns of further inputs no longer matters: 47 | 48 | >>> trn.transform(X_1[['a', 'b']]) 49 | a b 50 | 0 -1... -1... 51 | 1 1... 1... 52 | 2 3... 3... 53 | 54 | >>> trn.transform(X_1[['b', 'a']]) 55 | a b 56 | 0 -1... -1... 57 | 1 1... 1... 58 | 2 3... 3... 59 | 60 | The ``step`` will reorder the ``DataFrame`` to the same order of columns seen by ``fit``. 61 | 62 | 63 | .. _verification_and_processing_output: 64 | 65 | Output Processing 66 | ----------------- 67 | 68 | Indexes 69 | ~~~~~~~ 70 | 71 | The index of a returned ``DataFrame`` or ``Series`` objects, is that of the input: 72 | 73 | >>> X_1 = pd.DataFrame({'a': [1, 2, 3], 'b': [3, 4, 5]}, index=[10, 20, 30]) 74 | >>> trn.transform(X_1) 75 | a b 76 | 10 -1... -1... 77 | 20 1... 1... 78 | 30 3... 3... 79 | >>> 80 | >>> prd.predict(X_1) 81 | 10 3... 82 | 20 4... 83 | 30 5... 84 | dtype: ... 85 | 86 | 87 | .. _verification_and_processing_output_dataframe_columns: 88 | 89 | ``DataFrame`` Columns 90 | ~~~~~~~~~~~~~~~~~~~~~ 91 | 92 | In general, the columns of an outputted ``DataFrame`` object are those on which the estimator was ``fit``-ted: 93 | 94 | >>> trn.transform(X_1[['a', 'b']]) 95 | a b 96 | 10 -1... -1... 97 | 20 1... 1... 98 | 30 3... 3... 99 | 100 | >>> trn.transform(X_1[['b', 'a']]) 101 | a b 102 | 10 -1... -1... 103 | 20 1... 1... 104 | 30 3... 3... 105 | 106 | Some outputted ``DataFrame`` objects have a number of columns that is different from that of the input. If this is the case, the resulting ``DataFrame``'s columns will all be blank strings (``''``): 107 | 108 | # Tmp Ami 109 | 110 | >>> from ibex.sklearn import decomposition as pd_decomposition 111 | >>> pd_decomposition.PCA(n_components=1).fit(X).transform(X) 112 | comp_0 113 | 0 -0.707107 114 | 1 0.707107 115 | 116 | .. note:: 117 | 118 | In some cases, we might want greater control over the naming of output columns. For example, when transforming a 2-component PCA, we might want to name the ``DataFrame`` columns ``'pc1'`` and ``'pc2'``. :ref:`function_transformer_specifying_output_columns` in :ref:`function_transformer` shows how to do this. 119 | -------------------------------------------------------------------------------- /scripts/analyze_system_sklearn.py: -------------------------------------------------------------------------------- 1 | import os 2 | import importlib 3 | import inspect 4 | import ast 5 | import re 6 | import glob2 7 | 8 | import six 9 | import sklearn 10 | import pandas as pd 11 | from sklearn import base 12 | 13 | 14 | _identifier_re = re.compile(r'[^\d\W][\w\d_]*_$') 15 | if False: 16 | print(_identifier_re.match('foo')) 17 | print(_identifier_re.match('_foo')) 18 | print(_identifier_re.match('foo_')) 19 | print(_identifier_re.match('foo_bar')) 20 | print(_identifier_re.match('foo_bar_')) 21 | attr_blacklist = [ 22 | 'X_', 23 | 'you_should_not_set_this_'] 24 | 25 | 26 | class ClassLister(ast.NodeVisitor): 27 | 28 | def __init__(self): 29 | self._cur_class = None 30 | self._cur_attr = None 31 | 32 | self._found = set() 33 | 34 | def visit_ClassDef(self, node): 35 | self._cur_class = node.name 36 | self.generic_visit(node) 37 | self._cur_class = None 38 | 39 | def visit_Attribute(self, node): 40 | if self._cur_class is None: 41 | return 42 | if _identifier_re.match(node.attr) is None: 43 | return 44 | if node.attr in attr_blacklist: 45 | return 46 | if node.attr.startswith('_') or node.attr.startswith('n_'): 47 | return 48 | self._cur_attr = node.attr 49 | self.generic_visit(node) 50 | self._cur_attr = None 51 | 52 | def visit_Name(self, node): 53 | if self._cur_attr is None: 54 | return 55 | if node.id != 'self': 56 | return 57 | self._found.add((self._cur_class, self._cur_attr)) 58 | self.generic_visit(node) 59 | 60 | @property 61 | def found(self): 62 | return self._found 63 | 64 | 65 | from sklearn import datasets 66 | iris = datasets.load_iris() 67 | 68 | 69 | class _EstimatorAnalyzer(object): 70 | def __init__(self): 71 | pass 72 | 73 | def analyze(self, est): 74 | print(est) 75 | orig = est() 76 | print(set(dir(est().fit(iris['data'], iris['target']))).difference( 77 | set(dir(orig)))) 78 | 79 | 80 | analyzer = _EstimatorAnalyzer() 81 | from sklearn import ensemble 82 | analyzer.analyze(ensemble.RandomForestClassifier) 83 | ff 84 | 85 | 86 | base_dir = '/usr/local/lib/python3.6/site-packages/sklearn/' 87 | found = [] 88 | for f_name in glob2.glob(os.path.join(base_dir, '**/*.py')): 89 | tree = ast.parse(open(f_name).read()) 90 | v = ClassLister() 91 | v.visit(tree) 92 | found.extend([((f_name.split('/')[7], ) + t) for t in v.found]) 93 | found = pd.DataFrame(found, columns=['module', 'class', 'attr']) 94 | print(found.attr.value_counts().head(300)) 95 | ff 96 | 97 | 98 | m_names = set() 99 | js_c_names = [{'id': 'sklearn', 'value': ''}] 100 | for mod_name in sklearn.__all__: 101 | js_c_names += [{'id': 'sklearn.' + mod_name, 'value': ''}] 102 | import_str = 'from sklearn import %s as _orig' % mod_name 103 | exec(import_str) 104 | for name in dir(_orig): 105 | c = getattr(_orig, name) 106 | try: 107 | if not issubclass(c, base.BaseEstimator): 108 | continue 109 | except TypeError: 110 | continue 111 | js_c_names += [{'id': 'sklearn.' + mod_name + '.' + name, 'value': '1'}] 112 | for m_name in c.__dict__: 113 | if m_name.startswith('_'): 114 | continue 115 | m = getattr(c, m_name) 116 | if not six.callable(m): 117 | continue 118 | sig = inspect.signature(m) 119 | params = list(sig.parameters) 120 | if params[: 2] != ['self', 'X']: 121 | continue 122 | m_names.add(m_name + '-' + ','.join(params[: 3])) 123 | 124 | 125 | print('\n\nmodules:\n\n') 126 | print('\n'.join(sorted(sklearn.__all__))) 127 | 128 | print('\n\nmethods:\n\n') 129 | print('\n'.join(sorted(m_names))) 130 | 131 | print('\n\js_c_names:\n\n') 132 | print('[') 133 | print(',\n'.join([('\t' + str(d)) for d in js_c_names])) 134 | print(']') 135 | 136 | 137 | -------------------------------------------------------------------------------- /ibex/sklearn/_cluster.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | 4 | import functools 5 | import inspect 6 | 7 | import pandas as pd 8 | from sklearn import base 9 | from sklearn import feature_selection as orig 10 | 11 | from .._adapter import frame_ex 12 | 13 | 14 | def transform(self, base_ret): 15 | 16 | if isinstance(base_ret, pd.DataFrame): 17 | base_ret.columns = list(range(len(base_ret.columns))) 18 | return base_ret 19 | 20 | 21 | def get_transform_doc( 22 | orig, 23 | name, 24 | est, 25 | kwargs, 26 | is_regressor, 27 | is_classifier, 28 | is_transformer, 29 | is_clusterer, 30 | has_dataframe_y): 31 | 32 | return r""" 33 | Example: 34 | 35 | >>> import pandas as pd 36 | >>> import numpy as np 37 | >>> from ibex.sklearn import datasets 38 | >>> from ibex.sklearn.cluster import KMeans as PdKMeans 39 | 40 | >>> iris = datasets.load_iris() 41 | >>> features = iris['feature_names'] 42 | >>> iris = pd.DataFrame( 43 | ... np.c_[iris['data'], iris['target']], 44 | ... columns=features+['class']) 45 | 46 | >>> iris[features] 47 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) 48 | 0 5.1 3.5 1.4 0.2 49 | 1 4.9 3.0 1.4 0.2 50 | 2 4.7 3.2 1.3 0.2 51 | 3 4.6 3.1 1.5 0.2 52 | 4 5.0 3.6 1.4 0.2 53 | ... 54 | 55 | >>> clt = PdKMeans(n_clusters=3, random_state=1).fit(iris[features]) 56 | >>> clt.transform(iris[features]) 57 | 0 1 2 58 | 0 3.419251 0.146942 5.059542 59 | 1 3.398574 0.438169 5.114943 60 | 2 3.569357 0.412301 5.279355 61 | 3 3.422410 0.518837 5.153590 62 | 4 3.467264 0.197970 5.104334 63 | ... 64 | 65 | """ 66 | 67 | 68 | def fit_transform(self, base_ret): 69 | if isinstance(base_ret, pd.DataFrame): 70 | base_ret.columns = list(range(len(base_ret.columns))) 71 | return base_ret 72 | 73 | 74 | def get_fit_transform_doc( 75 | orig, 76 | name, 77 | est, 78 | kwargs, 79 | is_regressor, 80 | is_classifier, 81 | is_transformer, 82 | is_clusterer, 83 | has_dataframe_y): 84 | 85 | """ 86 | Example: 87 | 88 | >>> import pandas as pd 89 | >>> import numpy as np 90 | >>> from ibex.sklearn import datasets 91 | >>> from ibex.sklearn.cluster import KMeans as PdKMeans 92 | 93 | >>> iris = datasets.load_iris() 94 | >>> features = iris['feature_names'] 95 | >>> iris = pd.DataFrame( 96 | ... np.c_[iris['data'], iris['target']], 97 | ... columns=features+['class']) 98 | 99 | >>> iris[features] 100 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) 101 | 0 5.1 3.5 1.4 0.2 102 | 1 4.9 3.0 1.4 0.2 103 | 2 4.7 3.2 1.3 0.2 104 | 3 4.6 3.1 1.5 0.2 105 | 4 5.0 3.6 1.4 0.2 106 | ... 107 | 108 | >>> clt = PdKMeans(n_clusters=3, random_state=1).fit(iris[features]) 109 | >>> clt.transform(iris[features]) 110 | 0 1 2 111 | 0 3.419251 0.146942 5.059542 112 | 1 3.398574 0.438169 5.114943 113 | 2 3.569357 0.412301 5.279355 114 | 3 3.422410 0.518837 5.153590 115 | 4 3.467264 0.197970 5.104334 116 | ... 117 | 118 | """ 119 | -------------------------------------------------------------------------------- /docs/source/feature_union.rst: -------------------------------------------------------------------------------- 1 | .. _feature_union: 2 | 3 | Uniting Features 4 | ================ 5 | 6 | 7 | A feature-union `horizontally concatenates `_ the :class:`pandas.DataFrame` results of multiple transformer objects. 8 | 9 | This estimator applies a list of transformer objects in parallel to the input data, then concatenates the results. This is useful to combine several feature extraction mechanisms into a single transformer. 10 | 11 | In this chapter we'll use the following Iris dataset: 12 | 13 | >>> import numpy as np 14 | >>> from sklearn import datasets 15 | >>> import pandas as pd 16 | >>> 17 | >>> iris = datasets.load_iris() 18 | >>> features, iris = iris['feature_names'], pd.DataFrame( 19 | ... np.c_[iris['data'], iris['target']], 20 | ... columns=iris['feature_names']+['class']) 21 | >>> 22 | >>> iris.columns 23 | Index([...'sepal length (cm)', ...'sepal width (cm)', ...'petal length (cm)', 24 | ...'petal width (cm)', ...'class'], 25 | dtype='object') 26 | 27 | We'll also use PCA and univariate feature selection: 28 | 29 | >>> from ibex.sklearn.decomposition import PCA as PdPCA 30 | >>> from ibex.sklearn.feature_selection import SelectKBest as PdSelectKBest 31 | 32 | 33 | ``sklearn`` Alternative 34 | ----------------------- 35 | 36 | Using :class:`sklearn.pipeline.FeatureUnion`, we can create a feature-union of steps: 37 | 38 | >>> from sklearn.pipeline import FeatureUnion 39 | >>> 40 | >>> trn = FeatureUnion([('pca', PdPCA(n_components=2)), ('best', PdSelectKBest(k=1))]) 41 | 42 | Note how the step names can be exactly specified. The name of the second step is ``'best'``, even though that is unrelated to the name of the class. 43 | 44 | >>> trn.transformer_list 45 | [('pca', Adapter[PCA](... 46 | ...), ('best', Adapter[SelectKBest](...)] 47 | 48 | .. tip:: 49 | 50 | Steps' names are important, as they are `used by `_ 51 | :meth:`ibex.sklearn.pipeline.FeatureUnion.set_params` and :meth:`ibex.sklearn.pipeline.FeatureUnion.get_params`. 52 | 53 | 54 | Pipeline-Syntax Alternative 55 | --------------------------- 56 | 57 | Using the pipeline syntax, we can use ``+`` to create a pipeline: 58 | 59 | >>> trn = PdPCA(n_components=2) + PdSelectKBest(k=1) 60 | 61 | The output using this, however, discards the meaning of the columns: 62 | 63 | >>> trn = PdPCA(n_components=2) + PdSelectKBest(k=1) 64 | >>> trn.fit_transform(iris[features], iris['class']) 65 | pca selectkbest 66 | comp_0 comp_1 petal length (cm) 67 | 0 -2.684207 ...0.326607 1.4 68 | 1 -2.715391 ...0.169557 1.4 69 | 2 -2.889820 ...0.137346 1.3 70 | 3 -2.746437 ...0.311124 1.5 71 | 4 -2.728593 ...0.333925 1.4 72 | ... 73 | 74 | A better way would be to combine this with :func:`ibex.trans`: 75 | 76 | >>> from ibex import trans 77 | >>> 78 | >>> trn = trans(PdPCA(n_components=2), out_cols=['pc1', 'pc2']) + trans(PdSelectKBest(k=1), out_cols='best', pass_y=True) 79 | >>> trn.fit_transform(iris[features], iris['class']) 80 | functiontransformer_0 functiontransformer_1 81 | pc1 pc2 best 82 | 0 -2.684207 ...0.326607 1.4 83 | 1 -2.715391 ...0.169557 1.4 84 | 2 -2.889820 ...0.137346 1.3 85 | 3 -2.746437 ...0.311124 1.5 86 | 4 -2.728593 ...0.333925 1.4 87 | ... 88 | 89 | 90 | Note the names of the transformers: 91 | 92 | >>> trn.transformer_list 93 | [('functiontransformer_0', FunctionTransformer(func=Adapter[PCA](... 94 | ... 95 | ... 96 | ...)), ('functiontransformer_1', FunctionTransformer(func=Adapter[SelectKBest](... 97 | ...))] 98 | 99 | This is similar to the discussion of :ref:`pipeline_pipeline_syntax_alternative` in :ref:`pipeline`. 100 | 101 | .. note:: 102 | 103 | Just as with :class:`sklearn.pipeline.Pipeline` vs. ``|``, also :class:`sklearn.pipeline.FeatureUnion` gives greater control over steps name 104 | relative to ``+``. Note, however that ``FeatureUnion`` provides control over further aspects, e.g., the ability to run steps in parallel. 105 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | from setuptools import setup, Command 4 | import subprocess 5 | 6 | 7 | _python = 'python%d' % sys.version_info.major 8 | 9 | 10 | class _TestCommand(Command): 11 | user_options = [ 12 | ] 13 | 14 | def initialize_options(self): 15 | pass 16 | 17 | def finalize_options(self): 18 | pass 19 | 20 | def run(self): 21 | run_str = "%s -m unittest discover test *test.py" % _python 22 | level = os.getenv('IBEX_TEST_LEVEL') 23 | os.system(run_str) 24 | 25 | 26 | class _DocumentCommand(Command): 27 | user_options = [ 28 | ('reduced-checks', None, "Don't perforam all checks (spelling, links, lint)") 29 | ] 30 | 31 | def initialize_options(self): 32 | self.reduced_checks = False 33 | 34 | def finalize_options(self): 35 | pass 36 | 37 | def run(self): 38 | from distutils.dir_util import copy_tree 39 | 40 | import sklearn 41 | from sklearn import base 42 | from jinja2 import Template 43 | 44 | class_template = Template( 45 | open(os.path.join('docs/source/api_class.rst.jinja2')).read()) 46 | 47 | sklearn_modules = {} 48 | for mod_name in sklearn.__all__: 49 | if mod_name.startswith('_'): 50 | continue 51 | 52 | try: 53 | orig = __import__('sklearn.%s' % mod_name, fromlist=['']) 54 | except: 55 | for _ in range(20): 56 | print('failed to import %s' % orig) 57 | # Tmp Ami 58 | continue 59 | 60 | sklearn_modules[mod_name] = [] 61 | 62 | for name in dir(orig): 63 | c = getattr(orig, name) 64 | try: 65 | if not issubclass(c, base.BaseEstimator): 66 | continue 67 | except TypeError: 68 | continue 69 | sklearn_modules[mod_name].append('ibex.sklearn.%s.%s' % (mod_name, name)) 70 | content = class_template.render( 71 | class_name=name, 72 | full_class_name='ibex.sklearn.%s.%s' % (mod_name, name)) 73 | f_name = 'docs/source/api_ibex_sklearn_%s_%s.rst' % (mod_name, name.lower()) 74 | open(f_name, 'w').write(content) 75 | 76 | class_template = Template( 77 | open(os.path.join('docs/source/api.rst.jinja2')).read()) 78 | content = class_template.render( 79 | sklearn_modules=sklearn_modules) 80 | f_name = 'docs/source/api.rst' 81 | open(f_name, 'w').write(content) 82 | 83 | run_str = 'make text' 84 | subprocess.call(run_str.split(' '), cwd='docs') 85 | 86 | run_str = 'make html' 87 | if not self.reduced_checks: 88 | run_str += ' spelling lint linkcheck' 89 | subprocess.check_call(run_str.split(' '), cwd='docs') 90 | 91 | 92 | setup( 93 | name='ibex', 94 | version='0.1.3', 95 | author='Ami Tavory, Shahar Azulay, Tali Raveh-Sadka', 96 | author_email='atavory@gmail.com', 97 | url='https://github.com/atavory/ibex', 98 | packages=[ 99 | 'ibex', 100 | 'ibex.sklearn', 101 | 'ibex.tensorflow', 102 | 'ibex.tensorflow.contrib', 103 | 'ibex.tensorflow.contrib.keras', 104 | 'ibex.tensorflow.contrib.keras.wrappers', 105 | 'ibex.tensorflow.contrib.keras.wrappers.scikit_learn', 106 | 'ibex.xgboost', 107 | ], 108 | license='bsd', 109 | description='Pandas Adapters For Scikit-Learn', 110 | long_description=open('README.rst').read(), 111 | # Tmp Ami 112 | # install_requires=['six', 'numpy', 'scipy', 'sklearn', 'pandas'], 113 | zip_safe=False, 114 | package_data={ 115 | 'ibex': ['_metadata/*txt'] 116 | }, 117 | include_package_data=True, 118 | cmdclass={ 119 | 'document': _DocumentCommand, 120 | 'test': _TestCommand, 121 | }, 122 | classifiers=[ 123 | 'Development Status :: 4 - Beta', 124 | 'Environment :: Console', 125 | 'Intended Audience :: Science/Research', 126 | 'License :: OSI Approved :: BSD License', 127 | 'Operating System :: OS Independent', 128 | 'Programming Language :: Python', 129 | 'Programming Language :: Python :: 2', 130 | 'Programming Language :: Python :: 3', 131 | 'Topic :: Scientific/Engineering', 132 | 'Topic :: Scientific/Engineering :: Information Analysis', 133 | ], 134 | ) 135 | -------------------------------------------------------------------------------- /docs/source/extending.rst: -------------------------------------------------------------------------------- 1 | Extending 2 | ========= 3 | 4 | Writing new estimators is easy. One way of doing this is by writing a `estimator conforming to the sickit-learn protocol `_, and then wrapping it with :func:`ibex.frame` (see :ref:`adapting`). A different way is writing it directly as a :mod:`pandas` estimator. This might be the only way to go, if the logic of the estimator is ``pandas`` specific. This chapter shows how to write a new estimator from scratch. 5 | 6 | 7 | Example Transformation 8 | ---------------------- 9 | 10 | Suppose we have a :class:`pandas.DataFrame` like this: 11 | 12 | >>> import numpy as np 13 | >>> import pandas as pd 14 | >>> 15 | >>> df = pd.DataFrame({'a': [1, 3, 2, 1, 2], 'b': range(5), 'c': range(2, 7)}) 16 | >>> df 17 | a b c 18 | 0 1 0 2 19 | 1 3 1 3 20 | 2 2 2 4 21 | 3 1 3 5 22 | 4 2 4 6 23 | 24 | We think that, for each row, the mean values of ``'b'`` and ``'c'``, aggregated by ``'a'``, might make a useful feature. In ``pandas``, we could write this as follows: 25 | 26 | >>> df.groupby(df.a).transform(np.mean) 27 | b c 28 | 0 1.5 3.5 29 | 1 1.0 3.0 30 | 2 3.0 5.0 31 | 3 1.5 3.5 32 | 4 3.0 5.0 33 | 34 | 35 | We now want write a transformer to do this, in order to use it for more general settings (e.g., `cross validation `_). 36 | 37 | 38 | Writing A New Transformer Step 39 | ------------------------------ 40 | 41 | We can write a (slightly more general) estimator, as follows: 42 | 43 | >>> from sklearn import base 44 | >>> import ibex 45 | 46 | >>> class GroupbyAggregator( 47 | ... base.BaseEstimator, # (1) 48 | ... base.TransformerMixin, # (2) 49 | ... ibex.FrameMixin): # (3) 50 | ... 51 | ... def __init__(self, group_col, agg_func=np.mean): 52 | ... self._group_col, self._agg_func = group_col, agg_func 53 | ... 54 | ... def fit(self, X, _=None): 55 | ... self.x_columns = X.columns # (4) 56 | ... self._agg = X.groupby(df[self._group_col]).apply(self._agg_func) 57 | ... return self 58 | ... 59 | ... def transform(self, X): 60 | ... Xt = X[self.x_columns] # (5) 61 | ... Xt = pd.merge( 62 | ... Xt[[self._group_col]], 63 | ... self._agg, 64 | ... how='left') 65 | ... return Xt[[c for c in Xt.columns if c != self._group_col]] 66 | 67 | 68 | Note the following general points: 69 | 70 | 1. We subclass :class:`sklearn.base.BaseEstimator`, as this is an estimator. 71 | 72 | 2. We subclass :class:`sklearn.base.TransformerMixin`, as, in this case, this is specifically a transformer. 73 | 74 | 3. We subclass :class:`ibex.FrameMixin`, as this estimator deals with ``pandas`` entities. 75 | 76 | 4. In ``fit``, we make sure to set :py:attr:`ibex.FrameMixin.x_columns`; this will ensure that the transformer will "remember" the columns it should see in further calls. 77 | 78 | 5. In ``transform``, we first use ``x_columns``. This will verify the columns of ``X``, and also reorder them according to the original order seen in ``fit`` (if needed). 79 | 80 | The rest is logic specific to this transformer. 81 | 82 | * In ``__init__``, the group column and aggregation function are stored. 83 | 84 | * In ``fit``, ``X`` is aggregated by the group column according to the aggregation function, and the result is recorded. 85 | 86 | * In ``transform``, ``X`` (which is not necessarily the one used in ``fit``) is left-merged with the aggregation result, and then the relevant columns of the result are returned. 87 | 88 | | 89 | 90 | We can now use this as a regular step. If we fit it on ``df`` and transform it on the same ``df``, we get the result above: 91 | 92 | 93 | >>> GroupbyAggregator('a').fit(df).transform(df) 94 | b c 95 | 0 1.5 3.5 96 | 1 1.0 3.0 97 | 2 3.0 5.0 98 | 3 1.5 3.5 99 | 4 3.0 5.0 100 | 101 | 102 | We can, however, now use it for fitting on one ``DataFrame``, and transforming another: 103 | 104 | >>> try: 105 | ... from sklearn.model_selection import train_test_split 106 | ... except: # Older sklearn versions 107 | ... from ibex.sklearn.cross_validation import train_test_split 108 | >>> 109 | >>> tr, te = train_test_split(df, random_state=3) 110 | >>> GroupbyAggregator('a').fit(tr).transform(te) 111 | b c 112 | 0 0... 2... 113 | 1 2... 4... 114 | 115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /ibex/sklearn/_regression_coef_intercept.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | 4 | import string 5 | 6 | import pandas as pd 7 | 8 | from .._base import _get_iris_example_doc_preamble_ as _get_iris_example_doc_preamble_ 9 | 10 | 11 | def coef_(self, base_ret): 12 | if len(base_ret.shape) == 1: 13 | return pd.Series(base_ret, index=self.x_columns) 14 | 15 | if len(base_ret.shape) == 2: 16 | index = self.y_columns 17 | return pd.DataFrame(base_ret, index=index, columns=self.x_columns) 18 | 19 | raise RuntimeError() 20 | 21 | 22 | def get_coef_doc( 23 | orig, 24 | name, 25 | est, 26 | kwargs, 27 | is_regressor, 28 | is_classifier, 29 | is_transformer, 30 | is_clusterer, 31 | has_dataframe_y): 32 | 33 | doc = _get_iris_example_doc_preamble_( 34 | is_regressor, 35 | is_classifier, 36 | is_transformer, 37 | is_clusterer, 38 | indent=0) + \ 39 | string.Template( 40 | r""" 41 | >>> from ibex.sklearn import $orig as pd_$orig 42 | >>> 43 | >>> prd = pd_$orig.$name($kwargs).fit(iris[features], iris['class']) 44 | >>> 45 | >>> prd.coef_ 46 | sepal length (cm) ... 47 | sepal width (cm) ... 48 | petal length (cm) ... 49 | petal width (cm) ... 50 | dtype: float64 51 | 52 | """).substitute({ 53 | 'orig': orig, 54 | 'name': name, 55 | 'est': est, 56 | 'kwargs': kwargs, 57 | 'is_regressor': is_regressor, 58 | 'is_classifier': is_classifier, 59 | 'is_transformer': is_transformer, 60 | 'is_clusterer': is_clusterer}) 61 | 62 | 63 | if has_dataframe_y: 64 | doc += string.Template( 65 | r""" 66 | 67 | Example: 68 | 69 | >>> from ibex.sklearn import $orig as pd_$orig 70 | >>> prd = pd_$orig.$name($kwargs).fit(iris[features], iris[['class', 'class']]) 71 | >>> 72 | >>> prd.coef_ 73 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) 74 | 0... 0.414988 1.461297 -2.262141 -1.029095 75 | 1... 0.416640 -1.600833 0.577658 -1.385538 76 | 2... -1.707525 -1.534268 2.470972 2.555382 77 | 78 | """).substitute({ 79 | 'orig': orig, 80 | 'name': name, 81 | 'est': est, 82 | 'kwargs': kwargs, 83 | 'is_regressor': is_regressor, 84 | 'is_classifier': is_classifier, 85 | 'is_transformer': is_transformer, 86 | 'is_clusterer': is_clusterer}) 87 | 88 | return doc 89 | 90 | 91 | def intercept_(self, base_ret): 92 | # Tmp Ami - replace next by is_nummeric or is_scalar 93 | if isinstance(base_ret, (type(1), type(1.), type(1 + 1j))): 94 | return base_ret 95 | 96 | if len(base_ret.shape) == 1: 97 | return pd.Series(base_ret) 98 | 99 | raise RuntimeError() 100 | 101 | 102 | def get_intercept_doc( 103 | orig, 104 | name, 105 | est, 106 | kwargs, 107 | is_regressor, 108 | is_classifier, 109 | is_transformer, 110 | is_clusterer, 111 | has_dataframe_y): 112 | 113 | doc = _get_iris_example_doc_preamble_( 114 | is_regressor, 115 | is_classifier, 116 | is_transformer, 117 | is_clusterer, 118 | indent=0) 119 | 120 | if not has_dataframe_y: 121 | doc += string.Template( 122 | r""" 123 | >>> 124 | >>> from ibex.sklearn import $orig as pd_$orig 125 | >>> 126 | >>> prd = pd_$orig.$name($kwargs).fit(iris[features], iris['class']) 127 | >>> 128 | >>> #scalar intercept 129 | >>> type(prd.intercept_) 130 | 131 | 132 | """).substitute({ 133 | 'orig': orig, 134 | 'name': name, 135 | 'est': est, 136 | 'kwargs': kwargs, 137 | 'is_regressor': is_regressor, 138 | 'is_classifier': is_classifier, 139 | 'is_transformer': is_transformer, 140 | 'is_clusterer': is_clusterer}) 141 | 142 | 143 | if has_dataframe_y: 144 | doc += string.Template( 145 | r""" 146 | 147 | >>> from ibex.sklearn import $orig as pd_$orig 148 | >>> prd = pd_$orig.$name($kwargs).fit(iris[features], iris[['class', 'class']]) 149 | >>> 150 | >>> prd.intercept_ 151 | sepal length (cm) ... 152 | sepal width (cm) ... 153 | petal length (cm) ... 154 | petal width (cm) ... 155 | dtype: float64 156 | 157 | """).substitute({ 158 | 'orig': orig, 159 | 'name': name, 160 | 'est': est, 161 | 'kwargs': kwargs, 162 | 'is_regressor': is_regressor, 163 | 'is_classifier': is_classifier, 164 | 'is_transformer': is_transformer, 165 | 'is_clusterer': is_clusterer}) 166 | 167 | return doc 168 | -------------------------------------------------------------------------------- /ibex/_function_transformer.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from six import string_types 4 | import pandas as pd 5 | from sklearn import base 6 | 7 | from ._base import FrameMixin 8 | from ._utils import verify_x_type, verify_y_type 9 | 10 | 11 | __all__ = [] 12 | 13 | 14 | def _process_cols(cols): 15 | if cols is None: 16 | return None 17 | 18 | return [cols] if isinstance(cols, string_types) else list(cols) 19 | 20 | 21 | # Tmp Ami - add kw_args, inverse shit 22 | class FunctionTransformer(base.BaseEstimator, base.TransformerMixin, FrameMixin): 23 | """ 24 | Transforms using a function. 25 | 26 | Arguments: 27 | 28 | func: One of: 29 | 30 | * ``None`` 31 | * a callable 32 | * a step 33 | 34 | in_cols: One of: 35 | 36 | * ``None`` 37 | * a string 38 | * a list of strings 39 | 40 | out_cols: 41 | 42 | pass_y: Boolean indicating whether to pass the ``y`` argument to 43 | 44 | kw_args: Keyword arguments. 45 | 46 | Returns: 47 | 48 | An :py:class:`sklearn.preprocessing.FunctionTransformer` object. 49 | """ 50 | def __init__(self, func=None, in_cols=None, out_cols=None, pass_y=None, kw_args=None): 51 | FrameMixin.__init__(self) 52 | 53 | params = { 54 | 'func': func, 55 | 'in_cols': in_cols, 56 | 'out_cols': out_cols, 57 | 'pass_y': pass_y, 58 | 'kw_args': kw_args, 59 | } 60 | 61 | self.set_params(**params) 62 | 63 | def fit(self, X, y=None): 64 | """ 65 | Fits the transformer using ``X`` (and possibly ``y``). 66 | 67 | Returns: 68 | 69 | ``self`` 70 | """ 71 | verify_x_type(X) 72 | verify_y_type(y) 73 | 74 | self.x_columns = X.columns 75 | 76 | if self.in_cols is not None: 77 | Xt = X[self.in_cols] 78 | else: 79 | Xt = X 80 | 81 | if self.func is None: 82 | return self 83 | 84 | if isinstance(self.func, FrameMixin): 85 | if self.pass_y: 86 | self.func.fit(Xt, y) 87 | else: 88 | self.func.fit(Xt) 89 | 90 | return self 91 | 92 | def fit_transform(self, X, y=None): 93 | """ 94 | Fits the transformer using ``X`` (and possibly ``y``), and transforms, in one 95 | step if possible 96 | 97 | Returns: 98 | 99 | Transformed data. 100 | """ 101 | verify_x_type(X) 102 | verify_y_type(y) 103 | 104 | if not isinstance(self.func, FrameMixin) or not hasattr(self.func, 'fit_transform'): 105 | if self.pass_y: 106 | return self.fit(X, y).transform(X, y) 107 | return self.fit(X).transform(X) 108 | 109 | self.x_columns = X.columns 110 | 111 | Xt = X[self.x_columns] 112 | 113 | in_cols = _process_cols(self.in_cols) 114 | 115 | if in_cols is not None: 116 | Xt = Xt[in_cols] 117 | 118 | if self.func is None: 119 | res = Xt 120 | elif isinstance(self.func, FrameMixin): 121 | if self.pass_y: 122 | res = self.func.fit_transform(Xt, y) 123 | else: 124 | res = self.func.fit_transform(Xt) 125 | else: 126 | if self.kw_args is not None: 127 | res = pd.DataFrame(self.func(Xt, **self.kw_args), index=Xt.index) 128 | else: 129 | res = pd.DataFrame(self.func(Xt), index=Xt.index) 130 | 131 | return self.__process_res(Xt, res) 132 | 133 | def transform(self, X, y=None): 134 | """ 135 | Returns: 136 | 137 | Transformed data. 138 | """ 139 | verify_x_type(X) 140 | verify_y_type(y) 141 | 142 | Xt = X[self.x_columns] 143 | 144 | in_cols = _process_cols(self.in_cols) 145 | 146 | if in_cols is not None: 147 | Xt = Xt[in_cols] 148 | 149 | if self.func is None: 150 | res = Xt 151 | elif isinstance(self.func, FrameMixin): 152 | if self.pass_y: 153 | res = self.func.transform(Xt, y) 154 | else: 155 | res = self.func.transform(Xt) 156 | else: 157 | if self.kw_args is not None: 158 | res = pd.DataFrame(self.func(Xt, **self.kw_args), index=Xt.index) 159 | else: 160 | res = pd.DataFrame(self.func(Xt), index=Xt.index) 161 | 162 | return self.__process_res(Xt, res) 163 | 164 | def __process_res(self, Xt, res): 165 | in_cols = _process_cols(self.in_cols) 166 | out_cols = _process_cols(self.out_cols) 167 | if out_cols is not None: 168 | res_cols = out_cols 169 | elif in_cols is not None: 170 | res_cols = in_cols 171 | else: 172 | res_cols = Xt.columns 173 | 174 | res = res.copy() 175 | res.columns = res_cols 176 | return res 177 | -------------------------------------------------------------------------------- /ibex/sklearn/_classification_coef_intercept.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | 4 | import string 5 | 6 | import pandas as pd 7 | 8 | from .._base import _get_iris_example_doc_preamble_ as _get_iris_example_doc_preamble_ 9 | 10 | 11 | def coef_(self, base_ret): 12 | if len(base_ret.shape) == 1: 13 | return pd.Series(base_ret, index=self.x_columns) 14 | 15 | if len(base_ret.shape) == 2: 16 | if base_ret.shape[0] == 1: 17 | return pd.DataFrame(base_ret, columns=self.x_columns) 18 | index = self.classes_ 19 | return pd.DataFrame(base_ret, index=index, columns=self.x_columns) 20 | 21 | raise RuntimeError() 22 | 23 | 24 | def get_coef_doc( 25 | orig, 26 | name, 27 | est, 28 | kwargs, 29 | is_regressor, 30 | is_classifier, 31 | is_transformer, 32 | is_clusterer, 33 | has_dataframe_y): 34 | 35 | doc = _get_iris_example_doc_preamble_( 36 | is_regressor, 37 | is_classifier, 38 | is_transformer, 39 | is_clusterer, 40 | indent=0) + \ 41 | string.Template( 42 | r""" 43 | >>> 44 | >>> from ibex.sklearn import $orig as pd_$orig 45 | >>> 46 | >>> clf = pd_$orig.$name($kwargs).fit(iris[features], iris['class']) 47 | >>> 48 | >>> clf.coef_ 49 | sepal length (cm) ... 50 | sepal width (cm) ... 51 | petal length (cm) ... 52 | petal width (cm) ... 53 | dtype: float64 54 | 55 | """).substitute({ 56 | 'orig': orig, 'name': name, 57 | 'est': est, 58 | 'kwargs': kwargs, 59 | 'is_regressor': is_regressor, 60 | 'is_classifier': is_classifier, 61 | 'is_transformer': is_transformer, 62 | 'is_clusterer': is_clusterer}) 63 | 64 | if has_dataframe_y: 65 | doc += string.Template( 66 | r""" 67 | 68 | 69 | Example: 70 | 71 | >>> from ibex.sklearn import $orig as pd_$orig 72 | >>> 73 | >>> clf = pd_$orig.$name($kwargs).fit(iris[features], iris[['class', 'class']]) 74 | >>> 75 | >>> clf.coef_ 76 | sepal length (cm) sepal width (cm) petal length (cm) 77 | setosa ... 78 | versicolor ... 79 | virginica ... 80 | 81 | petal width (cm) 82 | setosa ... 83 | versicolor ... 84 | virginica ... 85 | """).substitute({ 86 | 'orig': orig, 87 | 'name': name, 88 | 'est': est, 89 | 'kwargs': kwargs, 90 | 'is_regressor': is_regressor, 91 | 'is_classifier': is_classifier, 92 | 'is_transformer': is_transformer, 93 | 'is_clusterer': is_clusterer}) 94 | 95 | return doc 96 | 97 | 98 | def intercept_(self, base_ret): 99 | 100 | # Tmp Ami - replace next by is_nummeric or is_scalar 101 | if isinstance(base_ret, (type(1), type(1.), type(1 + 1j))): 102 | return base_ret 103 | 104 | if len(base_ret.shape) == 1: 105 | return pd.Series(base_ret) 106 | 107 | raise RuntimeError() 108 | 109 | 110 | def get_intercept_doc( 111 | orig, 112 | name, 113 | est, 114 | kwargs, 115 | is_regressor, 116 | is_classifier, 117 | is_transformer, 118 | is_clusterer, 119 | has_dataframe_y): 120 | 121 | doc = _get_iris_example_doc_preamble_( 122 | is_regressor, 123 | is_classifier, 124 | is_transformer, 125 | is_clusterer, 126 | indent=0) + \ 127 | string.Template( 128 | r""" 129 | >>> from ibex.sklearn import $orig as pd_$orig 130 | >>> 131 | >>> clf = pd_$orig.$name($kwargs).fit(iris[features], iris['class']) 132 | >>> 133 | >>> clf.intercept_ 134 | sepal length (cm) ... 135 | sepal width (cm) ... 136 | petal length (cm) ... 137 | petal width (cm) ... 138 | dtype: float64 139 | 140 | """).substitute({ 141 | 'orig': orig, 142 | 'name': name, 143 | 'est': est, 144 | 'kwargs': kwargs, 145 | 'is_regressor': is_regressor, 146 | 'is_classifier': is_classifier, 147 | 'is_transformer': is_transformer, 148 | 'is_clusterer': is_clusterer}) 149 | 150 | 151 | if has_dataframe_y: 152 | doc += string.Template( 153 | r""" 154 | Example: 155 | 156 | >>> 157 | >>> from ibex.sklearn import $orig as pd_$orig 158 | >>> 159 | >>> clf = pd_$orig.$name($kwargs).fit(iris[features], iris[['class', 'class']]) 160 | >>> 161 | >>> clf.intercept_ 162 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) 163 | 0... 164 | 1... 165 | 2... 166 | 167 | """).substitute({ 168 | 'orig': orig, 169 | 'name': name, 170 | 'est': est, 171 | 'kwargs': kwargs, 172 | 'is_regressor': is_regressor, 173 | 'is_classifier': is_classifier, 174 | 'is_transformer': is_transformer, 175 | 'is_clusterer': is_clusterer}) 176 | 177 | return doc 178 | -------------------------------------------------------------------------------- /ibex/sklearn/_cross_val_predict.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | try: 4 | from sklearn.model_selection import cross_val_predict as _orig_cross_val_predict 5 | except ImportError: 6 | from sklearn.cross_validation import cross_val_predict as _orig_cross_val_predict 7 | import pandas as pd 8 | 9 | from .._xy_estimator import make_estimator, make_xy 10 | from .._utils import verify_x_type, verify_y_type 11 | from .__init__ import _sklearn_ver 12 | 13 | 14 | def cross_val_predict( 15 | estimator, 16 | X, 17 | y=None, 18 | groups=None, 19 | cv=None, 20 | n_jobs=1, 21 | verbose=0, 22 | fit_params=None, 23 | pre_dispatch='2*n_jobs', 24 | method='predict'): 25 | """ 26 | Generate cross-validated estimates for each input data point. 27 | 28 | Arguments: 29 | 30 | estimator: estimator object implementing 'fit' and 'predict' 31 | The object to use to fit the data. 32 | X: :class:`pandas.DataFrame` 33 | The data to fit. 34 | y: The target variable to try to predict in the case of 35 | supervised learning. 36 | groups : array-like, with shape (n_samples,), optional 37 | Group labels for the samples used while splitting the dataset into 38 | train/test set. 39 | cv : int, cross-validation generator or an iterable, optional 40 | Determines the cross-validation splitting strategy. 41 | Possible inputs for cv are: 42 | 43 | - ``None``, to use the default 3-fold cross validation, 44 | - integer, to specify the number of folds in a `(Stratified)KFold`, 45 | - An object to be used as a cross-validation generator. 46 | - An iterable yielding train, test splits. 47 | 48 | For integer/``None`` inputs, if the estimator is a classifier and ``y`` is 49 | either binary or multiclass, :class:`StratifiedKFold` is used. In all 50 | other cases, :class:`KFold` is used. 51 | Refer :ref:`User Guide ` for the various 52 | cross-validation strategies that can be used here. 53 | 54 | n_jobs : integer, optional 55 | The number of CPUs to use to do the computation. -1 means 56 | 'all CPUs'. 57 | verbose : integer, optional 58 | The verbosity level. 59 | fit_params : dict, optional 60 | Parameters to pass to the fit method of the estimator. 61 | pre_dispatch : int, or string, optional 62 | Controls the number of jobs that get dispatched during parallel 63 | execution. Reducing this number can be useful to avoid an 64 | explosion of memory consumption when more jobs get dispatched 65 | than CPUs can process. This parameter can be: 66 | 67 | - ``None``, in which case all the jobs are immediately 68 | created and spawned. Use this for lightweight and 69 | fast-running jobs, to avoid delays due to on-demand 70 | spawning of the jobs 71 | - An int, giving the exact number of total jobs that are 72 | spawned 73 | - A string, giving an expression as a function of n_jobs, 74 | as in '2*n_jobs' 75 | 76 | method : string, optional, default: 'predict' 77 | Invokes the passed method name of the passed estimator. 78 | 79 | Returns: 80 | 81 | :class:`pandas.DataFrame` or :class:`pandas.Series` (depending on ``y``). 82 | 83 | Example: 84 | 85 | >>> import pandas as pd 86 | >>> from ibex.sklearn.linear_model import LinearRegression 87 | >>> try: 88 | ... from ibex.sklearn.model_selection import cross_val_predict 89 | ... except: # Older sklearn versions 90 | ... from ibex.sklearn.cross_validation import cross_val_predict 91 | 92 | >>> df = pd.DataFrame({ 93 | ... 'x': range(100), 94 | ... 'y': range(100), 95 | ... }, 96 | ... index=['i%d' % i for i in range(100)]) 97 | 98 | >>> cross_val_predict( 99 | ... LinearRegression(), 100 | ... df[['x']], 101 | ... df['y']) 102 | i0 ... 103 | i1 ... 104 | i2 ... 105 | i3 ... 106 | i4 ... 107 | i5 ... 108 | ... 109 | 110 | """ 111 | verify_x_type(X) 112 | verify_y_type(y) 113 | 114 | est = make_estimator(estimator, X.index) 115 | X_, y_ = make_xy(X, y) 116 | if _sklearn_ver > 17: 117 | y_hat = _orig_cross_val_predict( 118 | est, 119 | X_, 120 | y_, 121 | groups, 122 | cv, 123 | n_jobs, 124 | verbose, 125 | fit_params, 126 | pre_dispatch, 127 | method) 128 | else: 129 | if groups is not None: 130 | raise ValueError('groups not supported for cross_val_predict in this version of sklearn') 131 | if method != 'predict': 132 | raise ValueError('method not supported for cross_val_predict in this version of sklearn') 133 | y_hat = _orig_cross_val_predict( 134 | est, 135 | X_, 136 | y_, 137 | cv, 138 | n_jobs, 139 | verbose, 140 | fit_params, 141 | pre_dispatch) 142 | 143 | if len(y_hat.shape) == 1: 144 | return pd.Series(y_hat, index=y.index) 145 | else: 146 | return pd.DataFrame(y_hat, index=y.index) 147 | -------------------------------------------------------------------------------- /ibex/sklearn/_decomposition.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | 4 | import inspect 5 | 6 | import pandas as pd 7 | from sklearn import base 8 | from sklearn import decomposition as orig 9 | 10 | from .._adapter import frame_ex 11 | from .._utils import set_lowest_level_column_names 12 | 13 | 14 | def transform(self, base_ret): 15 | if isinstance(base_ret, pd.DataFrame): 16 | set_lowest_level_column_names( 17 | base_ret, 18 | ['comp_%i' % i for i in range(len(base_ret.columns))]) 19 | return base_ret 20 | 21 | 22 | def get_transform_doc( 23 | orig, 24 | name, 25 | est, 26 | kwargs, 27 | is_regressor, 28 | is_classifier, 29 | is_transformer, 30 | is_clusterer, 31 | has_dataframe_y): 32 | 33 | return r""" 34 | Example: 35 | 36 | >>> import pandas as pd 37 | >>> import numpy as np 38 | >>> from ibex.sklearn import datasets 39 | >>> from ibex.sklearn.decomposition import PCA as PdPCA 40 | 41 | >>> iris = datasets.load_iris() 42 | >>> features = iris['feature_names'] 43 | >>> iris = pd.DataFrame( 44 | ... np.c_[iris['data'], iris['target']], 45 | ... columns=features+['class']) 46 | 47 | >>> iris[features] 48 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) 49 | 0 5.1 3.5 1.4 0.2 50 | 1 4.9 3.0 1.4 0.2 51 | 2 4.7 3.2 1.3 0.2 52 | 3 4.6 3.1 1.5 0.2 53 | 4 5.0 3.6 1.4 0.2 54 | ... 55 | 56 | >>> PdPCA(n_components=2).fit(iris[features], iris['class']).transform(iris[features]) 57 | comp_0 comp_1 58 | 0 -2.684207 ...0.326607 59 | 1 -2.715391 ...0.169557 60 | 2 -2.889820 ...0.137346 61 | 3 -2.746437 ...0.311124 62 | 4 -2.728593 ...0.333925 63 | ... 64 | 65 | """ 66 | 67 | 68 | def fit_transform(self, base_ret): 69 | if isinstance(base_ret, pd.DataFrame): 70 | set_lowest_level_column_names( 71 | base_ret, 72 | ['comp_%i' % i for i in range(len(base_ret.columns))]) 73 | return base_ret 74 | 75 | 76 | def get_fit_transform_doc( 77 | orig, 78 | name, 79 | est, 80 | kwargs, 81 | is_regressor, 82 | is_classifier, 83 | is_transformer, 84 | is_clusterer, 85 | has_dataframe_y): 86 | return r""" 87 | Example: 88 | 89 | >>> import pandas as pd 90 | >>> import numpy as np 91 | >>> from ibex.sklearn import datasets 92 | >>> from ibex.sklearn.decomposition import PCA as PdPCA 93 | 94 | >>> iris = datasets.load_iris() 95 | >>> features = iris['feature_names'] 96 | >>> iris = pd.DataFrame( 97 | ... np.c_[iris['data'], iris['target']], 98 | ... columns=features+['class']) 99 | 100 | >>> iris[features] 101 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) 102 | 0 5.1 3.5 1.4 0.2 103 | 1 4.9 3.0 1.4 0.2 104 | 2 4.7 3.2 1.3 0.2 105 | 3 4.6 3.1 1.5 0.2 106 | 4 5.0 3.6 1.4 0.2 107 | ... 108 | 109 | >>> PdPCA(n_components=2).fit(iris[features], iris['class']).transform(iris[features]) 110 | comp_0 comp_1 111 | 0 -2.684207 ...0.326607 112 | 1 -2.715391 ...0.169557 113 | 2 -2.889820 ...0.137346 114 | 3 -2.746437 ...0.311124 115 | 4 -2.728593 ...0.333925 116 | ... 117 | 118 | """ 119 | 120 | 121 | def components_(self, base_ret): 122 | return pd.DataFrame( 123 | base_ret, 124 | index=['comp_%i' % i for i in range(len(base_ret))], 125 | columns=self.x_columns) 126 | 127 | 128 | def get_components_doc( 129 | orig, 130 | name, 131 | est, 132 | kwargs, 133 | is_regressor, 134 | is_classifier, 135 | is_transformer, 136 | is_clusterer, 137 | has_dataframe_y): 138 | return r""" 139 | Example: 140 | 141 | >>> import pandas as pd 142 | >>> import numpy as np 143 | >>> from ibex.sklearn import datasets 144 | >>> from ibex.sklearn.decomposition import PCA as PdPCA 145 | 146 | >>> iris = datasets.load_iris() 147 | >>> features = iris['feature_names'] 148 | >>> iris = pd.DataFrame( 149 | ... np.c_[iris['data'], iris['target']], 150 | ... columns=features+['class']) 151 | 152 | >>> iris[features] 153 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) 154 | 0 5.1 3.5 1.4 0.2 155 | 1 4.9 3.0 1.4 0.2 156 | 2 4.7 3.2 1.3 0.2 157 | 3 4.6 3.1 1.5 0.2 158 | 4 5.0 3.6 1.4 0.2 159 | ... 160 | 161 | >>> PdPCA(n_components=2).fit(iris[features], iris['class']).transform(iris[features]) 162 | comp_0 comp_1 163 | 0 -2.684207 ...0.326607 164 | 1 -2.715391 ...0.169557 165 | 2 -2.889820 ...0.137346 166 | 3 -2.746437 ...0.311124 167 | 4 -2.728593 ...0.333925 168 | ... 169 | 170 | """ 171 | -------------------------------------------------------------------------------- /docs/source/tensorflow.rst: -------------------------------------------------------------------------------- 1 | .. _tensorflow: 2 | 3 | ``tensorflow`` 4 | =========== 5 | 6 | .. versionadded:: 1.2 7 | 8 | 9 | 10 | General Idea 11 | ------------ 12 | 13 | Ibex wraps :mod:`tensorflow.contrib.keras.wrappers.scikit_learn`, which has only two scikit-learn type estimators: :class:`tensorflow.contrib.keras.wrappers.scikit_learn.KerasClassifier` and :class:`tensorflow.contrib.keras.wrappers.scikit_learn.KerasRegressor`), with a number of changes to make them more 14 | `scikit-learn compliant `_ (see :ref:`tensorflow_diffs`). 15 | 16 | 17 | 18 | .. note:: 19 | 20 | Ibex does not *require* the installation of :mod:`tensorflow`. If ``tensorflow`` is not installed on the system, though, then this module will not be available. 21 | 22 | 23 | .. tip:: 24 | 25 | Ibex does not modify the code of ``tensorflow`` in any way. It is absolutely possibly to ``import`` and use both ``tensorflow`` and ``ibex.tensorflow`` simultaneously. 26 | 27 | 28 | .. seealso:: 29 | 30 | * See :mod:`ibex.tensorflow.contrib.keras.wrappers.scikit_learn` in :ref:`api`. 31 | 32 | * See `Tensorflow/Keras Classification In The Iris Dataset `_ in :ref:`examples`. 33 | 34 | 35 | .. _tensorflow_diffs: 36 | 37 | Differences From :mod:`tensorflow.contrib.keras.wrappers.scikit_learn` 38 | ---------------------------------------------------------------------- 39 | 40 | :mod:`ibex.tensorflow.contrib.keras.wrappers.scikit_learn` differs from the estimators of :mod:`tensorflow.contrib.keras.wrappers.scikit_learn`, which it wraps, in three ways: 41 | 42 | 1. In :mod:`ibex.tensorflow.contrib.keras.wrappers.scikit_learn`, :class:`KerasClassifier` subclasses :class:`sklearn.base.ClassifierMixin`, and :class:`KerasClassifier` subclasses :class:`sklearn.base.ClassifierMixin`. 43 | 44 | .. uml:: 45 | :caption: Use and absense of subclassing mixins from :mod:`sklearn.base`. 46 | 47 | skinparam monochrome true 48 | skinparam shadowing false 49 | 50 | namespace tensorflow.contrib.keras.wrappers.scikit_learn { 51 | class KerasClassifier 52 | class KerasRegressor 53 | } 54 | 55 | namespace ibex.tensorflow.contrib.keras.wrappers.scikit_learn { 56 | .KerasClassifier --> sklearn.base.ClassifierMixin 57 | .KerasRegressor --> sklearn.base.RegressorMixin 58 | } 59 | 60 | namespace sklearn.base { 61 | class ClassifierMixin 62 | class RegressorMixin 63 | } 64 | 65 | 2. In :mod:`tensorflow.contrib.keras.wrappers.scikit_learn`, :class:`KerasClassifier` and :class:`KerasRegressor` each have a ``fit`` method which returns a :class:`tensorflow.keras.History` object. E.g., starting with 66 | 67 | >>> import pandas as pd 68 | >>> import numpy as np 69 | >>> from ibex.sklearn import datasets 70 | >>> from ibex.sklearn.linear_model import LinearRegression as PdLinearRegression 71 | >>> import tensorflow 72 | ... 73 | ... 74 | >>> iris = datasets.load_iris() 75 | >>> features = iris['feature_names'] 76 | >>> iris = pd.DataFrame( 77 | ... np.c_[iris['data'], iris['target']], 78 | ... columns=features+['class']) 79 | ... 80 | >>> def build_regressor_nn(): 81 | ... model = tensorflow.contrib.keras.models.Sequential() 82 | ... model.add( 83 | ... tensorflow.contrib.keras.layers.Dense(20, input_dim=4, activation='relu')) 84 | ... model.add( 85 | ... tensorflow.contrib.keras.layers.Dense(1)) 86 | ... model.compile(loss='mean_squared_error', optimizer='adagrad') 87 | ... return model 88 | ... 89 | >>> prd = tensorflow.contrib.keras.wrappers.scikit_learn.KerasRegressor( 90 | ... build_fn=build_regressor_nn, 91 | ... verbose=0) 92 | 93 | Then 94 | 95 | >>> prd.fit(iris[features].values, iris['class'].values) 96 | 97 | 98 | This differs from the usual convention in :mod:`sklearn`: 99 | 100 | >>> prd.fit(iris[features].values, iris['class'].values).predict(iris[features].values) 101 | Traceback (most recent call last): 102 | ... 103 | AttributeError: 'History' object has no attribute 'predict' 104 | 105 | This differs from the usual convention in :mod:`sklearn` of allowing chained methods: 106 | 107 | Conversely, in :mod:`ibex.tensorflow.contrib.keras.wrappers.scikit_learn`, ``history_`` is an attribute of an estimator following ``fit``: 108 | 109 | >>> import ibex 110 | >>> prd = ibex.tensorflow.contrib.keras.wrappers.scikit_learn.KerasRegressor( 111 | ... build_fn=build_regressor_nn, 112 | ... verbose=0) 113 | >>> prd.fit(iris[features], iris['class']) 114 | Adapter[KerasRegressor](...build_fn=>> prd.history_ 116 | 117 | >>> prd.fit(iris[features], iris['class']).predict(iris[features]) 118 | 0 ... 119 | 1 ... 120 | 2 ... 121 | 3 ... 122 | 4 ... 123 | 124 | 3. In :mod:`ibex.tensorflow.contrib.keras.wrappers.scikit_learn`, :class:`KerasClassifier` takes a one-hot encoding of the dependent variable. For example, using the above dataset, if we have 125 | 126 | >>> iris['class'].head() 127 | 0 0... 128 | 1 0... 129 | 2 0... 130 | 3 0... 131 | 4 0... 132 | Name: class, dtype: float64 133 | 134 | then `fit` needs to be used on something like 135 | 136 | >>> pd.get_dummies(iris['class']).head() 137 | 0... 1... 2... 138 | 0 1... 0... 0... 139 | 1 1... 0... 0... 140 | 2 1... 0... 0... 141 | 3 1... 0... 0... 142 | 4 1... 0... 0... 143 | 144 | which is nonstandard. 145 | 146 | Conversely, in :mod:`ibex.tensorflow.contrib.keras.wrappers.scikit_learn`, the dependent variable is a :clas:`pandas.Series` (see ee `Tensorflow/Keras Classification In The Iris Dataset `_ in :ref:`examples`). 147 | 148 | -------------------------------------------------------------------------------- /docs/source/function_transformer.rst: -------------------------------------------------------------------------------- 1 | .. _function_transformer: 2 | 3 | Transforming 4 | ============ 5 | 6 | This chapter describes the :py:func:`ibex.trans` function, which allows 7 | 8 | #. applying functions or estimators to :class:`pandas.DataFrame` objects 9 | 10 | #. selecting a subset of columns for applications 11 | 12 | #. naming the output columns of the results 13 | 14 | or any combination of these. 15 | 16 | 17 | We'll use a ``DataFrame`` ``X``, with columns ``'a'`` and ``'b'``, and (implied) index ``1, 2, 3``, 18 | 19 | >>> import pandas as pd 20 | >>> X = pd.DataFrame({'a': [1, 2], 'b': [3, 4]}) 21 | 22 | and also import ``trans``: 23 | 24 | >>> from ibex import trans 25 | 26 | 27 | Specifying Functions 28 | -------------------- 29 | 30 | The (positionally first) ``func`` argument allows specifying the transformation to apply. 31 | 32 | This can be ``None``, meaning that the output should be the input: 33 | 34 | >>> trans().fit_transform(X) 35 | a b 36 | 0 1 3 37 | 1 2 4 38 | 39 | .. tip:: 40 | 41 | :ref:`function_transformer_specifying_output_columns` and :ref:`function_transformer_multiple_transformations` show uses for this. 42 | 43 | The ``func`` argument can alternatively be a function, which will be applied to the 44 | :attr:`pandas.DataFrame.values` of the input: 45 | 46 | >>> import numpy as np 47 | >>> trans(np.sqrt).fit_transform(X) 48 | a b 49 | 0 1.000000 1.732051 50 | 1 1.414214 2.000000 51 | 52 | Finally, it can be a different estimator: 53 | 54 | >>> from ibex.sklearn.decomposition import PCA 55 | >>> trans(PCA(n_components=2)).fit_transform(X) 56 | a b 57 | 0 -0.707107 ... 58 | 1 0.707107 ... 59 | 60 | 61 | Specifying Input Columns 62 | ------------------------ 63 | 64 | The (positionally second) ``in_cols`` argument allows specifying the columns to which to apply the function. 65 | 66 | If it is ``None``, then the function will be applied to all columns. 67 | 68 | If it is a string, the function will be applied to the ``DataFrame`` consisting of the single column corresponding to this string: 69 | 70 | >>> trans(None, 'a').fit_transform(X) 71 | a 72 | 0 1 73 | 1 2 74 | >>> trans(np.sqrt, 'a').fit_transform(X) 75 | a 76 | 0 1.000000 77 | 1 1.414214 78 | >>> trans(PCA(n_components=1), 'a').fit_transform(X) 79 | a 80 | 0 -0.5 81 | 1 0.5 82 | 83 | 84 | If it is a ``list`` of strings, the function will be applied to the ``DataFrame`` consisting of the columns corresponding to these strings: 85 | 86 | 87 | >>> trans(None, ['a']).fit_transform(X) 88 | a 89 | 0 1 90 | 1 2 91 | >>> trans(np.sqrt, ['a']).fit_transform(X) 92 | a 93 | 0 1.000000 94 | 1 1.414214 95 | >>> trans(PCA(n_components=1), ['a']).fit_transform(X) 96 | a 97 | 0 -0.5 98 | 1 0.5 99 | 100 | 101 | .. _function_transformer_specifying_output_columns: 102 | 103 | Specifying Output Columns 104 | ------------------------- 105 | 106 | The (positionally third) ``out_cols`` argument allows specifying the names of the columns of the result. 107 | 108 | If it is ``None``, then the output columns will be as explained in 109 | :ref:`_verification_and_processing_output_dataframe_columns` 110 | in 111 | :ref:`_verification_and_processing`: 112 | 113 | >>> trans(np.sqrt, out_cols=None).fit_transform(X) 114 | a b 115 | 0 1.000000 1.732051 116 | 1 1.414214 2.000000 117 | 118 | If it is a string, it will become the (single) column of the resulting ``DataFrame``. 119 | 120 | >>> trans(PCA(n_components=1), out_cols='pc').fit_transform(X) 121 | pc 122 | 0 -0.707107 123 | 1 0.707107 124 | 125 | If it is a ``list`` of strings, these will become the columns of the resulting ``DataFrame``. 126 | 127 | >>> trans(out_cols=['c', 'd']).fit_transform(X) 128 | c d 129 | 0 1 3 130 | 1 2 4 131 | 132 | >>> trans(np.sqrt, out_cols=['c', 'd']).fit_transform(X) 133 | c d 134 | 0 1.000000 1.732051 135 | 1 1.414214 2.000000 136 | >>> trans(PCA(n_components=2), out_cols=['pc1', 'pc2']).fit_transform(X) 137 | pc1 pc2 138 | 0 -0.707107 ... 139 | 1 0.707107 ... 140 | 141 | .. tip:: 142 | 143 | As can be seen from the first of the examples just above, this can be used to build a step that simply changes the column names of a ``DataFrame``. 144 | 145 | 146 | Specifying Combinations 147 | ----------------------------------- 148 | 149 | Of course, you can combine the arguments specified above: 150 | 151 | >>> trans(None, 'a', 'c').fit_transform(X) 152 | c 153 | 0 1 154 | 1 2 155 | 156 | >>> trans(None, ['a'], ['c']).fit_transform(X) 157 | c 158 | 0 1 159 | 1 2 160 | 161 | >>> trans(np.sqrt, ['a', 'b'], ['c', 'd']).fit_transform(X) 162 | c d 163 | 0 1.000000 1.732051 164 | 1 1.414214 2.000000 165 | 166 | >>> trans(PCA(n_components=1), 'a', 'pc').fit_transform(X) 167 | pc 168 | 0 -0.5 169 | 1 0.5 170 | 171 | 172 | .. _function_transformer_multiple_transformations: 173 | 174 | Multiple Transformations 175 | ------------------------ 176 | 177 | Applying multiple transformations on a single ``DataFrame`` is no different than any other case of uniting features (see :ref:`feature_union`). In particular, it's possible to succinctly use the ``+`` operator: 178 | 179 | >>> trn = trans(np.sin, 'a', 'sin_a') + trans(np.cos, 'b', 'cos_b') 180 | >>> trn.fit_transform(X) 181 | functiontransformer_0 functiontransformer_1 182 | sin_a cos_b 183 | 0 0.841471 -0.989992 184 | 1 0.909297 -0.653644 185 | 186 | >>> trn = trans() + trans(np.sin, 'a', 'sin_a') + trans(np.cos, 'b', 'cos_b') 187 | >>> trn.fit_transform(X) 188 | functiontransformer_0 functiontransformer_1 functiontransformer_2 189 | a b sin_a cos_b 190 | 0 1 3 0.841471 -0.989992 191 | 1 2 4 0.909297 -0.653644 192 | 193 | 194 | .. tip:: 195 | 196 | As can be seen from the last of the examples just above, this can be used to build a step that simply adds to the 197 | existing columns of some ``DataFrame``. 198 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Ibex 2 | ==== 3 | 4 | 5 | Ami Tavory, Shahar Azulay, Tali Raveh-Sadka 6 | 7 | .. image:: https://travis-ci.org/atavory/ibex.svg?branch=master 8 | :target: https://travis-ci.org/atavory/ibex 9 | 10 | .. image:: https://landscape.io/github/atavory/ibex/master/landscape.svg?style=flat 11 | :target: https://landscape.io/github/atavory/ibex/master 12 | 13 | .. image:: https://img.shields.io/codecov/c/github/atavory/ibex/master.svg 14 | :target: https://codecov.io/gh/atavory/ibex/ 15 | 16 | .. image:: http://readthedocs.org/projects/ibex/badge/?version=latest 17 | :target: http://ibex.readthedocs.io/en/latest/index.html 18 | 19 | .. image:: https://img.shields.io/badge/license-BSD--3--Clause-brightgreen.svg 20 | :target: https://raw.githubusercontent.com/atavory/ibex/master/LICENSE.txt 21 | 22 | .. image:: https://badge.fury.io/py/ibex.svg 23 | :target: https://badge.fury.io/py/ibex 24 | 25 | 26 | This library aims for two (somewhat independent) goals: 27 | 28 | * providing `pandas `_ adapters for `estimators conforming to the scikit-learn protocol `_, in particular those of `scikit-learn `_ itself 29 | 30 | * providing easier, and more succinct ways of combining estimators, features, and pipelines 31 | 32 | (You might also want to check out the excellent `pandas-sklearn `_ which has the same aims, but takes a very different 33 | approach.) 34 | 35 | The full documentation at |rtd_ibex|_ defines these matters in detail, but the library has an extremely-small `interface `_. 36 | 37 | 38 | .. |rtd_ibex| image:: http://ibex.readthedocs.io/en/latest/_static/read_the_docs.png 39 | .. _rtd_ibex: https://atavory.github.io/ibex/ 40 | 41 | 42 | TL;DR 43 | ----- 44 | 45 | The following short example shows the main points of the library. It is an adaptation of the scikit-learn example `Concatenating multiple feature extraction methods `_. In this example, we build a classifier for the `iris dataset `_ using a combination of `PCA `_, `univariate feature selection `_, and a `support vecor machine classifier `_. 46 | 47 | We first load the Iris dataset into a pandas ``DataFrame``. 48 | 49 | >>> import numpy as np 50 | >>> from sklearn import datasets 51 | >>> import pandas as pd 52 | >>> 53 | >>> iris = datasets.load_iris() 54 | >>> features, targets, iris = iris['feature_names'], iris['target_names'], pd.DataFrame( 55 | ... np.c_[iris['data'], iris['target']], 56 | ... columns=iris['feature_names']+['class']) 57 | >>> iris['class'] = iris['class'].map(pd.Series(targets)) 58 | >>> 59 | >>> iris.head() 60 | sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) \ 61 | 0 5.1 3.5 1.4 0.2 62 | 1 4.9 3.0 1.4 0.2 63 | 2 4.7 3.2 1.3 0.2 64 | 3 4.6 3.1 1.5 0.2 65 | 4 5.0 3.6 1.4 0.2 66 | 67 | class 68 | 0 setosa 69 | 1 setosa 70 | 2 setosa 71 | 3 setosa 72 | 4 setosa 73 | 74 | 75 | Now, we import the relevant steps. Note that, in this example, we import them from `ibex.sklearn` rather than `sklearn`. 76 | 77 | >>> from ibex.sklearn.svm import SVC as PdSVC 78 | >>> from ibex.sklearn.feature_selection import SelectKBest as PdSelectKBest 79 | >>> from ibex.sklearn.decomposition import PCA as PdPCA 80 | 81 | (Of course, it's possible to import steps from `sklearn` as well, and use them alongside and together with the steps of `ibex.sklearn`.) 82 | 83 | Finally, we construct a pipeline that, given a ``DataFrame`` of features: 84 | 85 | * horizontally concatenates a 2-component PCA ``DataFrame``, and the best-feature ``DataFrame``, to a resulting ``DataFrame`` 86 | * then, passes the result to a support-vector machine classifier outputting a pandas series: 87 | 88 | 89 | >>> clf = PdPCA(n_components=2) + PdSelectKBest(k=1) | PdSVC(kernel="linear") 90 | 91 | ``clf`` is now a ``pandas``-ware classifier, but otherwise can be used pretty much like all ``sklearn`` estimator. For example, 92 | 93 | >>> param_grid = dict( 94 | ... featureunion__pca__n_components=[1, 2, 3], 95 | ... featureunion__selectkbest__k=[1, 2], 96 | ... svc__C=[0.1, 1, 10]) 97 | >>> try: 98 | ... from ibex.sklearn.model_selection import GridSearchCV as PdGridSearchCV 99 | ... except: # Accomodate older versions of sklearn 100 | ... from ibex.sklearn.grid_search import GridSearchCV as PdGridSearchCV 101 | >>> PdGridSearchCV(clf, param_grid=param_grid).fit(iris[features], iris['class']) # doctest: +SKIP 102 | ... 103 | 104 | So what does this add to the original version? 105 | 106 | #. The estimators perform `verification and processing `_ on the inputs and outputs. They verify column names following calls to ``fit``, and index results according to those of the inputs. This helps catch bugs. 107 | 108 | #. The results are much more interpretable: 109 | 110 | >>> svc = PdSVC(kernel="linear", probability=True) 111 | 112 | Find the coefficients of the boundaries between the different classes: 113 | 114 | >>> svc.fit(iris[features], iris['class']).coef_ 115 | sepal length (cm) sepal width (cm) petal length (cm) \ 116 | setosa -0.046259 0.521183 -1.003045 117 | versicolor -0.007223 0.178941 -0.538365 118 | virginica 0.595498 0.973900 -2.031000 119 | 120 | petal width (cm) 121 | setosa -0.464130 122 | versicolor -0.292393 123 | virginica -2.006303 124 | 125 | Predict belonging to classes: 126 | 127 | >>> svc.fit(iris[features], iris['class']).predict_proba(iris[features]) 128 | setosa versicolor virginica 129 | 0 0.97... 0.01... 0.00... 130 | ... 131 | 132 | Find the coefficients of the boundaries between the different classes in a pipeline: 133 | 134 | >>> clf = PdPCA(n_components=2) + PdSelectKBest(k=1) | svc 135 | >>> clf = clf.fit(iris[features], iris['class']) 136 | >>> svc.coef_ 137 | pca selectkbest 138 | comp_0 comp_1 petal length (cm) 139 | setosa -0.757016 ...0.376680 -0.575197 140 | versicolor -0.351218 ...0.141699 -0.317562 141 | virginica -1.529320 ...1.472771 -1.509391 142 | 143 | #. It allows `writinfitg Pandas-munging estimators `_ (see also `Multiple-Row Features In The Movielens Dataset `_). 144 | 145 | #. Using ``DataFrame`` metadata, it allows writing more complex meta-learning algorithms, such as stacking and nested labeled and stratified cross validation. 146 | 147 | #. The pipeline syntax is succinct and clear (see `Motivation For Shorter Combinations `_). 148 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 21 | 22 | .PHONY: help 23 | help: 24 | @echo "Please use \`make ' where is one of" 25 | @echo " html to make standalone HTML files" 26 | @echo " dirhtml to make HTML files named index.html in directories" 27 | @echo " singlehtml to make a single large HTML file" 28 | @echo " pickle to make pickle files" 29 | @echo " json to make JSON files" 30 | @echo " htmlhelp to make HTML files and a HTML help project" 31 | @echo " qthelp to make HTML files and a qthelp project" 32 | @echo " applehelp to make an Apple Help Book" 33 | @echo " devhelp to make HTML files and a Devhelp project" 34 | @echo " epub to make an epub" 35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 36 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 38 | @echo " text to make text files" 39 | @echo " man to make manual pages" 40 | @echo " texinfo to make Texinfo files" 41 | @echo " info to make Texinfo files and run them through makeinfo" 42 | @echo " gettext to make PO message catalogs" 43 | @echo " changes to make an overview of all changed/added/deprecated items" 44 | @echo " xml to make Docutils-native XML files" 45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 46 | @echo " linkcheck to check all external links for integrity" 47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 48 | @echo " spelling to run spellcheck" 49 | @echo " lint to run lint" 50 | @echo " coverage to run coverage check of the documentation (if enabled)" 51 | 52 | .PHONY: clean 53 | clean: 54 | rm -rf $(BUILDDIR)/* 55 | 56 | .PHONY: html 57 | html: 58 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 59 | @echo 60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 61 | 62 | .PHONY: dirhtml 63 | dirhtml: 64 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 65 | @echo 66 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 67 | 68 | .PHONY: singlehtml 69 | singlehtml: 70 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 71 | @echo 72 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 73 | 74 | .PHONY: pickle 75 | pickle: 76 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 77 | @echo 78 | @echo "Build finished; now you can process the pickle files." 79 | 80 | .PHONY: json 81 | json: 82 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 83 | @echo 84 | @echo "Build finished; now you can process the JSON files." 85 | 86 | .PHONY: htmlhelp 87 | htmlhelp: 88 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 89 | @echo 90 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 91 | ".hhp project file in $(BUILDDIR)/htmlhelp." 92 | 93 | .PHONY: qthelp 94 | qthelp: 95 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 96 | @echo 97 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 98 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 99 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ibex.qhcp" 100 | @echo "To view the help file:" 101 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ibex.qhc" 102 | 103 | .PHONY: pushhtml 104 | pushhtml: html 105 | cd $(BUILDDIR)/html; git add . ; git commit -m "rebuilt docs"; git push origin gh-pages 106 | 107 | .PHONY: applehelp 108 | applehelp: 109 | $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp 110 | @echo 111 | @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." 112 | @echo "N.B. You won't be able to view it unless you put it in" \ 113 | "~/Library/Documentation/Help or install it in your application" \ 114 | "bundle." 115 | 116 | .PHONY: devhelp 117 | devhelp: 118 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 119 | @echo 120 | @echo "Build finished." 121 | @echo "To view the help file:" 122 | @echo "# mkdir -p $$HOME/.local/share/devhelp/ibex" 123 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ibex" 124 | @echo "# devhelp" 125 | 126 | .PHONY: epub 127 | epub: 128 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 129 | @echo 130 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 131 | 132 | .PHONY: latex 133 | latex: 134 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 135 | @echo 136 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 137 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 138 | "(use \`make latexpdf' here to do that automatically)." 139 | 140 | .PHONY: latexpdf 141 | latexpdf: 142 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 143 | @echo "Running LaTeX files through pdflatex..." 144 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 145 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 146 | 147 | .PHONY: latexpdfja 148 | latexpdfja: 149 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 150 | @echo "Running LaTeX files through platex and dvipdfmx..." 151 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 152 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 153 | 154 | .PHONY: text 155 | text: 156 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 157 | @echo 158 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 159 | 160 | .PHONY: man 161 | man: 162 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 163 | @echo 164 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 165 | 166 | .PHONY: texinfo 167 | texinfo: 168 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 169 | @echo 170 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 171 | @echo "Run \`make' in that directory to run these through makeinfo" \ 172 | "(use \`make info' here to do that automatically)." 173 | 174 | .PHONY: info 175 | info: 176 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 177 | @echo "Running Texinfo files through makeinfo..." 178 | make -C $(BUILDDIR)/texinfo info 179 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 180 | 181 | .PHONY: gettext 182 | gettext: 183 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 184 | @echo 185 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 186 | 187 | .PHONY: changes 188 | changes: 189 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 190 | @echo 191 | @echo "The overview file is in $(BUILDDIR)/changes." 192 | 193 | .PHONY: linkcheck 194 | linkcheck: 195 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 196 | @echo 197 | @echo "Link check complete; look for any errors in the above output " \ 198 | "or in $(BUILDDIR)/linkcheck/output.txt." 199 | 200 | .PHONY: doctest 201 | doctest: 202 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 203 | @echo "Testing of doctests in the sources finished, look at the " \ 204 | "results in $(BUILDDIR)/doctest/output.txt." 205 | 206 | .PHONY: coverage 207 | coverage: 208 | $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage 209 | @echo "Testing of coverage in the sources finished, look at the " \ 210 | "results in $(BUILDDIR)/coverage/python.txt." 211 | 212 | .PHONY: xml 213 | xml: 214 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 215 | @echo 216 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 217 | 218 | .PHONY: pseudoxml 219 | pseudoxml: 220 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 221 | @echo 222 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 223 | 224 | .PHONY: spelling 225 | spelling: 226 | $(SPHINXBUILD) -b spelling -d $(BUILDDIR)/doctrees source/ $(BUILDDIR)/spelling 227 | @echo 228 | @echo "Build finished. The words are in $(BUILDDIR)/spelling" 229 | 230 | .PHONY: lint 231 | lint: 232 | rst-lint ../README.rst 233 | doc8 source/*.rst 234 | --------------------------------------------------------------------------------