Uma possível extensão deste estudo pode se dar através da obtenção de uma base de dados com maior número de casos de com classe igual a Dengue, o que pode melhorar o desempenho do classificador já que neste trabalho o MLP consegue classificar melhor Não Dengue do que Dengue em parte pelo conjunto de instâncias da classe Não Dengue ser bem maior. Isso poderia resultar numa acurácia bem mais satisfatória.
Outra extensão poderia ser um estudo comparativo com outros classificadores promissores para o diagnóstico de doenças, e assim melhorar os resultados. Pode-se também combinar outras doenças como zika, chikungunya e Dengue, a fim de gerar uma ferramenta que possa apoiar o diagnóstico do Médico ou realizar uma triagem.
AGUIAR, Fábio S.; TORRES, Rodrigo C.; PINTO, João V. F.; KRITSKI, Afrânio L.; SEIXAS, José M.; MELLO, Fernanda C. Q. Development of two artificial neural network models to support the diagnosis of pulmonary tuberculosis in hospitalized patients in Rio de Janeiro, Brazil. International Federation for Medical and Biological Engineering 2016.
AMARAL, Fernando. Aprenda mineração de dados: teoria e prática. Rio de Janeiro: Alta Books, 2016.
BAHL, Shilpa; SHARMA, Sudhir Kumar. Improving Classification Accuracy of Intrusion Detection System using Feature Subset Selection.Advanced Computing & Communication Technologies (ACCT), 2015 Fifth International Conference on. IEEE, 2015. p. 431-436.
BARROS, Everton Fernando; ROMAO Wesley; CONSTANTINO, Ademir Aparecido; SOUZA, Celso Lara. Pré-processamento para mineração de dados sobre beneficiários de planos de saúde suplementar. Journal of Health Informatics, v. 3, n. 1, 2011.
BRAGA, Antônio de Pádua; CARVALHO, André Ponce de Leon F. de; LUDERMIR, Teresa Bernarda. Redes Neurais artificiais: teoria e aplicações. - 2.ed. - [Reimpr.] - Rio de Janeiro: LTC, 2011.
BRASIL. Ministério da Saúde - Secretaria de Vigilância em Saúde. Dengue: Diagnóstico e manejo clínico. Série A. Normas e Manuais Técnicos. 2ª edição.
Brasília, 2005. Disponível em
<http://bvsms.saude.gov.br/bvs/publicacoes/dengue_manejo_clinico_novo.pdf> Acesso em 01 de Junho de 2018.
BRASIL. Ministério da Saúde. Secretaria de Vigilância em Saúde. Guia de Vigilância em Saúde/ Ministério da Saúde, Secretaria de Vigilância em Saúde. Brasília: Ministério
da Saúde, 2014. Disponível em <
http://bvsms.saude.gov.br/bvs/publicacoes/guia_vigilancia_saude_unificado.pdf> Acesso em 01 de Junho de 2018.
BRASIL, Ministério da Saúde. Nota Técnica Nº 25/2011 CGPNCD/DEVEP/SVS/MS e GT-SINAN/CIEVS/DEVEP/SVS/MS. Brasília, 2011.
Brasil, Ministério da Saúde. Nota Informativa Nº 59 /2016 CGPNCD/DEVIT/SVS/MS. Brasília, 2016.
BRASIL. Ministério da Saúde - Secretaria de Vigilância em Saúde. Sistema de Informação de Agravos de Notificação – SINAN Online – Dicionário de Dados. Brasília: 2015.
BRASIL. Ministério da Saúde - Secretaria de Vigilância em Saúde. Boletim Epidemiológico Vol. 49 - nº 2 - 2018: Monitoramento dos casos de dengue, febre de chikungunya e febre pelo vírus Zika até a Semana Epidemiológica 52 de 2017.
Disponível em:
http://portalarquivos2.saude.gov.br/images/pdf/2018/janeiro/23/Boletim-2018-001- Dengue.pdf Acesso em 24 de Abril de 2018.
BRASIL, Ministério da Saúde, Secretaria Executiva, Departamento de Informática do SUS. Guia Rápido do SINAN Online: Sistema de Informação de agravos de
notificação online. Disponível em
http://sinan.saude.gov.br/sinan/ajuda/ajuda_sinan.pdf?v=1463659907519 Acesso em 08 de maio de 2018.
CASTANHEIRA, Luciana Gomes. Aplicação de técnicas de mineração de dados em problemas de classificação de padrões. Belo Horizonte: UFMG, 2008.
COSTA, Fabrício de Oliveira; MOTTA, Luciene Cristina Soares; NOGUEIRA, José Luiz Thomaselli. Uma abordagem baseada em Redes Neurais Artificiais para o auxílio ao diagnóstico de doenças meningocócicas. Revista Brasileira de Computação Aplicada (ISSN 2176-6649). Passo Fundo, v.2, n.1, p.79-88, mar.2010.
CRUZ, Jaqueline Silva. Avaliação de testes diagnósticos para a identificação da infecção pelo vírus da dengue em pacientes com síndrome febril aguda. / Jaqueline Silva Cruz. - 2014. Dissertação (mestrado) – Fundação Oswaldo Cruz, Centro de Pesquisas Gonçalo Moniz, 2014.
DANG, Thuy Hang; PHAM, Trung Dung; TRAN, Hoai Linh; VAN, Quang Le. Using Dimension Reduction with Feature Selection to Enhance Accuracy of
Tumor Classification. Biomedical Engineering (BME-HUST), International Conference on. IEEE, 2016. p. 14-17.
DE LIMA, Rafael Alexandre França. Estratégias de Seleção de Atributos para detecção de anomalias em transações eletrônicas. Belo Horizonte, 2016.
DE OLIVEIRA, Thiego Wanderley Fontes. Aplicação de Redes Neurais Artificiais na modelagem de um classificador de formas clínicas de Dengue utilizando dados genônimos. Recife, 2009.
DOS SANTOS, Asaffe CM. Aprendizado de máquina aplicado ao diagnóstico de Dengue. XIII Encontro Nacional de Inteligência Artificial e Computacional, 2016. EBRAHIMZADEH, Elias; MANUCHEHRI, Mohammad Sajad; AMOOZEGAR, Sana; ARAABI, Babak Nadjar; ZADEH-SOLTANIAN, Hamid. A time local subset feature selection for prediction of sudden cardiac death from ECG signal. Medical & biological engineering & computing, p. 1-18, 2017.
FATHIMA, Shameem A.; HUNDEWALE, Nisar. Comparitive Analysis of Machine learning Techniques for classification of Arbovirus. In: Biomedical and Health
379.
FERREIRA, Almir Miranda. Prevalência de lesões orais e potencialmente malignas e fatores associados em trabalhadores rurais da região Seridó do Rio Grande do Norte. Tese de Doutorado (UFRN). Natal, 2016.
FRANK, Eibe; WITTEN, Ian H. Data Mining: practical machine learning tools and techniques with java implementations. Chapter 7 – Transformstions: Engeneering the inpu and output, p.288-343. 2ª ed. San Francisco: Morgan Kaufmann Publishers, 2005.
GOLDSCHMIDT, Ronaldo; BEZERRA, Eduardo; PASSOS, Emanuel. Data mining: conceitos, técnicas, algoritmos, orientações e aplicações. – 2. Ed. – Rio de Janeiro : Elsevier, 2015.
HAYKIN, Simon. Redes Neurais: Princípios e Prática. Bookman Editora, 2007. GONÇALVES SOUZA; Gonçalves; TOSTES E SOUZA, Lelia de Mello. O uso de Redes Neurais Artificiais no diagnóstico de doenças reumatológicas. Florianópolis, 2004.
HERRERA, Luis Javier; ROJAS, Ignacio; POMARES, H; GUILLEN, A; VALENZUELA, O; BANOS, O. Classification of MRI Images for Alzheimer's Disease Detection. In: Social Computing (SocialCom), 2013 International Conference on. IEEE, 2013. p. 846- 851.
HUAN, Liu; MOTODA, Hiroshi. Computational methods of freature selection. 2008.
KOVÁCS, Zsolt László. Redes Neurais Artificiais: fundamentos e aplicações: um texto básico - 4.ed. Ver. -. São Paulo: Editora Livraria da Física, 2006.
LAHIJANIAN, B; FARAHANI, F. Vasheghani; ZARANDI. M. H. Fazel. A New Multiple Classifier System for Diagnosis of Erythemato-Squamous Diseases Based on Rough Set Feature Selection. Fuzzy Systems (FUZZ-IEEE), 2016 IEEE International Conference on. IEEE, 2016. p. 2309-2316.
MAHMOOD, Noor T.; ALLAWI, Salah T. Modified PCA Based on JK Method for Ranking to Select Features in Statistical DataSets. International Journal of Computer Science and Information Security, v. 14, n. 8, p. 1031, 2016.
NETTO, Oscar Picchi. Um Filtro Iterativo Utilizando Árvores de Decisão. 2013 PASSOS, Emmanuel; GOLDSCHMIDT, Ronaldo. Data Mining: um guia prático. Editora Campus, Rio de Janeiro, 2005.
PINHO, Aryane Cruz Oliveira. Diagnóstico e caracterização molecular do vírus dengue circulante na cidade de Salvador, Bahia, Brasil./ Aryane Cruz Oliveira Pinho. – Salvador, 2013. Dissertação (Mestrado) – Universidade Federal da Bahia.
QUILICI-GONZALEZ, José Artur; DE ASSIS ZAMPIROLLI, Francisco. Sistemas inteligentes e mineração de dados. 2015.
SARKAR, Chandrima; COOLEY, Sarah; SRIVASTAVA, Jaideep. Improved feature selection for hematopoietic cell transplantation outcome prediction using rank aggregation. Computer Science and Information Systems (FedCSIS), 2012 Federated Conference on. IEEE, 2012. p. 221-226.
STEINER, Maria Teresinha Arns; SOMA, Nei Yoshihiro; SHIMIZU, Tamio; NEIVOLA, Júlio Cesar; SMIDERLE, Andréia; LOPES, Fábio Mendonça. Data Mining como Suporte à Tomada de Decisões-uma Aplicação no Diagnóstico Médico. XXXVI SIMPÓSIO BRASILEIRO DE PESQUISA OPERACIONAL, “O IMPACTO DA PESQUISA OPERACIONAL NAS NOVAS TENDÊNCIAS MULTIDISCIPLINARES, v. 23, p. 96-107, 2004.
TAN, Pang-Ning; STEINBACH, Michael; KUMAR, Vipin. Introdução ao datamining: mineração de dados. Ciência Moderna, 2009.
TAKAMOTO, Miriam; TOMAZELA, Maria das Graças Junqueira Machado. Aplicação de técnicas de mineração de dados para planejamento agrícola no estado de São Paulo. Reverte-Revista de Estudos e Reflexões Tecnológicas da Faculdade de Indaiatuba, n. 9, 2011.
VARELLA, Dráuzio. Guia prático de Saúde e bem-estar: Dengue e Febre Amarela. Editora Gold, 2009.
VERDEAL, Juan Carlos Rosso; FILHO, Rubens Costa; VANZILLOTTA, Cleyde; MACEDO, Gerson Luiz de; BOZZA, Fernando Augusto; TOSCANO, Luisa; PRATA, Arnaldo; TANNER, Antônio Carlos; MACHADO, Flavia Ribeiro. Recomendações para o manejo de pacientes com formas graves de dengue. Revista Brasileira de Terapia Intensiva, v. 23, n. 2, p. 125-133, 2010.
WEKA. Disponível em: <http://www.cs.waikato.ac.nz/~ml/weka> Acesso em 21 de maio de 2018.
WIBAWA, Made Satria; NUGROHO, Hanung Adi; SETIAWAN, Noor Akhmad. Performance evaluation of combined feature selection and classification methods in diagnosing parkinson disease based on voice feature. In: Science in Information Technology (ICSITech), 2015 International Conference on. IEEE, 2015. p. 126-131.
learning tools and techniques. Morgan Kaufmann, 2005.
YILDIRIM, Pinar. Filter based feature selection methods for prediction of risks in hepatitis disease. International Journal of Machine Learning and Computing, v. 5, n. 4, p. 258, 2015.
APÊNCIDE A - Código-fonte sobre tratamento da base de dados. package programinhasimportarcsv; import java.io.*; import java.text.*; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.*;
public class PrograminhasImportarCSV { File arquivoCSV; Scanner leitor; String linhasDoArquivo; String[] valoresEntreVirgulas; String [][] tabela; String [][] tabela2; String [][] matDistancia; int colunas; int linhas; String caminho;
public static void main(String[] args) throws ParseException, IOException, Exception { PrograminhasImportarCSV csv = new PrograminhasImportarCSV();
csv.menu();
}
public void menu() throws IOException, Exception{ int op = 0; int op2 = 0; Scanner dados = new Scanner(System.in);
while (op < 99){ System.out.println("======================MENU======================="); System.out.println("1)Importar arquivo ---");
System.out.println("2)Excluir registros sem exame laboratorial ---");
System.out.println("3)Excluir registros sem sintomas---");
System.out.println("4)Excluir aspas das strings---");
System.out.println("5)binarizar sintomas, deonças PE e resultado---");
System.out.println("6)binarizar atributo sexo---");
System.out.println("7)binarizar atributo gestante---");
System.out.println("8)Tratar idade---");
System.out.println("9)binarizar atributo data dos primeiros sintomas-"); System.out.println("10)Tratar data de notificação---");
System.out.println("11)Tratar data de inicio de investigação---");
System.out.println("12)Tratar data de fim da investigação---");
System.out.println("13)Criar tempo da investigação---");
System.out.println("14)Criar tempo de notificação---");
System.out.println("95)Imprimir rótulo de coluna---");
System.out.println("96)Imprimir linhas---");
System.out.println("97)Exportar arquivo csv---");
System.out.println("98)Converter arquivo exportado de csv para ARFF--");
System.out.println("99)Sair---");
System.out.println("Digite um numero: "); op = dados.nextInt(); System.out.println("=================================================");
importarArquivo();
System.out.println("Arquivo importado com sucesso!"); } if (op == 2){ tabela = excluirSemLab(tabela); } if (op == 3){ tabela = excluirSemSintomas(tabela); } if (op == 4){ tabela = excluirAspas(tabela);
System.out.println("Aspas tratadas com sucesso!"); } if (op == 5){ binarizarSintomas(); binarizarResultadoDengue(); } if (op == 6){ binarizarSexo();
System.out.println("Atributo sexo binarizado!"); }
if (op==7){ binGest();
System.out.println("Atributo gestante tratado!"); } if (op==8){ tratarIdade(); System.out.println("idade tratada!"); } if (op==9){ tratarDataDePrimeirosSintomas(tabela);
System.out.println("Atributo data dos primeiros sintomas tratado"); }
if (op==10){
tratarDataNotificacao(tabela);
System.out.println("Data de notificação convertida em dia de notifigação"); }
if (op==11){
tabela = tratarDataInicioInv(tabela);
System.out.println("Data de inicio de investigação convertida em dia que iniciou a investigação");
}
if (op==12){
tratarDataEncerra(tabela);
System.out.println("Data de encerramento convertida em dia que terminou a investigação"); }
if(op==13){
criarTemp_Invest(tabela);
System.out.println("Atributo com tempo de investigação criado!"); }
if(op==14){
tempoParaNotificar(tabela);
System.out.println("Atributo com tempo de procura de tempo para notificar!");
}
if (op==95){
System.out.println("Digite o número da coluna que deseja verificar: "); colunas = dados.nextInt(); imprimirRotuloColuna(colunas); } if (op == 96){ System.out.println("==============IMPRIMINDO LINHAS=============="); imprimirLinhas(); } if (op == 97){ exportarMatrizParaCSV(tabela);
System.out.println("Arquivo exportado para: /home/moises/Área de Trabalho/Base de dados/"); }
if (op == 98){
tabela = removeColuna(111, tabela); ConverterCSVtoARFF.main();
System.out.println("Conversão realizada com sucesso!"); }
}
}
public void importarArquivo(){ //método recebe um arquivo e coloca os valores numa matriz
//caminho = "/home/moises/Área de Trabalho/Base de dados/DENGONF2016.csv"; caminho = "M:\\BSI\\2015.2\\TCC\\Base de dados\\DENGONF2016.csv";
//abre um arquivo e cria um file arquivoCSV = new File(caminho); try{
leitor = new Scanner(arquivoCSV); //cria um scanner para ler o arquivo
linhasDoArquivo = leitor.nextLine(); //recebe cada linha do arquivo
valoresEntreVirgulas = linhasDoArquivo.split(","); //quebra a linha em vetores
colunas = valoresEntreVirgulas.length; //descobrindo o número de colunas da matrix linhas = numLinhas(); // Esse método não é exato
// linhas = 63500; //colunas = 111;
tabela = new String [linhas][colunas]; //Não precisei o numero de elementos System.out.println("Colunas: "+colunas); System.out.println("Linhas: "+linhas);
for (int i=0; i<colunas; i++) { //colocando a primeira linha na matriz tabela[0][i] = valoresEntreVirgulas[i];
}
int cont = 1;
while(linhas >= cont && leitor.hasNext() ){ //colocando os valores dos vetores na matriz
linhasDoArquivo = leitor.nextLine(); //recebe cada linha do arquivo
valoresEntreVirgulas = linhasDoArquivo.split(","); //quebra a linha em um vetor
// System.out.println(valoresEntreVirgulas[i]);
System.out.print("L" + cont + " C" + i + " : " + valoresEntreVirgulas[i] + "\n"); // System.out.println(" = " + tabela[cont][i]); } cont = cont + 1; }
linhas = cont ; //estratégia para alinhar a matrix int linhasParaEliminar = tabela.length - linhas; for ( int i=0; linhasParaEliminar > i ; i++ ){ tabela = removeLinha(linhas, tabela); } }catch(FileNotFoundException e){ } }
public int numLinhas( ) throws FileNotFoundException{ //pegando o número de linhas
List<String> textos = new ArrayList<>();
File arquivo2 = new File(caminho); Scanner le = new Scanner(arquivo2);
//le linha por linha enquanto alimenta seu ArrayList while(le.hasNext()) {
textos.add(le.next());
} // System.out.println(textos.size() +" linhas"); return (textos.size());// tinha colocado -3 }
public String [][] addLinha (String [][] tab){
String [][] tabelaAux = new String[tab.length+1][tab[0].length] ;
for (int l = 0; l < tab.length; l++) { for (int c = 0; c < tab[0].length; c++) { tabelaAux[l][c] = tab[l][c]; } } return tabelaAux; }
public String [][] removeLinha(int linha, String [][] tab){
String [][] tabelaAux = new String[tab.length-1][tab[0].length] ; int linAux = 0;
for (int l = 0; l < tab.length; l++) { for (int c = 0; c < tab[0].length; c++) { if (l == linha){ linAux = linAux - 1; break; } tabelaAux[linAux][c] = tab[l][c]; }
linAux = linAux + 1; } return tabelaAux; }
public String [][] addColuna (String [][] tab){
String [][] tabelaAux = new String[tab.length][tab[0].length+1] ;
for (int l = 0; l < tab.length; l++) { for (int c = 0; c < tab[0].length; c++) { tabelaAux[l][c] = tab[l][c]; } } return tabelaAux; }
public String [][] removeColuna(int col, String [][] tab){
String [][] tabelaAux = new String[tab.length][tab[0].length-1] ; int colAux;
for (int l = 0; l < tab.length; l++) { colAux = 0;
for (int c = 0; c <= tab[0].length; c++) { if (c == col){ c = c+1; } if (c == tab[0].length){ break; } tabelaAux[l][colAux] = tab[l][c]; colAux = colAux + 1; } } return tabelaAux; }
public void imprimirLinhas(){ int l = 0;
for ( l = 0; l < tabela.length; l++) {
for (int c = 0; c < tabela[0].length; c++) {
System.out.print(tabela[l][c] + " "); //imprime caracter a caracter }
System.out.println(" "); //muda de linha }
System.out.println("Total de "+(l-1)+" linhas"); }
public void exportarMatrizParaCSV(String [][] tab) throws IOException {
// http://dbfconv.com/ site que converte DBF para CSV
try (FileWriter escrever = new FileWriter("/home/moises/Área de Trabalho/Base de dados/export.csv")) {
for (int l = 0; l < tab.length; l++) {
for (int c = 0; c < tab[0].length; c++) { escrever.append(tab[l][c]); escrever.append(","); } escrever.append('\n'); } escrever.flush(); escrever.close(); } }
public void imprimirMatriz(String [][] tab){
for (int l = 0; l < tab.length; l++) {
for (int c = 0; c < tab[0].length; c++) {
System.out.print(tab[l][c] + " "); //imprime caracter a caracter }
System.out.println(" "); //muda de linha
} }
public void imprimirRotuloColuna(int c){ System.out.println(tabela[0][c]);
}
public String [][] excluirSemLab(String [][] tab){ // critério lab coluna 65 int cont = 0;
for (int l = 1; l < tab.length; l++) {
if (!(tab[l][65]).contains("1") ) { //se o critério não for lab, ou seja 1 System.out.println(tab[l][65]+" excluído com sucesso linha: "+l); tab = removeLinha(l, tab);
l--; cont ++; }
}
System.out.println(cont+" registros excluídos sem exame laboratorial"); return tab;
}
public String [][] excluirSemSintomas(String [][] tab){ // critério lab coluna 65 int cont = 0;
for (int l = 1; l < tab.length; l++) {
if (!(tab[l][21]).contains("1") && !(tab[l][21]).contains("2") ) { //se não contém 1 ou 2 (sintomas), exclua a linha
System.out.println(tab[l][21]+" excluído com sucesso linha: "+l); tab = removeLinha(l, tab);
l--; cont ++; }
}
return tab; }
public String [][] excluirAspas(String [][] tab){ for (int l = 0; l < tab.length; l++) { for (int c = 0; c < tab[0].length; c++){ tab[l][c]= tab[l][c].replaceAll("\"", ""); } } return tab; }
public void binarizarSintomas (){
for (int l = 0; l < tabela.length; l++) {
for (int c = 21; c < 42; c++) { // 41 até 52 é o intervalo dos sinais clinicos e doença pe if ( (tabela[l][c]).equalsIgnoreCase("2")) // se for igual a 2 (não) deixe 0;
(tabela[l][c]) = "0"; }
} }
public void binarizarResultadoDengue (){ tabela[0][64] = "classe";
int contd = 0;
for (int l = 1; l < tabela.length; l++) {
if ((tabela[l][64]).equalsIgnoreCase("8")){ //aqui para excluídos casos de dengue com definição "8"
tabela = removeLinha(l, tabela); contd++; //contar resultados = "8" }
}
System.out.println(contd+" resultados desconhecidos excluídos");
for (int l = 1; l < tabela.length; l++) {
if ((tabela[l][64]).equalsIgnoreCase("10") || (tabela[l][64]).equalsIgnoreCase("11") || (tabela[l][64]).equalsIgnoreCase("12")){
(tabela[l][64]) = "Dengue";
} else if ((tabela[l][64]).equalsIgnoreCase("5") || (tabela[l][64]).equalsIgnoreCase("13")){ (tabela[l][64]) = "Não Dengue";
} } }
public void binarizarSexo (){
for (int l = 1; l < tabela.length; l++) {
if ( (tabela[l][11]).equalsIgnoreCase("M") /*&& (tabela[l][0]).equalsIgnoreCase("sexo")*/) { //Se for masculino
(tabela[l][11]) = "1"; }else
if ((tabela[l][11]).equalsIgnoreCase("F") ){ //se for feminino (tabela[l][11]) = "0";
} } }
int ct = 0;
for (int l = 1; l < tabela.length; l++) {
if(tabela[l][12].equalsIgnoreCase("9") || tabela[l][12].equalsIgnoreCase("") || tabela[l][12].equalsIgnoreCase("4") ){
tabela = removeLinha(l, tabela); l--;
ct++; } }
System.out.print(ct+" casos de gestante que precisam ser descartados \n");
for (int l = 1; l < tabela.length; l++){
if(tabela[l][12].equalsIgnoreCase("5")||tabela[l][12].equalsIgnoreCase("6")){ tabela[l][12] = "0"; } } }
public void tratarIdade() throws ParseException{
int idade = 0;
for (int l = 1; l < tabela.length; l++) { idade = Integer.parseInt(tabela[l][10]); idade = idade - 4000;
if(idade<0 && (!tabela[l][9].equalsIgnoreCase(""))){
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); LocalDate dataNasc = LocalDate.parse((tabela[l][9]),formatter);
LocalDate dataNot = LocalDate.parse((tabela[l][2]),formatter);
long diferencaEmAnos = ChronoUnit.YEARS.between(dataNasc, dataNot); idade = (int)diferencaEmAnos;
// System.out.println("Linha "+l+" Nascimento "+tabela[l][9]+" Notificação "+tabela[l][2]+" = "+" idade= "+idade); } tabela[l][10] = tabela[l][10].valueOf(idade); } int cont = 0;
for (int l = 1; l < tabela.length; l++) { idade = Integer.parseInt(tabela[l][10]); if ((idade > 120) || (idade<0)){
tabela = removeLinha(l, tabela); l--; cont++; } }
System.out.println(cont+" registros excluídos por conter idades com anomalias"); }
public void tratarDataDePrimeirosSintomas(String [][] tab) throws ParseException{ int contador = 0;
for (int l1 = 1; l1 < tabela.length; l1++) {
SimpleDateFormat formato1 = new SimpleDateFormat("dd/MM/yy"); Date data1 = formato1.parse(tabela[l1][7]);
Calendar cal1 = Calendar.getInstance(); cal1.setTime(data1);
int year1 = cal1.get(Calendar.YEAR);
if (year1 != 2016 ){
tabela = removeLinha(l1, tabela); contador ++;
l1--; }
}
System.out.println("Foram removidos "+contador+" casos com data dos primeiros sintomas com anomalias");
for (int l = 1; l < tabela.length; l++) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); LocalDate dt_sin_pri = LocalDate.parse((tabela[l][7]),formatter);
LocalDate inicio = LocalDate.parse(("01/01/2016"),formatter); long diferencaEmDias = ChronoUnit.DAYS.between(inicio, dt_sin_pri); int diasQueAdoeceu = (int)diferencaEmDias +1;
// System.out.println("Linha "+l+" dia: "+tabela[l][7]+" adoeceu no dia "+diasQueAdoeceu+" de 2016");
tabela[l][7] = tabela[l][7].valueOf(diasQueAdoeceu); }
}
public void tratarDataNotificacao(String [][] tab) throws ParseException{ int contador = 0;
for (int l = 1; l < tabela.length; l++) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); LocalDate dt_not = LocalDate.parse((tabela[l][2]),formatter);
LocalDate inicio = LocalDate.parse(("01/01/2016"),formatter); long diferencaEmDias = ChronoUnit.DAYS.between(inicio, dt_not); int diasInv = (int)diferencaEmDias +1;
// System.out.println("Linha "+l+tabela[l][2]+" investigação começou no dia "+diasInv+" de 2016");
tabela[l][2] = tabela[l][2].valueOf(diasInv);
if ((diasInv > 365)||(diasInv<0) ){ //se data de notificação foi maior ou menor que 2016 tabela = removeLinha(l, tabela);
contador ++; l--;
} }
System.out.println("Foram removidos "+contador+" casos com data de notificação maior ou menor que 2016");
}
public String [][] tratarDataInicioInv(String [][] tab) throws ParseException{ int contador = 0;
int cont =0;
tabela[0][5] = "DT_INVEST";
for (int l = 1; l < tabela.length; l++) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); LocalDate dt_iniInv = LocalDate.parse((tabela[l][19]),formatter);
LocalDate inicio = LocalDate.parse(("01/01/2016"),formatter); long diferencaEmDias = ChronoUnit.DAYS.between(inicio, dt_iniInv); int diasInv = (int)diferencaEmDias +1;
//System.out.println("Linha "+l+" inicio da investigação no dia "+diasInv+" de 2016"); tabela[l][5] = tabela[l][5].valueOf(diasInv);
if ((diasInv+1) > 366){
tabela = removeLinha(l, tabela); cont ++;
}
}
System.out.println("Removidos "+cont+" linhas com data de inicio de investigação maior que 2016");
return tabela; }
public void tratarDataEncerra(String [][] tab) throws ParseException{ int contador = 0;
int cont = 0;
for (int l = 1; l < tabela.length; l++) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); LocalDate dt_not = LocalDate.parse((tabela[l][70]),formatter);
LocalDate inicio = LocalDate.parse(("01/01/2016"),formatter); long diferencaEmDias = ChronoUnit.DAYS.between(inicio, dt_not); int diasInv = (int)diferencaEmDias +1;
// System.out.println("Linha "+l+tabela[l][70]+" encerrou investigação com"+diasInv+" dias de 2016");
tabela[l][70] = tabela[l][70].valueOf(diasInv);
if ((diasInv+1) < 0){
tabela = removeLinha(l, tabela); cont ++;
} }
System.out.println("Removidos "+cont+" linhas com tempo de investigação menor 0 dia"); }
public void criarTemp_Invest(String [][] tab){ tabela[0][8] ="TEMP_INV";
int inicio = 0; int fim = 0; int cont = 0;
for (int l = 1; l < tabela.length; l++) {
fim = Integer.parseInt(tabela[l][70]); // data de encerramento tabela[l][8] = tabela[l][8].valueOf(fim-inicio); if ((fim-inicio) < 0){
tabela = removeLinha(l, tabela); cont ++;
} }
System.out.println("Foram removidos "+cont+" linhas com datas de investigação com anomalias"); }
public void tempoParaNotificar(String [][] tab){ tabela[0][9] ="TEMP_NOT";
int inicio = 0; int fim = 0; int cont = 0;
for (int l = 1; l < tabela.length; l++) {
inicio = Integer.parseInt(tabela[l][7]); // data dos primeiros sintomas fim = Integer.parseInt(tabela[l][2]); // data de notificação
tabela[l][9] = tabela[l][9].valueOf(fim-inicio); if ((fim-inicio)<0){ removeLinha(l, tabela); //l--; cont ++;
System.out.println("Linha "+l+" tempo: "+(fim-inicio)); }
}
System.out.println("Foram removidos "+cont+" linhas com datas de primeiros sintomas maiores que data de notificação");
} package programinhasimportarcsv; /** * * @author moises */ import weka.core.Instances; import weka.core.converters.ArffSaver; import weka.core.converters.CSVLoader; import java.io.File;
public class ConverterCSVtoARFF { /**
* takes 2 arguments: * - CSV input file * - ARFF output file * @param args
* @throws java.lang.Exception */
public static void main(/*String[] args*/) throws Exception {
loader.setSource(new File("/home/moises/Área de Trabalho/Base de dados/export.csv")); Instances data = loader.getDataSet();
// save ARFF
ArffSaver saver = new ArffSaver(); saver.setInstances(data);
saver.setFile(new File("/home/moises/Área de Trabalho/Base de dados/converted.arff"));
saver.setDestination(new File("/home/moises/Área de Trabalho/Base de dados/converted.arff")); saver.writeBatch();
} }
Apêndice B - Testes com todos os subconjuntos de melhores experimentos do ranking em validação normal e validação cruzada usando MLP.
Atributos selecionados para o experimento
Percentual de acerto por método Validação normal Validação cruzada Melhor atributo 75,0 77,0 2 melhores atributos 75,0 76,6 3 melhores atributos 76,9 80,2 4 melhores atributos 80,0 80,7 5 melhores atributos 79,4 80,7 6 melhores atributos 79,4 81,1 7 melhores atributos 80,2 79,3 8 melhores atributos 76,9 80,8 9 melhores atributos 76,4 79,4
10 melhores atributos (a) 76,4 79,0
10 melhores atributos (b) 76,9 78,8 11 melhores atributos 76,7 79,2 12 melhores atributos 75,8 77,5 13 melhores atributos 75,6 77,0 14 melhores atributos 76,4 76,8 15 melhores atributos 74,2 76,7 16 melhores atributos 73,9 75,6 17 melhores atributos 74,7 74,9 18 melhores atributos 73,6 76,4 19 melhores atributos 74,2 76,1 20 melhores atributos 72,8 75,9 21 melhores atributos 70,6 74,3 22 melhores atributos 72,6 73,9 23 melhores atributos 73,4 74,8 24 melhores atributos 74,7 75,0 25 melhores atributos 72,3 74,2 26 melhores atributos (c) 71,2 72,9 26 melhores atributos (d) 72,0 76,4 27 melhores atributos 70,9 73,3 28 melhores atributos 73,1 73,0 Base completa 70,6 75,6
a. Experimento considerando EXANTEMA o 10º atributo mais significativo. b. Experimento considerando VOMITO o 10º atributo mais significativo. c. Experimento considerando HEMATOLOG o 26º atributo mais significativo. d. Experimento considerando ARTRALGIA o 26º atributo mais significativo.
Os percentuais mostram a acurácia obtida do algoritmo, pela quantidade de atributos selecionados e pela abordagem escolhida. Os campos em vermelho indicam o melhor desempenho na seleção.
ALGORITMO Melhor atributo
Melhores 02 atributos Melhores 03 atributos Melhores 04 atributos Val. normal CV 10 Val. normal CV 10 Val. normal CV 10 Val. normal CV 10
1 - ChiSquareAttributeEval 75 77 75 76,6 76,9 80,2 80 80,7 2 - FilteredAttributeEval 75 77 75,3 78,1 76,9 80,2 80 80,7 3 - GainRatioAttributeEval 75,6 77,4 75 77,2 75 77 77,2 77,4 4 - InfoGainAttributeEval 75 77 75 78,1 76,9 80,2 80 80,7 5 - OneRAttributeEval 75 77 75 76,6 75 76,4 75 76,6 6 - ReliefFattributeEval 75 77 75 77 75 77 75 77 7 - SVMAttributeEval 74,7 77,2 75,3 77,5 75,3 77,5 75,3 77,5 8- SymmetricalUncertAE 75 77 75,3 78,1 76,8 80,2 78,6 79,6 ALGORITMO Melhores 05 atributos Melhores 06 atributos Melhores 07 atributos Melhores 08 atributos Val. normal CV 10 Val. normal CV 10 Val. normal CV 10 Val. normal CV 10
1 - ChiSquareAttributeEval 79,4 80,7 79,1 80,4 78,3 80,2 79,1 78,4 2 - FilteredAttributeEval 79,4 80,7 79,1 80,4 78,3 80,2 70 78,4 3 - GainRatioAttributeEval 79,7 79,3 79,4 81,1 78,9 79,4 77,5 79 4 - InfoGainAttributeEval 79,4 80,7 79,1 80,4 78,3 80,2 79,1 78,4 5 - OneRAttributeEval 75 76,6 75 76,8 75,8 76,3 75 76,7 6 - ReliefFattributeEval 73,4 76,1 73,9 76,1 72,6 76,2 75,6 76 7 - SVMAttributeEval 74,2 77,1 76,1 76,9 79,7 78,6 80,2 80,4 8- SymmetricalUncertAE 79,4 80,7 79,1 80,4 78,3 80,2 76,9 80,8 ALGORITMO Melhores 09 atributos Melhores 10 atributos Melhores 11 atributos Melhores 12 atributos Val. normal CV 10 Val. normal CV 10 Val. normal CV 10 Val. normal CV 10
1 - ChiSquareAttributeEval 77,8 78,4 77,5 79,8 76,1 78.07 76,9 77,1 2 - FilteredAttributeEval 76,9 78 74,2 79,1 76,1 78 75,8 77,5 3 - GainRatioAttributeEval 77,8 78,4 77,8 78,4 77,8 79 76,1 77,9 4 - InfoGainAttributeEval 76,9 78 74,2 79,1 76,1 78,07 75,8 77,5 5 - OneRAttributeEval 74,5 77,9 71,2 76,1 76,4 76,2 72,3 75,6 6 - ReliefFattributeEval 74,2 76,3 74,2 75,8 69,8 76,3 71,7 75 7 - SVMAttributeEval 79,1 79,6 79,7 78,8 77 80,2 79,4 76 8- SymmetricalUncertAE 77,8 78,4 77,8 78,4 76,7 76,6 76,1 77,9