Skip to content

Commit c9f08f8

Browse files
committed
updated the funksvd algorithm
1 parent 5a956dd commit c9f08f8

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

lkauto/algorithms/funksvd.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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
33

44

5-
class FunkSVD(funksvd.FunkSVD):
5+
class FunkSVD(FunkSVDScorer):
66
def __init__(self, features, **kwargs):
77
super().__init__(features=features, **kwargs)
88

@@ -11,7 +11,7 @@ def get_default_configspace(**kwargs):
1111
"""
1212
return default configurationspace
1313
"""
14-
features = Integer('features', bounds=(2, 10000), default=1000, log=True)
14+
features = UniformIntegerHyperparameter('features', lower=2, upper=10000, default_value=1000, log=True)
1515

1616
"""
1717
The authors of the original FunkSVD paper (https://sifter.org/~simon/journal/20061211.html) stated:
@@ -20,23 +20,22 @@ def get_default_configspace(**kwargs):
2020
current prediction.
2121
But the original dataset just evaluated the performance on the netflix price dataset. Other datasets
2222
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)
2724
25+
"""
26+
lrate = UniformFloatHyperparameter('lrate', lower=0.0001, upper=0.01, default_value=0.001)
2827
"""
2928
The authors of the original FunkSVD paper (https://sifter.org/~simon/journal/20061211.html) stated:
3029
The point here is to try to cut down on over fitting, ultimately allowing us to use
3130
more features. Last I recall, Vincent liked K=0.02 or so, with well over 100 features (singular vector
3231
pairs--if you can still call them that).
3332
The default value of 0.02 is considered for the range. The range is set to a close range around the 0.02 value.
3433
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)
3837

3938
cs = ConfigurationSpace()
40-
cs.add_hyperparameters([features, lrate, reg, damping])
39+
cs.add([features, lrate, reg, damping])
4140

4241
return cs

0 commit comments

Comments
 (0)