Skip to content

Commit

Permalink
readd numFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
brkyvz committed May 8, 2015
1 parent 0bd66b1 commit eaed879
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/pyspark/ml/param/_shared_params_code_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def get$Name(self):
("inputCol", "input column name", None),
("inputCols", "input column names", None),
("outputCol", "output column name", None),
("numFeatures", "number of features", None),
("checkpointInterval", "checkpoint interval (>= 1)", None),
("seed", "random seed", None),
("tol", "the convergence tolerance for iterative algorithms", None),
Expand Down
29 changes: 29 additions & 0 deletions python/pyspark/ml/param/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,35 @@ def getOutputCol(self):
return self.getOrDefault(self.outputCol)


class HasNumFeatures(Params):
"""
Mixin for param numFeatures: number of features.
"""

# a placeholder to make it appear in the generated doc
numFeatures = Param(Params._dummy(), "numFeatures", "number of features")

def __init__(self):
super(HasNumFeatures, self).__init__()
#: param for number of features
self.numFeatures = Param(self, "numFeatures", "number of features")
if None is not None:
self._setDefault(numFeatures=None)

def setNumFeatures(self, value):
"""
Sets the value of :py:attr:`numFeatures`.
"""
self.paramMap[self.numFeatures] = value
return self

def getNumFeatures(self):
"""
Gets the value of numFeatures or its default value.
"""
return self.getOrDefault(self.numFeatures)


class HasCheckpointInterval(Params):
"""
Mixin for param checkpointInterval: checkpoint interval (>= 1).
Expand Down

0 comments on commit eaed879

Please sign in to comment.