IndexError when using DataHandlerLP
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 48.7k
- Forks
- 7.7k
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I am encountering an UnsortedIndexError when using DataHandlerLP in Qlib. It seems to be related to MultiIndex not being lexsorted. Could you provide guidance on how to resolve this issue?
UnsortedIndexError: 'MultiIndex slicing requires the index to be lexsorted: slicing on levels [0], lexsort depth 0'
handler = DataHandlerLP(
data_loader={
"class": "QlibDataLoader",
"kwargs": {
"config": {
"feature": market_info,
"label": ["Ref($close, -2)/Ref($close, -1) - 1"]
},
}
},
instruments="csi300",
infer_processors=[
{
"class": 'RobustZScoreNorm',
'kwargs': {
'clip_outlier': True,
'fields_group': 'feature',
'fit_start_time': '2009-01-01',
'fit_end_time': '2019-12-31'
}
},
{
'class': 'Fillna',
'kwargs': {
'fields_group': 'feature',
}
},
],
learn_processors=[
{"class": 'DropnaLabel'},
{
"class": 'CSZScoreNorm',
'kwargs': {
'fields_group': 'label',
}
},
],
)
Thank you.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied DataHandlerLP configuration and trace the MultiIndex slicing that raises UnsortedIndexError. The issue names no source file or test, so locate the relevant Qlib data-handling entry point first; done would require a documented or verified resolution for the lexsort failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100