1
- from lenskit .algorithms import funksvd
2
- from ConfigSpace import Integer , Float , ConfigurationSpace
1
+ from lenskit .funksvd import FunkSVDScorer
2
+ from ConfigSpace import ConfigurationSpace , UniformIntegerHyperparameter , UniformFloatHyperparameter
3
3
4
4
5
- class FunkSVD (funksvd . FunkSVD ):
5
+ class FunkSVD (FunkSVDScorer ):
6
6
def __init__ (self , features , ** kwargs ):
7
7
super ().__init__ (features = features , ** kwargs )
8
8
@@ -11,7 +11,7 @@ def get_default_configspace(**kwargs):
11
11
"""
12
12
return default configurationspace
13
13
"""
14
- features = Integer ('features' , bounds = ( 2 , 10000 ), default = 1000 , log = True )
14
+ features = UniformIntegerHyperparameter ('features' , lower = 2 , upper = 10000 , default_value = 1000 , log = True )
15
15
16
16
"""
17
17
The authors of the original FunkSVD paper (https://sifter.org/~simon/journal/20061211.html) stated:
@@ -20,23 +20,22 @@ def get_default_configspace(**kwargs):
20
20
current prediction.
21
21
But the original dataset just evaluated the performance on the netflix price dataset. Other datasets
22
22
perform well on ranges around 0.001.
23
- Therefore, the default value is set to 0.0001 and the lower and upper bound are a close range around
24
- the default value.
25
- """
26
- lrate = Float ('lrate' , bounds = (0.0001 , 0.01 ), default = 0.001 )
23
+ Therefore, the pip install -e .loatHyperparameter('lrate', lower=0.0001, upper=0.01, default_value=0.001)
27
24
25
+ """
26
+ lrate = UniformFloatHyperparameter ('lrate' , lower = 0.0001 , upper = 0.01 , default_value = 0.001 )
28
27
"""
29
28
The authors of the original FunkSVD paper (https://sifter.org/~simon/journal/20061211.html) stated:
30
29
The point here is to try to cut down on over fitting, ultimately allowing us to use
31
30
more features. Last I recall, Vincent liked K=0.02 or so, with well over 100 features (singular vector
32
31
pairs--if you can still call them that).
33
32
The default value of 0.02 is considered for the range. The range is set to a close range around the 0.02 value.
34
33
The default value is taken from the LensKit Library.
35
- """
36
- reg = Float ('reg' , bounds = ( 0.001 , 0.1 ), default = 0.015 )
37
- damping = Float ('damping' , bounds = ( 0.01 , 1000 ), default = 5 , log = True )
34
+ """ ""
35
+ reg = UniformFloatHyperparameter ('reg' , lower = 0.001 , upper = 0.1 , default_value = 0.015 )
36
+ damping = UniformFloatHyperparameter ('damping' , lower = 0.01 , upper = 1000 , default_value = 5 , log = True )
38
37
39
38
cs = ConfigurationSpace ()
40
- cs .add_hyperparameters ([features , lrate , reg , damping ])
39
+ cs .add ([features , lrate , reg , damping ])
41
40
42
41
return cs
0 commit comments