docstr: Transform scores to 1 - p-values.
  
  Parameters
  ----------
  scores
      `Torch.Tensor` of scores from ensemble of detectors.
  
  Returns
  -------
  `Torch.Tensor` of 1 - p-values.
docstr_tok: ["Transform","scores","to","1","-","p-values",".","Parameters","--","--","--","--","--","scores","`","Torch.Tensor","`","of","scores","from","ensemble","of","detectors",".","Returns","--","--","--","-","`","Torch.Tensor","`","of","1","-","p-values","."]
code: def transform(self, scores: torch.Tensor) -> torch.Tensor:
      """Transform scores to 1 - p-values.
  
      Parameters
      ----------
      scores
          `Torch.Tensor` of scores from ensemble of detectors.
  
      Returns
      -------
      `Torch.Tensor` of 1 - p-values.
      """
      self.check_fitted()
      less_than_val_scores = (
          scores[:, None, :] < self.val_scores[None, :, :]
      )
      p_vals = (1 + less_than_val_scores.sum(1)) / (
          len(self.val_scores) + 1
      )
      return 1 - p_vals
  
imports: from abc import ABC, abstractmethod
  from typing import Optional
  from typing_extensions import Self
  import torch
  import numpy
  from torch.nn import Module
  from alibi_detect.exceptions import NotFittedError
label_desc: Use image node_id 3 for calling the PValNormalizer obj's underlying member method code with example usage: obj.transform(scores) and returns: unknown