# -----------------------------------------------------------------------------------------# (C) Copyright IBM Corp. 2023-2024.# https://opensource.org/licenses/BSD-3-Clause# -----------------------------------------------------------------------------------------fromenumimportEnum__all__=["ClassificationAlgorithms","ClassificationAlgorithmsCP4D","RegressionAlgorithms","RegressionAlgorithmsCP4D","ForecastingAlgorithms","ForecastingAlgorithmsCP4D","PredictionType","RAGMetrics","Metrics","Transformers","DataConnectionTypes","RunStateTypes","PipelineTypes","Directions","TShirtSize","MetricsToDirections","PositiveLabelClass","VisualizationTypes","SamplingTypes","ImputationStrategy","ForecastingPipelineTypes","TimeseriesAnomalyPredictionPipelineTypes","TimeseriesAnomalyPredictionAlgorithms","DocumentsSamplingTypes",]
[docs]classClassificationAlgorithms(Enum):"""Classification algorithms that AutoAI can use for IBM Cloud."""EX_TREES="ExtraTreesClassifier"GB="GradientBoostingClassifier"LGBM="LGBMClassifier"LR="LogisticRegression"RF="RandomForestClassifier"XGB="XGBClassifier"DT="DecisionTreeClassifier"SnapDT="SnapDecisionTreeClassifier"SnapRF="SnapRandomForestClassifier"SnapSVM="SnapSVMClassifier"SnapLR="SnapLogisticRegression"SnapBM="SnapBoostingMachineClassifier"
[docs]classClassificationAlgorithmsCP4D(Enum):""" Classification algorithms that AutoAI can use for IBM Cloud Pak® for Data(CP4D). The SnapML estimators (SnapDT, SnapRF, SnapSVM, SnapLR) are supported on IBM Cloud Pak® for Data version 4.0.2 and later. """EX_TREES="ExtraTreesClassifierEstimator"GB="GradientBoostingClassifierEstimator"LGBM="LGBMClassifierEstimator"LR="LogisticRegressionEstimator"RF="RandomForestClassifierEstimator"XGB="XGBClassifierEstimator"DT="DecisionTreeClassifierEstimator"SnapDT="SnapDecisionTreeClassifier"SnapRF="SnapRandomForestClassifier"SnapSVM="SnapSVMClassifier"SnapLR="SnapLogisticRegression"SnapBM="SnapBoostingMachineClassifier"
classBatchedClassificationAlgorithms(Enum):"""Batched tree ensemble classification algorithms that AutoAI can use for IBM Cloud."""RF="BatchedTreeEnsembleClassifier(RandomForestClassifier)"EX_TREES="BatchedTreeEnsembleClassifier(ExtraTreesClassifier)"LGBM="BatchedTreeEnsembleClassifier(LGBMClassifier)"XGB="BatchedTreeEnsembleClassifier(XGBClassifier)"SnapRF="BatchedTreeEnsembleClassifier(SnapRandomForestClassifier)"SnapBM="BatchedTreeEnsembleClassifier(SnapBoostingMachineClassifier)"
[docs]classRegressionAlgorithms(Enum):"""Regression algorithms that AutoAI can use for IBM Cloud."""RF="RandomForestRegressor"RIDGE="Ridge"EX_TREES="ExtraTreesRegressor"GB="GradientBoostingRegressor"LR="LinearRegression"XGB="XGBRegressor"LGBM="LGBMRegressor"DT="DecisionTreeRegressor"SnapDT="SnapDecisionTreeRegressor"SnapRF="SnapRandomForestRegressor"SnapBM="SnapBoostingMachineRegressor"
[docs]classRegressionAlgorithmsCP4D(Enum):""" Regression algorithms that AutoAI can use for IBM Cloud Pak® for Data(CP4D). The SnapML estimators (SnapDT, SnapRF, SnapBM) are supported on IBM Cloud Pak® for Data version 4.0.2 and later. """RF="RandomForestRegressorEstimator"RIDGE="RidgeEstimator"EX_TREES="ExtraTreesRegressorEstimator"GB="GradientBoostingRegressorEstimator"LR="LinearRegressionEstimator"XGB="XGBRegressorEstimator"LGBM="LGBMRegressorEstimator"DT="DecisionTreeRegressorEstimator"SnapDT="SnapDecisionTreeRegressor"SnapRF="SnapRandomForestRegressor"SnapBM="SnapBoostingMachineRegressor"
classBatchedRegressionAlgorithms(Enum):"""Batched tree ensemble regression algorithms that AutoAI can use for IBM Cloud."""RF="BatchedTreeEnsembleRegressor(RandomForestRegressor)"EX_TREES="BatchedTreeEnsembleRegressor(ExtraTreesRegressor)"LGBM="BatchedTreeEnsembleRegressor(LGBMRegressor)"SnapRF="BatchedTreeEnsembleRegressor(SnapRandomForestRegressor)"SnapBM="BatchedTreeEnsembleRegressor(SnapBoostingMachineRegressor)"XGB="BatchedTreeEnsembleRegressor(XGBRegressor)"
[docs]classForecastingAlgorithmsCP4D(Enum):"""Forecasting algorithms that AutoAI can use for IBM Cloud."""LR="LinearRegression"ENSEMBLER="Ensembler"ARIMA="ARIMA"HW="HoltWinters"BATS="BATS"RF="RandomForest"SVM="SVM"
[docs]classForecastingAlgorithms(Enum):"""Forecasting algorithms that AutoAI can use for IBM watsonx.ai software with IBM Cloud Pak® for Data."""LR="LinearRegression"ENSEMBLER="Ensembler"ARIMA="ARIMA"HW="HoltWinters"BATS="BATS"RF="RandomForest"SVM="SVM"
[docs]classForecastingPipelineTypes(Enum):"""Forecasting pipeline types that AutoAI can use for IBM Cloud Pak® for Data(CP4D)."""RandomForestRegressor="RandomForestRegressor"ExogenousRandomForestRegressor="ExogenousRandomForestRegressor"SVM="SVM"ExogenousSVM="ExogenousSVM"LocalizedFlattenEnsembler="LocalizedFlattenEnsembler"DifferenceFlattenEnsembler="DifferenceFlattenEnsembler"FlattenEnsembler="FlattenEnsembler"ExogenousLocalizedFlattenEnsembler="ExogenousLocalizedFlattenEnsembler"ExogenousDifferenceFlattenEnsembler="ExogenousDifferenceFlattenEnsembler"ExogenousFlattenEnsembler="ExogenousFlattenEnsembler"MT2RForecaster="MT2RForecaster"ExogenousMT2RForecaster="ExogenousMT2RForecaster"HoltWinterAdditive="HoltWinterAdditive"HoltWinterMultiplicative="HoltWinterMultiplicative"Bats="Bats"ARIMA="ARIMA"ARIMAX="ARIMAX"ARIMAX_RSAR="ARIMAX_RSAR"ARIMAX_PALR="ARIMAX_PALR"ARIMAX_RAR="ARIMAX_RAR"ARIMAX_DMLR="ARIMAX_DMLR"
[docs]@staticmethoddefget_exogenous():"""Get a list of pipelines that use supporting features (exogenous pipelines). :return: list of pipelines using supporting features :rtype: list[ForecastingPipelineTypes] """return[pipelineforpipelineinForecastingPipelineTypesifpipeline.value.startswith("Exogenous")]
[docs]@staticmethoddefget_non_exogenous():"""Get a list of pipelines that are not using supporting features (non-exogenous pipelines). :return: list of pipelines that do not use supporting features :rtype: list[ForecastingPipelineTypes] """return[pipelineforpipelineinForecastingPipelineTypesifnotpipeline.value.startswith("Exogenous")]
[docs]classTimeseriesAnomalyPredictionAlgorithms(Enum):"""Timeseries Anomaly Prediction algorithms that AutoAI can use for IBM Cloud."""Forecasting="Forecasting"Window="Window"Relationship="Relationship"
[docs]classTimeseriesAnomalyPredictionPipelineTypes(Enum):"""Timeseries Anomaly Prediction pipeline types that AutoAI can use for IBM Cloud."""PointwiseBoundedHoltWintersAdditive="PointwiseBoundedHoltWintersAdditive"PointwiseBoundedBATS="PointwiseBoundedBATS"PointwiseBoundedBATSForceUpdate="PointwiseBoundedBATSForceUpdate"WindowNN="WindowNN"WindowPCA="WindowPCA"WindowLOF="WindowLOF"
[docs]classPredictionType:"""Supported types of learning."""CLASSIFICATION="classification"BINARY="binary"MULTICLASS="multiclass"REGRESSION="regression"FORECASTING="forecasting"TIMESERIES_ANOMALY_PREDICTION="timeseries_anomaly_prediction"
[docs]classPositiveLabelClass:"""Metrics that need positive label definition for binary classification."""AVERAGE_PRECISION_SCORE="average_precision"F1_SCORE="f1"PRECISION_SCORE="precision"RECALL_SCORE="recall"F1_SCORE_MICRO="f1_micro"F1_SCORE_MACRO="f1_macro"F1_SCORE_WEIGHTED="f1_weighted"PRECISION_SCORE_MICRO="precision_micro"PRECISION_SCORE_MACRO="precision_macro"PRECISION_SCORE_WEIGHTED="precision_weighted"RECALL_SCORE_MICRO="recall_micro"RECALL_SCORE_MACRO="recall_macro"RECALL_SCORE_WEIGHTED="recall_weighted"
[docs]classRAGMetrics:"""Supported types of AutoAI RAG metrics"""ANSWER_CORRECTNESS="answer_correctness"CONTEXT_CORRECTNESS="context_correctness"FAITHFULNESS="faithfulness"
[docs]classMetrics:"""Supported types of classification and regression metrics in AutoAI."""ACCURACY_SCORE="accuracy"ACCURACY_AND_DISPARATE_IMPACT_SCORE="accuracy_and_disparate_impact"AVERAGE_PRECISION_SCORE="average_precision"F1_SCORE="f1"LOG_LOSS="neg_log_loss"PRECISION_SCORE="precision"RECALL_SCORE="recall"ROC_AUC_SCORE="roc_auc"F1_SCORE_MICRO="f1_micro"F1_SCORE_MACRO="f1_macro"F1_SCORE_WEIGHTED="f1_weighted"PRECISION_SCORE_MICRO="precision_micro"PRECISION_SCORE_MACRO="precision_macro"PRECISION_SCORE_WEIGHTED="precision_weighted"RECALL_SCORE_MICRO="recall_micro"RECALL_SCORE_MACRO="recall_macro"RECALL_SCORE_WEIGHTED="recall_weighted"EXPLAINED_VARIANCE_SCORE="explained_variance"MEAN_ABSOLUTE_ERROR="neg_mean_absolute_error"MEAN_SQUARED_ERROR="neg_mean_squared_error"MEAN_SQUARED_LOG_ERROR="neg_mean_squared_log_error"MEDIAN_ABSOLUTE_ERROR="neg_median_absolute_error"ROOT_MEAN_SQUARED_ERROR="neg_root_mean_squared_error"ROOT_MEAN_SQUARED_LOG_ERROR="neg_root_mean_squared_log_error"R2_SCORE="r2"R2_AND_DISPARATE_IMPACT_SCORE="r2_and_disparate_impact"
[docs]classTransformers:"""Supported types of congito transformers names in AutoAI."""SQRT="sqrt"LOG="log"ROUND="round"SQUARE="square"CBRT="cbrt"SIN="sin"COS="cos"TAN="tan"ABS="abs"SIGMOID="sigmoid"PRODUCT="product"MAX="max"DIFF="diff"SUM="sum"DIVIDE="divide"STDSCALER="stdscaler"MINMAXSCALER="minmaxscaler"PCA="pca"NXOR="nxor"CUBE="cube"FEATUREAGGLOMERATION="featureagglomeration"ISOFORESTANOMALY="isoforestanomaly"
[docs]classDataConnectionTypes:"""Supported types of DataConnection."""S3="s3"FS="fs"DS="data_asset"CA="connection_asset"CN="container"
[docs]classRunStateTypes:"""Supported types of AutoAI fit/run."""COMPLETED="completed"FAILED="failed"
[docs]classPipelineTypes:"""Supported types of Pipelines."""LALE="lale"SKLEARN="sklearn"
[docs]classTShirtSize:"""Possible sizes of the AutoAI POD. Depending on the POD size, AutoAI can support different data set sizes. - S - small (2vCPUs and 8GB of RAM) - M - Medium (4vCPUs and 16GB of RAM) - L - Large (8vCPUs and 32GB of RAM)) - XL - Extra Large (16vCPUs and 64GB of RAM) """S="s"M="m"L="l"XL="xl"
[docs]classMetricsToDirections(Enum):"""Map of metrics directions."""ROC_AUC=Directions.ASCENDINGNORMALIZED_GINI_COEFFICIENT=Directions.ASCENDINGPRECISION=Directions.ASCENDINGAVERAGE_PRECISION=Directions.ASCENDINGNEG_LOG_LOSS=Directions.DESCENDINGRECALL=Directions.ASCENDINGACCURACY=Directions.ASCENDINGF1=Directions.ASCENDINGPRECISION_MICRO=Directions.ASCENDINGPRECISION_MACRO=Directions.ASCENDINGPRECISION_WEIGHTED=Directions.ASCENDINGF1_MICRO=Directions.ASCENDINGF1_MACRO=Directions.ASCENDINGF1_WEIGHTED=Directions.ASCENDINGRECALL_MICRO=Directions.ASCENDINGRECALL_MACRO=Directions.ASCENDINGRECALL_WEIGHTED=Directions.ASCENDINGNEG_ROOT_MEAN_SQUARED_ERROR=Directions.DESCENDINGEXPLAINED_VARIANCE=Directions.ASCENDINGNEG_MEAN_ABSOLUTE_ERROR=Directions.DESCENDINGNEG_MEAN_SQUARED_ERROR=Directions.DESCENDINGNEG_MEAN_SQUARED_LOG_ERROR=Directions.DESCENDINGNEG_MEDIAN_ABSOLUTE_ERROR=Directions.DESCENDINGNEG_ROOT_MEAN_SQUARED_LOG_ERROR=Directions.DESCENDINGR2=Directions.ASCENDING
[docs]classVisualizationTypes:"""Types of visualization options."""PDF="pdf"INPLACE="inplace"
[docs]classSamplingTypes:"""Types of training data sampling."""FIRST_VALUES="first_n_records"RANDOM="random"STRATIFIED="stratified"LAST_VALUES="truncate"
[docs]classDocumentsSamplingTypes:"""Types of training data sampling."""RANDOM="random"BENCHMARK_DRIVEN="benchmark_driven"