brightics / studio

Component based analytics studio on the web browser
Other
181 stars 86 forks source link

[BUG] Decision tree - Feature importance plot 한글 이슈 #828

Closed ju-ing closed 2 years ago

ju-ing commented 2 years ago

안녕하세요, Docker hub에 올라온 버전으로 잘 사용하고 있습니다.

python의 maplotlib로 그려지는 그림은 나눔고딕 폰트를 적용 시켜서 잘 사용하고 있습니다.

image

그런데 바로 아래 Feature importance plot은 한글 적용이 안됩니다. 방법이 있을까요?

https://github.com/brightics/studio/blob/9a2946a9a6046cd4a5b3c666b32296ebfe04b21a/function/python/brightics/function/regression/decision_tree_regression.py#L101

image

감사합니다.

github-actions[bot] commented 2 years ago

Awesome! Thanks for taking the time to open an issue. We will have a look and answer as soon as we can.' first issue

gyu77hs commented 2 years ago

현재로서는 feature importance column에 한글을 지원하지는 않고 있고, Add Function Column을 이용하여 영문 컬럼으로 변경하여 사용하시는 것을 권장 드립니다.

나눔고딕 폰트를 custom 하게 적용하시어 사용 중이시라면, matplotlib에 한글을 지원하는 폰트를 사용하시면 됩니다. 아래 경로의 파일에서 font를 직접 지정하시면 한글을 사용하실 수 있습니다. functions\python\brightics\function\classification\decision_tree_classification.py


# 상단에 import 선언
import matplotlib
from matplotlib import font_manager, rc

# _decision_tree_classification_train 메서드 내 폰트 지정
    font_path = "C:/Windows/Fonts/H2GTRM.TTF"  # 폰트 경로
    font_name = font_manager.FontProperties(fname=font_path).get_name()
    matplotlib.rc('font',family=font_name)

감사합니다.

ju-ing commented 2 years ago

decision_tree_classification.py 소스코드 자체를 수정하면 되는거였네요. 감사합니다.