deepmodeling / deepmodeling/unimol_tools
[Code scan] Restore MolPredictHF multiclass and save_path behavior
- Dominant language
- Python
- Stars
- 34
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
This issue is a result of a Codex global repository scan.
## Summary
MolTrainHF does not persist multiclass_cnt, and MolPredictHF.predict treats every non-binary task as regression. It also saves only metric results when save_path is provided, instead of saving prediction CSV and metric JSON outputs like MolPredict.
## Code references
https://github.com/deepmodeling/unimol_tools/blob/4596596aa8f73eb462d5cc5a921d79966d0465da/unimol_hf/trainer.py#L130-L136
https://github.com/deepmodeling/unimol_tools/blob/4596596aa8f73eb462d5cc5a921d79966d0465da/unimol_hf/trainer.py#L152-L188
https://github.com/deepmodeling/unimol_tools/blob/4596596aa8f73eb462d5cc5a921d79966d0465da/unimol_tools/predict.py#L87-L121
## Impact
HF multiclass predictions can be written into the wrong columns and scored with the wrong target/prediction shape. Users also lose the prediction CSV output that the regular MolPredict path produces.
## Suggested fix
Mirror MolPredict behavior: persist multiclass_cnt during training, add a multiclass prediction branch with probability columns and argmax labels, set prediction save paths, and save prediction CSV plus metric JSON/result files.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the referenced MolTrainHF and MolPredictHF sections in unimol_hf/trainer.py and unimol_tools/predict.py, then compare the regular MolPredict behavior. Verify that multiclass_cnt is persisted, multiclass predictions produce probability columns and argmax labels, and save_path produces prediction CSV plus metric JSON/result files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100