-
Notifications
You must be signed in to change notification settings - Fork 623
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #685 from flust/0.2.x
FEA: Add basic framework of 'lightgbm' and merge xgboost and lightgbm…
- Loading branch information
Showing
12 changed files
with
212 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,32 +8,32 @@ | |
# @Email : [email protected] | ||
|
||
""" | ||
recbole.data.dataloader.xgboost_dataloader | ||
recbole.data.dataloader.decisiontree_dataloader | ||
################################################ | ||
""" | ||
|
||
from recbole.data.dataloader.general_dataloader import GeneralDataLoader, GeneralNegSampleDataLoader, \ | ||
GeneralFullDataLoader | ||
|
||
|
||
class XgboostDataLoader(GeneralDataLoader): | ||
""":class:`XgboostDataLoader` is inherit from | ||
class DecisionTreeDataLoader(GeneralDataLoader): | ||
""":class:`DecisionTreeDataLoader` is inherit from | ||
:class:`~recbole.data.dataloader.general_dataloader.GeneralDataLoader`, | ||
and didn't add/change anything at all. | ||
""" | ||
pass | ||
|
||
|
||
class XgboostNegSampleDataLoader(GeneralNegSampleDataLoader): | ||
""":class:`XgboostNegSampleDataLoader` is inherit from | ||
class DecisionTreeNegSampleDataLoader(GeneralNegSampleDataLoader): | ||
""":class:`DecisionTreeNegSampleDataLoader` is inherit from | ||
:class:`~recbole.data.dataloader.general_dataloader.GeneralNegSampleDataLoader`, | ||
and didn't add/change anything at all. | ||
""" | ||
pass | ||
|
||
|
||
class XgboostFullDataLoader(GeneralFullDataLoader): | ||
""":class:`XgboostFullDataLoader` is inherit from | ||
class DecisionTreeFullDataLoader(GeneralFullDataLoader): | ||
""":class:`DecisionTreeFullDataLoader` is inherit from | ||
:class:`~recbole.data.dataloader.general_dataloader.GeneralFullDataLoader`, | ||
and didn't add/change anything at all. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,16 @@ | |
# @Email : [email protected] | ||
|
||
""" | ||
recbole.data.xgboost_dataset | ||
recbole.data.decisiontree_dataset | ||
########################## | ||
""" | ||
|
||
from recbole.data.dataset import Dataset | ||
from recbole.utils import FeatureType | ||
|
||
|
||
class XgboostDataset(Dataset): | ||
""":class:`XgboostDataset` is based on :class:`~recbole.data.dataset.dataset.Dataset`, | ||
class DecisionTreeDataset(Dataset): | ||
""":class:`DecisionTreeDataset` is based on :class:`~recbole.data.dataset.dataset.Dataset`, | ||
and | ||
Attributes: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# @Time : 2020/1/17 | ||
# @Author : Chen Yang | ||
# @Email : [email protected] | ||
|
||
r""" | ||
recbole.model.exlib_recommender.lightgbm | ||
############################# | ||
""" | ||
|
||
import lightgbm as lgb | ||
from recbole.utils import ModelType, InputType | ||
|
||
|
||
class lightgbm(lgb.Booster): | ||
r"""lightgbm is inherited from lgb.Booster | ||
""" | ||
type = ModelType.DECISIONTREE | ||
input_type = InputType.POINTWISE | ||
|
||
def __init__(self, config, dataset): | ||
super(lgb.Booster, self).__init__() | ||
|
||
def to(self, device): | ||
return self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
convert_token_to_onehot: False | ||
token_num_threshold: 10000 | ||
|
||
# Dataset | ||
lgb_silent: False | ||
|
||
# Train | ||
lgb_model: ~ | ||
lgb_params: | ||
boosting: gbdt | ||
num_leaves: 90 | ||
min_data_in_leaf: 30 | ||
max_depth: -1 | ||
learning_rate: 0.1 | ||
objective: binary | ||
lambda_l1: 0.1 | ||
metric: ['auc', 'binary_logloss'] | ||
force_row_wise: True | ||
lgb_learning_rates: ~ | ||
lgb_num_boost_round: 300 | ||
lgb_early_stopping_rounds: ~ | ||
lgb_verbose_eval: 100 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.