From c3e8fb450597615f10536ffbe306f3c747eaedf6 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Tue, 29 Jun 2021 12:42:49 -0400 Subject: [PATCH 01/19] Use sphinx-autoapi --- docs-requirements.txt | 1 + docs/source/conf.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs-requirements.txt b/docs-requirements.txt index 090928aa36..4e8a1003d7 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -3,3 +3,4 @@ pydata-sphinx-theme>=0.3.1 Sphinx>=2.0.1,<4.0.0 nbconvert>=5.5.0 nbsphinx>=0.8.5 +sphinx-autoapi \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index b3fdb43c13..8c2a4eb10b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,7 +50,8 @@ # ones. extensions = [ "nbsphinx", - "sphinx.ext.autodoc", + 'sphinx.ext.autodoc', + "autoapi.extension", "sphinx.ext.autosummary", "sphinx.ext.napoleon", "sphinx.ext.viewcode", @@ -60,7 +61,12 @@ ] # Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] +#templates_path = ["_templates"] + +autoapi_dirs = ['../../evalml'] +autoapi_template_dir = '_templates' +suppress_warnings = ["autoapi"] + # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: @@ -279,7 +285,7 @@ def setup(app): shutil.copy("disable-warnings.py", "/home/docs/.ipython/profile_default/startup/") shutil.copy("set-headers.py", "/home/docs/.ipython/profile_default/startup") app.add_javascript( - "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js" + "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js" ) app.add_stylesheet("style.css") app.add_autodocumenter(AccessorCallableDocumenter) From d343ae7c855391738de7b1926f575b2774033de4 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Tue, 29 Jun 2021 16:21:50 -0400 Subject: [PATCH 02/19] Fix build --- docs/source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 8c2a4eb10b..1c0cd81286 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -66,6 +66,7 @@ autoapi_dirs = ['../../evalml'] autoapi_template_dir = '_templates' suppress_warnings = ["autoapi"] +autoapi_add_toctree_entry = False # The suffix(es) of source filenames. @@ -87,7 +88,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ["**.ipynb_checkpoints"] +exclude_patterns = ["**.ipynb_checkpoints", "autoapi"] # The name of the Pygments (syntax highlighting) style to use. pygments_style = None From f86cae69449c7f1b2f539ba7d18a7dac89f32754 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Wed, 30 Jun 2021 17:16:53 -0400 Subject: [PATCH 03/19] Build works locally --- docs/source/api_reference.rst | 556 ------------------ docs/source/conf.py | 43 +- docs/source/index.ipynb | 2 +- docs/source/user_guide/automl.ipynb | 4 +- docs/source/user_guide/components.ipynb | 14 +- docs/source/user_guide/data_checks.ipynb | 4 +- docs/source/user_guide/faq.ipynb | 6 +- .../user_guide/model_understanding.ipynb | 8 +- docs/source/user_guide/pipelines.ipynb | 4 +- evalml/automl/automl_search.py | 3 - evalml/data_checks/sparsity_data_check.py | 2 +- evalml/model_understanding/force_plots.py | 34 +- evalml/utils/gen_utils.py | 23 +- 13 files changed, 79 insertions(+), 624 deletions(-) delete mode 100644 docs/source/api_reference.rst diff --git a/docs/source/api_reference.rst b/docs/source/api_reference.rst deleted file mode 100644 index b5b487fb59..0000000000 --- a/docs/source/api_reference.rst +++ /dev/null @@ -1,556 +0,0 @@ -============= -API Reference -============= - -.. currentmodule:: evalml.demos - -Demo Datasets -============= - -.. autosummary:: - :toctree: generated - :nosignatures: - - load_fraud - load_wine - load_breast_cancer - load_diabetes - load_churn - - -.. currentmodule:: evalml.preprocessing - -Preprocessing -============= - -Utilities to preprocess data before using evalml. - -.. autosummary:: - :toctree: generated - :nosignatures: - - load_data - drop_nan_target_rows - target_distribution - number_of_features - split_data - - -.. currentmodule:: evalml.exceptions - -Exceptions -============= - -.. autosummary:: - :toctree: generated - :template: class.rst - :nosignatures: - - MethodPropertyNotFoundError - PipelineNotFoundError - ObjectiveNotFoundError - MissingComponentError - ComponentNotYetFittedError - PipelineNotYetFittedError - AutoMLSearchException - EnsembleMissingPipelinesError - PipelineScoreError - DataCheckInitError - NullsInColumnWarning - - -.. currentmodule:: evalml.automl - -AutoML -====== - -AutoML Search Interface -~~~~~~~~~~~~~~~~~~~~~~~ -.. autosummary:: - :toctree: generated - :template: class_with_properties.rst - :nosignatures: - - AutoMLSearch - - -AutoML Utils -~~~~~~~~~~~~ -.. autosummary:: - :toctree: generated - :nosignatures: - - search - get_default_primary_search_objective - make_data_splitter - -.. currentmodule:: evalml.automl.automl_algorithm - -AutoML Algorithm Classes -~~~~~~~~~~~~~~~~~~~~~~~~ -.. autosummary:: - :toctree: generated - :template: class_with_properties.rst - :nosignatures: - - AutoMLAlgorithm - IterativeAlgorithm - - -.. currentmodule:: evalml.automl.callbacks - -AutoML Callbacks -~~~~~~~~~~~~~~~~~~~~~~~~ -.. autosummary:: - :toctree: generated - :nosignatures: - - silent_error_callback - log_error_callback - raise_error_callback - - -.. currentmodule:: evalml.pipelines - -Pipelines -========= - -Pipeline Base Classes -~~~~~~~~~~~~~~~~~~~~~ -.. autosummary:: - :toctree: generated - :template: pipeline_base_class.rst - :nosignatures: - - PipelineBase - ClassificationPipeline - BinaryClassificationPipeline - MulticlassClassificationPipeline - RegressionPipeline - TimeSeriesClassificationPipeline - TimeSeriesBinaryClassificationPipeline - TimeSeriesMulticlassClassificationPipeline - TimeSeriesRegressionPipeline - - -.. currentmodule:: evalml.pipelines.utils - -Pipeline Utils -~~~~~~~~~~~~~~ -.. autosummary:: - :toctree: generated - :nosignatures: - - make_pipeline - generate_pipeline_code - - -.. currentmodule:: evalml.pipelines.components - -Components -========== - -Component Base Classes -~~~~~~~~~~~~~~~~~~~~~~ -Components represent a step in a pipeline. - -.. autosummary:: - :toctree: generated - :template: class.rst - :nosignatures: - - ComponentBase - Transformer - Estimator - -.. currentmodule:: evalml.pipelines.components.utils - -Component Utils -~~~~~~~~~~~~~~~ -.. autosummary:: - :toctree: generated - :nosignatures: - - allowed_model_families - get_estimators - generate_component_code - - -.. currentmodule:: evalml.pipelines.components - -Transformers -~~~~~~~~~~~~ -Transformers are components that take in data as input and output transformed data. - -.. autosummary:: - :toctree: generated - :template: transformer_class.rst - :nosignatures: - - DropColumns - SelectColumns - OneHotEncoder - TargetEncoder - PerColumnImputer - Imputer - SimpleImputer - StandardScaler - RFRegressorSelectFromModel - RFClassifierSelectFromModel - DropNullColumns - DateTimeFeaturizer - TextFeaturizer - DelayedFeatureTransformer - DFSTransformer - PolynomialDetrender - Undersampler - SMOTESampler - SMOTENCSampler - SMOTENSampler - -Estimators -~~~~~~~~~~ - -Classifiers ------------ - -Classifiers are components that output a predicted class label. - -.. autosummary:: - :toctree: generated - :template: estimator_class.rst - :nosignatures: - - CatBoostClassifier - ElasticNetClassifier - ExtraTreesClassifier - RandomForestClassifier - LightGBMClassifier - LogisticRegressionClassifier - XGBoostClassifier - BaselineClassifier - StackedEnsembleClassifier - DecisionTreeClassifier - KNeighborsClassifier - SVMClassifier - -Regressors ------------ - -Regressors are components that output a predicted target value. - -.. autosummary:: - :toctree: generated - :template: estimator_class.rst - :nosignatures: - - ARIMARegressor - CatBoostRegressor - ElasticNetRegressor - LinearRegressor - ExtraTreesRegressor - RandomForestRegressor - XGBoostRegressor - BaselineRegressor - TimeSeriesBaselineEstimator - StackedEnsembleRegressor - DecisionTreeRegressor - LightGBMRegressor - SVMRegressor - -.. currentmodule:: evalml.model_understanding - -Model Understanding -=================== - -Utility Methods -~~~~~~~~~~~~~~~ -.. autosummary:: - :toctree: generated - :nosignatures: - - confusion_matrix - normalize_confusion_matrix - precision_recall_curve - roc_curve - calculate_permutation_importance - calculate_permutation_importance_one_column - binary_objective_vs_threshold - get_prediction_vs_actual_over_time_data - partial_dependence - get_prediction_vs_actual_data - get_linear_coefficients - t_sne - - -Graph Utility Methods -~~~~~~~~~~~~~~~~~~~~~~~ -.. autosummary:: - :toctree: generated - :nosignatures: - - - graph_precision_recall_curve - graph_roc_curve - graph_confusion_matrix - graph_permutation_importance - graph_binary_objective_vs_threshold - graph_prediction_vs_actual - graph_prediction_vs_actual_over_time - graph_partial_dependence - graph_t_sne - - -.. currentmodule:: evalml.model_understanding.prediction_explanations - -Prediction Explanations -~~~~~~~~~~~~~~~~~~~~~~~ - - -.. autosummary:: - :toctree: generated - :nosignatures: - - explain_predictions - explain_predictions_best_worst - - -.. currentmodule:: evalml.objectives - -Objective Functions -==================== - -Objective Base Classes -~~~~~~~~~~~~~~~~~~~~~~ - -.. autosummary:: - :toctree: generated - :template: objective_base_class.rst - :nosignatures: - - ObjectiveBase - BinaryClassificationObjective - MulticlassClassificationObjective - RegressionObjective - - -Domain-Specific Objectives -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. autosummary:: - :toctree: generated - :template: objective_class.rst - :nosignatures: - - FraudCost - LeadScoring - CostBenefitMatrix - - -Classification Objectives -~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. autosummary:: - :toctree: generated - :template: objective_class.rst - :nosignatures: - - AccuracyBinary - AccuracyMulticlass - AUC - AUCMacro - AUCMicro - AUCWeighted - BalancedAccuracyBinary - BalancedAccuracyMulticlass - F1 - F1Micro - F1Macro - F1Weighted - LogLossBinary - LogLossMulticlass - MCCBinary - MCCMulticlass - Precision - PrecisionMicro - PrecisionMacro - PrecisionWeighted - Recall - RecallMicro - RecallMacro - RecallWeighted - - - -Regression Objectives -~~~~~~~~~~~~~~~~~~~~~ - -.. autosummary:: - :toctree: generated - :template: objective_class.rst - :nosignatures: - - R2 - MAE - MAPE - MSE - MeanSquaredLogError - MedianAE - MaxError - ExpVariance - RootMeanSquaredError - RootMeanSquaredLogError - - -Objective Utils -~~~~~~~~~~~~~~~~~~~~~ - -.. autosummary:: - :toctree: generated - :nosignatures: - - get_all_objective_names - get_core_objectives - get_core_objective_names - get_non_core_objectives - get_objective - - -.. currentmodule:: evalml.problem_types - -Problem Types -============= - -.. autosummary:: - :toctree: generated - :nosignatures: - - handle_problem_types - detect_problem_type - - :template: enum_class.rst - - ProblemTypes - - - -.. currentmodule:: evalml.model_family - -Model Family -============ - -.. autosummary:: - :toctree: generated - :nosignatures: - - handle_model_family - - :template: enum_class.rst - - ModelFamily - - -.. currentmodule:: evalml.tuners - -Tuners -====== - -.. autosummary:: - :toctree: generated - :template: class.rst - :nosignatures: - - Tuner - SKOptTuner - GridSearchTuner - RandomSearchTuner - - -.. currentmodule:: evalml.data_checks - -Data Checks -=========== - -Data Check Classes -~~~~~~~~~~~~~~~~~~ -.. autosummary:: - :toctree: generated - :template: data_check_class.rst - :nosignatures: - - DataCheck - InvalidTargetDataCheck - HighlyNullDataCheck - IDColumnsDataCheck - TargetLeakageDataCheck - OutliersDataCheck - NoVarianceDataCheck - ClassImbalanceDataCheck - MulticollinearityDataCheck - DateTimeNaNDataCheck - NaturalLanguageNaNDataCheck - -.. autosummary:: - :toctree: generated - :template: class.rst - :nosignatures: - - DataChecks - DefaultDataChecks - - -Data Check Messages -~~~~~~~~~~~~~~~~~~~ -.. autosummary:: - :toctree: generated - :template: data_check_message.rst - :nosignatures: - - DataCheckMessage - DataCheckError - DataCheckWarning - - -Data Check Message Types -~~~~~~~~~~~~~~~~~~~~~~~~ - -.. autosummary:: - :toctree: generated - :template: enum_class.rst - :nosignatures: - - DataCheckMessageType - -Data Check Message Codes -~~~~~~~~~~~~~~~~~~~~~~~~ - -.. autosummary:: - :toctree: generated - :template: enum_class.rst - :nosignatures: - - DataCheckMessageCode - - -.. currentmodule:: evalml.utils - -Utils -===== - -General Utils -~~~~~~~~~~~~~ - -.. autosummary:: - :toctree: generated - :nosignatures: - - import_or_raise - convert_to_seconds - get_random_state - get_random_seed - pad_with_nans - drop_rows_with_nans - infer_feature_types - save_plot - is_all_numeric - get_importable_subclasses diff --git a/docs/source/conf.py b/docs/source/conf.py index 1c0cd81286..a140894124 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,9 +50,7 @@ # ones. extensions = [ "nbsphinx", - 'sphinx.ext.autodoc', "autoapi.extension", - "sphinx.ext.autosummary", "sphinx.ext.napoleon", "sphinx.ext.viewcode", "sphinx.ext.extlinks", @@ -64,9 +62,9 @@ #templates_path = ["_templates"] autoapi_dirs = ['../../evalml'] -autoapi_template_dir = '_templates' -suppress_warnings = ["autoapi"] -autoapi_add_toctree_entry = False +autoapi_ignore = ["*test*"] +autoapi_options = ['members', 'undoc-members', 'show-inheritance', 'show-module-summary', 'imported-members', ] +# autoapi_template_dir = 'autoapi_templates' # The suffix(es) of source filenames. @@ -88,7 +86,10 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ["**.ipynb_checkpoints", "autoapi"] +exclude_patterns = ["**.ipynb_checkpoints", "_templates"] + +suppress_warnings = ["autoapi"] + # The name of the Pygments (syntax highlighting) style to use. pygments_style = None @@ -220,8 +221,8 @@ } # autoclass_content = 'both' -autosummary_generate = ["api_reference.rst"] -templates_path = ["_templates"] +#autosummary_generate = ["api_reference.rst"] +#templates_path = ["_templates"] html_show_sphinx = False nbsphinx_execute = "always" @@ -272,23 +273,27 @@ class AccessorMethodDocumenter(AccessorLevelDocumenter, MethodDocumenter): # lower than MethodDocumenter so this is not chosen for normal methods priority = 0.6 -def autodoc_skip_member(app, what, name, obj, skip, options): - if what == "method" and name.startswith("_"): - return True - if what == "attribute" and name.startswith("_"): - return True - return skip +from sphinx.domains.python import PythonDomain + + +class PatchedPythonDomain(PythonDomain): + """To disable cross-reference warning: https://github.com/sphinx-doc/sphinx/issues/3866""" + def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): + if 'refspecific' in node: + del node['refspecific'] + return super(PatchedPythonDomain, self).resolve_xref( + env, fromdocname, builder, typ, target, node, contnode) def setup(app): - p = Path("/home/docs/.ipython/profile_default/startup") - p.mkdir(parents=True, exist_ok=True) - shutil.copy("disable-warnings.py", "/home/docs/.ipython/profile_default/startup/") - shutil.copy("set-headers.py", "/home/docs/.ipython/profile_default/startup") + # p = Path("/home/docs/.ipython/profile_default/startup") + # p.mkdir(parents=True, exist_ok=True) + # shutil.copy("disable-warnings.py", "/home/docs/.ipython/profile_default/startup/") + # shutil.copy("set-headers.py", "/home/docs/.ipython/profile_default/startup") + app.add_domain(PatchedPythonDomain, override=True) app.add_javascript( "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js" ) app.add_stylesheet("style.css") app.add_autodocumenter(AccessorCallableDocumenter) app.add_autodocumenter(AccessorMethodDocumenter) - app.connect('autodoc-skip-member', autodoc_skip_member) diff --git a/docs/source/index.ipynb b/docs/source/index.ipynb index 9769738519..f4da6a3e07 100644 --- a/docs/source/index.ipynb +++ b/docs/source/index.ipynb @@ -70,7 +70,7 @@ } }, "source": [ - "[API Reference](api_reference)" + "[API Reference](autoapi/index.rst)" ] }, { diff --git a/docs/source/user_guide/automl.ipynb b/docs/source/user_guide/automl.ipynb index 4d1d8897f2..b74d503a16 100644 --- a/docs/source/user_guide/automl.ipynb +++ b/docs/source/user_guide/automl.ipynb @@ -150,14 +150,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The AutoML interface supports a variety of other parameters. For a comprehensive list, please [refer to the API reference.](../generated/evalml.automl.AutoMLSearch.ipynb)" + "The AutoML interface supports a variety of other parameters. For a comprehensive list, please [refer to the API reference.] (../generated/evalml.automl.AutoMLSearch.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "We also provide [a standalone `search` method](../generated/evalml.automl.search.html) which does all of the above in a single line, and returns the `AutoMLSearch` instance and data check results. If there were data check errors, AutoML will not be run and no `AutoMLSearch` instance will be returned." + "We also provide [a standalone `search` method] (../generated/evalml.automl.search.html) which does all of the above in a single line, and returns the `AutoMLSearch` instance and data check results. If there were data check errors, AutoML will not be run and no `AutoMLSearch` instance will be returned." ] }, { diff --git a/docs/source/user_guide/components.ipynb b/docs/source/user_guide/components.ipynb index 86e99d9be8..a9a2599793 100644 --- a/docs/source/user_guide/components.ipynb +++ b/docs/source/user_guide/components.ipynb @@ -28,7 +28,7 @@ "\n", "Transformers subclass the `Transformer` class, and define a `fit` method to learn information from training data and a `transform` method to apply a learned transformation to new data.\n", "\n", - "For example, an [imputer](../generated/evalml.pipelines.components.SimpleImputer.ipynb) is configured with the desired impute strategy to follow, for instance the mean value. The imputers `fit` method would learn the mean from the training data, and the `transform` method would fill the learned mean value in for any missing values in new data.\n", + "For example, an [imputer] (../generated/evalml.pipelines.components.SimpleImputer.ipynb) is configured with the desired impute strategy to follow, for instance the mean value. The imputers `fit` method would learn the mean from the training data, and the `transform` method would fill the learned mean value in for any missing values in new data.\n", "\n", "All transformers can execute `fit` and `transform` separately or in one step by calling `fit_transform`. Defining a custom `fit_transform` method can facilitate useful performance optimizations in some cases." ] @@ -90,7 +90,7 @@ "\n", "Estimator classes each define a `model_family` attribute indicating what type of model is used.\n", "\n", - "Here's an example of using the [LogisticRegressionClassifier](../generated/evalml.pipelines.components.LogisticRegressionClassifier.ipynb) estimator to fit and predict on a simple dataset:" + "Here's an example of using the [LogisticRegressionClassifier] (../generated/evalml.pipelines.components.LogisticRegressionClassifier.ipynb) estimator to fit and predict on a simple dataset:" ] }, { @@ -139,7 +139,7 @@ "\n", "### Custom Transformers\n", "\n", - "Your transformer must inherit from the correct subclass. In this case [Transformer](../generated/evalml.pipelines.components.Transformer.ipynb) for components that transform data. Next we will use EvalML's [DropNullColumns](../generated/evalml.pipelines.components.DropNullColumns.ipynb) as an example." + "Your transformer must inherit from the correct subclass. In this case [Transformer] (../generated/evalml.pipelines.components.Transformer.ipynb) for components that transform data. Next we will use EvalML's [DropNullColumns] (../generated/evalml.pipelines.components.DropNullColumns.ipynb) as an example." ] }, { @@ -237,7 +237,7 @@ "source": [ "### Custom Estimators\n", "\n", - "Your estimator must inherit from the correct subclass. In this case [Estimator](../generated/evalml.pipelines.components.Estimator.ipynb) for components that predict new target values. Next we will use EvalML's [BaselineRegressor](../generated/evalml.pipelines.components.BaselineRegressor.ipynb) as an example." + "Your estimator must inherit from the correct subclass. In this case [Estimator] (../generated/evalml.pipelines.components.Estimator.ipynb) for components that predict new target values. Next we will use EvalML's [BaselineRegressor] (../generated/evalml.pipelines.components.BaselineRegressor.ipynb) as an example." ] }, { @@ -320,9 +320,9 @@ "\n", "- `name` indicating a human-readable name.\n", "\n", - "- `model_family` - EvalML [model_family](../generated/evalml.model_family.ModelFamily.ipynb) that this component belongs to\n", + "- `model_family` - EvalML [model_family] (../generated/evalml.model_family.ModelFamily.ipynb) that this component belongs to\n", "\n", - "- `supported_problem_types` - list of EvalML [problem_types](../generated/evalml.problem_types.ProblemTypes.ipynb) that this component supports\n", + "- `supported_problem_types` - list of EvalML [problem_types] (../generated/evalml.problem_types.ProblemTypes.ipynb) that this component supports\n", "\n", "Model families and problem types include:" ] @@ -365,7 +365,7 @@ "source": [ "### Components Wrapping Third-Party Objects\n", "\n", - "The `component_obj` parameter is used for wrapping third-party objects and using them in component implementation. If you're using a `component_obj` you will need to define `__init__()` and pass in the relevant object that has also implemented the required methods mentioned above. However, if the `component_obj` does not follow EvalML component conventions, you may need to override methods as needed. Below is an example of EvalML's [LinearRegressor](../generated/evalml.pipelines.components.LinearRegressor.ipynb)." + "The `component_obj` parameter is used for wrapping third-party objects and using them in component implementation. If you're using a `component_obj` you will need to define `__init__()` and pass in the relevant object that has also implemented the required methods mentioned above. However, if the `component_obj` does not follow EvalML component conventions, you may need to override methods as needed. Below is an example of EvalML's [LinearRegressor] (../generated/evalml.pipelines.components.LinearRegressor.ipynb)." ] }, { diff --git a/docs/source/user_guide/data_checks.ipynb b/docs/source/user_guide/data_checks.ipynb index 501c3f7a39..47638dbade 100644 --- a/docs/source/user_guide/data_checks.ipynb +++ b/docs/source/user_guide/data_checks.ipynb @@ -425,7 +425,7 @@ "source": [ "## Data Check Messages\n", "\n", - "Each data check's `validate` method returns a list of `DataCheckMessage` objects indicating warnings or errors found; warnings are stored as a `DataCheckWarning` object ([API reference](../generated/evalml.data_checks.DataCheckWarning.ipynb)) and errors are stored as a `DataCheckError` object ([API reference](../generated/evalml.data_checks.DataCheckError.ipynb)). You can filter the messages returned by a data check by checking for the type of message returned. Below, `NoVarianceDataCheck` returns a list containing a `DataCheckWarning` and a `DataCheckError` message. We can determine which is which by checking the type of each message." + "Each data check's `validate` method returns a list of `DataCheckMessage` objects indicating warnings or errors found; warnings are stored as a `DataCheckWarning` object ([API reference] (../generated/evalml.data_checks.DataCheckWarning.ipynb)) and errors are stored as a `DataCheckError` object ([API reference] (../generated/evalml.data_checks.DataCheckError.ipynb)). You can filter the messages returned by a data check by checking for the type of message returned. Below, `NoVarianceDataCheck` returns a list containing a `DataCheckWarning` and a `DataCheckError` message. We can determine which is which by checking the type of each message." ] }, { @@ -490,7 +490,7 @@ "source": [ "## Defining Collections of Data Checks\n", "\n", - "For convenience, EvalML provides a `DataChecks` class to represent a collection of data checks. We will go over `DefaultDataChecks` ([API reference](../generated/evalml.data_checks.DefaultDataChecks.ipynb)), a collection defined to check for some of the most common data issues." + "For convenience, EvalML provides a `DataChecks` class to represent a collection of data checks. We will go over `DefaultDataChecks` ([API reference] (../generated/evalml.data_checks.DefaultDataChecks.ipynb)), a collection defined to check for some of the most common data issues." ] }, { diff --git a/docs/source/user_guide/faq.ipynb b/docs/source/user_guide/faq.ipynb index 70319763a1..fb5fccb937 100644 --- a/docs/source/user_guide/faq.ipynb +++ b/docs/source/user_guide/faq.ipynb @@ -12,15 +12,15 @@ "\n", "#### Q: How does EvalML handle missing values?\n", "\n", - "EvalML contains imputation components in its pipelines so that missing values are taken care of. EvalML optimizes over different types of imputation to search for the best possible pipeline. You can find more information about components [here](components.ipynb) and in the API reference [here](../generated/evalml.pipelines.components.Imputer.ipynb).\n", + "EvalML contains imputation components in its pipelines so that missing values are taken care of. EvalML optimizes over different types of imputation to search for the best possible pipeline. You can find more information about components [here](components.ipynb) and in the API reference [here] (../generated/evalml.pipelines.components.Imputer.ipynb).\n", "\n", "#### Q: How does EvalML handle categorical encoding?\n", "\n", - "EvalML provides a [one-hot-encoding component](../generated/evalml.pipelines.components.OneHotEncoder.ipynb) in its pipelines for categorical variables. EvalML plans to support other encoders in the future.\n", + "EvalML provides a [one-hot-encoding component] (../generated/evalml.pipelines.components.OneHotEncoder.ipynb) in its pipelines for categorical variables. EvalML plans to support other encoders in the future.\n", "\n", "#### Q: How does EvalML handle feature selection?\n", "\n", - "EvalML currently utilizes scikit-learn's [SelectFromModel](https://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.SelectFromModel.html) with a Random Forest classifier/regressor to handle feature selection. EvalML plans on supporting more feature selectors in the future. You can find more information in the API reference [here](../generated/evalml.pipelines.components.RFClassifierSelectFromModel.ipynb).\n", + "EvalML currently utilizes scikit-learn's [SelectFromModel](https://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.SelectFromModel.html) with a Random Forest classifier/regressor to handle feature selection. EvalML plans on supporting more feature selectors in the future. You can find more information in the API reference [here] (../generated/evalml.pipelines.components.RFClassifierSelectFromModel.ipynb).\n", "\n", "#### Q: How is feature importance calculated?\n", "\n", diff --git a/docs/source/user_guide/model_understanding.ipynb b/docs/source/user_guide/model_understanding.ipynb index 20d6623e76..62585c6ec0 100644 --- a/docs/source/user_guide/model_understanding.ipynb +++ b/docs/source/user_guide/model_understanding.ipynb @@ -390,7 +390,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We can explain why the model made certain predictions with the [explain_predictions](../generated/evalml.model_understanding.prediction_explanations.explain_predictions.ipynb) function. This will use the [Shapley Additive Explanations (SHAP)](https://github.com/slundberg/shap) algorithm to identify the top features that explain the predicted value. \n", + "We can explain why the model made certain predictions with the [explain_predictions] (../generated/evalml.model_understanding.prediction_explanations.explain_predictions.ipynb) function. This will use the [Shapley Additive Explanations (SHAP)](https://github.com/slundberg/shap) algorithm to identify the top features that explain the predicted value. \n", "\n", "This function can explain both classification and regression models - all you need to do is provide the pipeline, the input features, and a list of rows corresponding to the indices of the input features you want to explain. The function will return a table that you can print summarizing the top 3 most positive and negative contributing features to the predicted value.\n", "\n", @@ -416,7 +416,7 @@ "source": [ "The interpretation of the table is the same for regression problems - but the SHAP value now corresponds to the change in the estimated value of the dependent variable rather than a change in probability. For multiclass classification problems, a table will be output for each possible class.\n", "\n", - "Below is an example of how you would explain three predictions with [explain_predictions](../generated/evalml.model_understanding.prediction_explanations.explain_predictions.ipynb)." + "Below is an example of how you would explain three predictions with [explain_predictions] (../generated/evalml.model_understanding.prediction_explanations.explain_predictions.ipynb)." ] }, { @@ -439,9 +439,9 @@ "source": [ "### Explaining Best and Worst Predictions\n", "\n", - "When debugging machine learning models, it is often useful to analyze the best and worst predictions the model made. The [explain_predictions_best_worst](../generated/evalml.model_understanding.prediction_explanations.explain_predictions_best_worst.ipynb) function can help us with this.\n", + "When debugging machine learning models, it is often useful to analyze the best and worst predictions the model made. The [explain_predictions_best_worst] (../generated/evalml.model_understanding.prediction_explanations.explain_predictions_best_worst.ipynb) function can help us with this.\n", "\n", - "This function will display the output of [explain_predictions](../generated/evalml.model_understanding.prediction_explanations.explain_predictions.ipynb) for the best 2 and worst 2 predictions. By default, the best and worst predictions are determined by the absolute error for regression problems and [cross entropy](https://en.wikipedia.org/wiki/Cross_entropy) for classification problems.\n", + "This function will display the output of [explain_predictions] (../generated/evalml.model_understanding.prediction_explanations.explain_predictions.ipynb) for the best 2 and worst 2 predictions. By default, the best and worst predictions are determined by the absolute error for regression problems and [cross entropy](https://en.wikipedia.org/wiki/Cross_entropy) for classification problems.\n", "\n", "We can specify our own ranking function by passing in a function to the `metric` parameter. This function will be called on `y_true` and `y_pred`. By convention, lower scores are better.\n", "\n", diff --git a/docs/source/user_guide/pipelines.ipynb b/docs/source/user_guide/pipelines.ipynb index 5203678714..61dbf81e26 100644 --- a/docs/source/user_guide/pipelines.ipynb +++ b/docs/source/user_guide/pipelines.ipynb @@ -155,7 +155,7 @@ "\n", "You can also pass in custom parameters by using the `parameters` parameter, which will then be used when instantiating each component in `component_graph`. The parameters dictionary needs to be in the format of a two-layered dictionary where the key-value pairs are the component name and corresponding component parameters dictionary. The component parameters dictionary consists of (parameter name, parameter values) key-value pairs.\n", "\n", - "An example will be shown below. The API reference for component parameters can also be found [here](../api_reference.rst#components)." + "An example will be shown below. The API reference for component parameters can also be found [here] (../api_reference.rst#components)." ] }, { @@ -252,7 +252,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "You can use `pipeline.get_component(name)` and provide the component name to access any component (API reference [here](../generated/methods/evalml.pipelines.PipelineBase.get_component.ipynb)):" + "You can use `pipeline.get_component(name)` and provide the component name to access any component (API reference [here] (../generated/methods/evalml.pipelines.PipelineBase.get_component.ipynb)):" ] }, { diff --git a/evalml/automl/automl_search.py b/evalml/automl/automl_search.py index 320f992a35..0458662f3b 100644 --- a/evalml/automl/automl_search.py +++ b/evalml/automl/automl_search.py @@ -235,9 +235,6 @@ class AutoMLSearch: _MAX_NAME_LEN = 40 - # Necessary for "Plotting" documentation, since Sphinx does not work well with instance attributes. - plot = PipelineSearchPlots - def __init__( self, X_train=None, diff --git a/evalml/data_checks/sparsity_data_check.py b/evalml/data_checks/sparsity_data_check.py index c3de8cb10c..5f1e1d22d4 100644 --- a/evalml/data_checks/sparsity_data_check.py +++ b/evalml/data_checks/sparsity_data_check.py @@ -97,7 +97,7 @@ def sparsity_score(col, count_threshold=10): Arguments: col (pd.Series): Feature values. count_threshold (int): The number of instances below which a value is considered sparse. - Default is 10. + Default is 10. Returns: (float): Sparsity score, or the percentage of the unique values that exceed count_threshold. """ diff --git a/evalml/model_understanding/force_plots.py b/evalml/model_understanding/force_plots.py index 374fab8d8a..f78013286f 100644 --- a/evalml/model_understanding/force_plots.py +++ b/evalml/model_understanding/force_plots.py @@ -68,20 +68,26 @@ def force_plot(pipeline, rows_to_explain, training_data, y): Returns: list(dict()): list of dictionaries where each dict contains force plot data. Each dictionary entry represents the explanations for a single row. - e.x. For single row binary force plots: - [{'malignant': {'expected_value': 0.37, - 'feature_names': ['worst concave points', 'worst perimeter', 'worst radius'], - 'shap_values': [0.09, 0.09, 0.08], - 'plot': AdditiveForceVisualizer}] - For two row binary force plots: - [{'malignant': {'expected_value': 0.37, - 'feature_names': ['worst concave points', 'worst perimeter', 'worst radius'], - 'shap_values': [0.09, 0.09, 0.08], - 'plot': AdditiveForceVisualizer}, - {'malignant': {'expected_value': 0.29, - 'feature_names': ['worst concave points', 'worst perimeter', 'worst radius'], - 'shap_values': [0.05, 0.03, 0.02], - 'plot': AdditiveForceVisualizer}] + + .. code-block:: + + For single row binary force plots: + + [{'malignant': {'expected_value': 0.37, + 'feature_names': ['worst concave points', 'worst perimeter', 'worst radius'], + 'shap_values': [0.09, 0.09, 0.08], + 'plot': AdditiveForceVisualizer}] + + For two row binary force plots: + + [{'malignant': {'expected_value': 0.37, + 'feature_names': ['worst concave points', 'worst perimeter', 'worst radius'], + 'shap_values': [0.09, 0.09, 0.08], + 'plot': AdditiveForceVisualizer}, + {'malignant': {'expected_value': 0.29, + 'feature_names': ['worst concave points', 'worst perimeter', 'worst radius'], + 'shap_values': [0.05, 0.03, 0.02], + 'plot': AdditiveForceVisualizer}] Raises: TypeError: if rows_to_explain is not a list. diff --git a/evalml/utils/gen_utils.py b/evalml/utils/gen_utils.py index 9e19e0f300..ec62dbe50d 100644 --- a/evalml/utils/gen_utils.py +++ b/evalml/utils/gen_utils.py @@ -121,16 +121,19 @@ def get_random_seed( class classproperty: """Allows function to be accessed as a class level property. Example: - class LogisticRegressionBinaryPipeline(PipelineBase): - component_graph = ['Simple Imputer', 'Logistic Regression Classifier'] - - @classproperty - def summary(cls): - summary = "" - for component in cls.component_graph: - component = handle_component_class(component) - summary += component.name + " + " - return summary + + .. code-block:: + + class LogisticRegressionBinaryPipeline(PipelineBase): + component_graph = ['Simple Imputer', 'Logistic Regression Classifier'] + + @classproperty + def summary(cls): + summary = "" + for component in cls.component_graph: + component = handle_component_class(component) + summary += component.name + " + " + return summary assert LogisticRegressionBinaryPipeline.summary == "Simple Imputer + Logistic Regression Classifier + " assert LogisticRegressionBinaryPipeline().summary == "Simple Imputer + Logistic Regression Classifier + " From fb8e9c10e0e526799edcc8ba75da159cc3af28f3 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Wed, 30 Jun 2021 17:17:08 -0400 Subject: [PATCH 04/19] Add back disable warnings script --- docs/source/conf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index a140894124..6d4a99e922 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -286,10 +286,10 @@ def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): def setup(app): - # p = Path("/home/docs/.ipython/profile_default/startup") - # p.mkdir(parents=True, exist_ok=True) - # shutil.copy("disable-warnings.py", "/home/docs/.ipython/profile_default/startup/") - # shutil.copy("set-headers.py", "/home/docs/.ipython/profile_default/startup") + p = Path("/home/docs/.ipython/profile_default/startup") + p.mkdir(parents=True, exist_ok=True) + shutil.copy("disable-warnings.py", "/home/docs/.ipython/profile_default/startup/") + shutil.copy("set-headers.py", "/home/docs/.ipython/profile_default/startup") app.add_domain(PatchedPythonDomain, override=True) app.add_javascript( "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js" From ca826f5ef309db9d7d27885f3d8b81193740d4e5 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Thu, 1 Jul 2021 17:04:40 -0400 Subject: [PATCH 05/19] Changing API Reference landing page --- docs/source/api_index.rst | 74 +++++++++++++++++++++++++++++++++++++++ docs/source/conf.py | 2 +- docs/source/index.ipynb | 2 +- 3 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 docs/source/api_index.rst diff --git a/docs/source/api_index.rst b/docs/source/api_index.rst new file mode 100644 index 0000000000..1fc307f1a6 --- /dev/null +++ b/docs/source/api_index.rst @@ -0,0 +1,74 @@ +API Reference +============= + +******************************************* +:doc:`AutoML ` +******************************************* +Classes and functions related to the automated search of machine learning pipelines. For a tutorial, see the +:doc:`AutoMLSearch User Guide ` + +***************************************************** +:doc:`Data Checks ` +***************************************************** +Classes that can determine if your data is healthy enough to run :doc:`AutoMLSearch `. For +a tutorial, see the :doc:`DataChecks User Guide ` + +************************************************* +:doc:`Demo Datasets ` +************************************************* +Functions used to load demo data. This data can be used to try out :doc:`AutoMLSearch ` +and our :doc:`pipelines `. + +********************************************************** +:doc:`Model Families ` +********************************************************** +A categorization of the different kinds of :doc:`Estimators ` our +:doc:`pipelines ` support. + +********************************************************************* +:doc:`Model Understanding ` +********************************************************************* +Functions and classes used to interpret the pipelines found by :doc:`AutoMLSearch `. For a +tutorial, see the :doc:`Model Understanding User Guide ` + +*************************************************** +:doc:`Objectives ` +*************************************************** +Classes that represent the cost function :doc:`AutoMLSearch ` will optimize. For a tutorial, +see the :doc:`Objectives User Guide ` + +************************************************* +:doc:`Pipelines ` +************************************************* +Classes that represent a sequence of operations to be applied to data. :doc:`AutoMLSearch ` +searches over these classes. For a tutorial, see the :doc:`Pipelines User Guide ` + +********************************************************* +:doc:`Preprocessing ` +********************************************************* +Functions for splitting and preprocessing data before doing machine learning. + +********************************************************* +:doc:`Problem Types ` +********************************************************* +The different types of machine learning problems that our estimators, pipelines, and AutoMLSearch can handle. + +********************************************************* +:doc:`AutoML Tuners ` +********************************************************* +Tuners implement different strategies for sampling from a search space. They’re used in to search the space of pipeline hyperparameters. + +********************************************************* +:doc:`Utilities ` +********************************************************* +General utilities used primarily by EvalML developers. + +********************************************************** +:doc:`Custom Exceptions ` +********************************************************** +Exceptions that EvalML can raise. + +.. toctree:: + :hidden: + + autoapi/evalml/index \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 6d4a99e922..19ea04d792 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -64,7 +64,7 @@ autoapi_dirs = ['../../evalml'] autoapi_ignore = ["*test*"] autoapi_options = ['members', 'undoc-members', 'show-inheritance', 'show-module-summary', 'imported-members', ] -# autoapi_template_dir = 'autoapi_templates' +autoapi_add_toctree_entry = False # The suffix(es) of source filenames. diff --git a/docs/source/index.ipynb b/docs/source/index.ipynb index f4da6a3e07..90f022a5cf 100644 --- a/docs/source/index.ipynb +++ b/docs/source/index.ipynb @@ -70,7 +70,7 @@ } }, "source": [ - "[API Reference](autoapi/index.rst)" + "[API Reference](api_index.rst)" ] }, { From 674f4fcc87da12e56a5f4d3528e806255a826736 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Fri, 2 Jul 2021 17:03:10 -0400 Subject: [PATCH 06/19] Get class attributes to show up. Fix module names --- dev-requirements.txt | 7 - docs-requirements.txt | 6 - .../_auto_api_templates/python/attribute.rst | 60 +++++++++ .../_auto_api_templates/python/module.rst | 120 ++++++++++++++++++ docs/source/conf.py | 14 +- docs/source/release_notes.rst | 1 + evalml/model_understanding/force_plots.py | 10 +- .../binary_classification_pipeline.py | 1 + .../ensemble/stacked_ensemble_base.py | 1 + .../ensemble/stacked_ensemble_classifier.py | 8 ++ .../ensemble/stacked_ensemble_regressor.py | 6 + .../classifiers/baseline_classifier.py | 3 + .../classifiers/catboost_classifier.py | 12 ++ .../classifiers/decision_tree_classifier.py | 12 ++ .../classifiers/elasticnet_classifier.py | 8 ++ .../estimators/classifiers/et_classifier.py | 13 ++ .../classifiers/kneighbors_classifier.py | 14 ++ .../classifiers/lightgbm_classifier.py | 18 +++ .../logistic_regression_classifier.py | 11 ++ .../estimators/classifiers/rf_classifier.py | 11 ++ .../estimators/classifiers/svm_classifier.py | 12 ++ .../classifiers/xgboost_classifier.py | 13 ++ .../components/estimators/estimator.py | 1 + .../estimators/regressors/arima_regressor.py | 11 ++ .../regressors/baseline_regressor.py | 6 + .../regressors/catboost_regressor.py | 10 ++ .../regressors/decision_tree_regressor.py | 10 ++ .../regressors/elasticnet_regressor.py | 9 ++ .../estimators/regressors/et_regressor.py | 10 ++ .../regressors/lightgbm_regressor.py | 13 ++ .../estimators/regressors/linear_regressor.py | 6 + .../estimators/regressors/rf_regressor.py | 9 ++ .../estimators/regressors/svm_regressor.py | 10 ++ .../time_series_baseline_estimator.py | 7 + .../regressors/xgboost_regressor.py | 11 ++ .../transformers/column_selectors.py | 2 + .../dimensionality_reduction/lda.py | 1 + .../dimensionality_reduction/pca.py | 1 + .../transformers/encoders/onehot_encoder.py | 1 + .../transformers/encoders/target_encoder.py | 1 + .../rf_classifier_feature_selector.py | 4 + .../rf_regressor_feature_selector.py | 4 + .../transformers/imputers/imputer.py | 4 + .../imputers/per_column_imputer.py | 1 + .../transformers/imputers/simple_imputer.py | 1 + .../transformers/imputers/target_imputer.py | 1 + .../preprocessing/datetime_featurizer.py | 1 + .../delayed_feature_transformer.py | 1 + .../preprocessing/drop_null_columns.py | 1 + .../preprocessing/featuretools.py | 1 + .../transformers/preprocessing/lsa.py | 1 + .../preprocessing/polynomial_detrender.py | 1 + .../preprocessing/text_featurizer.py | 1 + .../transformers/samplers/oversamplers.py | 3 + .../transformers/samplers/undersampler.py | 1 + .../transformers/scalers/standard_scaler.py | 1 + .../components/transformers/transformer.py | 1 + .../multiclass_classification_pipeline.py | 1 + evalml/pipelines/pipeline_base.py | 1 + evalml/pipelines/regression_pipeline.py | 1 + .../time_series_classification_pipelines.py | 1 + .../time_series_regression_pipeline.py | 1 + requirements.txt | 15 --- test-requirements.txt | 10 -- 64 files changed, 486 insertions(+), 52 deletions(-) delete mode 100644 dev-requirements.txt delete mode 100644 docs-requirements.txt create mode 100644 docs/source/_auto_api_templates/python/attribute.rst create mode 100644 docs/source/_auto_api_templates/python/module.rst delete mode 100644 requirements.txt delete mode 100644 test-requirements.txt diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index e2b3876b0d..0000000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ --r requirements.txt --r test-requirements.txt --r docs-requirements.txt -flake8==3.7.0 -black==21.5b1 -isort==5.0.0 - diff --git a/docs-requirements.txt b/docs-requirements.txt deleted file mode 100644 index 4e8a1003d7..0000000000 --- a/docs-requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -docutils>=0.15.2,<0.17 -pydata-sphinx-theme>=0.3.1 -Sphinx>=2.0.1,<4.0.0 -nbconvert>=5.5.0 -nbsphinx>=0.8.5 -sphinx-autoapi \ No newline at end of file diff --git a/docs/source/_auto_api_templates/python/attribute.rst b/docs/source/_auto_api_templates/python/attribute.rst new file mode 100644 index 0000000000..fd5cce7165 --- /dev/null +++ b/docs/source/_auto_api_templates/python/attribute.rst @@ -0,0 +1,60 @@ +{% if obj.display %} +{% if obj.docstring|length > 0 %} +.. py:{{ obj.type }}:: {{ obj.name }} + :annotation: + {%- if obj.docstring is not none %} = {% + if obj.docstring.splitlines()|count > 1 -%} + Multiline-Value + + .. raw:: html + +
Show Value + + .. code-block:: text + :linenos: + + {{ obj.docstring|indent(width=8) }} + + .. raw:: html + +
+ + {%- else -%} + {{ obj.docstring }} + {%- endif %} + {% endif %} + +{% else %} +.. py:{{ obj.type }}:: {{ obj.name }} + {%+ if obj.value is not none or obj.annotation is not none -%} + :annotation: + {%- if obj.annotation %} :{{ obj.annotation }} + {%- endif %} + {%- if obj.value is not none %} = {% + if obj.value is string and obj.value.splitlines()|count > 1 -%} + Multiline-String + + .. raw:: html + +
Show Value + + .. code-block:: text + :linenos: + + {{ obj.value|indent(width=8) }} + + .. raw:: html + +
+ + {%- else -%} + {{ obj.value|string|truncate(100) }} + {%- endif %} + {%- endif %} + {% endif %} + + + {{ obj.docstring|prepare_docstring|indent(3) }} +{% endif %} +{% endif %} + diff --git a/docs/source/_auto_api_templates/python/module.rst b/docs/source/_auto_api_templates/python/module.rst new file mode 100644 index 0000000000..89c160935f --- /dev/null +++ b/docs/source/_auto_api_templates/python/module.rst @@ -0,0 +1,120 @@ +{% if not obj.display %} +:orphan: + +{% endif %} +{% if obj.name.split('.')[-1][0] == '_' %} +{{ obj.name }} +{% elif obj.name.split('.')|length <= 2 %} +{{ (' '.join(obj.name.split('.')[-1].split('_'))|title) }} +{% else %} +{{ obj.name.split('.')[-1] }} +{% endif %} +=========={{ "=" * obj.name|length }} + +.. py:module:: {{ obj.name }} + +{% if obj.docstring %} +.. autoapi-nested-parse:: + + {{ obj.docstring|prepare_docstring|indent(3) }} + +{% endif %} + +{% block subpackages %} +{% set visible_subpackages = obj.subpackages|selectattr("display")|list %} +{% if visible_subpackages %} +Subpackages +----------- +.. toctree:: + :titlesonly: + :maxdepth: 3 + +{% for subpackage in visible_subpackages %} + {{ subpackage.short_name }}/index.rst +{% endfor %} + + +{% endif %} +{% endblock %} +{% block submodules %} +{% set visible_submodules = obj.submodules|selectattr("display")|list %} +{% if visible_submodules %} +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + +{% for submodule in visible_submodules %} + {{ submodule.short_name }}/index.rst +{% endfor %} + + +{% endif %} +{% endblock %} +{% block content %} +{% if obj.all is not none %} +{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %} +{% elif obj.type is equalto("package") %} +{% set visible_children = obj.children|selectattr("display")|list %} +{% else %} +{% set visible_children = obj.children|selectattr("display")|rejectattr("imported")|list %} +{% endif %} +{% if visible_children %} +{{ obj.type|title }} Contents +{{ "-" * obj.type|length }}--------- + +{% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %} +{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %} +{% set visible_attributes = visible_children|selectattr("type", "equalto", "data")|list %} +{% if "show-module-summary" in autoapi_options and (visible_classes or visible_functions) %} +{% block classes scoped %} +{% if visible_classes %} +Classes +~~~~~~~ + +.. autoapisummary:: + +{% for klass in visible_classes %} + {{ klass.id }} +{% endfor %} + + +{% endif %} +{% endblock %} + +{% block functions scoped %} +{% if visible_functions %} +Functions +~~~~~~~~~ + +.. autoapisummary:: + +{% for function in visible_functions %} + {{ function.id }} +{% endfor %} + + +{% endif %} +{% endblock %} + +{% block attributes scoped %} +{% if visible_attributes %} +Attributes +~~~~~~~~~~ + +.. autoapisummary:: + +{% for attribute in visible_attributes %} + {{ attribute.id }} +{% endfor %} + + +{% endif %} +{% endblock %} +{% endif %} +{% for obj_item in visible_children %} +{{ obj_item.render()|indent(0) }} +{% endfor %} +{% endif %} +{% endblock %} \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 19ea04d792..a62cc412ba 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -65,7 +65,7 @@ autoapi_ignore = ["*test*"] autoapi_options = ['members', 'undoc-members', 'show-inheritance', 'show-module-summary', 'imported-members', ] autoapi_add_toctree_entry = False - +autoapi_template_dir = "_auto_api_templates" # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: @@ -86,7 +86,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ["**.ipynb_checkpoints", "_templates"] +exclude_patterns = ["**.ipynb_checkpoints", "_templates", "_auto_api_templates"] suppress_warnings = ["autoapi"] @@ -109,7 +109,7 @@ html_theme_options = { "github_url": "https://github.com/alteryx/evalml", "twitter_url": "https://twitter.com/AlteryxOSS", - "collapse_navigation": True, + "collapse_navigation": False, "navigation_depth": 2, } @@ -286,10 +286,10 @@ def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): def setup(app): - p = Path("/home/docs/.ipython/profile_default/startup") - p.mkdir(parents=True, exist_ok=True) - shutil.copy("disable-warnings.py", "/home/docs/.ipython/profile_default/startup/") - shutil.copy("set-headers.py", "/home/docs/.ipython/profile_default/startup") + # p = Path("/home/docs/.ipython/profile_default/startup") + # p.mkdir(parents=True, exist_ok=True) + # shutil.copy("disable-warnings.py", "/home/docs/.ipython/profile_default/startup/") + # shutil.copy("set-headers.py", "/home/docs/.ipython/profile_default/startup") app.add_domain(PatchedPythonDomain, override=True) app.add_javascript( "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js" diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst index f1edd61397..ad77093b54 100644 --- a/docs/source/release_notes.rst +++ b/docs/source/release_notes.rst @@ -32,6 +32,7 @@ Release Notes * Documentation Changes * Sped up docs :pr:`2430` * Removed mentions of ``DataTable`` and ``DataColumn`` from the docs :pr:`2445` + * Build documentation with sphinx-autoapi :pr:`2458` * Testing Changes * Added slack integration for nightlies tests :pr:`2436` * Changed ``build_conda_pkg`` CI job to run only when dependencies are updates :pr:`2446` diff --git a/evalml/model_understanding/force_plots.py b/evalml/model_understanding/force_plots.py index f78013286f..02e8d7ac4a 100644 --- a/evalml/model_understanding/force_plots.py +++ b/evalml/model_understanding/force_plots.py @@ -57,7 +57,7 @@ def gen_force_plot(shap_values, training_data, expected_value, matplotlib): def force_plot(pipeline, rows_to_explain, training_data, y): - """Function to generate the data required to build a force plot. + r"""Function to generate the data required to build a force plot. Args: pipeline (PipelineBase): The pipeline to generate the force plot for. @@ -69,17 +69,13 @@ def force_plot(pipeline, rows_to_explain, training_data, y): list(dict()): list of dictionaries where each dict contains force plot data. Each dictionary entry represents the explanations for a single row. - .. code-block:: - - For single row binary force plots: - + For single row binary force plots: [{'malignant': {'expected_value': 0.37, 'feature_names': ['worst concave points', 'worst perimeter', 'worst radius'], 'shap_values': [0.09, 0.09, 0.08], 'plot': AdditiveForceVisualizer}] - For two row binary force plots: - + For two row binary force plots: [{'malignant': {'expected_value': 0.37, 'feature_names': ['worst concave points', 'worst perimeter', 'worst radius'], 'shap_values': [0.09, 0.09, 0.08], diff --git a/evalml/pipelines/binary_classification_pipeline.py b/evalml/pipelines/binary_classification_pipeline.py index 3695781e12..c169b502d4 100644 --- a/evalml/pipelines/binary_classification_pipeline.py +++ b/evalml/pipelines/binary_classification_pipeline.py @@ -26,6 +26,7 @@ class BinaryClassificationPipeline( """ problem_type = ProblemTypes.BINARY + """ProblemTypes.BINARY""" def _predict(self, X, objective=None): """Make predictions using selected features. diff --git a/evalml/pipelines/components/ensemble/stacked_ensemble_base.py b/evalml/pipelines/components/ensemble/stacked_ensemble_base.py index 1747254065..0db2f44d8d 100644 --- a/evalml/pipelines/components/ensemble/stacked_ensemble_base.py +++ b/evalml/pipelines/components/ensemble/stacked_ensemble_base.py @@ -30,6 +30,7 @@ class StackedEnsembleBase(Estimator): """ model_family = ModelFamily.ENSEMBLE + """ModelFamily.ENSEMBLE""" _stacking_estimator_class = None _default_final_estimator = None _default_cv = None diff --git a/evalml/pipelines/components/ensemble/stacked_ensemble_classifier.py b/evalml/pipelines/components/ensemble/stacked_ensemble_classifier.py index 0c1b7526b2..ff7b830584 100644 --- a/evalml/pipelines/components/ensemble/stacked_ensemble_classifier.py +++ b/evalml/pipelines/components/ensemble/stacked_ensemble_classifier.py @@ -31,13 +31,21 @@ class StackedEnsembleClassifier(StackedEnsembleBase): name = "Stacked Ensemble Classifier" model_family = ModelFamily.ENSEMBLE + """ModelFamily.ENSEMBLE""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """[ + ProblemTypes.BINARY, + ProblemTypes.MULTICLASS, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" hyperparameter_ranges = {} + """{}""" _stacking_estimator_class = StackingClassifier _default_final_estimator = LogisticRegressionClassifier _default_cv = StratifiedKFold diff --git a/evalml/pipelines/components/ensemble/stacked_ensemble_regressor.py b/evalml/pipelines/components/ensemble/stacked_ensemble_regressor.py index b7a9fb8139..15752b00fe 100644 --- a/evalml/pipelines/components/ensemble/stacked_ensemble_regressor.py +++ b/evalml/pipelines/components/ensemble/stacked_ensemble_regressor.py @@ -31,11 +31,17 @@ class StackedEnsembleRegressor(StackedEnsembleBase): name = "Stacked Ensemble Regressor" model_family = ModelFamily.ENSEMBLE + """ModelFamily.ENSEMBLE""" supported_problem_types = [ ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION, ] + """[ + ProblemTypes.REGRESSION, + ProblemTypes.TIME_SERIES_REGRESSION, + ]""" hyperparameter_ranges = {} + """{}""" _stacking_estimator_class = StackingRegressor _default_final_estimator = LinearRegressor _default_cv = KFold diff --git a/evalml/pipelines/components/estimators/classifiers/baseline_classifier.py b/evalml/pipelines/components/estimators/classifiers/baseline_classifier.py index 303221b55a..909744c722 100644 --- a/evalml/pipelines/components/estimators/classifiers/baseline_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/baseline_classifier.py @@ -19,8 +19,11 @@ class BaselineClassifier(Estimator): name = "Baseline Classifier" hyperparameter_ranges = {} + """{}""" model_family = ModelFamily.BASELINE + """ModelFamily.BASELINE""" supported_problem_types = [ProblemTypes.BINARY, ProblemTypes.MULTICLASS] + """[ProblemTypes.BINARY, ProblemTypes.MULTICLASS]""" def __init__(self, strategy="mode", random_seed=0, **kwargs): if strategy not in ["mode", "random", "random_weighted"]: diff --git a/evalml/pipelines/components/estimators/classifiers/catboost_classifier.py b/evalml/pipelines/components/estimators/classifiers/catboost_classifier.py index d7a467dc9d..9dda2f9eb1 100644 --- a/evalml/pipelines/components/estimators/classifiers/catboost_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/catboost_classifier.py @@ -36,13 +36,25 @@ class CatBoostClassifier(Estimator): "eta": Real(0.000001, 1), "max_depth": Integer(4, 10), } + """{ + "n_estimators": Integer(4, 100), + "eta": Real(0.000001, 1), + "max_depth": Integer(4, 10), + }""" model_family = ModelFamily.CATBOOST + """ModelFamily.CATBOOST""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """[ + ProblemTypes.BINARY, + ProblemTypes.MULTICLASS, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/classifiers/decision_tree_classifier.py b/evalml/pipelines/components/estimators/classifiers/decision_tree_classifier.py index 94f73a58f1..07dab70f8f 100644 --- a/evalml/pipelines/components/estimators/classifiers/decision_tree_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/decision_tree_classifier.py @@ -42,13 +42,25 @@ class DecisionTreeClassifier(Estimator): "max_features": ["auto", "sqrt", "log2"], "max_depth": Integer(4, 10), } + """{ + "criterion": ["gini", "entropy"], + "max_features": ["auto", "sqrt", "log2"], + "max_depth": Integer(4, 10), + }""" model_family = ModelFamily.DECISION_TREE + """ModelFamily.DECISION_TREE""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """[ + ProblemTypes.BINARY, + ProblemTypes.MULTICLASS, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/classifiers/elasticnet_classifier.py b/evalml/pipelines/components/estimators/classifiers/elasticnet_classifier.py index 75354391b7..c41fb25a9b 100644 --- a/evalml/pipelines/components/estimators/classifiers/elasticnet_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/elasticnet_classifier.py @@ -38,13 +38,21 @@ class ElasticNetClassifier(Estimator): name = "Elastic Net Classifier" hyperparameter_ranges = {"C": Real(0.01, 10), "l1_ratio": Real(0, 1)} + """{"C": Real(0.01, 10), "l1_ratio": Real(0, 1)}""" model_family = ModelFamily.LINEAR_MODEL + """ModelFamily.LINEAR_MODEL""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """[ + ProblemTypes.BINARY, + ProblemTypes.MULTICLASS, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/classifiers/et_classifier.py b/evalml/pipelines/components/estimators/classifiers/et_classifier.py index b0426d5129..cc9b6d5e3e 100644 --- a/evalml/pipelines/components/estimators/classifiers/et_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/et_classifier.py @@ -42,13 +42,26 @@ class ExtraTreesClassifier(Estimator): "max_features": ["auto", "sqrt", "log2"], "max_depth": Integer(4, 10), } + """{ + "n_estimators": Integer(10, 1000), + "max_features": ["auto", "sqrt", "log2"], + "max_depth": Integer(4, 10), + } + """ model_family = ModelFamily.EXTRA_TREES + """ModelFamily.EXTRA_TREES""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """supported_problem_types = [ + ProblemTypes.BINARY, + ProblemTypes.MULTICLASS, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/classifiers/kneighbors_classifier.py b/evalml/pipelines/components/estimators/classifiers/kneighbors_classifier.py index 6c6eaec538..04d56beaa5 100644 --- a/evalml/pipelines/components/estimators/classifiers/kneighbors_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/kneighbors_classifier.py @@ -46,13 +46,27 @@ class KNeighborsClassifier(Estimator): "leaf_size": Integer(10, 30), "p": Integer(1, 5), } + """{ + "n_neighbors": Integer(2, 12), + "weights": ["uniform", "distance"], + "algorithm": ["auto", "ball_tree", "kd_tree", "brute"], + "leaf_size": Integer(10, 30), + "p": Integer(1, 5), + }""" model_family = ModelFamily.K_NEIGHBORS + """ModelFamily.K_NEIGHBORS""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """[ + ProblemTypes.BINARY, + ProblemTypes.MULTICLASS, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/classifiers/lightgbm_classifier.py b/evalml/pipelines/components/estimators/classifiers/lightgbm_classifier.py index 1517b8ddae..225c089843 100644 --- a/evalml/pipelines/components/estimators/classifiers/lightgbm_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/lightgbm_classifier.py @@ -53,16 +53,34 @@ class LightGBMClassifier(Estimator): "bagging_fraction": Real(0.000001, 1), "bagging_freq": Integer(0, 1), } + """{ + "learning_rate": Real(0.000001, 1), + "boosting_type": ["gbdt", "dart", "goss", "rf"], + "n_estimators": Integer(10, 100), + "max_depth": Integer(0, 10), + "num_leaves": Integer(2, 100), + "min_child_samples": Integer(1, 100), + "bagging_fraction": Real(0.000001, 1), + "bagging_freq": Integer(0, 1), + }""" model_family = ModelFamily.LIGHTGBM + """ModelFamily.LIGHTGBM""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """[ + ProblemTypes.BINARY, + ProblemTypes.MULTICLASS, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" SEED_MIN = 0 SEED_MAX = SEED_BOUNDS.max_bound + """SEED_BOUNDS.max_bound""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/classifiers/logistic_regression_classifier.py b/evalml/pipelines/components/estimators/classifiers/logistic_regression_classifier.py index fbc6498420..5a7443c313 100644 --- a/evalml/pipelines/components/estimators/classifiers/logistic_regression_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/logistic_regression_classifier.py @@ -37,13 +37,24 @@ class LogisticRegressionClassifier(Estimator): "penalty": ["l2"], "C": Real(0.01, 10), } + """{ + "penalty": ["l2"], + "C": Real(0.01, 10), + }""" model_family = ModelFamily.LINEAR_MODEL + """model_family = ModelFamily.LINEAR_MODEL""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """[ + ProblemTypes.BINARY, + ProblemTypes.MULTICLASS, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/classifiers/rf_classifier.py b/evalml/pipelines/components/estimators/classifiers/rf_classifier.py index 405d17f7d6..7868d31701 100644 --- a/evalml/pipelines/components/estimators/classifiers/rf_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/rf_classifier.py @@ -22,13 +22,24 @@ class RandomForestClassifier(Estimator): "n_estimators": Integer(10, 1000), "max_depth": Integer(1, 10), } + """{ + "n_estimators": Integer(10, 1000), + "max_depth": Integer(1, 10), + }""" model_family = ModelFamily.RANDOM_FOREST + """model_family = ModelFamily.RANDOM_FOREST""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """[ + ProblemTypes.BINARY, + ProblemTypes.MULTICLASS, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" def __init__( self, n_estimators=100, max_depth=6, n_jobs=-1, random_seed=0, **kwargs diff --git a/evalml/pipelines/components/estimators/classifiers/svm_classifier.py b/evalml/pipelines/components/estimators/classifiers/svm_classifier.py index 41a6d07ee3..e82b097628 100644 --- a/evalml/pipelines/components/estimators/classifiers/svm_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/svm_classifier.py @@ -28,13 +28,25 @@ class SVMClassifier(Estimator): "kernel": ["linear", "poly", "rbf", "sigmoid", "precomputed"], "gamma": ["scale", "auto"], } + """{ + "C": Real(0, 10), + "kernel": ["linear", "poly", "rbf", "sigmoid", "precomputed"], + "gamma": ["scale", "auto"], + }""" model_family = ModelFamily.SVM + """ModelFamily.SVM""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """[ + ProblemTypes.BINARY, + ProblemTypes.MULTICLASS, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/classifiers/xgboost_classifier.py b/evalml/pipelines/components/estimators/classifiers/xgboost_classifier.py index 2bd0c8edbc..0862d5d36f 100644 --- a/evalml/pipelines/components/estimators/classifiers/xgboost_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/xgboost_classifier.py @@ -29,13 +29,26 @@ class XGBoostClassifier(Estimator): "min_child_weight": Real(1, 10), "n_estimators": Integer(1, 1000), } + """{ + "eta": Real(0.000001, 1), + "max_depth": Integer(1, 10), + "min_child_weight": Real(1, 10), + "n_estimators": Integer(1, 1000), + }""" model_family = ModelFamily.XGBOOST + """ModelFamily.XGBOOST""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """[ + ProblemTypes.BINARY, + ProblemTypes.MULTICLASS, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" # xgboost supports seeds from -2**31 to 2**31 - 1 inclusive. these limits ensure the random seed generated below # is within that range. diff --git a/evalml/pipelines/components/estimators/estimator.py b/evalml/pipelines/components/estimators/estimator.py index 284b5429bd..fdfa1de967 100644 --- a/evalml/pipelines/components/estimators/estimator.py +++ b/evalml/pipelines/components/estimators/estimator.py @@ -26,6 +26,7 @@ class Estimator(ComponentBase): # We can't use the inspect module to dynamically determine this because of issue 1582 predict_uses_y = False model_family = ModelFamily.NONE + """ModelFamily.NONE""" @property @classmethod diff --git a/evalml/pipelines/components/estimators/regressors/arima_regressor.py b/evalml/pipelines/components/estimators/regressors/arima_regressor.py index b041c83815..716bf71c03 100644 --- a/evalml/pipelines/components/estimators/regressors/arima_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/arima_regressor.py @@ -42,8 +42,19 @@ class ARIMARegressor(Estimator): "max_q": Integer(3, 10), "seasonal": [True, False], } + """{ + "start_p": Integer(1, 3), + "d": Integer(0, 2), + "start_q": Integer(1, 3), + "max_p": Integer(3, 10), + "max_d": Integer(2, 5), + "max_q": Integer(3, 10), + "seasonal": [True, False], + }""" model_family = ModelFamily.ARIMA + """ModelFamily.ARIMA""" supported_problem_types = [ProblemTypes.TIME_SERIES_REGRESSION] + """[ProblemTypes.TIME_SERIES_REGRESSION]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/regressors/baseline_regressor.py b/evalml/pipelines/components/estimators/regressors/baseline_regressor.py index c0b2a020d1..570ecf2784 100644 --- a/evalml/pipelines/components/estimators/regressors/baseline_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/baseline_regressor.py @@ -19,11 +19,17 @@ class BaselineRegressor(Estimator): name = "Baseline Regressor" hyperparameter_ranges = {} + """{}""" model_family = ModelFamily.BASELINE + """ModelFamily.BASELINE""" supported_problem_types = [ ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION, ] + """[ + ProblemTypes.REGRESSION, + ProblemTypes.TIME_SERIES_REGRESSION, + ]""" def __init__(self, strategy="mean", random_seed=0, **kwargs): if strategy not in ["mean", "median"]: diff --git a/evalml/pipelines/components/estimators/regressors/catboost_regressor.py b/evalml/pipelines/components/estimators/regressors/catboost_regressor.py index c6c6f3b51b..aeb085fe4b 100644 --- a/evalml/pipelines/components/estimators/regressors/catboost_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/catboost_regressor.py @@ -33,11 +33,21 @@ class CatBoostRegressor(Estimator): "eta": Real(0.000001, 1), "max_depth": Integer(4, 10), } + """{ + "n_estimators": Integer(4, 100), + "eta": Real(0.000001, 1), + "max_depth": Integer(4, 10), + }""" model_family = ModelFamily.CATBOOST + """ModelFamily.CATBOOST""" supported_problem_types = [ ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION, ] + """[ + ProblemTypes.REGRESSION, + ProblemTypes.TIME_SERIES_REGRESSION, + ]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/regressors/decision_tree_regressor.py b/evalml/pipelines/components/estimators/regressors/decision_tree_regressor.py index 3a5adbc9c6..be629ca313 100644 --- a/evalml/pipelines/components/estimators/regressors/decision_tree_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/decision_tree_regressor.py @@ -46,11 +46,21 @@ class DecisionTreeRegressor(Estimator): "max_features": ["auto", "sqrt", "log2"], "max_depth": Integer(4, 10), } + """{ + "criterion": ["mse", "friedman_mse", "mae"], + "max_features": ["auto", "sqrt", "log2"], + "max_depth": Integer(4, 10), + }""" model_family = ModelFamily.DECISION_TREE + """ModelFamily.DECISION_TREE""" supported_problem_types = [ ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION, ] + """[ + ProblemTypes.REGRESSION, + ProblemTypes.TIME_SERIES_REGRESSION, + ]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/regressors/elasticnet_regressor.py b/evalml/pipelines/components/estimators/regressors/elasticnet_regressor.py index f9dad8139c..b42999e8d7 100644 --- a/evalml/pipelines/components/estimators/regressors/elasticnet_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/elasticnet_regressor.py @@ -24,11 +24,20 @@ class ElasticNetRegressor(Estimator): "alpha": Real(0, 1), "l1_ratio": Real(0, 1), } + """{ + "alpha": Real(0, 1), + "l1_ratio": Real(0, 1), + }""" model_family = ModelFamily.LINEAR_MODEL + """ModelFamily.LINEAR_MODEL""" supported_problem_types = [ ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION, ] + """[ + ProblemTypes.REGRESSION, + ProblemTypes.TIME_SERIES_REGRESSION, + ]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/regressors/et_regressor.py b/evalml/pipelines/components/estimators/regressors/et_regressor.py index 6812674778..b63a8ccdd9 100644 --- a/evalml/pipelines/components/estimators/regressors/et_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/et_regressor.py @@ -41,11 +41,21 @@ class ExtraTreesRegressor(Estimator): "max_features": ["auto", "sqrt", "log2"], "max_depth": Integer(4, 10), } + """{ + "n_estimators": Integer(10, 1000), + "max_features": ["auto", "sqrt", "log2"], + "max_depth": Integer(4, 10), + }""" model_family = ModelFamily.EXTRA_TREES + """ModelFamily.EXTRA_TREES""" supported_problem_types = [ ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION, ] + """[ + ProblemTypes.REGRESSION, + ProblemTypes.TIME_SERIES_REGRESSION, + ]""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/regressors/lightgbm_regressor.py b/evalml/pipelines/components/estimators/regressors/lightgbm_regressor.py index f952a5fb8a..9d18c4f2b4 100644 --- a/evalml/pipelines/components/estimators/regressors/lightgbm_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/lightgbm_regressor.py @@ -51,11 +51,24 @@ class LightGBMRegressor(Estimator): "bagging_fraction": Real(0.000001, 1), "bagging_freq": Integer(0, 1), } + """{ + "learning_rate": Real(0.000001, 1), + "boosting_type": ["gbdt", "dart", "goss", "rf"], + "n_estimators": Integer(10, 100), + "max_depth": Integer(0, 10), + "num_leaves": Integer(2, 100), + "min_child_samples": Integer(1, 100), + "bagging_fraction": Real(0.000001, 1), + "bagging_freq": Integer(0, 1), + }""" model_family = ModelFamily.LIGHTGBM + """ModelFamily.LIGHTGBM""" supported_problem_types = [ProblemTypes.REGRESSION] + """[ProblemTypes.REGRESSION]""" SEED_MIN = 0 SEED_MAX = SEED_BOUNDS.max_bound + """SEED_BOUNDS.max_bound""" def __init__( self, diff --git a/evalml/pipelines/components/estimators/regressors/linear_regressor.py b/evalml/pipelines/components/estimators/regressors/linear_regressor.py index 5268f9e77b..bb6a9d91d2 100644 --- a/evalml/pipelines/components/estimators/regressors/linear_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/linear_regressor.py @@ -21,11 +21,17 @@ class LinearRegressor(Estimator): name = "Linear Regressor" hyperparameter_ranges = {"fit_intercept": [True, False], "normalize": [True, False]} + """{"fit_intercept": [True, False], "normalize": [True, False]}""" model_family = ModelFamily.LINEAR_MODEL + """ModelFamily.LINEAR_MODEL""" supported_problem_types = [ ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION, ] + """[ + ProblemTypes.REGRESSION, + ProblemTypes.TIME_SERIES_REGRESSION, + ]""" def __init__( self, fit_intercept=True, normalize=False, n_jobs=-1, random_seed=0, **kwargs diff --git a/evalml/pipelines/components/estimators/regressors/rf_regressor.py b/evalml/pipelines/components/estimators/regressors/rf_regressor.py index bed03318b8..c24016ae0b 100644 --- a/evalml/pipelines/components/estimators/regressors/rf_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/rf_regressor.py @@ -21,11 +21,20 @@ class RandomForestRegressor(Estimator): "n_estimators": Integer(10, 1000), "max_depth": Integer(1, 32), } + """{ + "n_estimators": Integer(10, 1000), + "max_depth": Integer(1, 32), + }""" model_family = ModelFamily.RANDOM_FOREST + """ModelFamily.RANDOM_FOREST""" supported_problem_types = [ ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION, ] + """[ + ProblemTypes.REGRESSION, + ProblemTypes.TIME_SERIES_REGRESSION, + ]""" def __init__( self, n_estimators=100, max_depth=6, n_jobs=-1, random_seed=0, **kwargs diff --git a/evalml/pipelines/components/estimators/regressors/svm_regressor.py b/evalml/pipelines/components/estimators/regressors/svm_regressor.py index fd4312921c..6e898dbefc 100644 --- a/evalml/pipelines/components/estimators/regressors/svm_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/svm_regressor.py @@ -26,11 +26,21 @@ class SVMRegressor(Estimator): "kernel": ["linear", "poly", "rbf", "sigmoid", "precomputed"], "gamma": ["scale", "auto"], } + """{ + "C": Real(0, 10), + "kernel": ["linear", "poly", "rbf", "sigmoid", "precomputed"], + "gamma": ["scale", "auto"], + }""" model_family = ModelFamily.SVM + """ModelFamily.SVM""" supported_problem_types = [ ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION, ] + """[ + ProblemTypes.REGRESSION, + ProblemTypes.TIME_SERIES_REGRESSION, + ]""" def __init__(self, C=1.0, kernel="rbf", gamma="scale", random_seed=0, **kwargs): parameters = {"C": C, "kernel": kernel, "gamma": gamma} diff --git a/evalml/pipelines/components/estimators/regressors/time_series_baseline_estimator.py b/evalml/pipelines/components/estimators/regressors/time_series_baseline_estimator.py index d6fe466ed7..ad5e791567 100644 --- a/evalml/pipelines/components/estimators/regressors/time_series_baseline_estimator.py +++ b/evalml/pipelines/components/estimators/regressors/time_series_baseline_estimator.py @@ -19,12 +19,19 @@ class TimeSeriesBaselineEstimator(Estimator): name = "Time Series Baseline Estimator" hyperparameter_ranges = {} + """{}""" model_family = ModelFamily.BASELINE + """ModelFamily.BASELINE""" supported_problem_types = [ ProblemTypes.TIME_SERIES_REGRESSION, ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] + """[ + ProblemTypes.TIME_SERIES_REGRESSION, + ProblemTypes.TIME_SERIES_BINARY, + ProblemTypes.TIME_SERIES_MULTICLASS, + ]""" predict_uses_y = True def __init__(self, gap=1, random_seed=0, **kwargs): diff --git a/evalml/pipelines/components/estimators/regressors/xgboost_regressor.py b/evalml/pipelines/components/estimators/regressors/xgboost_regressor.py index 6c08785173..ee6bff0941 100644 --- a/evalml/pipelines/components/estimators/regressors/xgboost_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/xgboost_regressor.py @@ -28,11 +28,22 @@ class XGBoostRegressor(Estimator): "min_child_weight": Real(1, 10), "n_estimators": Integer(1, 1000), } + """{ + "eta": Real(0.000001, 1), + "max_depth": Integer(1, 20), + "min_child_weight": Real(1, 10), + "n_estimators": Integer(1, 1000), + }""" model_family = ModelFamily.XGBOOST + """ModelFamily.XGBOOST""" supported_problem_types = [ ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION, ] + """[ + ProblemTypes.REGRESSION, + ProblemTypes.TIME_SERIES_REGRESSION, + ]""" # xgboost supports seeds from -2**31 to 2**31 - 1 inclusive. these limits ensure the random seed generated below # is within that range. diff --git a/evalml/pipelines/components/transformers/column_selectors.py b/evalml/pipelines/components/transformers/column_selectors.py index 71857bf506..42be2fe597 100644 --- a/evalml/pipelines/components/transformers/column_selectors.py +++ b/evalml/pipelines/components/transformers/column_selectors.py @@ -75,6 +75,7 @@ class DropColumns(ColumnSelector): name = "Drop Columns Transformer" hyperparameter_ranges = {} + """{}""" needs_fitting = False def _modify_columns(self, cols, X, y=None): @@ -104,6 +105,7 @@ class SelectColumns(ColumnSelector): name = "Select Columns Transformer" hyperparameter_ranges = {} + """{}""" needs_fitting = False def _modify_columns(self, cols, X, y=None): diff --git a/evalml/pipelines/components/transformers/dimensionality_reduction/lda.py b/evalml/pipelines/components/transformers/dimensionality_reduction/lda.py index a2b6150ec4..d05836ae82 100644 --- a/evalml/pipelines/components/transformers/dimensionality_reduction/lda.py +++ b/evalml/pipelines/components/transformers/dimensionality_reduction/lda.py @@ -20,6 +20,7 @@ class LinearDiscriminantAnalysis(Transformer): name = "Linear Discriminant Analysis Transformer" hyperparameter_ranges = {} + """{}""" def __init__(self, n_components=None, random_seed=0, **kwargs): if n_components and n_components < 1: diff --git a/evalml/pipelines/components/transformers/dimensionality_reduction/pca.py b/evalml/pipelines/components/transformers/dimensionality_reduction/pca.py index 32a14535e0..9e3a2ae0d1 100644 --- a/evalml/pipelines/components/transformers/dimensionality_reduction/pca.py +++ b/evalml/pipelines/components/transformers/dimensionality_reduction/pca.py @@ -24,6 +24,7 @@ class PCA(Transformer): name = "PCA Transformer" hyperparameter_ranges = {"variance": Real(0.25, 1)} + """{"variance": Real(0.25, 1)}""" def __init__(self, variance=0.95, n_components=None, random_seed=0, **kwargs): parameters = {"variance": variance, "n_components": n_components} diff --git a/evalml/pipelines/components/transformers/encoders/onehot_encoder.py b/evalml/pipelines/components/transformers/encoders/onehot_encoder.py index 86c7bf6293..68beaaf276 100644 --- a/evalml/pipelines/components/transformers/encoders/onehot_encoder.py +++ b/evalml/pipelines/components/transformers/encoders/onehot_encoder.py @@ -41,6 +41,7 @@ class OneHotEncoder(Transformer, metaclass=OneHotEncoderMeta): name = "One Hot Encoder" hyperparameter_ranges = {} + """{}""" def __init__( self, diff --git a/evalml/pipelines/components/transformers/encoders/target_encoder.py b/evalml/pipelines/components/transformers/encoders/target_encoder.py index ac4f86bc5d..543868e5ad 100644 --- a/evalml/pipelines/components/transformers/encoders/target_encoder.py +++ b/evalml/pipelines/components/transformers/encoders/target_encoder.py @@ -31,6 +31,7 @@ class TargetEncoder(Transformer, metaclass=OneHotEncoderMeta): name = "Target Encoder" hyperparameter_ranges = {} + """{}""" def __init__( self, diff --git a/evalml/pipelines/components/transformers/feature_selection/rf_classifier_feature_selector.py b/evalml/pipelines/components/transformers/feature_selection/rf_classifier_feature_selector.py index 9444f76484..a0e616687a 100644 --- a/evalml/pipelines/components/transformers/feature_selection/rf_classifier_feature_selector.py +++ b/evalml/pipelines/components/transformers/feature_selection/rf_classifier_feature_selector.py @@ -31,6 +31,10 @@ class RFClassifierSelectFromModel(FeatureSelector): "percent_features": Real(0.01, 1), "threshold": ["mean", -np.inf], } + """{ + "percent_features": Real(0.01, 1), + "threshold": ["mean", -np.inf], + }""" def __init__( self, diff --git a/evalml/pipelines/components/transformers/feature_selection/rf_regressor_feature_selector.py b/evalml/pipelines/components/transformers/feature_selection/rf_regressor_feature_selector.py index b1f98ac71d..ba8a1258fd 100644 --- a/evalml/pipelines/components/transformers/feature_selection/rf_regressor_feature_selector.py +++ b/evalml/pipelines/components/transformers/feature_selection/rf_regressor_feature_selector.py @@ -31,6 +31,10 @@ class RFRegressorSelectFromModel(FeatureSelector): "percent_features": Real(0.01, 1), "threshold": ["mean", -np.inf], } + """{ + "percent_features": Real(0.01, 1), + "threshold": ["mean", -np.inf], + }""" def __init__( self, diff --git a/evalml/pipelines/components/transformers/imputers/imputer.py b/evalml/pipelines/components/transformers/imputers/imputer.py index 07a36446e8..613434c1fb 100644 --- a/evalml/pipelines/components/transformers/imputers/imputer.py +++ b/evalml/pipelines/components/transformers/imputers/imputer.py @@ -24,6 +24,10 @@ class Imputer(Transformer): "categorical_impute_strategy": ["most_frequent"], "numeric_impute_strategy": ["mean", "median", "most_frequent"], } + """{ + "categorical_impute_strategy": ["most_frequent"], + "numeric_impute_strategy": ["mean", "median", "most_frequent"], + }""" _valid_categorical_impute_strategies = set(["most_frequent", "constant"]) _valid_numeric_impute_strategies = set( ["mean", "median", "most_frequent", "constant"] diff --git a/evalml/pipelines/components/transformers/imputers/per_column_imputer.py b/evalml/pipelines/components/transformers/imputers/per_column_imputer.py index 7ac1fcbce6..1cee5b7159 100644 --- a/evalml/pipelines/components/transformers/imputers/per_column_imputer.py +++ b/evalml/pipelines/components/transformers/imputers/per_column_imputer.py @@ -25,6 +25,7 @@ class PerColumnImputer(Transformer): name = "Per Column Imputer" hyperparameter_ranges = {} + """{}""" def __init__( self, diff --git a/evalml/pipelines/components/transformers/imputers/simple_imputer.py b/evalml/pipelines/components/transformers/imputers/simple_imputer.py index 6850ed94a8..8d8da8ffd7 100644 --- a/evalml/pipelines/components/transformers/imputers/simple_imputer.py +++ b/evalml/pipelines/components/transformers/imputers/simple_imputer.py @@ -22,6 +22,7 @@ class SimpleImputer(Transformer): name = "Simple Imputer" hyperparameter_ranges = {"impute_strategy": ["mean", "median", "most_frequent"]} + """{"impute_strategy": ["mean", "median", "most_frequent"]}""" def __init__( self, impute_strategy="most_frequent", fill_value=None, random_seed=0, **kwargs diff --git a/evalml/pipelines/components/transformers/imputers/target_imputer.py b/evalml/pipelines/components/transformers/imputers/target_imputer.py index 2f8c1e36a0..e47dc396ea 100644 --- a/evalml/pipelines/components/transformers/imputers/target_imputer.py +++ b/evalml/pipelines/components/transformers/imputers/target_imputer.py @@ -47,6 +47,7 @@ class TargetImputer(Transformer, metaclass=TargetImputerMeta): name = "Target Imputer" hyperparameter_ranges = {"impute_strategy": ["mean", "median", "most_frequent"]} + """{"impute_strategy": ["mean", "median", "most_frequent"]}""" def __init__( self, impute_strategy="most_frequent", fill_value=None, random_seed=0, **kwargs diff --git a/evalml/pipelines/components/transformers/preprocessing/datetime_featurizer.py b/evalml/pipelines/components/transformers/preprocessing/datetime_featurizer.py index 5e6daa2e9a..95335ceafb 100644 --- a/evalml/pipelines/components/transformers/preprocessing/datetime_featurizer.py +++ b/evalml/pipelines/components/transformers/preprocessing/datetime_featurizer.py @@ -69,6 +69,7 @@ class DateTimeFeaturizer(Transformer): name = "DateTime Featurization Component" hyperparameter_ranges = {} + """{}""" _function_mappings = { "year": _extract_year, "month": _extract_month, diff --git a/evalml/pipelines/components/transformers/preprocessing/delayed_feature_transformer.py b/evalml/pipelines/components/transformers/preprocessing/delayed_feature_transformer.py index 93217c4e2b..3f9d86e0ca 100644 --- a/evalml/pipelines/components/transformers/preprocessing/delayed_feature_transformer.py +++ b/evalml/pipelines/components/transformers/preprocessing/delayed_feature_transformer.py @@ -23,6 +23,7 @@ class DelayedFeatureTransformer(Transformer): name = "Delayed Feature Transformer" hyperparameter_ranges = {} + """{}""" needs_fitting = False def __init__( diff --git a/evalml/pipelines/components/transformers/preprocessing/drop_null_columns.py b/evalml/pipelines/components/transformers/preprocessing/drop_null_columns.py index 7d5f3d871a..521fa6bfd7 100644 --- a/evalml/pipelines/components/transformers/preprocessing/drop_null_columns.py +++ b/evalml/pipelines/components/transformers/preprocessing/drop_null_columns.py @@ -14,6 +14,7 @@ class DropNullColumns(Transformer): name = "Drop Null Columns Transformer" hyperparameter_ranges = {} + """{}""" def __init__(self, pct_null_threshold=1.0, random_seed=0, **kwargs): if pct_null_threshold < 0 or pct_null_threshold > 1: diff --git a/evalml/pipelines/components/transformers/preprocessing/featuretools.py b/evalml/pipelines/components/transformers/preprocessing/featuretools.py index 1004b9cb69..e6e4feb36a 100644 --- a/evalml/pipelines/components/transformers/preprocessing/featuretools.py +++ b/evalml/pipelines/components/transformers/preprocessing/featuretools.py @@ -18,6 +18,7 @@ class DFSTransformer(Transformer): name = "DFS Transformer" hyperparameter_ranges = {} + """{}""" def __init__(self, index="index", random_seed=0, **kwargs): parameters = {"index": index} diff --git a/evalml/pipelines/components/transformers/preprocessing/lsa.py b/evalml/pipelines/components/transformers/preprocessing/lsa.py index 3f54a2664a..2fc239355a 100644 --- a/evalml/pipelines/components/transformers/preprocessing/lsa.py +++ b/evalml/pipelines/components/transformers/preprocessing/lsa.py @@ -18,6 +18,7 @@ class LSA(TextTransformer): name = "LSA Transformer" hyperparameter_ranges = {} + """{}""" def __init__(self, random_seed=0, **kwargs): self._lsa_pipeline = make_pipeline( diff --git a/evalml/pipelines/components/transformers/preprocessing/polynomial_detrender.py b/evalml/pipelines/components/transformers/preprocessing/polynomial_detrender.py index 3e7897576b..06cb30890c 100644 --- a/evalml/pipelines/components/transformers/preprocessing/polynomial_detrender.py +++ b/evalml/pipelines/components/transformers/preprocessing/polynomial_detrender.py @@ -19,6 +19,7 @@ class PolynomialDetrender(TargetTransformer): name = "Polynomial Detrender" hyperparameter_ranges = {"degree": Integer(1, 3)} + """{"degree": Integer(1, 3)}""" def __init__(self, degree=1, random_seed=0, **kwargs): if not isinstance(degree, int): diff --git a/evalml/pipelines/components/transformers/preprocessing/text_featurizer.py b/evalml/pipelines/components/transformers/preprocessing/text_featurizer.py index 01f13016f3..c9ace06677 100644 --- a/evalml/pipelines/components/transformers/preprocessing/text_featurizer.py +++ b/evalml/pipelines/components/transformers/preprocessing/text_featurizer.py @@ -19,6 +19,7 @@ class TextFeaturizer(TextTransformer): name = "Text Featurization Component" hyperparameter_ranges = {} + """{}""" def __init__(self, random_seed=0, **kwargs): self._trans = [ diff --git a/evalml/pipelines/components/transformers/samplers/oversamplers.py b/evalml/pipelines/components/transformers/samplers/oversamplers.py index 5914f5e95d..d139977ee7 100644 --- a/evalml/pipelines/components/transformers/samplers/oversamplers.py +++ b/evalml/pipelines/components/transformers/samplers/oversamplers.py @@ -19,6 +19,7 @@ class SMOTESampler(BaseOverSampler): name = "SMOTE Oversampler" hyperparameter_ranges = {} + """{}""" def __init__( self, @@ -54,6 +55,7 @@ class SMOTENCSampler(BaseOverSampler): name = "SMOTENC Oversampler" hyperparameter_ranges = {} + """{}""" def __init__( self, @@ -105,6 +107,7 @@ class SMOTENSampler(BaseOverSampler): name = "SMOTEN Oversampler" hyperparameter_ranges = {} + """{}""" def __init__( self, diff --git a/evalml/pipelines/components/transformers/samplers/undersampler.py b/evalml/pipelines/components/transformers/samplers/undersampler.py index 379f0fe26c..ec5815fcae 100644 --- a/evalml/pipelines/components/transformers/samplers/undersampler.py +++ b/evalml/pipelines/components/transformers/samplers/undersampler.py @@ -31,6 +31,7 @@ class Undersampler(BaseSampler): name = "Undersampler" hyperparameter_ranges = {} + """{}""" def __init__( self, diff --git a/evalml/pipelines/components/transformers/scalers/standard_scaler.py b/evalml/pipelines/components/transformers/scalers/standard_scaler.py index aae5a852d6..4ad6393de8 100644 --- a/evalml/pipelines/components/transformers/scalers/standard_scaler.py +++ b/evalml/pipelines/components/transformers/scalers/standard_scaler.py @@ -19,6 +19,7 @@ class StandardScaler(Transformer): name = "Standard Scaler" hyperparameter_ranges = {} + """{}""" def __init__(self, random_seed=0, **kwargs): parameters = {} diff --git a/evalml/pipelines/components/transformers/transformer.py b/evalml/pipelines/components/transformers/transformer.py index 38a75f9b03..4f6908edfa 100644 --- a/evalml/pipelines/components/transformers/transformer.py +++ b/evalml/pipelines/components/transformers/transformer.py @@ -30,6 +30,7 @@ class Transformer(ComponentBase): """ model_family = ModelFamily.NONE + """ModelFamily.NONE""" def transform(self, X, y=None): """Transforms data X. diff --git a/evalml/pipelines/multiclass_classification_pipeline.py b/evalml/pipelines/multiclass_classification_pipeline.py index 3dd6ab4403..3efe301a9c 100644 --- a/evalml/pipelines/multiclass_classification_pipeline.py +++ b/evalml/pipelines/multiclass_classification_pipeline.py @@ -18,3 +18,4 @@ class MulticlassClassificationPipeline(ClassificationPipeline): """ problem_type = ProblemTypes.MULTICLASS + """ProblemTypes.MULTICLASS""" diff --git a/evalml/pipelines/pipeline_base.py b/evalml/pipelines/pipeline_base.py index d087b6799c..c05da83f04 100644 --- a/evalml/pipelines/pipeline_base.py +++ b/evalml/pipelines/pipeline_base.py @@ -55,6 +55,7 @@ class PipelineBase(ABC, metaclass=PipelineBaseMeta): """ problem_type = None + """None""" def __init__( self, diff --git a/evalml/pipelines/regression_pipeline.py b/evalml/pipelines/regression_pipeline.py index 09d63fcbe1..4dbb6abf0a 100644 --- a/evalml/pipelines/regression_pipeline.py +++ b/evalml/pipelines/regression_pipeline.py @@ -19,6 +19,7 @@ class RegressionPipeline(PipelineBase): """ problem_type = ProblemTypes.REGRESSION + """ProblemTypes.REGRESSION""" def fit(self, X, y): """Build a regression model. diff --git a/evalml/pipelines/time_series_classification_pipelines.py b/evalml/pipelines/time_series_classification_pipelines.py index c16f24b9af..070feb3743 100644 --- a/evalml/pipelines/time_series_classification_pipelines.py +++ b/evalml/pipelines/time_series_classification_pipelines.py @@ -265,3 +265,4 @@ class TimeSeriesMulticlassClassificationPipeline(TimeSeriesClassificationPipelin """ problem_type = ProblemTypes.TIME_SERIES_MULTICLASS + """ProblemTypes.TIME_SERIES_MULTICLASS""" diff --git a/evalml/pipelines/time_series_regression_pipeline.py b/evalml/pipelines/time_series_regression_pipeline.py index 222d79a9ea..965d52da02 100644 --- a/evalml/pipelines/time_series_regression_pipeline.py +++ b/evalml/pipelines/time_series_regression_pipeline.py @@ -29,6 +29,7 @@ class TimeSeriesRegressionPipeline( """ problem_type = ProblemTypes.TIME_SERIES_REGRESSION + """ProblemTypes.TIME_SERIES_REGRESSIO""" def __init__( self, diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 02a32932e3..0000000000 --- a/requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ --r core-requirements.txt -plotly>=5.0.0 -kaleido>=0.1.0 -ipywidgets>=7.5 -xgboost>=1.1.0,<1.3.0 -catboost>=0.20 -lightgbm>=2.3.1 -matplotlib>=3.3.3 -graphviz>=0.13 -seaborn>=0.11.1 -category_encoders>=2.2.2 -statsmodels >= 0.12.2 -imbalanced-learn>=0.8.0 -pmdarima==1.8.0 -sktime>=0.5.3;python_version<"3.9" diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index a4b1924605..0000000000 --- a/test-requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -wheel>=0.33.1 -setuptools>=50.0.1 -pytest==6.0.1 -pytest-xdist==2.1.0 -pytest-timeout==1.4.2 -pytest-cov==2.10.1 -nbval==0.9.3 -IPython>=5.0.0 -codecov==2.1.11 -PyYAML==5.4 From cf5f845825adbdf241dad41eeff3f55ca509ae68 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Fri, 2 Jul 2021 17:07:32 -0400 Subject: [PATCH 07/19] Add back requirements files --- core-requirements.txt | 4 ++++ dev-requirements.txt | 7 +++++++ docs-requirements.txt | 6 ++++++ requirements.txt | 15 +++++++++++++++ test-requirements.txt | 10 ++++++++++ 5 files changed, 42 insertions(+) create mode 100644 dev-requirements.txt create mode 100644 docs-requirements.txt create mode 100644 requirements.txt create mode 100644 test-requirements.txt diff --git a/core-requirements.txt b/core-requirements.txt index 4faf973d99..998257a1be 100644 --- a/core-requirements.txt +++ b/core-requirements.txt @@ -11,7 +11,11 @@ psutil>=5.6.6 requirements-parser>=0.2.0 shap>=0.36.0 texttable>=1.6.2 +<<<<<<< HEAD woodwork>=0.4.1,<0.5.0 +======= +woodwork>=0.4.1 +>>>>>>> Add back requirements files dask>=2.12.0 featuretools>=0.21.0 nlp-primitives>=1.1.0 diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000000..e2b3876b0d --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,7 @@ +-r requirements.txt +-r test-requirements.txt +-r docs-requirements.txt +flake8==3.7.0 +black==21.5b1 +isort==5.0.0 + diff --git a/docs-requirements.txt b/docs-requirements.txt new file mode 100644 index 0000000000..4e8a1003d7 --- /dev/null +++ b/docs-requirements.txt @@ -0,0 +1,6 @@ +docutils>=0.15.2,<0.17 +pydata-sphinx-theme>=0.3.1 +Sphinx>=2.0.1,<4.0.0 +nbconvert>=5.5.0 +nbsphinx>=0.8.5 +sphinx-autoapi \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000..02a32932e3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,15 @@ +-r core-requirements.txt +plotly>=5.0.0 +kaleido>=0.1.0 +ipywidgets>=7.5 +xgboost>=1.1.0,<1.3.0 +catboost>=0.20 +lightgbm>=2.3.1 +matplotlib>=3.3.3 +graphviz>=0.13 +seaborn>=0.11.1 +category_encoders>=2.2.2 +statsmodels >= 0.12.2 +imbalanced-learn>=0.8.0 +pmdarima==1.8.0 +sktime>=0.5.3;python_version<"3.9" diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000000..a4b1924605 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,10 @@ +wheel>=0.33.1 +setuptools>=50.0.1 +pytest==6.0.1 +pytest-xdist==2.1.0 +pytest-timeout==1.4.2 +pytest-cov==2.10.1 +nbval==0.9.3 +IPython>=5.0.0 +codecov==2.1.11 +PyYAML==5.4 From 5da87b8b642a0e630352a613b242ea7715410081 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Fri, 2 Jul 2021 17:10:11 -0400 Subject: [PATCH 08/19] Add back warnings --- docs/source/conf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index a62cc412ba..49eb275581 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -286,10 +286,10 @@ def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): def setup(app): - # p = Path("/home/docs/.ipython/profile_default/startup") - # p.mkdir(parents=True, exist_ok=True) - # shutil.copy("disable-warnings.py", "/home/docs/.ipython/profile_default/startup/") - # shutil.copy("set-headers.py", "/home/docs/.ipython/profile_default/startup") + p = Path("/home/docs/.ipython/profile_default/startup") + p.mkdir(parents=True, exist_ok=True) + shutil.copy("disable-warnings.py", "/home/docs/.ipython/profile_default/startup/") + shutil.copy("set-headers.py", "/home/docs/.ipython/profile_default/startup") app.add_domain(PatchedPythonDomain, override=True) app.add_javascript( "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js" From 32e597e8ab5089a6b46faab436c4d0ded8890413 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Fri, 2 Jul 2021 18:17:52 -0400 Subject: [PATCH 09/19] Fix links in user guide --- docs/source/user_guide/automl.ipynb | 4 ++-- docs/source/user_guide/components.ipynb | 15 ++++++++------- docs/source/user_guide/data_checks.ipynb | 4 ++-- docs/source/user_guide/model_understanding.ipynb | 8 ++++---- docs/source/user_guide/pipelines.ipynb | 2 +- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/source/user_guide/automl.ipynb b/docs/source/user_guide/automl.ipynb index b74d503a16..a231efbbe8 100644 --- a/docs/source/user_guide/automl.ipynb +++ b/docs/source/user_guide/automl.ipynb @@ -150,14 +150,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The AutoML interface supports a variety of other parameters. For a comprehensive list, please [refer to the API reference.] (../generated/evalml.automl.AutoMLSearch.ipynb)" + "The AutoML interface supports a variety of other parameters. For a comprehensive list, please [refer to the API reference.](../autoapi/evalml/automl/index.rst#evalml.automl.AutoMLSearch)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "We also provide [a standalone `search` method] (../generated/evalml.automl.search.html) which does all of the above in a single line, and returns the `AutoMLSearch` instance and data check results. If there were data check errors, AutoML will not be run and no `AutoMLSearch` instance will be returned." + "We also provide [a standalone search method](../autoapi/evalml/automl/index.rst#evalml.automl.search) which does all of the above in a single line, and returns the `AutoMLSearch` instance and data check results. If there were data check errors, AutoML will not be run and no `AutoMLSearch` instance will be returned." ] }, { diff --git a/docs/source/user_guide/components.ipynb b/docs/source/user_guide/components.ipynb index a9a2599793..d8f0938395 100644 --- a/docs/source/user_guide/components.ipynb +++ b/docs/source/user_guide/components.ipynb @@ -28,7 +28,8 @@ "\n", "Transformers subclass the `Transformer` class, and define a `fit` method to learn information from training data and a `transform` method to apply a learned transformation to new data.\n", "\n", - "For example, an [imputer] (../generated/evalml.pipelines.components.SimpleImputer.ipynb) is configured with the desired impute strategy to follow, for instance the mean value. The imputers `fit` method would learn the mean from the training data, and the `transform` method would fill the learned mean value in for any missing values in new data.\n", + "For example, an [imputer](../autoapi/evalml/pipelines/components/index.rst#evalml.pipelines.components.SimpleImputer) is configured with the desired impute strategy to follow, for instance the mean value. The imputers `fit` method would learn the mean from the training data, and the `transform` method would fill the learned mean value in for any missing values in new data.\n", + "\n", "All transformers can execute `fit` and `transform` separately or in one step by calling `fit_transform`. Defining a custom `fit_transform` method can facilitate useful performance optimizations in some cases." ] @@ -90,7 +91,7 @@ "\n", "Estimator classes each define a `model_family` attribute indicating what type of model is used.\n", "\n", - "Here's an example of using the [LogisticRegressionClassifier] (../generated/evalml.pipelines.components.LogisticRegressionClassifier.ipynb) estimator to fit and predict on a simple dataset:" + "Here's an example of using the [LogisticRegressionClassifier](../autoapi/evalml/pipelines/index.rst#evalml.pipelines.LogisticRegressionClassifier) estimator to fit and predict on a simple dataset:" ] }, { @@ -139,7 +140,7 @@ "\n", "### Custom Transformers\n", "\n", - "Your transformer must inherit from the correct subclass. In this case [Transformer] (../generated/evalml.pipelines.components.Transformer.ipynb) for components that transform data. Next we will use EvalML's [DropNullColumns] (../generated/evalml.pipelines.components.DropNullColumns.ipynb) as an example." + "Your transformer must inherit from the correct subclass. In this case [Transformer](../autoapi/evalml/pipelines/index.rst#evalml.pipelines.Transformer) for components that transform data. Next we will use EvalML's [DropNullColumns](../autoapi/evalml/pipelines/components/index.rst#evalml.pipelines.components.DropNullColumns) as an example." ] }, { @@ -237,7 +238,7 @@ "source": [ "### Custom Estimators\n", "\n", - "Your estimator must inherit from the correct subclass. In this case [Estimator] (../generated/evalml.pipelines.components.Estimator.ipynb) for components that predict new target values. Next we will use EvalML's [BaselineRegressor] (../generated/evalml.pipelines.components.BaselineRegressor.ipynb) as an example." + "Your estimator must inherit from the correct subclass. In this case [Estimator](../autoapi/evalml/pipelines/index.rst#evalml.pipelines.Estimator) for components that predict new target values. Next we will use EvalML's [BaselineRegressor](../autoapi/evalml/pipelines/components/index.rst#evalml.pipelines.components.BaselineRegressor) as an example." ] }, { @@ -320,9 +321,9 @@ "\n", "- `name` indicating a human-readable name.\n", "\n", - "- `model_family` - EvalML [model_family] (../generated/evalml.model_family.ModelFamily.ipynb) that this component belongs to\n", + "- `model_family` - EvalML [model_family](../autoapi/evalml/model_family/index.rst#evalml.model_family.ModelFamily) that this component belongs to\n", "\n", - "- `supported_problem_types` - list of EvalML [problem_types] (../generated/evalml.problem_types.ProblemTypes.ipynb) that this component supports\n", + "- `supported_problem_types` - list of EvalML [problem_types](../autoapi/evalml/problem_types/index.rst#evalml.problem_types.ProblemTypes) that this component supports\n", "\n", "Model families and problem types include:" ] @@ -365,7 +366,7 @@ "source": [ "### Components Wrapping Third-Party Objects\n", "\n", - "The `component_obj` parameter is used for wrapping third-party objects and using them in component implementation. If you're using a `component_obj` you will need to define `__init__()` and pass in the relevant object that has also implemented the required methods mentioned above. However, if the `component_obj` does not follow EvalML component conventions, you may need to override methods as needed. Below is an example of EvalML's [LinearRegressor] (../generated/evalml.pipelines.components.LinearRegressor.ipynb)." + "The `component_obj` parameter is used for wrapping third-party objects and using them in component implementation. If you're using a `component_obj` you will need to define `__init__()` and pass in the relevant object that has also implemented the required methods mentioned above. However, if the `component_obj` does not follow EvalML component conventions, you may need to override methods as needed. Below is an example of EvalML's [LinearRegressor](../autoapi/evalml/pipelines/index.rst#evalml.pipelines.LinearRegressor)." ] }, { diff --git a/docs/source/user_guide/data_checks.ipynb b/docs/source/user_guide/data_checks.ipynb index 47638dbade..d158baf40e 100644 --- a/docs/source/user_guide/data_checks.ipynb +++ b/docs/source/user_guide/data_checks.ipynb @@ -425,7 +425,7 @@ "source": [ "## Data Check Messages\n", "\n", - "Each data check's `validate` method returns a list of `DataCheckMessage` objects indicating warnings or errors found; warnings are stored as a `DataCheckWarning` object ([API reference] (../generated/evalml.data_checks.DataCheckWarning.ipynb)) and errors are stored as a `DataCheckError` object ([API reference] (../generated/evalml.data_checks.DataCheckError.ipynb)). You can filter the messages returned by a data check by checking for the type of message returned. Below, `NoVarianceDataCheck` returns a list containing a `DataCheckWarning` and a `DataCheckError` message. We can determine which is which by checking the type of each message." + "Each data check's `validate` method returns a list of `DataCheckMessage` objects indicating warnings or errors found; warnings are stored as a `DataCheckWarning` object ([API reference](../autoapi/evalml/data_checks/index.rst#evalml.data_checks.DataCheckWarning)) and errors are stored as a `DataCheckError` object ([API reference](../autoapi/evalml/data_checks/index.rst#evalml.data_checks.DataCheckError)). You can filter the messages returned by a data check by checking for the type of message returned. Below, `NoVarianceDataCheck` returns a list containing a `DataCheckWarning` and a `DataCheckError` message. We can determine which is which by checking the type of each message." ] }, { @@ -490,7 +490,7 @@ "source": [ "## Defining Collections of Data Checks\n", "\n", - "For convenience, EvalML provides a `DataChecks` class to represent a collection of data checks. We will go over `DefaultDataChecks` ([API reference] (../generated/evalml.data_checks.DefaultDataChecks.ipynb)), a collection defined to check for some of the most common data issues." + "For convenience, EvalML provides a `DataChecks` class to represent a collection of data checks. We will go over `DefaultDataChecks` ([API reference](../autoapi/evalml/data_checks/index.rst#evalml.data_checks.DefaultDataChecks)), a collection defined to check for some of the most common data issues." ] }, { diff --git a/docs/source/user_guide/model_understanding.ipynb b/docs/source/user_guide/model_understanding.ipynb index 62585c6ec0..570351bf67 100644 --- a/docs/source/user_guide/model_understanding.ipynb +++ b/docs/source/user_guide/model_understanding.ipynb @@ -390,7 +390,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We can explain why the model made certain predictions with the [explain_predictions] (../generated/evalml.model_understanding.prediction_explanations.explain_predictions.ipynb) function. This will use the [Shapley Additive Explanations (SHAP)](https://github.com/slundberg/shap) algorithm to identify the top features that explain the predicted value. \n", + "We can explain why the model made certain predictions with the [explain_predictions](../autoapi/evalml/model_understanding/prediction_explanations/explainers/index.rst#evalml.model_understanding.prediction_explanations.explainers.explain_predictions) function. This will use the [Shapley Additive Explanations (SHAP)](https://github.com/slundberg/shap) algorithm to identify the top features that explain the predicted value. \n", "\n", "This function can explain both classification and regression models - all you need to do is provide the pipeline, the input features, and a list of rows corresponding to the indices of the input features you want to explain. The function will return a table that you can print summarizing the top 3 most positive and negative contributing features to the predicted value.\n", "\n", @@ -416,7 +416,7 @@ "source": [ "The interpretation of the table is the same for regression problems - but the SHAP value now corresponds to the change in the estimated value of the dependent variable rather than a change in probability. For multiclass classification problems, a table will be output for each possible class.\n", "\n", - "Below is an example of how you would explain three predictions with [explain_predictions] (../generated/evalml.model_understanding.prediction_explanations.explain_predictions.ipynb)." + "Below is an example of how you would explain three predictions with [explain_predictions](../autoapi/evalml/model_understanding/prediction_explanations/explainers/index.rst#evalml.model_understanding.prediction_explanations.explainers.explain_predictions)." ] }, { @@ -439,9 +439,9 @@ "source": [ "### Explaining Best and Worst Predictions\n", "\n", - "When debugging machine learning models, it is often useful to analyze the best and worst predictions the model made. The [explain_predictions_best_worst] (../generated/evalml.model_understanding.prediction_explanations.explain_predictions_best_worst.ipynb) function can help us with this.\n", + "When debugging machine learning models, it is often useful to analyze the best and worst predictions the model made. The [explain_predictions_best_worst](../autoapi/evalml/model_understanding/prediction_explanations/explainers/index.rst#evalml.model_understanding.prediction_explanations.explainers.explain_predictions_best_worst) function can help us with this.\n", "\n", - "This function will display the output of [explain_predictions] (../generated/evalml.model_understanding.prediction_explanations.explain_predictions.ipynb) for the best 2 and worst 2 predictions. By default, the best and worst predictions are determined by the absolute error for regression problems and [cross entropy](https://en.wikipedia.org/wiki/Cross_entropy) for classification problems.\n", + "This function will display the output of [explain_predictions](../autoapi/evalml/model_understanding/prediction_explanations/explainers/index.rst#evalml.model_understanding.prediction_explanations.explainers.explain_predictions) for the best 2 and worst 2 predictions. By default, the best and worst predictions are determined by the absolute error for regression problems and [cross entropy](https://en.wikipedia.org/wiki/Cross_entropy) for classification problems.\n", "\n", "We can specify our own ranking function by passing in a function to the `metric` parameter. This function will be called on `y_true` and `y_pred`. By convention, lower scores are better.\n", "\n", diff --git a/docs/source/user_guide/pipelines.ipynb b/docs/source/user_guide/pipelines.ipynb index 61dbf81e26..63f413c890 100644 --- a/docs/source/user_guide/pipelines.ipynb +++ b/docs/source/user_guide/pipelines.ipynb @@ -252,7 +252,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "You can use `pipeline.get_component(name)` and provide the component name to access any component (API reference [here] (../generated/methods/evalml.pipelines.PipelineBase.get_component.ipynb)):" + "You can use `pipeline.get_component(name)` and provide the component name to access any component (API reference [here](../autoapi/evalml/pipelines/index.rst#evalml.pipelines.PipelineBase.get_component)):" ] }, { From aef4f373aa645cb3c69a96cb946dafd1f42f9431 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Fri, 2 Jul 2021 18:46:08 -0400 Subject: [PATCH 10/19] Fix requirements error --- core-requirements.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core-requirements.txt b/core-requirements.txt index 998257a1be..4faf973d99 100644 --- a/core-requirements.txt +++ b/core-requirements.txt @@ -11,11 +11,7 @@ psutil>=5.6.6 requirements-parser>=0.2.0 shap>=0.36.0 texttable>=1.6.2 -<<<<<<< HEAD woodwork>=0.4.1,<0.5.0 -======= -woodwork>=0.4.1 ->>>>>>> Add back requirements files dask>=2.12.0 featuretools>=0.21.0 nlp-primitives>=1.1.0 From 4d35a89ba14633722ad0e10e3fd9d658fd380595 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Tue, 6 Jul 2021 11:29:30 -0400 Subject: [PATCH 11/19] Update api index to match what it was like before --- docs/source/api_index.rst | 493 +++++++++++++++++++++++++++++++++----- 1 file changed, 427 insertions(+), 66 deletions(-) diff --git a/docs/source/api_index.rst b/docs/source/api_index.rst index 1fc307f1a6..9e90e0aa5e 100644 --- a/docs/source/api_index.rst +++ b/docs/source/api_index.rst @@ -1,72 +1,433 @@ +============= API Reference ============= -******************************************* -:doc:`AutoML ` -******************************************* -Classes and functions related to the automated search of machine learning pipelines. For a tutorial, see the -:doc:`AutoMLSearch User Guide ` - -***************************************************** -:doc:`Data Checks ` -***************************************************** -Classes that can determine if your data is healthy enough to run :doc:`AutoMLSearch `. For -a tutorial, see the :doc:`DataChecks User Guide ` - -************************************************* -:doc:`Demo Datasets ` -************************************************* -Functions used to load demo data. This data can be used to try out :doc:`AutoMLSearch ` -and our :doc:`pipelines `. - -********************************************************** -:doc:`Model Families ` -********************************************************** -A categorization of the different kinds of :doc:`Estimators ` our -:doc:`pipelines ` support. - -********************************************************************* -:doc:`Model Understanding ` -********************************************************************* -Functions and classes used to interpret the pipelines found by :doc:`AutoMLSearch `. For a -tutorial, see the :doc:`Model Understanding User Guide ` - -*************************************************** -:doc:`Objectives ` -*************************************************** -Classes that represent the cost function :doc:`AutoMLSearch ` will optimize. For a tutorial, -see the :doc:`Objectives User Guide ` - -************************************************* -:doc:`Pipelines ` -************************************************* -Classes that represent a sequence of operations to be applied to data. :doc:`AutoMLSearch ` -searches over these classes. For a tutorial, see the :doc:`Pipelines User Guide ` - -********************************************************* -:doc:`Preprocessing ` -********************************************************* -Functions for splitting and preprocessing data before doing machine learning. - -********************************************************* -:doc:`Problem Types ` -********************************************************* -The different types of machine learning problems that our estimators, pipelines, and AutoMLSearch can handle. - -********************************************************* -:doc:`AutoML Tuners ` -********************************************************* -Tuners implement different strategies for sampling from a search space. They’re used in to search the space of pipeline hyperparameters. - -********************************************************* -:doc:`Utilities ` -********************************************************* -General utilities used primarily by EvalML developers. - -********************************************************** -:doc:`Custom Exceptions ` -********************************************************** -Exceptions that EvalML can raise. + +Demo Datasets +============= + +.. autoapisummary:: + + evalml.demos.load_breast_cancer + evalml.demos.load_diabetes + evalml.demos.load_fraud + evalml.demos.load_wine + evalml.demos.load_churn + + +Preprocessing +============= + +Utilities to preprocess data before using evalml. + +.. autoapisummary:: + + evalml.preprocessing.load_data + evalml.preprocessing.drop_nan_target_rows + evalml.preprocessing.target_distribution + evalml.preprocessing.number_of_features + evalml.preprocessing.split_data + + +Exceptions +============= + +.. autoapisummary:: + + evalml.exceptions.MethodPropertyNotFoundError + evalml.exceptions.PipelineNotFoundError + evalml.exceptions.ObjectiveNotFoundError + evalml.exceptions.MissingComponentError + evalml.exceptions.ComponentNotYetFittedError + evalml.exceptions.PipelineNotYetFittedError + evalml.exceptions.AutoMLSearchException + evalml.exceptions.EnsembleMissingPipelinesError + evalml.exceptions.PipelineScoreError + evalml.exceptions.DataCheckInitError + evalml.exceptions.NullsInColumnWarning + + +AutoML +====== + +AutoML Search Interface +~~~~~~~~~~~~~~~~~~~~~~~ +.. autoapisummary:: + + evalml.automl.AutoMLSearch + + +AutoML Utils +~~~~~~~~~~~~ +.. autoapisummary:: + + evalml.automl.search + evalml.automl.get_default_primary_search_objective + evalml.automl.make_data_splitter + + +AutoML Algorithm Classes +~~~~~~~~~~~~~~~~~~~~~~~~ +.. autoapisummary:: + + evalml.automl.automl_algorithm.AutoMLAlgorithm + evalml.automl.automl_algorithm.IterativeAlgorithm + + +AutoML Callbacks +~~~~~~~~~~~~~~~~~~~~~~~~ +.. autoapisummary:: + + evalml.automl.callbacks.silent_error_callback + evalml.automl.callbacks.log_error_callback + evalml.automl.callbacks.raise_error_callback + + +Pipelines +========= + +Pipeline Base Classes +~~~~~~~~~~~~~~~~~~~~~ +.. autoapisummary:: + + evalml.pipelines.PipelineBase + evalml.pipelines.ClassificationPipeline + evalml.pipelines.BinaryClassificationPipeline + evalml.pipelines.MulticlassClassificationPipeline + evalml.pipelines.RegressionPipeline + evalml.pipelines.TimeSeriesClassificationPipeline + evalml.pipelines.TimeSeriesBinaryClassificationPipeline + evalml.pipelines.TimeSeriesMulticlassClassificationPipeline + evalml.pipelines.TimeSeriesRegressionPipeline + + +Pipeline Utils +~~~~~~~~~~~~~~ +.. autoapisummary:: + + evalml.pipelines.utils.make_pipeline + evalml.pipelines.utils.generate_pipeline_code + + +Components +========== + +Component Base Classes +~~~~~~~~~~~~~~~~~~~~~~ +Components represent a step in a pipeline. + +.. autoapisummary:: + evalml.pipelines.components.ComponentBase + evalml.pipelines.Transformer + evalml.pipelines.Estimator + + +Component Utils +~~~~~~~~~~~~~~~ +.. autoapisummary:: + + evalml.pipelines.components.utils.allowed_model_families + evalml.pipelines.components.utils.get_estimators + evalml.pipelines.components.utils.generate_component_code + + +Transformers +~~~~~~~~~~~~ +Transformers are components that take in data as input and output transformed data. + +.. autoapisummary:: + + evalml.pipelines.components.DropColumns + evalml.pipelines.components.SelectColumns + evalml.pipelines.components.OneHotEncoder + evalml.pipelines.components.TargetEncoder + evalml.pipelines.components.PerColumnImputer + evalml.pipelines.components.Imputer + evalml.pipelines.components.SimpleImputer + evalml.pipelines.components.StandardScaler + evalml.pipelines.components.RFRegressorSelectFromModel + evalml.pipelines.components.RFClassifierSelectFromModel + evalml.pipelines.components.DropNullColumns + evalml.pipelines.components.DateTimeFeaturizer + evalml.pipelines.components.TextFeaturizer + evalml.pipelines.components.DelayedFeatureTransformer + evalml.pipelines.components.DFSTransformer + evalml.pipelines.components.PolynomialDetrender + evalml.pipelines.components.Undersampler + evalml.pipelines.components.SMOTESampler + evalml.pipelines.components.SMOTENCSampler + evalml.pipelines.components.SMOTENSampler + + +Estimators +~~~~~~~~~~ + +Classifiers +----------- + +Classifiers are components that output a predicted class label. + +.. autoapisummary:: + + evalml.pipelines.components.CatBoostClassifier + evalml.pipelines.components.ElasticNetClassifier + evalml.pipelines.components.ExtraTreesClassifier + evalml.pipelines.components.RandomForestClassifier + evalml.pipelines.components.LightGBMClassifier + evalml.pipelines.components.LogisticRegressionClassifier + evalml.pipelines.components.XGBoostClassifier + evalml.pipelines.components.BaselineClassifier + evalml.pipelines.components.StackedEnsembleClassifier + evalml.pipelines.components.DecisionTreeClassifier + evalml.pipelines.components.KNeighborsClassifier + evalml.pipelines.components.SVMClassifier + +Regressors +----------- + +Regressors are components that output a predicted target value. + +.. autoapisummary:: + + evalml.pipelines.components.ARIMARegressor + evalml.pipelines.components.CatBoostRegressor + evalml.pipelines.components.ElasticNetRegressor + evalml.pipelines.components.LinearRegressor + evalml.pipelines.components.ExtraTreesRegressor + evalml.pipelines.components.RandomForestRegressor + evalml.pipelines.components.XGBoostRegressor + evalml.pipelines.components.BaselineRegressor + evalml.pipelines.components.TimeSeriesBaselineEstimator + evalml.pipelines.components.StackedEnsembleRegressor + evalml.pipelines.components.DecisionTreeRegressor + evalml.pipelines.components.LightGBMRegressor + evalml.pipelines.components.SVMRegressor + + +Model Understanding +=================== + +Utility Methods +~~~~~~~~~~~~~~~ +.. autoapisummary:: + + evalml.model_understanding.confusion_matrix + evalml.model_understanding.normalize_confusion_matrix + evalml.model_understanding.precision_recall_curve + evalml.model_understanding.roc_curve + evalml.model_understanding.calculate_permutation_importance + evalml.model_understanding.calculate_permutation_importance_one_column + evalml.model_understanding.binary_objective_vs_threshold + evalml.model_understanding.get_prediction_vs_actual_over_time_data + evalml.model_understanding.partial_dependence + evalml.model_understanding.get_prediction_vs_actual_data + evalml.model_understanding.get_linear_coefficients + evalml.model_understanding.t_sne + + +Graph Utility Methods +~~~~~~~~~~~~~~~~~~~~~~~ +.. autoapisummary:: + + evalml.model_understanding.graph_precision_recall_curve + evalml.model_understanding.graph_roc_curve + evalml.model_understanding.graph_confusion_matrix + evalml.model_understanding.graph_permutation_importance + evalml.model_understanding.graph_binary_objective_vs_threshold + evalml.model_understanding.graph_prediction_vs_actual + evalml.model_understanding.graph_prediction_vs_actual_over_time + evalml.model_understanding.graph_partial_dependence + evalml.model_understanding.graph_t_sne + + +Prediction Explanations +~~~~~~~~~~~~~~~~~~~~~~~ + +.. autoapisummary:: + + evalml.model_understanding.explain_predictions + evalml.model_understanding.explain_predictions_best_worst + + +Objective Functions +==================== + +Objective Base Classes +~~~~~~~~~~~~~~~~~~~~~~ + +.. autoapisummary:: + + evalml.objectives.ObjectiveBase + evalml.objectives.BinaryClassificationObjective + evalml.objectives.MulticlassClassificationObjective + evalml.objectives.RegressionObjective + + +Domain-Specific Objectives +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autoapisummary:: + + evalml.objectives.FraudCost + evalml.objectives.LeadScoring + evalml.objectives.CostBenefitMatrix + + +Classification Objectives +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autoapisummary:: + + evalml.objectives.AccuracyBinary + evalml.objectives.AccuracyMulticlass + evalml.objectives.AUC + evalml.objectives.AUCMacro + evalml.objectives.AUCMicro + evalml.objectives.AUCWeighted + evalml.objectives.BalancedAccuracyBinary + evalml.objectives.BalancedAccuracyMulticlass + evalml.objectives.F1 + evalml.objectives.F1Micro + evalml.objectives.F1Macro + evalml.objectives.F1Weighted + evalml.objectives.LogLossBinary + evalml.objectives.LogLossMulticlass + evalml.objectives.MCCBinary + evalml.objectives.MCCMulticlass + evalml.objectives.Precision + evalml.objectives.PrecisionMicro + evalml.objectives.PrecisionMacro + evalml.objectives.PrecisionWeighted + evalml.objectives.Recall + evalml.objectives.RecallMicro + evalml.objectives.RecallMacro + evalml.objectives.RecallWeighted + + +Regression Objectives +~~~~~~~~~~~~~~~~~~~~~ + +.. autoapisummary:: + + evalml.objectives.R2 + evalml.objectives.MAE + evalml.objectives.MAPE + evalml.objectives.MSE + evalml.objectives.MeanSquaredLogError + evalml.objectives.MedianAE + evalml.objectives.MaxError + evalml.objectives.ExpVariance + evalml.objectives.RootMeanSquaredError + evalml.objectives.RootMeanSquaredLogError + + +Objective Utils +~~~~~~~~~~~~~~~~~~~~~ + +.. autoapisummary:: + + evalml.objectives.get_all_objective_names + evalml.objectives.get_core_objectives + evalml.objectives.get_core_objective_names + evalml.objectives.get_non_core_objectives + evalml.objectives.get_objective + + +Problem Types +============= + +.. autoapisummary:: + + evalml.problem_types.handle_problem_types + evalml.problem_types.detect_problem_type + evalml.problem_types.ProblemTypes + + +Model Family +============ + +.. autoapisummary:: + + evalml.model_family.handle_model_family + evalml.model_family.ModelFamily + + +Tuners +====== + +.. autoapisummary:: + + evalml.tuners.Tuner + evalml.tuners.SKOptTuner + evalml.tuners.GridSearchTuner + evalml.tuners.RandomSearchTuner + + +Data Checks +=========== + +Data Check Classes +~~~~~~~~~~~~~~~~~~ +.. autoapisummary:: + + evalml.data_checks.DataCheck + evalml.data_checks.InvalidTargetDataCheck + evalml.data_checks.HighlyNullDataCheck + evalml.data_checks.IDColumnsDataCheck + evalml.data_checks.TargetLeakageDataCheck + evalml.data_checks.OutliersDataCheck + evalml.data_checks.NoVarianceDataCheck + evalml.data_checks.ClassImbalanceDataCheck + evalml.data_checks.MulticollinearityDataCheck + evalml.data_checks.DateTimeNaNDataCheck + evalml.data_checks.NaturalLanguageNaNDataCheck + evalml.data_checks.DataChecks + evalml.data_checks.DefaultDataChecks + + +Data Check Messages +~~~~~~~~~~~~~~~~~~~ +.. autoapisummary:: + + evalml.data_checks.DataCheckMessage + evalml.data_checks.DataCheckError + evalml.data_checks.DataCheckWarning + + +Data Check Message Types +~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autoapisummary:: + + evalml.data_checks.DataCheckMessageType + +Data Check Message Codes +~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autoapisummary:: + + evalml.data_checks.DataCheckMessageCode + + +Utils +===== + +General Utils +~~~~~~~~~~~~~ + +.. autoapisummary:: + + evalml.utils.import_or_raise + evalml.utils.convert_to_seconds + evalml.utils.get_random_state + evalml.utils.get_random_seed + evalml.utils.pad_with_nans + evalml.utils.drop_rows_with_nans + evalml.utils.infer_feature_types + evalml.utils.save_plot + evalml.utils.is_all_numeric + evalml.utils.get_importable_subclasses + .. toctree:: :hidden: From ff024c83c1ab0702213ff62577efd4b6f525962a Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Tue, 6 Jul 2021 11:53:44 -0400 Subject: [PATCH 12/19] Update release notes --- docs/source/api_index.rst | 2 +- docs/source/release_notes.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/api_index.rst b/docs/source/api_index.rst index 9e90e0aa5e..0f4430df30 100644 --- a/docs/source/api_index.rst +++ b/docs/source/api_index.rst @@ -249,7 +249,7 @@ Prediction Explanations evalml.model_understanding.explain_predictions_best_worst -Objective Functions +Objectives ==================== Objective Base Classes diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst index ad77093b54..1e86c5844d 100644 --- a/docs/source/release_notes.rst +++ b/docs/source/release_notes.rst @@ -11,6 +11,7 @@ Release Notes * Changes * Documentation Changes * Moved docstrings from ``__init__`` to class pages, added missing docstrings for missing classes, and updated missing default values :pr:`2452` + * Build documentation with sphinx-autoapi :pr:`2458` * Testing Changes * Fixed flaky dask tests :pr:`2471` @@ -32,7 +33,6 @@ Release Notes * Documentation Changes * Sped up docs :pr:`2430` * Removed mentions of ``DataTable`` and ``DataColumn`` from the docs :pr:`2445` - * Build documentation with sphinx-autoapi :pr:`2458` * Testing Changes * Added slack integration for nightlies tests :pr:`2436` * Changed ``build_conda_pkg`` CI job to run only when dependencies are updates :pr:`2446` From 2574a78475f346b19341cfa06df6e862d5047400 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Tue, 6 Jul 2021 14:43:10 -0400 Subject: [PATCH 13/19] Add whitespace --- evalml/data_checks/sparsity_data_check.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/evalml/data_checks/sparsity_data_check.py b/evalml/data_checks/sparsity_data_check.py index 5f1e1d22d4..64dbe68fdf 100644 --- a/evalml/data_checks/sparsity_data_check.py +++ b/evalml/data_checks/sparsity_data_check.py @@ -38,11 +38,14 @@ def __init__(self, problem_type, threshold, unique_count_threshold=10): def validate(self, X, y=None): """Calculates what percentage of each column's unique values exceed the count threshold and compare that percentage to the sparsity threshold stored in the class instance. + Arguments: X (pd.DataFrame, np.ndarray): Features. y (pd.Series, np.ndarray): Ignored. + Returns: dict: dict with a DataCheckWarning if there are any sparse columns. + Example: >>> import pandas as pd >>> df = pd.DataFrame({ @@ -94,10 +97,12 @@ def validate(self, X, y=None): def sparsity_score(col, count_threshold=10): """This function calculates a sparsity score for the given value counts by calculating the percentage of unique values that exceed the count_threshold. + Arguments: col (pd.Series): Feature values. count_threshold (int): The number of instances below which a value is considered sparse. - Default is 10. + Default is 10. + Returns: (float): Sparsity score, or the percentage of the unique values that exceed count_threshold. """ From 26c1b91733bd73c837e009d54afd223acee608e3 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Tue, 6 Jul 2021 15:15:17 -0400 Subject: [PATCH 14/19] Fix formatting for en/linear regressor hyperparamter values --- .../estimators/classifiers/elasticnet_classifier.py | 5 ++++- .../components/estimators/regressors/linear_regressor.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/evalml/pipelines/components/estimators/classifiers/elasticnet_classifier.py b/evalml/pipelines/components/estimators/classifiers/elasticnet_classifier.py index c41fb25a9b..82419c5b68 100644 --- a/evalml/pipelines/components/estimators/classifiers/elasticnet_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/elasticnet_classifier.py @@ -38,7 +38,10 @@ class ElasticNetClassifier(Estimator): name = "Elastic Net Classifier" hyperparameter_ranges = {"C": Real(0.01, 10), "l1_ratio": Real(0, 1)} - """{"C": Real(0.01, 10), "l1_ratio": Real(0, 1)}""" + """{ + "C": Real(0.01, 10), + "l1_ratio": Real(0, 1) + }""" model_family = ModelFamily.LINEAR_MODEL """ModelFamily.LINEAR_MODEL""" supported_problem_types = [ diff --git a/evalml/pipelines/components/estimators/regressors/linear_regressor.py b/evalml/pipelines/components/estimators/regressors/linear_regressor.py index bb6a9d91d2..eafcb69635 100644 --- a/evalml/pipelines/components/estimators/regressors/linear_regressor.py +++ b/evalml/pipelines/components/estimators/regressors/linear_regressor.py @@ -21,7 +21,10 @@ class LinearRegressor(Estimator): name = "Linear Regressor" hyperparameter_ranges = {"fit_intercept": [True, False], "normalize": [True, False]} - """{"fit_intercept": [True, False], "normalize": [True, False]}""" + """{ + "fit_intercept": [True, False], + "normalize": [True, False] + }""" model_family = ModelFamily.LINEAR_MODEL """ModelFamily.LINEAR_MODEL""" supported_problem_types = [ From acd9f039e5112902855ad3d432ebb35bb9e7ef5f Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Thu, 8 Jul 2021 09:18:42 -0400 Subject: [PATCH 15/19] Display class attributes as strings as opposed to html. Fix some model family docstrings --- .../_auto_api_templates/python/attribute.rst | 23 +------------------ docs/source/api_index.rst | 14 +++++++++++ docs/source/conf.py | 2 +- evalml/data_checks/data_check_message.py | 2 ++ .../estimators/classifiers/et_classifier.py | 2 +- .../logistic_regression_classifier.py | 2 +- .../estimators/classifiers/rf_classifier.py | 2 +- 7 files changed, 21 insertions(+), 26 deletions(-) diff --git a/docs/source/_auto_api_templates/python/attribute.rst b/docs/source/_auto_api_templates/python/attribute.rst index fd5cce7165..26a8ca2917 100644 --- a/docs/source/_auto_api_templates/python/attribute.rst +++ b/docs/source/_auto_api_templates/python/attribute.rst @@ -1,28 +1,7 @@ {% if obj.display %} {% if obj.docstring|length > 0 %} .. py:{{ obj.type }}:: {{ obj.name }} - :annotation: - {%- if obj.docstring is not none %} = {% - if obj.docstring.splitlines()|count > 1 -%} - Multiline-Value - - .. raw:: html - -
Show Value - - .. code-block:: text - :linenos: - - {{ obj.docstring|indent(width=8) }} - - .. raw:: html - -
- - {%- else -%} - {{ obj.docstring }} - {%- endif %} - {% endif %} + :annotation: = {{ obj.docstring.replace("\n", "") }} {% else %} .. py:{{ obj.type }}:: {{ obj.name }} diff --git a/docs/source/api_index.rst b/docs/source/api_index.rst index 0f4430df30..d2bd56847e 100644 --- a/docs/source/api_index.rst +++ b/docs/source/api_index.rst @@ -7,6 +7,7 @@ Demo Datasets ============= .. autoapisummary:: + :nosignatures: evalml.demos.load_breast_cancer evalml.demos.load_diabetes @@ -21,6 +22,7 @@ Preprocessing Utilities to preprocess data before using evalml. .. autoapisummary:: + :nosignatures: evalml.preprocessing.load_data evalml.preprocessing.drop_nan_target_rows @@ -60,6 +62,7 @@ AutoML Search Interface AutoML Utils ~~~~~~~~~~~~ .. autoapisummary:: + :nosignatures: evalml.automl.search evalml.automl.get_default_primary_search_objective @@ -77,6 +80,7 @@ AutoML Algorithm Classes AutoML Callbacks ~~~~~~~~~~~~~~~~~~~~~~~~ .. autoapisummary:: + :nosignatures: evalml.automl.callbacks.silent_error_callback evalml.automl.callbacks.log_error_callback @@ -104,6 +108,7 @@ Pipeline Base Classes Pipeline Utils ~~~~~~~~~~~~~~ .. autoapisummary:: + :nosignatures: evalml.pipelines.utils.make_pipeline evalml.pipelines.utils.generate_pipeline_code @@ -117,6 +122,7 @@ Component Base Classes Components represent a step in a pipeline. .. autoapisummary:: + evalml.pipelines.components.ComponentBase evalml.pipelines.Transformer evalml.pipelines.Estimator @@ -125,6 +131,7 @@ Components represent a step in a pipeline. Component Utils ~~~~~~~~~~~~~~~ .. autoapisummary:: + :nosignatures: evalml.pipelines.components.utils.allowed_model_families evalml.pipelines.components.utils.get_estimators @@ -210,6 +217,7 @@ Model Understanding Utility Methods ~~~~~~~~~~~~~~~ .. autoapisummary:: + :nosignatures: evalml.model_understanding.confusion_matrix evalml.model_understanding.normalize_confusion_matrix @@ -228,6 +236,7 @@ Utility Methods Graph Utility Methods ~~~~~~~~~~~~~~~~~~~~~~~ .. autoapisummary:: + :nosignatures: evalml.model_understanding.graph_precision_recall_curve evalml.model_understanding.graph_roc_curve @@ -244,6 +253,7 @@ Prediction Explanations ~~~~~~~~~~~~~~~~~~~~~~~ .. autoapisummary:: + :nosignatures: evalml.model_understanding.explain_predictions evalml.model_understanding.explain_predictions_best_worst @@ -325,6 +335,7 @@ Objective Utils ~~~~~~~~~~~~~~~~~~~~~ .. autoapisummary:: + :nosignatures: evalml.objectives.get_all_objective_names evalml.objectives.get_core_objectives @@ -337,6 +348,7 @@ Problem Types ============= .. autoapisummary:: + :nosignatures: evalml.problem_types.handle_problem_types evalml.problem_types.detect_problem_type @@ -347,6 +359,7 @@ Model Family ============ .. autoapisummary:: + :nosignatures: evalml.model_family.handle_model_family evalml.model_family.ModelFamily @@ -416,6 +429,7 @@ General Utils ~~~~~~~~~~~~~ .. autoapisummary:: + :nosignatures: evalml.utils.import_or_raise evalml.utils.convert_to_seconds diff --git a/docs/source/conf.py b/docs/source/conf.py index 49eb275581..a4ae326374 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -63,7 +63,7 @@ autoapi_dirs = ['../../evalml'] autoapi_ignore = ["*test*"] -autoapi_options = ['members', 'undoc-members', 'show-inheritance', 'show-module-summary', 'imported-members', ] +autoapi_options = ['members', 'undoc-members', 'show-module-summary', 'imported-members', 'inherited-members'] autoapi_add_toctree_entry = False autoapi_template_dir = "_auto_api_templates" diff --git a/evalml/data_checks/data_check_message.py b/evalml/data_checks/data_check_message.py index 9e6f362697..36fb89a2b7 100644 --- a/evalml/data_checks/data_check_message.py +++ b/evalml/data_checks/data_check_message.py @@ -50,9 +50,11 @@ class DataCheckError(DataCheckMessage): """DataCheckMessage subclass for errors returned by data checks.""" message_type = DataCheckMessageType.ERROR + """DataCheckMessageType.ERROR""" class DataCheckWarning(DataCheckMessage): """DataCheckMessage subclass for warnings returned by data checks.""" message_type = DataCheckMessageType.WARNING + """DataCheckMessageType.WARNING""" diff --git a/evalml/pipelines/components/estimators/classifiers/et_classifier.py b/evalml/pipelines/components/estimators/classifiers/et_classifier.py index cc9b6d5e3e..c670a4608c 100644 --- a/evalml/pipelines/components/estimators/classifiers/et_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/et_classifier.py @@ -56,7 +56,7 @@ class ExtraTreesClassifier(Estimator): ProblemTypes.TIME_SERIES_BINARY, ProblemTypes.TIME_SERIES_MULTICLASS, ] - """supported_problem_types = [ + """[ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_BINARY, diff --git a/evalml/pipelines/components/estimators/classifiers/logistic_regression_classifier.py b/evalml/pipelines/components/estimators/classifiers/logistic_regression_classifier.py index 5a7443c313..61a8c35f3c 100644 --- a/evalml/pipelines/components/estimators/classifiers/logistic_regression_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/logistic_regression_classifier.py @@ -42,7 +42,7 @@ class LogisticRegressionClassifier(Estimator): "C": Real(0.01, 10), }""" model_family = ModelFamily.LINEAR_MODEL - """model_family = ModelFamily.LINEAR_MODEL""" + """ModelFamily.LINEAR_MODEL""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, diff --git a/evalml/pipelines/components/estimators/classifiers/rf_classifier.py b/evalml/pipelines/components/estimators/classifiers/rf_classifier.py index 7868d31701..347c7195f2 100644 --- a/evalml/pipelines/components/estimators/classifiers/rf_classifier.py +++ b/evalml/pipelines/components/estimators/classifiers/rf_classifier.py @@ -27,7 +27,7 @@ class RandomForestClassifier(Estimator): "max_depth": Integer(1, 10), }""" model_family = ModelFamily.RANDOM_FOREST - """model_family = ModelFamily.RANDOM_FOREST""" + """ModelFamily.RANDOM_FOREST""" supported_problem_types = [ ProblemTypes.BINARY, ProblemTypes.MULTICLASS, From e6831644d87c69bc965f43a8b1d09780c6bcd0ac Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Fri, 9 Jul 2021 14:28:02 -0500 Subject: [PATCH 16/19] Display attributes in table. Add autosummary to methods. List stuff in alphabetical order --- .../_auto_api_templates/python/attribute.rst | 40 ++-------- .../_auto_api_templates/python/class.rst | 76 +++++++++++++++++++ .../binary_classification_objective.py | 1 + .../multiclass_classification_objective.py | 1 + evalml/objectives/regression_objective.py | 1 + .../time_series_regression_objective.py | 1 + 6 files changed, 85 insertions(+), 35 deletions(-) create mode 100644 docs/source/_auto_api_templates/python/class.rst diff --git a/docs/source/_auto_api_templates/python/attribute.rst b/docs/source/_auto_api_templates/python/attribute.rst index 26a8ca2917..fce1a7e7b7 100644 --- a/docs/source/_auto_api_templates/python/attribute.rst +++ b/docs/source/_auto_api_templates/python/attribute.rst @@ -1,39 +1,9 @@ {% if obj.display %} {% if obj.docstring|length > 0 %} -.. py:{{ obj.type }}:: {{ obj.name }} - :annotation: = {{ obj.docstring.replace("\n", "") }} - +* - {{ obj.name }} + - {{ obj.docstring.replace("\n", "") }} {% else %} -.. py:{{ obj.type }}:: {{ obj.name }} - {%+ if obj.value is not none or obj.annotation is not none -%} - :annotation: - {%- if obj.annotation %} :{{ obj.annotation }} - {%- endif %} - {%- if obj.value is not none %} = {% - if obj.value is string and obj.value.splitlines()|count > 1 -%} - Multiline-String - - .. raw:: html - -
Show Value - - .. code-block:: text - :linenos: - - {{ obj.value|indent(width=8) }} - - .. raw:: html - -
- - {%- else -%} - {{ obj.value|string|truncate(100) }} - {%- endif %} - {%- endif %} - {% endif %} - - - {{ obj.docstring|prepare_docstring|indent(3) }} +* - {{ obj.name }} + - {{ obj.value|string }} {% endif %} -{% endif %} - +{% endif %} \ No newline at end of file diff --git a/docs/source/_auto_api_templates/python/class.rst b/docs/source/_auto_api_templates/python/class.rst new file mode 100644 index 0000000000..1e074ef130 --- /dev/null +++ b/docs/source/_auto_api_templates/python/class.rst @@ -0,0 +1,76 @@ +{% if obj.display %} +.. py:{{ obj.type }}:: {{ obj.short_name }}{% if obj.args %}({{ obj.args }}){% endif %} +{% for (args, return_annotation) in obj.overloads %} + {{ " " * (obj.type | length) }} {{ obj.short_name }}{% if args %}({{ args }}){% endif %} +{% endfor %} + + + {% if obj.bases %} + {% if "show-inheritance" in autoapi_options %} + Bases: {% for base in obj.bases %}{{ base|link_objs }}{% if not loop.last %}, {% endif %}{% endfor %} + {% endif %} + + + {% if "show-inheritance-diagram" in autoapi_options and obj.bases != ["object"] %} + .. autoapi-inheritance-diagram:: {{ obj.obj["full_name"] }} + :parts: 1 + {% if "private-members" in autoapi_options %} + :private-bases: + {% endif %} + + {% endif %} + {% endif %} + {% if obj.docstring %} + {{ obj.docstring|prepare_docstring|indent(3) }} + {% endif %} + {% if "inherited-members" in autoapi_options %} + {% set visible_classes = obj.classes|selectattr("display")|list %} + {% else %} + {% set visible_classes = obj.classes|rejectattr("inherited")|selectattr("display")|list %} + {% endif %} + {% for klass in visible_classes %} + {{ klass.render()|indent(3) }} + {% endfor %} + {% if "inherited-members" in autoapi_options %} + {% set visible_attributes = obj.attributes|selectattr("display")|list %} + {% else %} + {% set visible_attributes = obj.attributes|rejectattr("inherited")|selectattr("display")|list %} + {% endif %} + + {% if visible_attributes|length %} + **Attributes** + + .. list-table:: + :widths: 15 85 + :header-rows: 0 + + {% for attribute in visible_attributes|sort(attribute='name') %} + {% if attribute.docstring|length > 0 %} + * - {{ attribute.name }} + - {{ attribute.docstring.replace("\n", "") }} + {% else %} + * - {{ attribute.name }} + - {{ attribute.value|string }} + {% endif %} + {% endfor %} + {% endif %} + + {% if "inherited-members" in autoapi_options %} + {% set visible_methods = obj.methods|selectattr("display")|list %} + {% else %} + {% set visible_methods = obj.methods|rejectattr("inherited")|selectattr("display")|list %} + {% endif %} + + **Methods** + + .. autoapisummary:: + :nosignatures: + + {% for method in visible_methods|sort(attribute='name') %} + {{ obj.obj["full_name"] }}.{{ method.name }} + {% endfor %} + + {% for method in visible_methods|sort(attribute='name') %} + {{ method.render()|indent(3) }} + {% endfor %} +{% endif %} \ No newline at end of file diff --git a/evalml/objectives/binary_classification_objective.py b/evalml/objectives/binary_classification_objective.py index e47f927fae..ed190e33c0 100644 --- a/evalml/objectives/binary_classification_objective.py +++ b/evalml/objectives/binary_classification_objective.py @@ -10,6 +10,7 @@ class BinaryClassificationObjective(ObjectiveBase): """Base class for all binary classification objectives.""" problem_types = [ProblemTypes.BINARY, ProblemTypes.TIME_SERIES_BINARY] + """[ProblemTypes.BINARY, ProblemTypes.TIME_SERIES_BINARY]""" @property def can_optimize_threshold(cls): diff --git a/evalml/objectives/multiclass_classification_objective.py b/evalml/objectives/multiclass_classification_objective.py index 63668535c6..cb76a9520a 100644 --- a/evalml/objectives/multiclass_classification_objective.py +++ b/evalml/objectives/multiclass_classification_objective.py @@ -7,3 +7,4 @@ class MulticlassClassificationObjective(ObjectiveBase): """Base class for all multiclass classification objectives.""" problem_types = [ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS] + """[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]""" diff --git a/evalml/objectives/regression_objective.py b/evalml/objectives/regression_objective.py index 55932be714..69d9b3d116 100644 --- a/evalml/objectives/regression_objective.py +++ b/evalml/objectives/regression_objective.py @@ -7,3 +7,4 @@ class RegressionObjective(ObjectiveBase): """Base class for all regression objectives.""" problem_types = [ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION] + """[ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION]""" diff --git a/evalml/objectives/time_series_regression_objective.py b/evalml/objectives/time_series_regression_objective.py index 973bdd90df..5d9229aa56 100644 --- a/evalml/objectives/time_series_regression_objective.py +++ b/evalml/objectives/time_series_regression_objective.py @@ -7,3 +7,4 @@ class TimeSeriesRegressionObjective(RegressionObjective): """Base class for all time series regression objectives.""" problem_types = [ProblemTypes.TIME_SERIES_REGRESSION] + """[ProblemTypes.TIME_SERIES_REGRESSION]""" From e2f369162325613739d78a9f6c259c2562fd323d Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Mon, 12 Jul 2021 16:01:04 -0400 Subject: [PATCH 17/19] Sort alphabetical --- .../_auto_api_templates/python/class.rst | 3 +- .../_auto_api_templates/python/module.rst | 35 ++++++++++++++----- docs/source/_static/style.css | 14 ++++++++ 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/docs/source/_auto_api_templates/python/class.rst b/docs/source/_auto_api_templates/python/class.rst index 1e074ef130..801acd4a98 100644 --- a/docs/source/_auto_api_templates/python/class.rst +++ b/docs/source/_auto_api_templates/python/class.rst @@ -45,11 +45,10 @@ :header-rows: 0 {% for attribute in visible_attributes|sort(attribute='name') %} + * - **{{ attribute.name }}** {% if attribute.docstring|length > 0 %} - * - {{ attribute.name }} - {{ attribute.docstring.replace("\n", "") }} {% else %} - * - {{ attribute.name }} - {{ attribute.value|string }} {% endif %} {% endfor %} diff --git a/docs/source/_auto_api_templates/python/module.rst b/docs/source/_auto_api_templates/python/module.rst index 89c160935f..a59aa9818a 100644 --- a/docs/source/_auto_api_templates/python/module.rst +++ b/docs/source/_auto_api_templates/python/module.rst @@ -64,14 +64,15 @@ Submodules {{ obj.type|title }} Contents {{ "-" * obj.type|length }}--------- -{% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %} -{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %} -{% set visible_attributes = visible_children|selectattr("type", "equalto", "data")|list %} +{% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list|sort(attribute="id") %} +{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list|sort(attribute="id") %} +{% set visible_attributes = visible_children|selectattr("type", "equalto", "data")|list|sort(attribute="id") %} +{% set visible_exceptions = visible_children|selectattr("type", "equalto", "exception")|list|sort(attribute="id") %} {% if "show-module-summary" in autoapi_options and (visible_classes or visible_functions) %} {% block classes scoped %} {% if visible_classes %} -Classes -~~~~~~~ +Classes Summary +~~~~~~~~~~~~~~~ .. autoapisummary:: @@ -80,6 +81,21 @@ Classes {% endfor %} +{% endif %} +{% endblock %} + +{% block exceptions scoped %} +{% if visible_exceptions %} +Exceptions Summary +~~~~~~~~~~~~~~~~~~ + +.. autoapisummary:: + +{% for klass in visible_exceptions %} + `{{ klass.id }}` +{% endfor %} + + {% endif %} {% endblock %} @@ -89,6 +105,7 @@ Functions ~~~~~~~~~ .. autoapisummary:: + :nosignatures: {% for function in visible_functions %} {{ function.id }} @@ -100,8 +117,8 @@ Functions {% block attributes scoped %} {% if visible_attributes %} -Attributes -~~~~~~~~~~ +Attributes Summary +~~~~~~~~~~~~~~~~~~~ .. autoapisummary:: @@ -113,7 +130,9 @@ Attributes {% endif %} {% endblock %} {% endif %} -{% for obj_item in visible_children %} +Contents +~~~~~~~~~~~~~~~~~~~ +{% for obj_item in visible_children|sort(attribute="id") %} {{ obj_item.render()|indent(0) }} {% endfor %} {% endif %} diff --git a/docs/source/_static/style.css b/docs/source/_static/style.css index fb796bac57..c7a712f7e1 100644 --- a/docs/source/_static/style.css +++ b/docs/source/_static/style.css @@ -59,4 +59,18 @@ div.graphviz { border-top: 2px solid white; margin-left: 7px; margin-right: 15px; +} + +.class > dt, .function > dt, .method > dt { + padding: 0.5rem; + background-color: #f8f8f8; + font-weight: normal; + border: 1px solid rgba(0, 0, 0, 0.125); + border-left: 2px solid #ff9c34; + overflow: auto; + margin-bottom: 1rem; +} + +.class > dt::after, .function > dt::after, .method > dt::after { + overflow: auto; } \ No newline at end of file From a90d2bd3ac251e5c6e4c0e52577f1c2d6b8208f3 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Tue, 20 Jul 2021 12:06:26 -0400 Subject: [PATCH 18/19] Fix error from rebase --- docs/source/user_guide/components.ipynb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/source/user_guide/components.ipynb b/docs/source/user_guide/components.ipynb index 16951e28ed..15ab3bdd40 100644 --- a/docs/source/user_guide/components.ipynb +++ b/docs/source/user_guide/components.ipynb @@ -325,10 +325,6 @@ "\n", "- `name`: A human-readable name.\n", "\n", - "- `model_family`: EvalML [model_family](../generated/evalml.model_family.ModelFamily.ipynb) that this component belongs to\n", - "\n", - "- `supported_problem_types`: List of EvalML [problem_types](../generated/evalml.problem_types.ProblemTypes.ipynb) that this component supports\n", - "\n", "- `model_family` - EvalML [model_family](../autoapi/evalml/model_family/index.rst#evalml.model_family.ModelFamily) that this component belongs to\n", "\n", "- `supported_problem_types` - list of EvalML [problem_types](../autoapi/evalml/problem_types/index.rst#evalml.problem_types.ProblemTypes) that this component supports\n", From 372ca0fa4fbe74283ac0c8cf9de9dcc61cdc3373 Mon Sep 17 00:00:00 2001 From: freddyaboulton Date: Tue, 20 Jul 2021 15:02:32 -0400 Subject: [PATCH 19/19] Format exceptions and docstrings --- docs/source/_auto_api_templates/python/class.rst | 10 ++++++---- docs/source/_static/style.css | 2 +- docs/source/conf.py | 8 -------- .../components/transformers/imputers/simple_imputer.py | 4 +++- .../components/transformers/imputers/target_imputer.py | 4 +++- .../transformers/preprocessing/polynomial_detrender.py | 4 +++- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/source/_auto_api_templates/python/class.rst b/docs/source/_auto_api_templates/python/class.rst index 801acd4a98..a81c292c12 100644 --- a/docs/source/_auto_api_templates/python/class.rst +++ b/docs/source/_auto_api_templates/python/class.rst @@ -24,9 +24,9 @@ {{ obj.docstring|prepare_docstring|indent(3) }} {% endif %} {% if "inherited-members" in autoapi_options %} - {% set visible_classes = obj.classes|selectattr("display")|list %} + {% set visible_classes = obj.classes|selectattr("display")|rejectattr("name", "equalto", "args")|list %} {% else %} - {% set visible_classes = obj.classes|rejectattr("inherited")|selectattr("display")|list %} + {% set visible_classes = obj.classes|rejectattr("inherited")|rejectattr("name", "equalto", "args")|selectattr("display")|list %} {% endif %} {% for klass in visible_classes %} {{ klass.render()|indent(3) }} @@ -55,11 +55,12 @@ {% endif %} {% if "inherited-members" in autoapi_options %} - {% set visible_methods = obj.methods|selectattr("display")|list %} + {% set visible_methods = obj.methods|selectattr("display")|rejectattr("name", "equalto", "with_traceback")|list %} {% else %} - {% set visible_methods = obj.methods|rejectattr("inherited")|selectattr("display")|list %} + {% set visible_methods = obj.methods|rejectattr("inherited")|rejectattr("name", "equalto", "with_traceback")|selectattr("display")|list %} {% endif %} + {% if visible_methods|length %} **Methods** .. autoapisummary:: @@ -72,4 +73,5 @@ {% for method in visible_methods|sort(attribute='name') %} {{ method.render()|indent(3) }} {% endfor %} + {% endif %} {% endif %} \ No newline at end of file diff --git a/docs/source/_static/style.css b/docs/source/_static/style.css index c7a712f7e1..20257a6724 100644 --- a/docs/source/_static/style.css +++ b/docs/source/_static/style.css @@ -61,7 +61,7 @@ div.graphviz { margin-right: 15px; } -.class > dt, .function > dt, .method > dt { +.class > dt, .function > dt, .method > dt, .exception > dt { padding: 0.5rem; background-color: #f8f8f8; font-weight: normal; diff --git a/docs/source/conf.py b/docs/source/conf.py index a4ae326374..c1d5f9c423 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -58,9 +58,6 @@ "sphinx.ext.inheritance_diagram", ] -# Add any paths that contain templates here, relative to this directory. -#templates_path = ["_templates"] - autoapi_dirs = ['../../evalml'] autoapi_ignore = ["*test*"] autoapi_options = ['members', 'undoc-members', 'show-module-summary', 'imported-members', 'inherited-members'] @@ -70,7 +67,6 @@ # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # -# source_suffix = ['.rst', '.md'] source_suffix = ".rst" # The main toctree document. @@ -220,10 +216,6 @@ "user": ("https://github.com/%s", "@"), } -# autoclass_content = 'both' -#autosummary_generate = ["api_reference.rst"] -#templates_path = ["_templates"] - html_show_sphinx = False nbsphinx_execute = "always" nbsphinx_timeout = ( diff --git a/evalml/pipelines/components/transformers/imputers/simple_imputer.py b/evalml/pipelines/components/transformers/imputers/simple_imputer.py index 8d8da8ffd7..42563b1947 100644 --- a/evalml/pipelines/components/transformers/imputers/simple_imputer.py +++ b/evalml/pipelines/components/transformers/imputers/simple_imputer.py @@ -22,7 +22,9 @@ class SimpleImputer(Transformer): name = "Simple Imputer" hyperparameter_ranges = {"impute_strategy": ["mean", "median", "most_frequent"]} - """{"impute_strategy": ["mean", "median", "most_frequent"]}""" + """{ + "impute_strategy": ["mean", "median", "most_frequent"] + }""" def __init__( self, impute_strategy="most_frequent", fill_value=None, random_seed=0, **kwargs diff --git a/evalml/pipelines/components/transformers/imputers/target_imputer.py b/evalml/pipelines/components/transformers/imputers/target_imputer.py index d341f0f889..cd91575090 100644 --- a/evalml/pipelines/components/transformers/imputers/target_imputer.py +++ b/evalml/pipelines/components/transformers/imputers/target_imputer.py @@ -47,7 +47,9 @@ class TargetImputer(Transformer, metaclass=TargetImputerMeta): name = "Target Imputer" hyperparameter_ranges = {"impute_strategy": ["mean", "median", "most_frequent"]} - """{"impute_strategy": ["mean", "median", "most_frequent"]}""" + """{ + "impute_strategy": ["mean", "median", "most_frequent"] + }""" modifies_features = False modifies_target = True diff --git a/evalml/pipelines/components/transformers/preprocessing/polynomial_detrender.py b/evalml/pipelines/components/transformers/preprocessing/polynomial_detrender.py index 81797a68c2..92b618c572 100644 --- a/evalml/pipelines/components/transformers/preprocessing/polynomial_detrender.py +++ b/evalml/pipelines/components/transformers/preprocessing/polynomial_detrender.py @@ -18,7 +18,9 @@ class PolynomialDetrender(TargetTransformer): name = "Polynomial Detrender" hyperparameter_ranges = {"degree": Integer(1, 3)} - """{"degree": Integer(1, 3)}""" + """{ + "degree": Integer(1, 3) + }""" def __init__(self, degree=1, random_seed=0, **kwargs): if not isinstance(degree, int):