Lung cancer is one of the major reasons for the death if it is not diagnosed in the early stages of cancer. It is the one among the most dreadful disease which affects in the lungs function. It can be identified only after the disease spread into the deeper parts of the lungs and then only it will make a life threading problem. Lung cancer prognosis which was done based on the various parameters such as age, sex, condition of smoking, duration of smoking and count of smoking per day. The proceedings were done using the algorithm for the time to first cigarette after awakening which is represented as TTFC. The expert doctor says that the back-propagation network is a great deal in the recognition of the lung cancer without any involvement by them. This research is based on the classification of lung cancer and its stages using the establishment of the BPN and predicts the recurrence. Similarly, with this BPN, an algorithm that is inspired from its habitat known as ant lion optimization algorithm is also used in the optimization of weights and parameters of the BPN. The use of the ALO algorithm provides an improved convergence mechanism by improving the proposed technique's accuracy. The use of this proposed method with the BPN optimizes the network and the ALO optimizer provides an accurate prediction of the lung cancer by the earlier stage and even predicts the changes for reoccurrence after diagnosis. The prognosis analysis was made by the various comparative study between the characteristic features of HIV and the unaffected person using the algorithm such as the Wilcoxon rank-sum test. This algorithm will continuously classify the viral load and CD4 count which is based on factors such as age, sex, and smoking activities. It will be useful for early diagnosis and future prediction. Lung cancer rates can be analyzed based on the incident rates of affected and unaffected persons to HIV infections.