Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REVIEW][PROPOSAL] Add tags and prefered memory order tags to estimators #3113

Merged
merged 27 commits into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
39e94a4
FEA Add preferred_order class parameter to linear models
dantegd Nov 4, 2020
bc99ec6
Merge branch 'branch-0.17' of https://github.com/rapidsai/cuml into 0…
dantegd Nov 4, 2020
7e84f8c
ENH adopt tags from scikit-learn API to support preferred order attri…
dantegd Nov 8, 2020
564ae51
DOC remove attribute docstrings
dantegd Nov 8, 2020
86830dc
FIX Change straggling classes
dantegd Nov 8, 2020
d6d8a51
FIX Change straggling classes
dantegd Nov 8, 2020
c85acea
FIX Add missing self
dantegd Nov 8, 2020
2f42eaa
FIX straggling attribute
dantegd Nov 9, 2020
bb8e2f7
ENH Add device data tag for proposal
dantegd Nov 11, 2020
9c5b63f
FEA Add all scikit-learn API tags to base and improve gpu input types…
dantegd Nov 11, 2020
340a5e2
FEA Add preferred_order tag to cluster models
dantegd Nov 11, 2020
c66ad00
FEA Add preferred_order tag to most models
dantegd Nov 11, 2020
0a892d1
Merge branch-0.17
dantegd Nov 14, 2020
fe6efb7
ENH Improvements and PR review feedback
dantegd Nov 14, 2020
4e5bb3f
DOC add tag documentation to estimator guide
dantegd Nov 14, 2020
e0cc4f9
DOC add scikit link
dantegd Nov 14, 2020
fe117db
Update wiki/python/ESTIMATOR_GUIDE.md
dantegd Nov 18, 2020
520a4c4
Update wiki/python/ESTIMATOR_GUIDE.md
dantegd Nov 18, 2020
c3a9b41
Update wiki/python/ESTIMATOR_GUIDE.md
dantegd Nov 18, 2020
637dde3
Update wiki/python/ESTIMATOR_GUIDE.md
dantegd Nov 18, 2020
a9ba498
Update wiki/python/ESTIMATOR_GUIDE.md
dantegd Nov 18, 2020
44e698a
ENH Rename test_fit to test_api and add tags tests
dantegd Nov 19, 2020
5689ef8
FIX fixes from PR review
dantegd Nov 19, 2020
d713c89
DOC Added entry to changelog
dantegd Nov 19, 2020
1b02eac
Merge branch 'branch-0.17' into 017-fea-pref-order
cjnolet Nov 19, 2020
5fb7ef1
FIX PEP8 fixes
dantegd Nov 19, 2020
17d0ff6
Merge branch '017-fea-pref-order' of github.com:dantegd/cuml into 017…
dantegd Nov 19, 2020
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
5 changes: 5 additions & 0 deletions python/cuml/linear_model/elastic_net.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,17 @@ class ElasticNet(Base, RegressorMixin):
The estimated coefficients for the linear regression model.
intercept_ : array
The independent term. If `fit_intercept` is False, will be 0.
preferred_order : 'F'
Whether the algorithm internally operates in column ('F') or row ('C')
major data. Pass data to the algorithm with this order for the best
memory and time processing efficiency.

Notes
-----
For additional docs, see `scikitlearn's ElasticNet
<https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.ElasticNet.html>`_.
"""
preferred_order = 'F'

def __init__(self, alpha=1.0, l1_ratio=0.5, fit_intercept=True,
normalize=False, max_iter=1000, tol=1e-3, selection='cyclic',
Expand Down
5 changes: 5 additions & 0 deletions python/cuml/linear_model/lasso.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,17 @@ class Lasso(Base, RegressorMixin):
The estimated coefficients for the linear regression model.
intercept_ : array
The independent term. If `fit_intercept` is False, will be 0.
preferred_order : 'F'
Whether the algorithm internally operates in column ('F') or row ('C')
major data. Pass data to the algorithm with this order for the best
memory and time processing efficiency.

Notes
-----
For additional docs, see `scikitlearn's Lasso
<https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lasso.html>`_.
"""
preferred_order = 'F'

def __init__(self, alpha=1.0, fit_intercept=True, normalize=False,
max_iter=1000, tol=1e-3, selection='cyclic', handle=None,
Expand Down
5 changes: 5 additions & 0 deletions python/cuml/linear_model/linear_regression.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ class LinearRegression(Base, RegressorMixin):
The estimated coefficients for the linear regression model.
intercept_ : array
The independent term. If `fit_intercept` is False, will be 0.
preferred_order : 'F'
Whether the algorithm internally operates in column ('F') or row ('C')
major data. Pass data to the algorithm with this order for the best
memory and time processing efficiency.

Notes
------
Expand All @@ -196,6 +200,7 @@ class LinearRegression(Base, RegressorMixin):


"""
preferred_order = 'F'

def __init__(self, algorithm='eig', fit_intercept=True, normalize=False,
handle=None, verbose=False, output_type=None):
Expand Down
5 changes: 5 additions & 0 deletions python/cuml/linear_model/logistic_regression.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ class LogisticRegression(Base, ClassifierMixin):
is True
intercept_: device array (n_classes, 1)
The independent term. If `fit_intercept` is False, will be 0.
preferred_order : 'F'
Whether the algorithm internally operates in column ('F') or row ('C')
major data. Pass data to the algorithm with this order for the best
memory and time processing efficiency.

Notes
------
Expand All @@ -169,6 +173,7 @@ class LogisticRegression(Base, ClassifierMixin):
For additional information, see Scikit-learn's LogistRegression
<https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html>`_.
"""
preferred_order = 'F'

def __init__(
self,
Expand Down
2 changes: 2 additions & 0 deletions python/cuml/linear_model/mbsgd_classifier.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ class MBSGDClassifier(Base, ClassifierMixin):
<https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html>`_.
"""

preferred_order = 'F'

def __init__(self, loss='hinge', penalty='l2', alpha=0.0001,
l1_ratio=0.15, fit_intercept=True, epochs=1000, tol=1e-3,
shuffle=True, learning_rate='constant', eta0=0.001,
Expand Down
2 changes: 2 additions & 0 deletions python/cuml/linear_model/mbsgd_regressor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ class MBSGDRegressor(Base, RegressorMixin):
<https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDRegressor.html>`_.
"""

preferred_order = 'F'

def __init__(self, loss='squared_loss', penalty='l2', alpha=0.0001,
l1_ratio=0.15, fit_intercept=True, epochs=1000, tol=1e-3,
shuffle=True, learning_rate='constant', eta0=0.001,
Expand Down
6 changes: 6 additions & 0 deletions python/cuml/linear_model/ridge.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ class Ridge(Base, RegressorMixin):
The estimated coefficients for the linear regression model.
intercept_ : array
The independent term. If `fit_intercept` is False, will be 0.
preferred_order : 'F'
Whether the algorithm internally operates in column ('F') or row ('C')
major data. Pass data to the algorithm with this order for the best
memory and time processing efficiency.

Notes
------
Expand All @@ -207,6 +211,8 @@ class Ridge(Base, RegressorMixin):
<https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Ridge.html>`_.
"""

preferred_order = 'F'

def __init__(self, alpha=1.0, solver='eig', fit_intercept=True,
normalize=False, handle=None, output_type=None,
verbose=False):
Expand Down
1 change: 1 addition & 0 deletions python/cuml/solvers/cd.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ class CD(Base):
See :ref:`output-data-type-configuration` for more info.

"""
preferred_order = 'F'

def __init__(self, loss='squared_loss', alpha=0.0001, l1_ratio=0.15,
fit_intercept=True, normalize=False, max_iter=1000, tol=1e-3,
Expand Down
5 changes: 5 additions & 0 deletions python/cuml/solvers/qn.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ class QN(Base):
Note: shape is (n_classes, n_features + 1) if fit_intercept = True.
intercept_ : array (n_classes, 1)
The independent term. If `fit_intercept` is False, will be 0.
preferred_order : 'F'
dantegd marked this conversation as resolved.
Show resolved Hide resolved
Whether the algorithm internally operates in column ('F') or row ('C')
major data. Pass data to the algorithm with this order for the best
memory and time processing efficiency.

Notes
------
Expand All @@ -244,6 +248,7 @@ class QN(Base):
2007]
<https://www.microsoft.com/en-us/research/publication/scalable-training-of-l1-regularized-log-linear-models/>
"""
preferred_order = 'F'

def __init__(self, loss='sigmoid', fit_intercept=True,
l1_strength=0.0, l2_strength=0.0, max_iter=1000, tol=1e-3,
Expand Down
2 changes: 2 additions & 0 deletions python/cuml/solvers/sgd.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ class SGD(Base):

"""

preferred_order = 'F'

def __init__(self, loss='squared_loss', penalty='none', alpha=0.0001,
l1_ratio=0.15, fit_intercept=True, epochs=1000, tol=1e-3,
shuffle=True, learning_rate='constant', eta0=0.001,
Expand Down