라구파스타

  • 홈
  • 태그
  • 방명록

XGBClassifier 1

[Python] XGBoost 사용 시 ValueError: DataFrame.dtypes for data must be int, float,

아래와 같이 XGBClassifier나 XGBRegressor를 사용할 때, 범주형 변수에 대한 고려 없이 데이터가 그대로 들어갈 경우 제목과 같은 ValueError가 발생할 수 있다. ### anti-pattern ### import xgboost as xgb # 데이터셋은 준비되어 있다고 가정 clf = xgb.XGBClassifier(random_state=42, verbosity=1) clf.fit(X_train, y_train) 이를 해결하기 위해 보통 범주형 변수를 인코딩하는데, 그렇게 하지 않고도 바로 XGBoost를 training할 수 있는 방법이 에러 메시지 두 번째 문장에 나온다. ValueError: DataFrame.dtypes for data must be int, float,..

Development/Python 2023.08.23
이전
1
다음
더보기
프로필사진

라구파스타

Something for Data Scientist & pseudo-Developer

  • 분류 전체보기 (9)
    • Research (2)
      • Recommendation System (2)
      • Anomaly Detection (0)
      • Label correction (0)
    • Development (7)
      • Python (5)
      • SQL (2)

Tag

파이썬, hiveql, matrix factorization, alternating least square, Wide & Deep, recommendation system, 추천시스템, Python, keras, XGB, 판다스, DMatrix, categorical, 범주형, relu, cross-product, XGBClassifier, RecommSys, XGBRegressor, required positional argument,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바