Commit ccb78f3 1 parent b6e452f commit ccb78f3 Copy full SHA for ccb78f3
File tree 1 file changed +12
-3
lines changed
tests/python_package_test
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1541,9 +1541,18 @@ def test_string_serialized_params_retrieval(rng):
1541
1541
new_model = lgb .Booster (params = {"num_leaves" : 7 }, model_str = model_serialized )
1542
1542
1543
1543
assert (new_model .params ) # Check not empty dict
1544
- for k , v in params .items ():
1545
- assert (k in new_model .params )
1546
- assert (new_model .params [k ] == v )
1544
+ assert (new_model .params ["boosting" ] == "gbdt" )
1545
+ assert (new_model .params ["deterministic" ] == True )
1546
+ assert (new_model .params ["feature_contri" ] == [0.5 ] * train_x .shape [1 ])
1547
+ assert (new_model .params ["interaction_constraints" ] == [[0 , 1 ], [0 ]])
1548
+ assert (new_model .params ["objective" ] == "binary" )
1549
+ assert (new_model .params ["metric" ] == ["auc" ])
1550
+ assert (new_model .params ["num_leaves" ] == 7 )
1551
+ assert (new_model .params ["learning_rate" ] == 0.05 )
1552
+ assert (new_model .params ["feature_fraction" ] == 0.9 )
1553
+ assert (new_model .params ["bagging_fraction" ] == 0.8 )
1554
+ assert (new_model .params ["bagging_freq" ] == 5 )
1555
+ assert (new_model .params ["verbosity" ] == - 100 )
1547
1556
1548
1557
1549
1558
def test_save_load_copy_pickle (tmp_path ):
You can’t perform that action at this time.
0 commit comments