Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
oefirouz committed Apr 21, 2015
1 parent 8b8a6d2 commit 9a8ce22
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions python/pyspark/ml/tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

__all__ = ['ParamGridBuilder']


class ParamGridBuilder(object):
"""
Builder for a param grid used in grid search-based model selection.
Expand Down Expand Up @@ -66,18 +67,17 @@ def build(self):
lr = LogisticRegression()
grid_test.addGrid(lr.regParam, [1.0, 2.0, 3.0])
grid_test.addGrid(lr.maxIter, [1, 5])
grid_test.addGrid(lr.featuresCol, ['f'])
grid_test.addGrid(lr.inputCol, ['f'])
grid_test.baseOn({lr.labelCol: 'l'})
grid_test.baseOn([lr.predictionCol, 'p'])
grid_test.baseOn([lr.outputCol, 'p'])
grid = grid_test.build()
expected = [
{lr.regParam: 1.0, lr.featuresCol: 'f', lr.maxIter: 1, lr.labelCol: 'l', lr.predictionCol: 'p'},
{lr.regParam: 2.0, lr.featuresCol: 'f', lr.maxIter: 1, lr.labelCol: 'l', lr.predictionCol: 'p'},
{lr.regParam: 3.0, lr.featuresCol: 'f', lr.maxIter: 1, lr.labelCol: 'l', lr.predictionCol: 'p'},
{lr.regParam: 1.0, lr.featuresCol: 'f', lr.maxIter: 5, lr.labelCol: 'l', lr.predictionCol: 'p'},
{lr.regParam: 2.0, lr.featuresCol: 'f', lr.maxIter: 5, lr.labelCol: 'l', lr.predictionCol: 'p'},
{lr.regParam: 3.0, lr.featuresCol: 'f', lr.maxIter: 5, lr.labelCol: 'l', lr.predictionCol: 'p'}
]
{lr.regParam: 1.0, lr.inputCol: 'f', lr.maxIter: 1, lr.labelCol: 'l', lr.outputCol: 'p'},
{lr.regParam: 2.0, lr.inputCol: 'f', lr.maxIter: 1, lr.labelCol: 'l', lr.outputCol: 'p'},
{lr.regParam: 3.0, lr.inputCol: 'f', lr.maxIter: 1, lr.labelCol: 'l', lr.outputCol: 'p'},
{lr.regParam: 1.0, lr.inputCol: 'f', lr.maxIter: 5, lr.labelCol: 'l', lr.outputCol: 'p'},
{lr.regParam: 2.0, lr.inputCol: 'f', lr.maxIter: 5, lr.labelCol: 'l', lr.outputCol: 'p'},
{lr.regParam: 3.0, lr.inputCol: 'f', lr.maxIter: 5, lr.labelCol: 'l', lr.outputCol: 'p'}]

for a, b in zip(grid, expected):
if a != b:
Expand Down

0 comments on commit 9a8ce22

Please sign in to comment.