Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sklearn/datasets/kddcup99.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def fetch_kddcup99(subset=None, shuffle=False, random_state=None,
.. [2] A Geometric Framework for Unsupervised Anomaly Detection: Detecting
Intrusions in Unlabeled Data (2002) by Eleazar Eskin, Andrew Arnold,
Michael Prerau, Leonid Portnoy, Sal Stolfo

.. versionadded:: 0.18
"""
kddcup99 = _fetch_brute_kddcup99(shuffle=shuffle, percent10=percent10)

Expand Down Expand Up @@ -248,6 +250,7 @@ def _fetch_brute_kddcup99(subset=None, data_home=None,
dataset.DESCR : string
Description of the kddcup99 dataset.

.. versionadded:: 0.18
"""

data_home = get_data_home(data_home=data_home)
Expand Down
2 changes: 2 additions & 0 deletions sklearn/decomposition/kernel_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class KernelPCA(BaseEstimator, TransformerMixin):
A pseudo random number generator used for the initialization of the
residuals when eigen_solver == 'arpack'.

.. versionadded:: 0.18

Attributes
----------

Expand Down
2 changes: 2 additions & 0 deletions sklearn/decomposition/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class PCA(BaseEstimator, TransformerMixin):
explained_variance_ : array, [n_components]
The amount of variance explained by each of the selected components.

.. versionadded:: 0.18

explained_variance_ratio_ : array, [n_components]
Percentage of variance explained by each of the selected components.

Expand Down
32 changes: 32 additions & 0 deletions sklearn/ensemble/forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ def decision_path(self, X):
n_nodes_ptr : array of size (n_estimators + 1, )
The columns from indicator[n_nodes_ptr[i]:n_nodes_ptr[i+1]]
gives the indicator value for the i-th estimator.

.. versionadded:: 0.18
"""
X = self._validate_X_predict(X)
indicators = Parallel(n_jobs=self.n_jobs, verbose=self.verbose,
Expand Down Expand Up @@ -792,6 +794,9 @@ class RandomForestClassifier(ForestClassifier):
`ceil(min_samples_split * n_samples)` are the minimum
number of samples for each split.

.. versionchanged:: 0.18
Added float values for percentages.

min_samples_leaf : int, float, optional (default=1)
The minimum number of samples required to be at a leaf node:

Expand All @@ -800,6 +805,9 @@ class RandomForestClassifier(ForestClassifier):
`ceil(min_samples_leaf * n_samples)` are the minimum
number of samples for each node.

.. versionchanged:: 0.18
Added float values for percentages.

min_weight_fraction_leaf : float, optional (default=0.)
The minimum weighted fraction of the input samples required to be at a
leaf node.
Expand Down Expand Up @@ -985,6 +993,9 @@ class RandomForestRegressor(ForestRegressor):
`ceil(min_samples_split * n_samples)` are the minimum
number of samples for each split.

.. versionchanged:: 0.18
Added float values for percentages.

min_samples_leaf : int, float, optional (default=1)
The minimum number of samples required to be at a leaf node:

Expand All @@ -993,6 +1004,9 @@ class RandomForestRegressor(ForestRegressor):
`ceil(min_samples_leaf * n_samples)` are the minimum
number of samples for each node.

.. versionchanged:: 0.18
Added float values for percentages.

min_weight_fraction_leaf : float, optional (default=0.)
The minimum weighted fraction of the input samples required to be at a
leaf node.
Expand Down Expand Up @@ -1144,6 +1158,9 @@ class ExtraTreesClassifier(ForestClassifier):
`ceil(min_samples_split * n_samples)` are the minimum
number of samples for each split.

.. versionchanged:: 0.18
Added float values for percentages.

min_samples_leaf : int, float, optional (default=1)
The minimum number of samples required to be at a leaf node:

Expand All @@ -1152,6 +1169,9 @@ class ExtraTreesClassifier(ForestClassifier):
`ceil(min_samples_leaf * n_samples)` are the minimum
number of samples for each node.

.. versionchanged:: 0.18
Added float values for percentages.

min_weight_fraction_leaf : float, optional (default=0.)
The minimum weighted fraction of the input samples required to be at a
leaf node.
Expand Down Expand Up @@ -1337,6 +1357,9 @@ class ExtraTreesRegressor(ForestRegressor):
`ceil(min_samples_split * n_samples)` are the minimum
number of samples for each split.

.. versionchanged:: 0.18
Added float values for percentages.

min_samples_leaf : int, float, optional (default=1)
The minimum number of samples required to be at a leaf node:

Expand All @@ -1345,6 +1368,9 @@ class ExtraTreesRegressor(ForestRegressor):
`ceil(min_samples_leaf * n_samples)` are the minimum
number of samples for each node.

.. versionchanged:: 0.18
Added float values for percentages.

min_weight_fraction_leaf : float, optional (default=0.)
The minimum weighted fraction of the input samples required to be at a
leaf node.
Expand Down Expand Up @@ -1482,6 +1508,9 @@ class RandomTreesEmbedding(BaseForest):
`ceil(min_samples_split * n_samples)` is the minimum
number of samples for each split.

.. versionchanged:: 0.18
Added float values for percentages.

min_samples_leaf : int, float, optional (default=1)
The minimum number of samples required to be at a leaf node:

Expand All @@ -1490,6 +1519,9 @@ class RandomTreesEmbedding(BaseForest):
`ceil(min_samples_leaf * n_samples)` is the minimum
number of samples for each node.

.. versionchanged:: 0.18
Added float values for percentages.

min_weight_fraction_leaf : float, optional (default=0.)
The minimum weighted fraction of the input samples required to be at a
leaf node.
Expand Down
11 changes: 11 additions & 0 deletions sklearn/ensemble/gradient_boosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,9 @@ class GradientBoostingClassifier(BaseGradientBoosting, ClassifierMixin):
`ceil(min_samples_split * n_samples)` are the minimum
number of samples for each split.

.. versionchanged:: 0.18
Added float values for percentages.

min_samples_leaf : int, float, optional (default=1)
The minimum number of samples required to be at a leaf node:

Expand All @@ -1312,6 +1315,8 @@ class GradientBoostingClassifier(BaseGradientBoosting, ClassifierMixin):
`ceil(min_samples_leaf * n_samples)` are the minimum
number of samples for each node.

.. versionchanged:: 0.18
Added float values for percentages.

min_weight_fraction_leaf : float, optional (default=0.)
The minimum weighted fraction of the input samples required to be at a
Expand Down Expand Up @@ -1651,6 +1656,9 @@ class GradientBoostingRegressor(BaseGradientBoosting, RegressorMixin):
`ceil(min_samples_split * n_samples)` are the minimum
number of samples for each split.

.. versionchanged:: 0.18
Added float values for percentages.

min_samples_leaf : int, float, optional (default=1)
The minimum number of samples required to be at a leaf node:

Expand All @@ -1659,6 +1667,9 @@ class GradientBoostingRegressor(BaseGradientBoosting, RegressorMixin):
`ceil(min_samples_leaf * n_samples)` are the minimum
number of samples for each node.

.. versionchanged:: 0.18
Added float values for percentages.

min_weight_fraction_leaf : float, optional (default=0.)
The minimum weighted fraction of the input samples required to be at a
leaf node.
Expand Down
2 changes: 2 additions & 0 deletions sklearn/ensemble/iforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ class IsolationForest(BaseBagging):
.. [2] Liu, Fei Tony, Ting, Kai Ming and Zhou, Zhi-Hua. "Isolation-based
anomaly detection." ACM Transactions on Knowledge Discovery from
Data (TKDD) 6.1 (2012): 3.

.. versionadded:: 0.18
"""

def __init__(self,
Expand Down
35 changes: 32 additions & 3 deletions sklearn/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,26 @@ class NotFittedError(ValueError, AttributeError):
... print(repr(e))
... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
NotFittedError('This LinearSVC instance is not fitted yet',)

.. versionchanged:: 0.18
Moved from sklearn.utils.validation.
"""


class ChangedBehaviorWarning(UserWarning):
"""Warning class used to notify the user of any change in the behavior."""
"""Warning class used to notify the user of any change in the behavior.

.. versionchanged:: 0.18
Moved from sklearn.base.
"""


class ConvergenceWarning(UserWarning):
"""Custom warning to capture convergence problems"""
"""Custom warning to capture convergence problems

.. versionchanged:: 0.18
Moved from sklearn.utils.
"""


class DataConversionWarning(UserWarning):
Expand All @@ -53,6 +64,9 @@ class DataConversionWarning(UserWarning):
- requests a non-copying operation, but a copy is required to meet the
implementation's data-type expectations;
- passes an input whose shape can be interpreted ambiguously.

.. versionchanged:: 0.18
Moved from sklearn.utils.validation.
"""


Expand All @@ -64,6 +78,9 @@ class DataDimensionalityWarning(UserWarning):
projection space, is higher than the number of features, which quantifies
the dimensionality of the original source space, to imply that the
dimensionality of the problem will not be reduced.

.. versionchanged:: 0.18
Moved from sklearn.utils.
"""


Expand All @@ -73,6 +90,8 @@ class EfficiencyWarning(UserWarning):
This warning notifies the user that the efficiency may not be optimal due
to some reason which may be included as a part of the warning message.
This may be subclassed into a more specific Warning class.

.. versionadded:: 0.18
"""


Expand Down Expand Up @@ -102,6 +121,9 @@ class FitFailedWarning(RuntimeWarning):
FitFailedWarning("Classifier fit failed. The score on this train-test
partition for these parameters will be set to 0.000000. Details:
\\nValueError('Penalty term must be positive; got (C=-2)',)",)

.. versionchanged:: 0.18
Moved from sklearn.cross_validation.
"""


Expand All @@ -110,8 +132,15 @@ class NonBLASDotWarning(EfficiencyWarning):

This warning is used to notify the user that BLAS was not used for dot
operation and hence the efficiency may be affected.

.. versionchanged:: 0.18
Moved from sklearn.utils.validation, extends EfficiencyWarning.
"""


class UndefinedMetricWarning(UserWarning):
"""Warning used when the metric is invalid"""
"""Warning used when the metric is invalid

.. versionchanged:: 0.18
Moved from sklearn.base.
"""
4 changes: 4 additions & 0 deletions sklearn/gaussian_process/gpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ def optimizer(obj_func, initial_theta, bounds):

log_marginal_likelihood_value_: float
The log-marginal-likelihood of ``self.kernel_.theta``

.. versionadded:: 0.18
"""
def __init__(self, kernel=None, optimizer="fmin_l_bfgs_b",
n_restarts_optimizer=0, max_iter_predict=100,
Expand Down Expand Up @@ -546,6 +548,8 @@ def optimizer(obj_func, initial_theta, bounds):

n_classes_ : int
The number of classes in the training data

.. versionadded:: 0.18
"""
def __init__(self, kernel=None, optimizer="fmin_l_bfgs_b",
n_restarts_optimizer=0, max_iter_predict=100,
Expand Down
2 changes: 2 additions & 0 deletions sklearn/gaussian_process/gpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def optimizer(obj_func, initial_theta, bounds):

log_marginal_likelihood_value_: float
The log-marginal-likelihood of ``self.kernel_.theta``

.. versionadded:: 0.18
"""
def __init__(self, kernel=None, alpha=1e-10,
optimizer="fmin_l_bfgs_b", n_restarts_optimizer=0,
Expand Down
Loading