Recall Score

25 July 2020

sklearn.metrics의 recall_score 이용하여 recall 값을 계산해보도록 하겠습니다. 먼저 아래의 그림을 통해 recall의 개념에 대해서 알아보도록 하겠습니다. classifier를 통해 해당 값이 우리가 구분하려는 카테고리에 속하는 것은 positive, 아닌 것은 negative로 표현하도록 합니다. 그 중에 실제 값으로 속하는 값은 그림에서 relavant elements로 표현됩니다. classifier가 positive로 판단하면서 실제로 positive인 값은 true positive classifier가 positive로 판단하면서 실제로 negative인 값은 false positive classifier가 negative로 판단하면서 실제로 negative인 값은 true negative classifier가 negative로 판단하면서 실제로 positive인 값은 false negative 와 같이 표현할 수 있습니다. 표현한 모양을 자세히 살펴보면 앞에 붙는 true와 false인 뒤에 따라오는 값이 classifier가 예측한 값과 실제 값이 동일한 경우에는 true, 아닌 경우에는 false인...

read more

Precision Score

15 July 2020

sklearn.metrics의 precision_score 이용하여 precsion을 계산해보도록 하겠습니다. 먼저 아래의 그림을 통해 precision의 개념에 대해서 알아보도록 하겠습니다. classifier를 통해 해당 값이 우리가 구분하려는 카테고리에 속하는 것은 positive, 아닌 것은 negative로 표현하도록 합니다. 그 중에 실제 값으로 속하는 값은 그림에서 relavant elements로 표현됩니다. classifier가 positive로 판단하면서 실제로 positive인 값은 true positive classifier가 positive로 판단하면서 실제로 negative인 값은 false positive classifier가 negative로 판단하면서 실제로 negative인 값은 true negative classifier가 negative로 판단하면서 실제로 positive인 값은 false negative 와 같이 표현할 수 있습니다. 표현한 모양을 자세히 살펴보면 앞에 붙는 true와 false인 뒤에 따라오는 값이 classifier가 예측한 값과 실제 값이 동일한 경우에는 true, 아닌 경우에는 false인 것을...

read more

DecisionTreeClassifier 예제

06 July 2020

sklearn.datasets의 dataSet을 이용하여, DecisionTreeClassifier로 data를 예측하는 예제를 만들어보도록 하겠습니다. - init.py from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import train_test_split from sklearn.datasets import load_wine from sklearn.metrics import accuracy_score

read more