User Tools

Site Tools


neuroimagen:bioface_atn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
neuroimagen:bioface_atn [2021/09/09 09:18]
osotolongo [What we got so far]
neuroimagen:bioface_atn [2021/09/12 10:23] (current)
osotolongo [Métodos no lineales]
Line 183: Line 183:
 library("ADNIMERGE") library("ADNIMERGE")
 pop <- adnimerge[adnimerge$VISCODE=="bl" & (adnimerge$DX=="Dementia" | adnimerge$DX=="CN"),]; pop <- adnimerge[adnimerge$VISCODE=="bl" & (adnimerge$DX=="Dementia" | adnimerge$DX=="CN"),];
-pop$ND = ifelse(pop$DX == "Dementia", 1, 0)+pop$ND = as.factor(ifelse(pop$DX == "Dementia", 1, 0))
 xt <- pop[, c("Hippocampus", "Entorhinal", "Ventricles", "MidTemp", "AGE", "ICV", "ND")] xt <- pop[, c("Hippocampus", "Entorhinal", "Ventricles", "MidTemp", "AGE", "ICV", "ND")]
 </code> </code>
Line 206: Line 206:
  
 <code> <code>
 +setwd("/home/data/bioface")
 base <- read.csv("bf_data.csv") base <- read.csv("bf_data.csv")
 base$Hippocampus = base$Left.Hippocampus + base$Right.Hippocampus base$Hippocampus = base$Left.Hippocampus + base$Right.Hippocampus
Line 227: Line 228:
  
  
 +^ Clasificación ^ Probabilidades de N+ ^
 +| {{ :neuroimagen:bioface_nplus_classifier.png?600 | my pretty cool neurodegeneration classifier output }} | {{ :neuroimagen:nplus_probabilities_histogram.png?600 | how the probabilities are distributed? }} |
  
 +Y esto voy a hacerlo para FACEHBI también para compararlo,
  
 +<code>
 +setwd("/home/data/facehbi")
 +read.csv("face_data.csv") -> face
 +face$Hippocampus = face$Left.Hippocampus + face$Right.Hippocampus
 +face$Entorhinal = face$lh.entorhinal.GrayVol + face$rh.entorhinal.GrayVol
 +face$Ventricles <- face$Left.Inf.Lat.Vent + face$Right.Inf.Lat.Vent + face$Left.Lateral.Ventricle + face$Right.Lateral.Ventricle
 +face$MidTemp = face$lh.middletemporal.GrayVol + face$rh.middletemporal.GrayVol
 +face$ICV = face$eTIV
 +face$ND <- predict(classifier_cl, newdata = face)
 +face$post <- predict(classifier_cl, newdata = face, type="raw")
 +</code>
 +
 +^ Clasificación ^ Probabilidades de N+ ^
 +| {{ :neuroimagen:facehbi_nbayes_classifier.png?600 | my pretty cool neurodegeneration classifier output (FACEHBI)}} | {{ :neuroimagen:facehbi_nplus_prob_histogram.png?600 |how the probabilities are distributed?}} |
 +
 +==== Métodos no lineales ====
 +
 +Vamos a intentar con métodos no lineales. Ojo, estos  métodos no tienen interpretación probabilistica. Son construcciones matemáticas que funcionan.
 +
 +=== random Forest ===
 +
 +** BIOFACE **
 +<code>
 +rf_cl <- randomForest(ND ~ ., data = xt, na.action = na.omit)
 +base$ND <- predict(rf_cl, newdata = base)
 +base$post <- predict(rf_cl, newdata = base, type="prob")
 +plot(base$AGE, base$Hippocampus, main = "Hippocampus Volume versus Age", xlab="Age", ylab="HV", pch=19, col=ifelse(base$ND==1,"red","green"))
 +hist(base$post[,2], col="red", density = 50, probability=TRUE, breaks = 10, main="Probabilities profile", xlab = "Probability of N+")
 +</code>
 +
 +^ Clasificación ^ Probabilidades de N+ ^
 +| {{ :neuroimagen:rf_classifier_bioface.png?600 |}} | {{ :neuroimagen:rf_prob_profile_bioface.png?600 |}} |
 +
 +**FACEHBI** 
 +
 +<code>
 +face$ND <- predict(rf_cl, newdata = face)
 +face$post <- predict(rf_cl, newdata = face, type = "prob")
 +plot(face$AGE, face$Hippocampus, main = "Hippocampus Volume versus Age", xlab="Age", ylab="HV", pch=19, col=ifelse(face$ND==1,"red","green"))
 +hist(face$post[,2], col="red", density = 50, probability=TRUE, breaks = 10, main="Probabilities profile", xlab = "Probability of N+")
 +</code>
 +
 +^ Clasificación ^ Probabilidades de N+ ^
 +| {{ :neuroimagen:rf_classifier_facehbi.png?600 |}} | {{ :neuroimagen:rf_prob_profile_facehbi.png?600 |}} |
 +
 +=== support-vector machine ===
 +
 +**BIOFACE**
 +
 +<code>
 +svm_cl <- svm(ND ~ ., data = xt, na.action = na.omit)
 +base$ND <- predict(svm_cl, newdata = base)
 +plot(base$AGE, base$Hippocampus, main = "Hippocampus Volume versus Age", xlab="Age", ylab="HV", pch=19, col=ifelse(base$ND==1,"red","green"))
 +</code>
 +
 +{{ :neuroimagen:svm_classifier_bioface.png?600 |}}
 +
 +** FACEHBI **
 +
 +<code>
 +face$ND <- predict(svm_cl, newdata = face)
 +plot(face$AGE, face$Hippocampus, main = "Hippocampus Volume versus Age", xlab="Age", ylab="HV", pch=19, col=ifelse(face$ND==1,"red","green"))
 +</code>
 +
 +{{ :neuroimagen:svm_classifier_facehbi.png?600 |}}
neuroimagen/bioface_atn.1631179108.txt.gz · Last modified: 2021/09/09 09:18 by osotolongo