docstr: Rule anomaly score.
  
  The more negative the score, the more anomalous is the instance regarding the subspace
  covered by the rule. Instances whose score is greater than zero are considered normal.
  Different threshold values can be used to decide upon discarding or using the instance
  for training. A small negative threshold is considered to be a conservative choice,
  whereas cutting at zero is a more aggressive choice.
  
  Parameters
  ----------
  x
      A dictionary of features.
  
  Returns
  -------
  An anomaly score. The more negative the score, the more anomalous is the instance.
docstr_tok: ["Rule","anomaly","score",".","The","more","negative","the","score",",","the","more","anomalous","is","the","instance","regarding","the","subspace","covered","by","the","rule",".","Instances","whose","score","is","greater","than","zero","are","considered","normal",".","Different","threshold","values","can","be","used","to","decide","upon","discarding","or","using","the","instance","for","training",".","A","small","negative","threshold","is","considered","to","be","a","conservative","choice",",","whereas","cutting","at","zero","is","a","more","aggressive","choice",".","Parameters","--","--","--","--","--","x","A","dictionary","of","features",".","Returns","--","--","--","-","An","anomaly","score",".","The","more","negative","the","score",",","the","more","anomalous","is","the","instance","."]
code: def score_one(self, x) -> float:
      """Rule anomaly score.
  
      The more negative the score, the more anomalous is the instance regarding the subspace
      covered by the rule. Instances whose score is greater than zero are considered normal.
      Different threshold values can be used to decide upon discarding or using the instance
      for training. A small negative threshold is considered to be a conservative choice,
      whereas cutting at zero is a more aggressive choice.
  
      Parameters
      ----------
      x
          A dictionary of features.
  
      Returns
      -------
      An anomaly score. The more negative the score, the more anomalous is the instance.
  
  
      """
      score = 0.0
      hits = 0
  
      for feat_name, feat_val in x.items():
          # Skip nominal features
          if feat_name in self.nominal_features:
              continue
  
          mean = self._feat_stats[feat_name].mean.get()
          var = self._feat_stats[feat_name].get()
  
          if var > 0:
              # One tailed variant of Chebyshev's inequality: ported from the MOA code
              proba = (2 * var) / (var + (feat_val - mean) ** 2)
  
              if 0 < proba < 1:
                  score += math.log(proba) - math.log(1 - proba)
                  hits += 1
  
      return score / hits if hits > 0 else 0.0
  
imports: from __future__ import annotations
  import collections
  import functools
  import io
  import math
  import typing
  from river import anomaly, base, drift, linear_model, stats
  from river.tree import split_criterion
  from river.tree import splitter
  from .base import HoeffdingRule
label_desc: Use image node_id 8 for calling the RegRule obj's underlying member method code with example usage: obj.score_one(x) and returns: unknown