cvanmf.models ============= .. py:module:: cvanmf.models .. autoapi-nested-parse:: Load existing Enterosignature models. Attributes ---------- .. autoapisummary:: cvanmf.models.FIVE_ES_COLORS cvanmf.models.logger Classes ------- .. autoapisummary:: cvanmf.models.Signatures Functions --------- .. autoapisummary:: cvanmf.models.five_es Module Contents --------------- .. py:class:: Signatures Bases: :py:obj:`NamedTuple` Definition of an existing signature model. This provides the definition of existing signatures required to reapply the signature model to new data. Where Decomposition stores the input and H matrix, these are not necessary for transforming new data. Rather, we only need the W matrix, the colors associated with each signature (for consistency of representation), and the preprocessing steps (to match features in the new data with those in the W matrix). .. py:method:: reapply(y: pandas.DataFrame, **kwargs) -> Decomposition Transform new data using this signature model. :param y: New data of same type as the existing model. .. py:attribute:: citation :type: Optional[str] :value: None Citation when using this model. .. py:attribute:: colors :type: Union[List[str], Dict[str, str]] Color for each signature in the model. .. py:attribute:: feature_match :type: FeatureMatch Function to map features in new data to those in the model W matrix. .. py:attribute:: input_validation :type: InputValidation Function to validate and potentially transform input table. Defaults to identity function .. py:attribute:: w :type: pandas.DataFrame Feature weights (W matrix) for this model. .. py:function:: five_es() -> Signatures The 5 Enterosignature model of Frioux et al. (2023, https://doi.org/10.1016/j.chom.2023.05.024). A summary of this model can also be found on the website https://enterosignatures.quadram.ac.uk. The `reapply` method for this model will normalise (total-sum-scale) input data after applying filters to match model format, so data provided does not need to be normalised. :return: 5 Enterosignature model :type: Signatures .. py:data:: FIVE_ES_COLORS .. py:data:: logger :type: logging.Logger