docstr: Computes unbalanced scaled-fscores
  Parameters
  ----------
  category : str
      category name to score
  scaler_algo : str
      Function that scales an array to a range \in [0 and 1]. Use 'percentile', 'normcdf'. Default normcdf
  beta : float
      Beta in (1+B^2) * (Scale(P(w|c)) * Scale(P(c|w)))/(B^2*Scale(P(w|c)) + Scale(P(c|w))). Defaults to 1.
  Returns
  -------
      np.array of harmonic means of scaled P(word|category) and scaled P(category|word).
docstr_tok: ["Computes","unbalanced","scaled-fscores","Parameters","--","--","--","--","--","category",":","str","category","name","to","score","scaler_algo",":","str","Function","that","scales","an","array","to","a","range","\\in","[","0","and","1","]",".","Use","'percentile","'",",","'normcdf","'",".","Default","normcdf","beta",":","float","Beta","in","(","1+B^2",")","*","(","Scale","(","P","(","w|c",")",")","*","Scale","(","P","(","c|w",")",")",")","\/","(","B^2","*","Scale","(","P","(","w|c",")",")","+","Scale","(","P","(","c|w",")",")",")",".","Defaults","to","1",".","Returns","--","--","--","-","np.array","of","harmonic","means","of","scaled","P","(","word|category",")","and","scaled","P","(","category|word",")","."]
code: def get_scores_for_category(
      cat_word_counts,
      not_cat_word_counts,
      scaler_algo=DEFAULT_SCALER_ALGO,
      beta=DEFAULT_BETA,
  ):
      """Computes unbalanced scaled-fscores
      Parameters
      ----------
      category : str
          category name to score
      scaler_algo : str
          Function that scales an array to a range \in [0 and 1]. Use 'percentile', 'normcdf'. Default normcdf
      beta : float
          Beta in (1+B^2) * (Scale(P(w|c)) * Scale(P(c|w)))/(B^2*Scale(P(w|c)) + Scale(P(c|w))). Defaults to 1.
      Returns
      -------
          np.array of harmonic means of scaled P(word|category) and scaled P(category|word).
      """
      assert beta > 0
      old_cat_word_counts = None
      if type(cat_word_counts) == pd.Series:
          old_cat_word_counts = cat_word_counts
          cat_word_counts = cat_word_counts.values
  
      if type(not_cat_word_counts) == pd.Series:
          not_cat_word_counts = not_cat_word_counts.values
  
      precision = (
          cat_word_counts
          * 1.0
          / (cat_word_counts + not_cat_word_counts)
      )
      recall = cat_word_counts * 1.0 / cat_word_counts.sum()
      precision_normcdf = ScaledFScore._safe_scaler(
          scaler_algo, precision
      )
      recall_normcdf = ScaledFScore._safe_scaler(scaler_algo, recall)
      scores_numerator = (1 + beta**2) * (
          precision_normcdf * recall_normcdf
      )
      scores_denominator = (
          beta**2
      ) * precision_normcdf + recall_normcdf
      scores_denominator[scores_denominator == 0] = 1
      scores = scores_numerator / scores_denominator
      scores[np.isnan(scores)] = 0.0
      if old_cat_word_counts is None:
          return scores
      else:
          return pd.Series(scores, index=old_cat_word_counts.index)
  
imports: from abc import ABC, abstractmethod
  import numpy
  import pandas
  from scipy.stats import norm, rankdata
  from scattertext.Common import DEFAULT_SCALER_ALGO, DEFAULT_BETA
label_desc: Use image node_id 3 for calling the ScaledFScore obj's underlying member method code with example usage: obj.get_scores_for_category(cat_word_counts, not_cat_word_counts, scaler_algo, beta) and returns: scores, pd