microsoft / microsoft/qlib

The Alpha158 handler get NAN in y["label"]["LABEL0"] in other instruments except csi300

Open
#1,860 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
48.7k
Forks
7.7k
PR merge metrics
No merged PRs in 30d

Description

❓ Questions and Help

After changing market from default "csi300" to other specific code like market = ["SH600519"] in example tutorial workflow_by_code.ipynb

I got 0 loss in model.fit(dataset)
Image

After debug, I find that the output of y["LABEL0"] in

https://github.com/microsoft/qlib/blob/f2caf452e95348ea0ab986dbdc88f2dd96751835/qlib/contrib/model/gbdt.py#L40C1-L41C1

are all NAN

Image

and using default ”csi300“ is work fine with

Image

So how do i do model fit in such specific stock id,rather than sci300?

I'd appreciate it if someone can tell me Why is that happen and how to solve it?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in workflow_by_code.ipynb using market = ["SH600519"], then inspect the LABEL0 output at qlib/contrib/model/gbdt.py around lines 40–41. Trace how Alpha158 labels are generated for a single instrument and compare them with the csi300 case. Done means the cause is identified and model.fit receives valid labels for the specific stock, with a regression check if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
fintech-quant, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.