Entering edit mode
3.8 years ago
manojkumarbioinfo
▴
100
Hi, I'm new to machine learning. I have trained my data to separate my data as heart and eye. while testing it I cant able to extract the data which is predicted as eye and heart for example if my test data of row 1 is predicted as eye means I want all the data in the row of that. can anyone help me with it. I have given the code and my input data below
> library(neuralnet)
> library(readxl)
> Test_run <- read_excel("Test_run.xlsx")
> View(Test_run)
> data =data.frame(Test_run)
> data$Heart=data$Disease=="Heart"
> data$Eye=data$Disease=="Eye"
> View(data)
> data.train.idx <- sample(x = nrow(data), size = nrow(data)*0.8)
> data.train <- data[data.train.idx,]
> data.valid <- data[-data.train.idx,]
> library(neuralnet)
> View(Test_run)
> View(data)
> data.net <- neuralnet(Eye+Heart ~ SIFT_converted_rankscore + Polyphen2_HDIV_rankscore + LRT_converted_rankscore + MutationTaster_converted_rankscore + MutationAssessor_score + FATHMM_converted_rankscore + PROVEAN_converted_rankscore + VEST3_score + MetaSVM_rankscore + MetaLR_rankscore + MCAP_rankscore + CADD_phred + DANN_score + fathmmMKL_coding_score + GERP_RS + phyloP100way_vertebrate_rankscore + phyloP20way_mammalian_rankscore + phastCons100way_vertebrate_rankscore + phastCons20way_mammalian_rankscore + SiPhy_29way_logOdds_rankscore + CB_MA + CB_Z + ClosestCRX + Cornea_MA + Cornea_Z + Exons + Iris_MA + Iris_Z + Lens_MA + Lens_Z + ONH_MA + ONH_Z + ON_MA + ON_Z + PeakCount + PeakSum + RPE_Choroid_MA + RPE_Choroid_Z + Retina_MA + Retina_Z + Sclera_MA + Sclera_Z + TM_MA + TM_Z + adipose_fpkm + adrenal_fpkm + brain_fpkm + breast_fpkm + colon_fpkm + heart_fpkm + human_retina_sra_fpkm + kidney_fpkm + liver_fpkm + lung_fpkm + lymph_node_fpkm + maxLength + ovary_fpkm + prostate_fpkm + skeletal_muscle_fpkm + testes_fpkm + thyroid_fpkm + white_blood_cells_fpkm + retDiff + Z_score, data=data.train, hidden=c(15,10), rep = 15, err.fct = "ce", linear.output = F, lifesign = "minimal", stepmax = 1000000, threshold = 0.001)
> plotdata.net, rep="best")
> data.prediction <- computedata.net, data.valid[-65:-67])
> idx <- apply(data.prediction$net.result, 1, which.max)
> predicted <- c('Eye', 'Heart')[idx]
> table(predicted,data.valid$Disease)
Output
predicted Eye Heart
Eye 54 1
Heart 0 22
Input file https://drive.google.com/file/d/1SmucxdaJklQxPejMtxLomqpOA7K2uQdp/view?usp=sharing