OCDocker.OCScore.Analysis.SHAP.Model module¶
Build neural network models for SHAP analysis in OCScore.
Usage:
from OCDocker.OCScore.Analysis.SHAP.Model import build_neural_net
- OCDocker.OCScore.Analysis.SHAP.Model.build_neural_net(input_dim, autoencoder_params, nn_params, seed, mask=None, use_gpu=None, verbose=False)[source]¶
Build and configure a neural network for SHAP analysis.
- Parameters:
input_dim (int) – Number of input features.
autoencoder_params (Dict[str, Union[int, float, str, bool]]) – Parameters for the autoencoder component.
nn_params (Dict[str, Union[int, float, str, bool]]) – Parameters for the neural network component.
seed (int) – Random seed for reproducibility.
mask (Optional[list[int] | list[bool]], optional) – Feature mask to apply. Default is None.
use_gpu (Optional[bool], optional) – Whether to use GPU. If None, auto-detects CUDA availability. Default is None.
verbose (bool, optional) – Whether to print verbose output. Default is False.
- Returns:
Configured neural network in evaluation mode.
- Return type: