@@ -80,11 +80,11 @@ class ALS(JavaEstimator, HasCheckpointInterval, HasMaxIter, HasPredictionCol, Ha
80
80
81
81
@keyword_only
82
82
def __init__ (self , rank = 10 , maxIter = 10 , regParam = 0.1 , numUserBlocks = 10 , numItemBlocks = 10 ,
83
- implicitPrefs = False , alpha = 1.0 , userCol = "user" , itemCol = "item" , seed = 42L ,
83
+ implicitPrefs = False , alpha = 1.0 , userCol = "user" , itemCol = "item" , seed = 0 ,
84
84
ratingCol = "rating" , nonnegative = False , checkpointInterval = 10 ):
85
85
"""
86
86
__init__(self, rank=10, maxIter=10, regParam=0.1, numUserBlocks=10, numItemBlocks=10,
87
- implicitPrefs=false, alpha=1.0, userCol="user", itemCol="item", seed=42L ,
87
+ implicitPrefs=false, alpha=1.0, userCol="user", itemCol="item", seed=0 ,
88
88
ratingCol="rating", nonnegative=false, checkpointInterval=10)
89
89
"""
90
90
super (ALS , self ).__init__ ()
@@ -99,18 +99,18 @@ def __init__(self, rank=10, maxIter=10, regParam=0.1, numUserBlocks=10, numItemB
99
99
self .nonnegative = Param (self , "nonnegative" ,
100
100
"whether to use nonnegative constraint for least squares" )
101
101
self ._setDefault (rank = 10 , maxIter = 10 , regParam = 0.1 , numUserBlocks = 10 , numItemBlocks = 10 ,
102
- implicitPrefs = False , alpha = 1.0 , userCol = "user" , itemCol = "item" , seed = 42 ,
102
+ implicitPrefs = False , alpha = 1.0 , userCol = "user" , itemCol = "item" , seed = 0 ,
103
103
ratingCol = "rating" , nonnegative = False , checkpointInterval = 10 )
104
104
kwargs = self .__init__ ._input_kwargs
105
105
self .setParams (** kwargs )
106
106
107
107
@keyword_only
108
108
def setParams (self , rank = 10 , maxIter = 10 , regParam = 0.1 , numUserBlocks = 10 , numItemBlocks = 10 ,
109
- implicitPrefs = False , alpha = 1.0 , userCol = "user" , itemCol = "item" , seed = 42 ,
109
+ implicitPrefs = False , alpha = 1.0 , userCol = "user" , itemCol = "item" , seed = 0 ,
110
110
ratingCol = "rating" , nonnegative = False , checkpointInterval = 10 ):
111
111
"""
112
112
setParams(self, rank=10, maxIter=10, regParam=0.1, numUserBlocks=10, numItemBlocks=10,
113
- implicitPrefs=False, alpha=1.0, userCol="user", itemCol="item", seed=42 ,
113
+ implicitPrefs=False, alpha=1.0, userCol="user", itemCol="item", seed=0 ,
114
114
ratingCol="rating", nonnegative=False, checkpointInterval=10)
115
115
Sets params for ALS.
116
116
"""
@@ -166,7 +166,6 @@ def setNumBlocks(self, value):
166
166
self .paramMap [self .numUserBlocks ] = value
167
167
self .paramMap [self .numItemBlocks ] = value
168
168
169
-
170
169
def setImplicitPrefs (self , value ):
171
170
"""
172
171
Sets the value of :py:attr:`implicitPrefs`.
@@ -264,7 +263,7 @@ class ALSModel(JavaModel):
264
263
globs ['sc' ] = sc
265
264
globs ['sqlContext' ] = sqlContext
266
265
globs ['df' ] = sqlContext .createDataFrame ([(0 , 0 , 4.0 ), (0 , 1 , 2.0 ), (1 , 1 , 3.0 ), (1 , 2 , 4.0 ),
267
- (2 , 1 , 1.0 ), (2 , 2 , 5.0 )], ["user" , "item" , "rating" ])
266
+ (2 , 1 , 1.0 ), (2 , 2 , 5.0 )], ["user" , "item" , "rating" ])
268
267
(failure_count , test_count ) = doctest .testmod (globs = globs , optionflags = doctest .ELLIPSIS )
269
268
sc .stop ()
270
269
if failure_count :
0 commit comments