Kernel: Python 3 (Ubuntu Linux)
Dataset Mushroom
Disciplina: Tópicos Especiais em Sistemas de Informação
Por: Mateus Oliveira e Daniel Farias
Questão 1
Dados sobre o Dataset
Nome: Mushroms Database
Descrição: Registros de cogumelos retirados do guia de campo da sociedade Audubon para cogumelos norte americanos (Audubon Society Field Guide to North American Mushrooms) (1981). G. H. Lincoff (Pres.), Alfred A. Knopf
Volume de dados: 8.224 registros
Principais colunas (TOTAL DE 8):
poison: edible=e, poisonous=p
refere-se à toxicidade do cogumelo
cap-shape: bell=b,conical=c,convex=x,flat=f,knobbed=k,sunken=s
refere-se à forma do "chapeu" do cogumelo
cap-color: brown=n,buff=b,cinnamon=c,gray=g,green=r,pink=p,purple=u,red=e,white=w,yellow=y
refere-se à cor do cogumelo
bruises? bruises=t,no=f
refere-se se o cogumelo possui ou não manchas
odor: almond=a,anise=l,creosote=c,fishy=y,foul=f,musty=m,none=n,pungent=p,spicy=s
refere-se ao cheiro do cogumelo
ring-type: cobwebby=c,evanescent=e,flaring=f,large=l,none=n,pendant=p,sheathing=s,zone=z
essa coluna refere-se à forma do anel do cogumelo
population: abundant=a,clustered=c,numerous=n,scattered=s,several=v,solitary=y
refere-se à população do cogumelo
habitat: grasses=g,leaves=l,meadows=m,paths=p,urban=u,waste=w,woods=d
refere-se ao habitat do cogumelo
DADOS GERAIS DO DATASET
Número de atributos: 22 colunas (todos nominalmente valorados)
0. poison: edible=e, poisonous=p ----> esse foi criado no dataset como parte da base de dados
1. cap-shape: bell=b,conical=c,convex=x,flat=f,knobbed=k,sunken=s
2. cap-surface: fibrous=f,grooves=g,scaly=y,smooth=s
3. cap-color: brown=n,buff=b,cinnamon=c,gray=g,green=r,pink=p,purple=u,red=e,white=w,yellow=y
4. bruises?: bruises=t,no=f
5. odor: almond=a,anise=l,creosote=c,fishy=y,foul=f,musty=m,none=n,pungent=p,spicy=s
6. gill-attachment: attached=a,descending=d,free=f,notched=n
7. gill-spacing: close=c,crowded=w,distant=d
8. gill-size: broad=b,narrow=n
9. gill-color: black=k,brown=n,buff=b,chocolate=h,gray=g,green=r,orange=o,pink=p,purple=u,red=e,white=w,yellow=y
10. stalk-shape: enlarging=e,tapering=t
11. stalk-root: bulbous=b,club=c,cup=u,equal=e,rhizomorphs=z,rooted=r,missing=?
12. stalk-surface-above-ring: fibrous=f,scaly=y,silky=k,smooth=s
13. stalk-surface-below-ring: fibrous=f,scaly=y,silky=k,smooth=s
14. stalk-color-above-ring: brown=n,buff=b,cinnamon=c,gray=g,orange=o,pink=p,red=e,white=w,yellow=y
15. stalk-color-below-ring: brown=n,buff=b,cinnamon=c,gray=g,orange=o,pink=p,red=e,white=w,yellow=y
16. veil-type: partial=p,universal=u
17. veil-color: brown=n,orange=o,white=w,yellow=y
18. ring-number: none=n,one=o,two=t
19. ring-type: cobwebby=c,evanescent=e,flaring=f,large=l,none=n,pendant=p,sheathing=s,zone=z
21. population: abundant=a,clustered=c,numerous=n,scattered=s,several=v,solitary=y
22. habitat: grasses=g,leaves=l,meadows=m,paths=p,urban=u,waste=w,woods=d
Campos em branco: 2480 (denotados por "?"), todos do atributo #11.
Objetivo do Trabalho Sobre o Dataset
Avaliar características de cogumelos (cor, cheiros, toxicidade...)
Relacionar algumas características do cogumelo com a sua toxicidade
O resultado esperado após a execução dos algoritmos é a definição se um cogumelos com determinadas características pode ser venenoso ou não.
In [2]:
In [7]:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-7-39c9486487c1> in <module>()
35 return {'x': x, 'y': y}
36
---> 37 def apply_algorithms(df = df, method = 'mnb'):
38 input_data = _get_data(df)
39 manager = _algorithm_builder(method)
NameError: name 'df' is not defined
In [6]:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-6-762f20c8acb6> in <module>()
----> 1 def plota_populacao(filtro=df, label="populacao dos cogumelos"):
2 dframe = filtro
3
4 p_abundant = dframe[dframe['population'] == 'a']['population'].count()
5 p_clustered = dframe[dframe['population'] == 'c']['population'].count()
NameError: name 'df' is not defined
In [0]:
In [5]:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-5-a01a6f8ed278> in <module>()
1 # cores dos cogumelos
2
----> 3 plota_cor(filtro=df, label = "cor dos cogumelos")
NameError: name 'plota_cor' is not defined
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [122]:
ALGORITMO MultinomialNB
Acurácia: 0.9985228951255539
Precisão: 0.9985902255639098
Recall: 0.9985228951255539
tempo de execução: 0.0039520263671875
ALGORITMO RandomForestClassifier
Acurácia: 1.0
Precisão: 1.0
Recall: 1.0
tempo de execução: 0.0023920536041259766
ALGORITMO GaussianNB
Acurácia: 1.0
Precisão: 1.0
Recall: 1.0
tempo de execução: 0.0035805702209472656
ALGORITMO DecisionTreeClassifier
Acurácia: 1.0
Precisão: 1.0
Recall: 1.0
tempo de execução: 0.0032019615173339844
ALGORITMO LinearDiscriminantAnalysis
Acurácia: 1.0
Precisão: 1.0
Recall: 1.0
tempo de execução: 0.004513978958129883
ALGORITMO AdaBoostClassifier
Acurácia: 1.0
Precisão: 1.0
Recall: 1.0
tempo de execução: 0.003444194793701172
ALGORITMO QuadraticDiscriminantAnalysis
Acurácia: 1.0
Precisão: 1.0
Recall: 1.0
tempo de execução: 0.004183053970336914
In [0]:
In [0]: