강의

멘토링

커뮤니티

Inflearn Community Q&A

freedom07's profile image
freedom07

asked

[Revised Edition] The Complete Guide to Python Machine Learning

Introduction to classification performance evaluation index and accuracy

MyFakeClassifier에서 predict() 함수 부분에서 dtype='bool '하는 이유

Written on

·

300

0

선생님~

노란색 부분이 잘 이해가 가지 않네요..ㅠ

np.zeros( (len(X), 1) , dtype=bool)  이 코드에서 

dtype='int32' 가 아니라.. 왜 dtype='bool'로 하는 건가요~?

0이 아니라 False로 반환해주는 게 이해가 잘 되지 않네요..ㅠ

통계머신러닝 배워볼래요? python

Answer 1

1

dooleyz3525님의 프로필 이미지
dooleyz3525
Instructor

bool로 해서 직관적으로 True/False 인것을 설명하기 위함이고 bool로 저장하면 보이는건 False이지만 실제 값 저장은 0 이 되므로 별 문제 없습니다. 

freedom07's profile image
freedom07

asked

Ask a question