|  | 
| 21 | 21 | 
 | 
| 22 | 22 | 
 | 
| 23 | 23 | class HasMaxIter(Params): | 
|  | 24 | +    """ | 
|  | 25 | +    Params with maxIter. | 
|  | 26 | +    """ | 
|  | 27 | + | 
|  | 28 | +    # a placeholder to make it appear in the generated doc | 
|  | 29 | +    maxIter = Param(Params._dummy(), "maxIter", "max number of iterations", 100) | 
| 24 | 30 | 
 | 
| 25 | 31 |     def __init__(self): | 
| 26 | 32 |         super(HasMaxIter, self).__init__() | 
| 27 |  | -        #: max number of iterations | 
|  | 33 | +        #: param for max number of iterations | 
| 28 | 34 |         self.maxIter = Param(self, "maxIter", "max number of iterations", 100) | 
| 29 | 35 | 
 | 
| 30 | 36 |     def setMaxIter(self, value): | 
|  | 37 | +        """ | 
|  | 38 | +        Sets the value of :py:attr:`maxIter`. | 
|  | 39 | +        """ | 
| 31 | 40 |         self.paramMap[self.maxIter] = value | 
| 32 | 41 |         return self | 
| 33 | 42 | 
 | 
| 34 | 43 |     def getMaxIter(self): | 
|  | 44 | +        """ | 
|  | 45 | +        Gets the value of maxIter or its default value. | 
|  | 46 | +        """ | 
| 35 | 47 |         if self.maxIter in self.paramMap: | 
| 36 | 48 |             return self.paramMap[self.maxIter] | 
| 37 | 49 |         else: | 
| 38 | 50 |             return self.maxIter.defaultValue | 
| 39 | 51 | 
 | 
| 40 | 52 | 
 | 
| 41 | 53 | class HasRegParam(Params): | 
|  | 54 | +    """ | 
|  | 55 | +    Params with regParam. | 
|  | 56 | +    """ | 
|  | 57 | + | 
|  | 58 | +    # a placeholder to make it appear in the generated doc | 
|  | 59 | +    regParam = Param(Params._dummy(), "regParam", "regularization constant", 0.1) | 
| 42 | 60 | 
 | 
| 43 | 61 |     def __init__(self): | 
| 44 | 62 |         super(HasRegParam, self).__init__() | 
| 45 |  | -        #: regularization constant | 
|  | 63 | +        #: param for regularization constant | 
| 46 | 64 |         self.regParam = Param(self, "regParam", "regularization constant", 0.1) | 
| 47 | 65 | 
 | 
| 48 | 66 |     def setRegParam(self, value): | 
|  | 67 | +        """ | 
|  | 68 | +        Sets the value of :py:attr:`regParam`. | 
|  | 69 | +        """ | 
| 49 | 70 |         self.paramMap[self.regParam] = value | 
| 50 | 71 |         return self | 
| 51 | 72 | 
 | 
| 52 | 73 |     def getRegParam(self): | 
|  | 74 | +        """ | 
|  | 75 | +        Gets the value of regParam or its default value. | 
|  | 76 | +        """ | 
| 53 | 77 |         if self.regParam in self.paramMap: | 
| 54 | 78 |             return self.paramMap[self.regParam] | 
| 55 | 79 |         else: | 
| 56 | 80 |             return self.regParam.defaultValue | 
| 57 | 81 | 
 | 
| 58 | 82 | 
 | 
| 59 | 83 | class HasFeaturesCol(Params): | 
|  | 84 | +    """ | 
|  | 85 | +    Params with featuresCol. | 
|  | 86 | +    """ | 
|  | 87 | + | 
|  | 88 | +    # a placeholder to make it appear in the generated doc | 
|  | 89 | +    featuresCol = Param(Params._dummy(), "featuresCol", "features column name", 'features') | 
| 60 | 90 | 
 | 
| 61 | 91 |     def __init__(self): | 
| 62 | 92 |         super(HasFeaturesCol, self).__init__() | 
| 63 |  | -        #: features column name | 
|  | 93 | +        #: param for features column name | 
| 64 | 94 |         self.featuresCol = Param(self, "featuresCol", "features column name", 'features') | 
| 65 | 95 | 
 | 
| 66 | 96 |     def setFeaturesCol(self, value): | 
|  | 97 | +        """ | 
|  | 98 | +        Sets the value of :py:attr:`featuresCol`. | 
|  | 99 | +        """ | 
| 67 | 100 |         self.paramMap[self.featuresCol] = value | 
| 68 | 101 |         return self | 
| 69 | 102 | 
 | 
| 70 | 103 |     def getFeaturesCol(self): | 
|  | 104 | +        """ | 
|  | 105 | +        Gets the value of featuresCol or its default value. | 
|  | 106 | +        """ | 
| 71 | 107 |         if self.featuresCol in self.paramMap: | 
| 72 | 108 |             return self.paramMap[self.featuresCol] | 
| 73 | 109 |         else: | 
| 74 | 110 |             return self.featuresCol.defaultValue | 
| 75 | 111 | 
 | 
| 76 | 112 | 
 | 
| 77 | 113 | class HasLabelCol(Params): | 
|  | 114 | +    """ | 
|  | 115 | +    Params with labelCol. | 
|  | 116 | +    """ | 
|  | 117 | + | 
|  | 118 | +    # a placeholder to make it appear in the generated doc | 
|  | 119 | +    labelCol = Param(Params._dummy(), "labelCol", "label column name", 'label') | 
| 78 | 120 | 
 | 
| 79 | 121 |     def __init__(self): | 
| 80 | 122 |         super(HasLabelCol, self).__init__() | 
| 81 |  | -        #: label column name | 
|  | 123 | +        #: param for label column name | 
| 82 | 124 |         self.labelCol = Param(self, "labelCol", "label column name", 'label') | 
| 83 | 125 | 
 | 
| 84 | 126 |     def setLabelCol(self, value): | 
|  | 127 | +        """ | 
|  | 128 | +        Sets the value of :py:attr:`labelCol`. | 
|  | 129 | +        """ | 
| 85 | 130 |         self.paramMap[self.labelCol] = value | 
| 86 | 131 |         return self | 
| 87 | 132 | 
 | 
| 88 | 133 |     def getLabelCol(self): | 
|  | 134 | +        """ | 
|  | 135 | +        Gets the value of labelCol or its default value. | 
|  | 136 | +        """ | 
| 89 | 137 |         if self.labelCol in self.paramMap: | 
| 90 | 138 |             return self.paramMap[self.labelCol] | 
| 91 | 139 |         else: | 
| 92 | 140 |             return self.labelCol.defaultValue | 
| 93 | 141 | 
 | 
| 94 | 142 | 
 | 
| 95 | 143 | class HasPredictionCol(Params): | 
|  | 144 | +    """ | 
|  | 145 | +    Params with predictionCol. | 
|  | 146 | +    """ | 
|  | 147 | + | 
|  | 148 | +    # a placeholder to make it appear in the generated doc | 
|  | 149 | +    predictionCol = Param(Params._dummy(), "predictionCol", "prediction column name", 'prediction') | 
| 96 | 150 | 
 | 
| 97 | 151 |     def __init__(self): | 
| 98 | 152 |         super(HasPredictionCol, self).__init__() | 
| 99 |  | -        #: prediction column name | 
|  | 153 | +        #: param for prediction column name | 
| 100 | 154 |         self.predictionCol = Param(self, "predictionCol", "prediction column name", 'prediction') | 
| 101 | 155 | 
 | 
| 102 | 156 |     def setPredictionCol(self, value): | 
|  | 157 | +        """ | 
|  | 158 | +        Sets the value of :py:attr:`predictionCol`. | 
|  | 159 | +        """ | 
| 103 | 160 |         self.paramMap[self.predictionCol] = value | 
| 104 | 161 |         return self | 
| 105 | 162 | 
 | 
| 106 | 163 |     def getPredictionCol(self): | 
|  | 164 | +        """ | 
|  | 165 | +        Gets the value of predictionCol or its default value. | 
|  | 166 | +        """ | 
| 107 | 167 |         if self.predictionCol in self.paramMap: | 
| 108 | 168 |             return self.paramMap[self.predictionCol] | 
| 109 | 169 |         else: | 
| 110 | 170 |             return self.predictionCol.defaultValue | 
| 111 | 171 | 
 | 
| 112 | 172 | 
 | 
| 113 | 173 | class HasInputCol(Params): | 
|  | 174 | +    """ | 
|  | 175 | +    Params with inputCol. | 
|  | 176 | +    """ | 
|  | 177 | + | 
|  | 178 | +    # a placeholder to make it appear in the generated doc | 
|  | 179 | +    inputCol = Param(Params._dummy(), "inputCol", "input column name", 'input') | 
| 114 | 180 | 
 | 
| 115 | 181 |     def __init__(self): | 
| 116 | 182 |         super(HasInputCol, self).__init__() | 
| 117 |  | -        #: input column name | 
|  | 183 | +        #: param for input column name | 
| 118 | 184 |         self.inputCol = Param(self, "inputCol", "input column name", 'input') | 
| 119 | 185 | 
 | 
| 120 | 186 |     def setInputCol(self, value): | 
|  | 187 | +        """ | 
|  | 188 | +        Sets the value of :py:attr:`inputCol`. | 
|  | 189 | +        """ | 
| 121 | 190 |         self.paramMap[self.inputCol] = value | 
| 122 | 191 |         return self | 
| 123 | 192 | 
 | 
| 124 | 193 |     def getInputCol(self): | 
|  | 194 | +        """ | 
|  | 195 | +        Gets the value of inputCol or its default value. | 
|  | 196 | +        """ | 
| 125 | 197 |         if self.inputCol in self.paramMap: | 
| 126 | 198 |             return self.paramMap[self.inputCol] | 
| 127 | 199 |         else: | 
| 128 | 200 |             return self.inputCol.defaultValue | 
| 129 | 201 | 
 | 
| 130 | 202 | 
 | 
| 131 | 203 | class HasOutputCol(Params): | 
|  | 204 | +    """ | 
|  | 205 | +    Params with outputCol. | 
|  | 206 | +    """ | 
|  | 207 | + | 
|  | 208 | +    # a placeholder to make it appear in the generated doc | 
|  | 209 | +    outputCol = Param(Params._dummy(), "outputCol", "output column name", 'output') | 
| 132 | 210 | 
 | 
| 133 | 211 |     def __init__(self): | 
| 134 | 212 |         super(HasOutputCol, self).__init__() | 
| 135 |  | -        #: output column name | 
|  | 213 | +        #: param for output column name | 
| 136 | 214 |         self.outputCol = Param(self, "outputCol", "output column name", 'output') | 
| 137 | 215 | 
 | 
| 138 | 216 |     def setOutputCol(self, value): | 
|  | 217 | +        """ | 
|  | 218 | +        Sets the value of :py:attr:`outputCol`. | 
|  | 219 | +        """ | 
| 139 | 220 |         self.paramMap[self.outputCol] = value | 
| 140 | 221 |         return self | 
| 141 | 222 | 
 | 
| 142 | 223 |     def getOutputCol(self): | 
|  | 224 | +        """ | 
|  | 225 | +        Gets the value of outputCol or its default value. | 
|  | 226 | +        """ | 
| 143 | 227 |         if self.outputCol in self.paramMap: | 
| 144 | 228 |             return self.paramMap[self.outputCol] | 
| 145 | 229 |         else: | 
|  | 
0 commit comments