uqmodels.modelization package
Subpackages
- uqmodels.modelization.DL_estimator package
- Submodules
- uqmodels.modelization.DL_estimator.Lstm_WS_ED module
- uqmodels.modelization.DL_estimator.baseline_models module
- uqmodels.modelization.DL_estimator.data_embedding module
- uqmodels.modelization.DL_estimator.loss module
- uqmodels.modelization.DL_estimator.lstm_ed module
- uqmodels.modelization.DL_estimator.metalayers module
Add_query_to_Z_Processing_with_state
Double_Moving_slice_layer
EDLProcessing
LSTMCellMidsize
LSTMCellReturnCellState
LSTM_DProcessing()
LSTM_EProcessing()
Moving_slice_layer
ProbabilisticProcessing
RNN_states_in_inputs
Tconv_block_1D()
Tconv_block_2D()
cnn_dec()
cnn_dec_1D()
cnn_dec_bis()
cnn_enc()
cnn_enc_1D()
cnn_enc_bis()
conv_block_1D()
conv_block_2D()
dense2D_enc_dec()
get_cnn_dec_params()
get_cnn_enc_params()
mlp()
moving_slice_map()
stack_and_roll_layer()
- uqmodels.modelization.DL_estimator.neural_network_UQ module
Deterministic_prediction()
Drawn_based_prediction()
Ensemble_based_prediction()
Identity_factory()
NN_UQ
NN_UQ.Build_generator()
NN_UQ.basic_fit()
NN_UQ.basic_predict()
NN_UQ.build_loss()
NN_UQ.build_metrics()
NN_UQ.compile()
NN_UQ.dataset_generator()
NN_UQ.factory()
NN_UQ.fit()
NN_UQ.init_neural_network()
NN_UQ.load()
NN_UQ.modify_dropout()
NN_UQ.predict()
NN_UQ.reset()
NN_UQ.save()
NN_UQ.set_fit_request()
NN_UQ.set_predict_request()
default_Generator
generate_K_fold_removing_index()
generate_train_test()
get_params_dict()
get_training_parameters()
- uqmodels.modelization.DL_estimator.transformer_ed module
- uqmodels.modelization.DL_estimator.utils module
- Module contents
- uqmodels.modelization.ML_estimator package
Submodules
uqmodels.modelization.UQEstimator module
- class uqmodels.modelization.UQEstimator.MeanVarUQEstimator(estimator=None, estimator_var=None, type_UQ='var', name='MeanVarUQEstimator', rescale=False, var_min=1e-05, random_state=None)[source]
Bases:
UQEstimator
Mean var UQ Estimator that estimate a mean values and estimate irreductible
- fit(X, y, skip_format=False, **kwargs)[source]
Fit UQestimator using training data. :param X: train features :param y: train targets/observations
- predict(X, skip_format=False, **kwargs)[source]
Compute prediction (or provide None) and UQ-measure :param X: features
- Returns:
pred, UQ_measure
- set_fit_request(*, skip_format: bool | None | str = '$UNCHANGED$') MeanVarUQEstimator
Request metadata passed to the
fit
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
pipeline.Pipeline
. Otherwise it has no effect.- Parameters:
skip_format (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
skip_format
parameter infit
.- Returns:
self – The updated object.
- Return type:
object
- set_predict_request(*, skip_format: bool | None | str = '$UNCHANGED$') MeanVarUQEstimator
Request metadata passed to the
predict
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed topredict
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it topredict
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
pipeline.Pipeline
. Otherwise it has no effect.- Parameters:
skip_format (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
skip_format
parameter inpredict
.- Returns:
self – The updated object.
- Return type:
object
- class uqmodels.modelization.UQEstimator.QuantileUQEstimator(list_estimators, list_alpha: list = [0.025, 0.5, 0.975], type_UQ: str = 'quantile', name: str = 'QuantileUQEstimator', rescale=False, var_min=1e-05, random_state=None, **kwargs)[source]
Bases:
UQEstimator
- fit(X, y, skip_format=False, **kwargs)[source]
Fit UQestimator using training data. :param X: train features :param y: train targets/observations
- predict(X, skip_format=False, **kwargs)[source]
Compute prediction (or provide None) and UQ-measure :param X: features
- Returns:
pred, UQ_measure
- set_fit_request(*, skip_format: bool | None | str = '$UNCHANGED$') QuantileUQEstimator
Request metadata passed to the
fit
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
pipeline.Pipeline
. Otherwise it has no effect.- Parameters:
skip_format (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
skip_format
parameter infit
.- Returns:
self – The updated object.
- Return type:
object
- set_predict_request(*, skip_format: bool | None | str = '$UNCHANGED$') QuantileUQEstimator
Request metadata passed to the
predict
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed topredict
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it topredict
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
pipeline.Pipeline
. Otherwise it has no effect.- Parameters:
skip_format (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
skip_format
parameter inpredict
.- Returns:
self – The updated object.
- Return type:
object
- class uqmodels.modelization.UQEstimator.UQEstimator(name='UQEstimator', type_UQ='None', rescale=False, type_UQ_params=None, var_min=1e-06, random_state=None)[source]
Bases:
BaseEstimator
Abstract structure of a UQEstimator : Estimator (fit/predict) that perform prediction(optionaly) and UQmeasure estimation
- abstract fit(X: array, y: array, skip_format=False, **kwargs) None [source]
Fit UQestimator using training data. :param X: train features :param y: train targets/observations
- get_params(deep=False)[source]
Get parameters for this estimator.
- Parameters:
deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns:
params – Parameter names mapped to their values.
- Return type:
dict
- abstract predict(X: array, skip_format=False, **kwargs)[source]
Compute prediction (or provide None) and UQ-measure :param X: features
- Returns:
pred, UQ_measure
- set_fit_request(*, skip_format: bool | None | str = '$UNCHANGED$') UQEstimator
Request metadata passed to the
fit
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
pipeline.Pipeline
. Otherwise it has no effect.- Parameters:
skip_format (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
skip_format
parameter infit
.- Returns:
self – The updated object.
- Return type:
object
- set_predict_request(*, skip_format: bool | None | str = '$UNCHANGED$') UQEstimator
Request metadata passed to the
predict
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed topredict
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it topredict
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
pipeline.Pipeline
. Otherwise it has no effect.- Parameters:
skip_format (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
skip_format
parameter inpredict
.- Returns:
self – The updated object.
- Return type:
object
- uqmodels.modelization.UQEstimator.get_UQEstimator_parameters(model_parameters={}, factory_parameters={}, training_parameters=None, type_output=None, rescale=False, random_state=None, **kwargs)[source]
Generate dict object containing UQEstimators parameters to provide to init().
- Parameters:
model_parameters (dict, optional) – UQestimators parameters. Defaults to {}.
factory_parameters (dict, optional) – Factory parameters, to data preprocessing. Defaults to {}.
training_parameters (_type_, optional) – Model training parameters for DEEP estimators. Defaults to None.
type_output (_type_, optional) – Specification of deep learning output. Defaults to None.
rescale (bool, optional) – Use or not internal rescale function Defaults to False.
random_state (bool) – handle experimental random using seed.
- Returns:
UQEstimators parameters
- Return type:
dict