Skip to content

Commit

Permalink
Merge pull request scikit-learn#2 from MZeej/tversions
Browse files Browse the repository at this point in the history
Tversions
  • Loading branch information
EricaXia committed Nov 2, 2019
2 parents 084a351 + c3286d2 commit e5044b9
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 3 deletions.
3 changes: 2 additions & 1 deletion sklearn/decomposition/_truncated_svd.py
Expand Up @@ -113,7 +113,8 @@ class TruncatedSVD(TransformerMixin, BaseEstimator):
sign of the ``components_`` and the output from transform depend on the
algorithm and random state. To work around this, fit instances of this
class to data once, then keep the instance around to do transformations.
..versionadded:: v0.14
"""
def __init__(self, n_components=2, algorithm="randomized", n_iter=5,
random_state=None, tol=0.):
Expand Down
3 changes: 3 additions & 0 deletions sklearn/dummy.py
Expand Up @@ -90,6 +90,9 @@ class DummyClassifier(MultiOutputMixin, ClassifierMixin, BaseEstimator):
array([1, 1, 1, 1])
>>> dummy_clf.score(X, y)
0.75
..vershionchanged:: v0.19
Accepts non-finite features
..versionadded:: v0.13
"""

def __init__(self, strategy="stratified", random_state=None,
Expand Down
18 changes: 16 additions & 2 deletions sklearn/feature_extraction/text.py
Expand Up @@ -624,7 +624,7 @@ class HashingVectorizer(TransformerMixin, _VectorizerMixin, BaseEstimator):
If a callable is passed it is used to extract the sequence of features
out of the raw, unprocessed input.
.. versionchanged:: 0.21
.. versionadded:: v0.21
Since v0.21, if ``input`` is ``filename`` or ``file``, the data is
first read from the file and then passed to the given callable
Expand Down Expand Up @@ -979,6 +979,17 @@ class CountVectorizer(_VectorizerMixin, BaseEstimator):
The ``stop_words_`` attribute can get large and increase the model size
when pickling. This attribute is provided only for introspection and can
be safely removed using delattr or set to None before pickling.
..versionchanged:: v0.22
Raise warning of parameter choide means the another parameter unused
..versionchanged:: v0.21
Read the data from the file instead of pass file name
..versionchanged:: v0.20
Bug fix
..versionchanged:: v0.17
Bug fix of inconsistent results when pickling
..versionchanged:: v0.14
Speed and memory imporvements
"""

def __init__(self, input='content', encoding='utf-8',
Expand Down Expand Up @@ -1346,7 +1357,8 @@ class TfidfTransformer(TransformerMixin, BaseEstimator):
----------
idf_ : array, shape (n_features)
The inverse document frequency (IDF) vector; only defined
if ``use_idf`` is True.
if ``use_idf`` is True.
.. versionadded:: v0.20
Examples
--------
Expand Down Expand Up @@ -1382,6 +1394,8 @@ class TfidfTransformer(TransformerMixin, BaseEstimator):
.. [MRS2008] C.D. Manning, P. Raghavan and H. Schütze (2008).
Introduction to Information Retrieval. Cambridge University
Press, pp. 118-120.
.. versionadded:: v.019
"""

def __init__(self, norm='l2', use_idf=True, smooth_idf=True,
Expand Down
2 changes: 2 additions & 0 deletions sklearn/linear_model/_theil_sen.py
Expand Up @@ -291,6 +291,8 @@ class TheilSenRegressor(RegressorMixin, LinearModel):
- Theil-Sen Estimators in a Multiple Linear Regression Model, 2009
Xin Dang, Hanxiang Peng, Xueqin Wang and Heping Zhang
http://home.olemiss.edu/~xdang/papers/MTSE.pdf
..versionadded:: v0.16
"""

def __init__(self, fit_intercept=True, copy_X=True,
Expand Down
3 changes: 3 additions & 0 deletions sklearn/model_selection/_split.py
Expand Up @@ -758,6 +758,7 @@ class TimeSeriesSplit(_BaseKFold):
max_train_size : int, optional
Maximum size for a single training set.
..versionadded:: v0.19
Examples
--------
Expand All @@ -784,6 +785,8 @@ class TimeSeriesSplit(_BaseKFold):
+ n_samples % (n_splits + 1)`` in the ``i``th split,
with a test set of size ``n_samples//(n_splits + 1)``,
where ``n_samples`` is the number of samples.
..versionadded:: v0.18
"""
def __init__(self, n_splits=5, max_train_size=None):
super().__init__(n_splits, shuffle=False, random_state=None)
Expand Down
8 changes: 8 additions & 0 deletions sklearn/naive_bayes.py
Expand Up @@ -746,6 +746,12 @@ class MultinomialNB(BaseDiscreteNB):
C.D. Manning, P. Raghavan and H. Schuetze (2008). Introduction to
Information Retrieval. Cambridge University Press, pp. 234-265.
https://nlp.stanford.edu/IR-book/html/htmledition/naive-bayes-text-classification-1.html
..versionadded:: v0.14
..versionchanged:: v0.16
Correct ``partial_fit`` handling of ``class_prior``
..versionchanged:: v0.19
Fixed a bug where failed when ``alpha=0``.
"""

def __init__(self, alpha=1.0, fit_prior=True, class_prior=None):
Expand Down Expand Up @@ -851,6 +857,8 @@ class ComplementNB(BaseDiscreteNB):
Tackling the poor assumptions of naive bayes text classifiers. In ICML
(Vol. 3, pp. 616-623).
https://people.csail.mit.edu/jrennie/papers/icml03-nb.pdf
..versionadded:: v0.20
"""

def __init__(self, alpha=1.0, fit_prior=True, class_prior=None,
Expand Down

0 comments on commit e5044b9

Please sign in to comment.