src.fairreckitlib.model.algorithms.elliot.elliot_params
This module contains the parameter creation functions for elliot recommenders.
Functions:
create_params_funk_svd: create FunkSVD config parameters.
create_params_knn: create ItemKNN/UserKNN config parameters.
create_params_multi_vae: create MultiVAE config parameters.
create_params_pure_svd: create PureSVD config parameters.
create_params_svd_pp: create SVDpp config parameters.
This program has been developed by students from the bachelor Computer Science at Utrecht University within the Software Project course. © Copyright Utrecht University (Department of Information and Computing Sciences)
1"""This module contains the parameter creation functions for elliot recommenders. 2 3Functions: 4 5 create_params_funk_svd: create FunkSVD config parameters. 6 create_params_knn: create ItemKNN/UserKNN config parameters. 7 create_params_multi_vae: create MultiVAE config parameters. 8 create_params_pure_svd: create PureSVD config parameters. 9 create_params_svd_pp: create SVDpp config parameters. 10 11This program has been developed by students from the bachelor Computer Science at 12Utrecht University within the Software Project course. 13© Copyright Utrecht University (Department of Information and Computing Sciences) 14""" 15 16from ....core.config.config_parameters import ConfigParameters 17 18 19def create_params_funk_svd() -> ConfigParameters: 20 """Create the parameters of the FunkSVD algorithm. 21 22 Returns: 23 the configuration parameters of the algorithm. 24 """ 25 params = ConfigParameters() 26 params.add_number('iterations', int, 10, (1, 50)) 27 params.add_number('factors', int, 10, (1, 100)) 28 params.add_number('learning_rate', float, 0.001, (0.0001, 1.0)) 29 params.add_number('regularization_factors', float, 0.1, (0.0001, 1.0)) 30 params.add_number('regularization_bias', float, 0.001, (0.0001, 1.0)) 31 params.add_random_seed('seed') 32 return params 33 34 35def create_params_knn() -> ConfigParameters: 36 """Create the parameters of the ItemKNN/UserKNN algorithm. 37 38 Returns: 39 the configuration parameters of the algorithm. 40 """ 41 implementations = ['aiolli', 'classical'] 42 similarities = [ 43 'cosine', 44 'adjusted', 45 'asymmetric', 46 'pearson', 47 'jaccard', 48 'dice', 49 'tversky', 50 'tanimoto' 51 ] 52 53 params = ConfigParameters() 54 params.add_number('neighbors', int, 40, (1, 50)) 55 params.add_single_option('similarity', str, similarities[0], similarities) 56 params.add_single_option('implementation', str, implementations[0], implementations) 57 return params 58 59 60def create_params_multi_vae() -> ConfigParameters: 61 """Create the parameters of the MultiVAE algorithm. 62 63 Returns: 64 the configuration parameters of the algorithm. 65 """ 66 params = ConfigParameters() 67 params.add_number('iterations', int, 10, (1, 50)) 68 params.add_number('factors', int, 200, (100, 500)) 69 params.add_number('learning_rate', float, 0.001, (0.0001, 1.0)) 70 params.add_number('regularization_factors', float, 0.01, (0.0001, 1.0)) 71 params.add_number('intermediate_dimensions', int, 100, (1000, 600)) 72 params.add_number('dropout_probability', float, 1.0, (0.0, 1.0)) 73 params.add_random_seed('seed') 74 return params 75 76 77def create_params_pure_svd() -> ConfigParameters: 78 """Create the parameters of the PureSVD algorithm. 79 80 Returns: 81 the configuration parameters of the algorithm. 82 """ 83 params = ConfigParameters() 84 params.add_number('factors', int, 10, (1, 100)) 85 params.add_random_seed('seed') 86 return params 87 88 89def create_params_svd_pp() -> ConfigParameters: 90 """Create the parameters of the SVDpp algorithm. 91 92 Returns: 93 the configuration parameters of the algorithm. 94 """ 95 params = ConfigParameters() 96 params.add_number('iterations', int, 10, (1, 50)) 97 params.add_number('factors', int, 50, (1, 100)) 98 params.add_number('learning_rate', float, 0.001, (0.0001, 1.0)) 99 params.add_number('regularization_factors', float, 0.1, (0.0001, 1.0)) 100 params.add_number('regularization_bias', float, 0.001, (0.0001, 1.0)) 101 params.add_random_seed('seed') 102 return params
20def create_params_funk_svd() -> ConfigParameters: 21 """Create the parameters of the FunkSVD algorithm. 22 23 Returns: 24 the configuration parameters of the algorithm. 25 """ 26 params = ConfigParameters() 27 params.add_number('iterations', int, 10, (1, 50)) 28 params.add_number('factors', int, 10, (1, 100)) 29 params.add_number('learning_rate', float, 0.001, (0.0001, 1.0)) 30 params.add_number('regularization_factors', float, 0.1, (0.0001, 1.0)) 31 params.add_number('regularization_bias', float, 0.001, (0.0001, 1.0)) 32 params.add_random_seed('seed') 33 return params
Create the parameters of the FunkSVD algorithm.
Returns: the configuration parameters of the algorithm.
36def create_params_knn() -> ConfigParameters: 37 """Create the parameters of the ItemKNN/UserKNN algorithm. 38 39 Returns: 40 the configuration parameters of the algorithm. 41 """ 42 implementations = ['aiolli', 'classical'] 43 similarities = [ 44 'cosine', 45 'adjusted', 46 'asymmetric', 47 'pearson', 48 'jaccard', 49 'dice', 50 'tversky', 51 'tanimoto' 52 ] 53 54 params = ConfigParameters() 55 params.add_number('neighbors', int, 40, (1, 50)) 56 params.add_single_option('similarity', str, similarities[0], similarities) 57 params.add_single_option('implementation', str, implementations[0], implementations) 58 return params
Create the parameters of the ItemKNN/UserKNN algorithm.
Returns: the configuration parameters of the algorithm.
61def create_params_multi_vae() -> ConfigParameters: 62 """Create the parameters of the MultiVAE algorithm. 63 64 Returns: 65 the configuration parameters of the algorithm. 66 """ 67 params = ConfigParameters() 68 params.add_number('iterations', int, 10, (1, 50)) 69 params.add_number('factors', int, 200, (100, 500)) 70 params.add_number('learning_rate', float, 0.001, (0.0001, 1.0)) 71 params.add_number('regularization_factors', float, 0.01, (0.0001, 1.0)) 72 params.add_number('intermediate_dimensions', int, 100, (1000, 600)) 73 params.add_number('dropout_probability', float, 1.0, (0.0, 1.0)) 74 params.add_random_seed('seed') 75 return params
Create the parameters of the MultiVAE algorithm.
Returns: the configuration parameters of the algorithm.
78def create_params_pure_svd() -> ConfigParameters: 79 """Create the parameters of the PureSVD algorithm. 80 81 Returns: 82 the configuration parameters of the algorithm. 83 """ 84 params = ConfigParameters() 85 params.add_number('factors', int, 10, (1, 100)) 86 params.add_random_seed('seed') 87 return params
Create the parameters of the PureSVD algorithm.
Returns: the configuration parameters of the algorithm.
90def create_params_svd_pp() -> ConfigParameters: 91 """Create the parameters of the SVDpp algorithm. 92 93 Returns: 94 the configuration parameters of the algorithm. 95 """ 96 params = ConfigParameters() 97 params.add_number('iterations', int, 10, (1, 50)) 98 params.add_number('factors', int, 50, (1, 100)) 99 params.add_number('learning_rate', float, 0.001, (0.0001, 1.0)) 100 params.add_number('regularization_factors', float, 0.1, (0.0001, 1.0)) 101 params.add_number('regularization_bias', float, 0.001, (0.0001, 1.0)) 102 params.add_random_seed('seed') 103 return params
Create the parameters of the SVDpp algorithm.
Returns: the configuration parameters of the algorithm.