Conversation
|
@mmosc Hello, thanks for your attention to RecBole. I tested your code and found some questions. K-fold CV means seperate the dataset into K groups and chooses one group as the test set in turn. However, I found that your code only divides the dataset and fixes the test set. So actually the code works like a |
|
Hi @AoiDragon ! Actually when calling So overall, depending on Do you agree on this? |
|
Hello @mmosc , In my understanding, your method need to call |
|
Hi @AoiDragon , if list(config["eval_args"]["split"].keys())[0] == 'KF':
print("==KF")
folds = dataset.build()# data_preparation(config, dataset)
n_folds = len(folds)
print(n_folds)
k = config["eval_args"]["fold"]
folds = folds[k:] + folds[:k]The elif split_mode == "KF":
"""
Will return n_folds datasets
"""
if not isinstance(split_args["KF"], list):
raise ValueError(f'The value of "KF" [{split_args}] should be a list.')
if group_by is None or group_by.lower() == "none":
datasets = self.split_by_ratio(split_args["KF"], group_by=None)
elif group_by == "user":
datasets = self.split_by_ratio(
split_args["KF"], group_by=self.uid_field
)
else:
raise NotImplementedError(
f"The grouping method [{group_by}] has not been implemented."
)This is where |
Hi!
For my own research, I implemented k-fold CV in your library. Have a look and let me know if it looks good for you! Maybe someone else will also need it.
Cheers,
Marta