#NEWLINE# def test_create_MatrixFactorBasedRecommender( ) : #NEWLINE# #INDENT# items_strategy = AllPossibleItemsStrategy ( ) #NEWLINE# recsys = MatrixFactorBasedRecommender ( model = matrix_model , items_selection_strategy = items_strategy , n_features = 2 ) #NEWLINE# assert_equals ( recsys . items_selection_strategy , items_strategy ) #NEWLINE# assert_equals ( recsys . model , matrix_model ) #NEWLINE# assert_equals ( recsys . capper , True ) #NEWLINE# assert_equals ( recsys . learning_rate , 0.01 ) #NEWLINE# assert_equals ( recsys . regularization , 0.02 ) #NEWLINE# assert_equals ( recsys . init_mean , 0.1 ) #NEWLINE# assert_equals ( recsys . n_interations , 30 ) #NEWLINE# assert_equals ( recsys . init_stdev , 0.1 ) #NEWLINE# assert_equals ( recsys . with_preference , False ) #NEWLINE# assert_equals ( recsys . user_factors . shape , ( 8 , 2 ) ) #NEWLINE# assert_equals ( recsys . item_factors . shape , ( 6 , 2 ) ) #NEWLINE# assert_equals ( recsys . _global_bias , 3.2285714285714286 )