class_docstr: Unsupervised method
  compute smooth inverse frequency (SIF)
  
  Parameters
  ----------
  model : :class:`~gensim.models.keyedvectors.BaseKeyedVectors`
      Object contains the word vectors and the vocabulary.
  
  alpha : float, default=0.001
      Parameter which is used to weigh each individual word
      based on its probability.
  
  npc : int, default=1
      Number of principal components to remove from
      sentence embedding.
  
  norm : 'l1', 'l2', 'max' or None, optional
      Norm used to normalize term vectors. None for no normalization.
  
  Examples
  --------
  >>> from textvec.vectorizers import SifVectorizer
  >>> import gensim.downloader as api
  >>> model = api.load("glove-twitter-25")
  >>> X = [["first", "sentence"], ["second", "sentence"]]
  >>> sif = SifVectorizer(model, alpha=0.001, npc=1)
  >>> sif.fit(X)
  >>> sif.transform(X)
  array([[-0.2028063 , -0.07884892,  0.30937403, -0.4058012 , -0.02779805,
          -0.14715618,  0.09867747,  0.2490029 ,  0.22715728,  0.02029565,
          -0.0324943 , -0.14876653, -0.19695622, -0.349479  , -0.00145111,
          -0.17245306,  0.14833301, -0.15239874,  0.1624661 ,  0.08161873,
           0.13065818, -0.06360044, -0.39932743,  0.02312368,  0.26987103],
         [ 0.20280789,  0.0788492 , -0.30937368,  0.40580118,  0.02779823,
           0.14715572, -0.09867608, -0.24900348, -0.22715725, -0.02029571,
           0.0324944 ,  0.14876756,  0.19695152,  0.34947947,  0.00145159,
           0.1724532 , -0.14833233,  0.15239872, -0.1624666 , -0.08161937,
          -0.13065891,  0.06360071,  0.39932764, -0.02312382, -0.26987168]],
        dtype=float32)
  
  References
  ----------
  Arora S, Liang Y, Ma T (2017)
  A Simple but Tough-to-Beat Baseline for Sentence Embeddings
  https://openreview.net/pdf?id=SyK00v5xx
class_docstr_tok: ["Unsupervised","method","compute","smooth","inverse","frequency","(","SIF",")","Parameters","--","--","--","--","--","model",":",":","class",":","`","~gensim.models.keyedvectors.BaseKeyedVectors","`","Object","contains","the","word","vectors","and","the","vocabulary",".","alpha",":","float",",","default=0.001","Parameter","which","is","used","to","weigh","each","individual","word","based","on","its","probability",".","npc",":","int",",","default=1","Number","of","principal","components","to","remove","from","sentence","embedding",".","norm",":","'l1","'",",","'l2","'",",","'max","'","or","None",",","optional","Norm","used","to","normalize","term","vectors",".","None","for","no","normalization",".","Examples","--","--","--","--",">",">",">","from","textvec.vectorizers","import","SifVectorizer",">",">",">","import","gensim.downloader","as","api",">",">",">","model","=","api.load","(","``","glove-twitter-25","''",")",">",">",">","X","=","[","[","``","first","''",",","``","sentence","''","]",",","[","``","second","''",",","``","sentence","''","]","]",">",">",">","sif","=","SifVectorizer","(","model",",","alpha=0.001",",","npc=1",")",">",">",">","sif.fit","(","X",")",">",">",">","sif.transform","(","X",")","array","(","[","[","-0.2028063",",","-0.07884892",",","0.30937403",",","-0.4058012",",","-0.02779805",",","-0.14715618",",","0.09867747",",","0.2490029",",","0.22715728",",","0.02029565",",","-0.0324943",",","-0.14876653",",","-0.19695622",",","-0.349479",",","-0.00145111",",","-0.17245306",",","0.14833301",",","-0.15239874",",","0.1624661",",","0.08161873",",","0.13065818",",","-0.06360044",",","-0.39932743",",","0.02312368",",","0.26987103","]",",","[","0.20280789",",","0.0788492",",","-0.30937368",",","0.40580118",",","0.02779823",",","0.14715572",",","-0.09867608",",","-0.24900348",",","-0.22715725",",","-0.02029571",",","0.0324944",",","0.14876756",",","0.19695152",",","0.34947947",",","0.00145159",",","0.1724532",",","-0.14833233",",","0.15239872",",","-0.1624666",",","-0.08161937",",","-0.13065891",",","0.06360071",",","0.39932764",",","-0.02312382",",","-0.26987168","]","]",",","dtype=float32",")","References","--","--","--","--","--","Arora","S",",","Liang","Y",",","Ma","T","(","2017",")","A","Simple","but","Tough-to-Beat","Baseline","for","Sentence","Embeddings","https",":","\/\/openreview.net\/pdf","?","id=SyK00v5xx"]
docstr: Transform sentences to SIF weighted sentence embedding matrix.
  
  Parameters
  ----------
  X : iterable
      An iterable which yields iterable of str.
  
  Returns
  -------
  numpy.ndarray
      The sentence embedding matrix.
docstr_tok: ["Transform","sentences","to","SIF","weighted","sentence","embedding","matrix",".","Parameters","--","--","--","--","--","X",":","iterable","An","iterable","which","yields","iterable","of","str",".","Returns","--","--","--","-","numpy.ndarray","The","sentence","embedding","matrix","."]
code: def transform(self, X):
      """Transform sentences to SIF weighted sentence embedding matrix.
  
      Parameters
      ----------
      X : iterable
          An iterable which yields iterable of str.
  
      Returns
      -------
      numpy.ndarray
          The sentence embedding matrix.
  
      """
      if not self.vocab:
          raise RuntimeError(
              "This SifVectorizer instance is not fitted yet."
          )
      embeddings = self._get_weighted_average(X)
      if self.npc > 0:
          embeddings = self._remove_pc(embeddings, self.npc)
      if self.norm:
          embeddings = normalize(embeddings, self.norm, copy=False)
      return embeddings
  
imports: import collections
  import itertools
  import numpy
  import scipy.sparse
  from scipy.stats import norm
  from sklearn.decomposition import TruncatedSVD
  from sklearn.preprocessing import normalize
  from sklearn.base import TransformerMixin, BaseEstimator
  from gensim.models.keyedvectors import BaseKeyedVectors
label_desc: Use image node_id 6 for calling the SifVectorizer obj's underlying member method code with example usage: obj.transform(X) and returns: embeddings