Mayil-AI / bugbug-21dec23

Mozilla Public License 2.0
0 stars 0 forks source link

[model:bugtype] ValueError: y should be a 1d array, got an array of shape (198635, 5) instead. (hashtag3956) #9

Open vikramsubramanian opened 4 months ago

vikramsubramanian commented 4 months ago

I'm wondering if the error encountered during the training of the bugtype model is something we should investigate.

Traceback (most recent call last):
  File "/home/promisefru/anaconda3/envs/bugbug/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/promisefru/anaconda3/envs/bugbug/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/promisefru/mozilla/bugbug/scripts/trainer.py", line 145, in <module>
    main()
  File "/home/promisefru/mozilla/bugbug/scripts/trainer.py", line 141, in main
    retriever.go(args)
  File "/home/promisefru/mozilla/bugbug/scripts/trainer.py", line 41, in go
    metrics = model_obj.train(limit=args.limit)
  File "/home/promisefru/mozilla/bugbug/bugbug/model.py", line 377, in train
    self.le.fit(y)
  File "/home/promisefru/anaconda3/envs/bugbug/lib/python3.10/site-packages/sklearn/preprocessing/_label.py", line 98, in fit
    y = column_or_1d(y, warn=True)
  File "/home/promisefru/anaconda3/envs/bugbug/lib/python3.10/site-packages/sklearn/utils/validation.py", line 1156, in column_or_1d
    raise ValueError(
ValueError: y should be a 1d array, got an array of shape (198635, 5) instead.

_Originally posted by in

See also: )

mayil-ai[bot] commented 4 months ago

Possible Solution

Code snippets to check

bugbug → models → bugtype.py This snippet is from the 'bugbug/models/bugtype.py' file, which is likely related to the 'bugtype' model mentioned in the issue. The error suggests a problem with the shape of the array being passed to the label encoder, which could be related to the data processing or training logic in this file. https://github.com/Mayil-AI/bugbug-21dec23/blob/0acd00da46afbb37bd047c0bce06ce7cfad21568/bugbug/models/bugtype.py#L1-L92