MCPcopy
hub / github.com/scikit-learn/scikit-learn / idf_

Method idf_

sklearn/feature_extraction/text.py:2010–2022  ·  view source on GitHub ↗

Inverse document frequency vector, only defined if `use_idf=True`. Returns ------- ndarray of shape (n_features,)

(self)

Source from the content-addressed store, hash-verified

2008
2009 @property
2010 def idf_(self):
2011 """Inverse document frequency vector, only defined if `use_idf=True`.
2012
2013 Returns
2014 -------
2015 ndarray of shape (n_features,)
2016 """
2017 if not hasattr(self, "_tfidf"):
2018 raise NotFittedError(
2019 f"{self.__class__.__name__} is not fitted yet. Call 'fit' with "
2020 "appropriate arguments before using this attribute."
2021 )
2022 return self._tfidf.idf_
2023
2024 @idf_.setter
2025 def idf_(self, value):

Callers

nothing calls this directly

Calls 3

NotFittedErrorClass · 0.90
TfidfTransformerClass · 0.85
_validate_vocabularyMethod · 0.80

Tested by

no test coverage detected