A molecularly imprinted polymer (MIP) sensor was prepared applying electropolymerization of pyrrole monomer in the presence of celecoxib (CXB) as a template molecule on a pencil graphite electrode (PGE) which modified with functionalized multi-walled carbon nanotubes (MWCNTs). The fabrication of sensor and the measurement process were carried out by cyclic voltammetry (CV) and differential pulse voltammetry (DPV) method, respectively. The selection of functional monomer was done using computational method. The optimization of parameters was performed using Plackett–Burman design (PBD), central composite design (CCD), artificial neural network (ANN) and genetic algorithm (GA). First, a Plackett–Burman design as a screening method was applied to estimate positive or negative influences of the factors on the sensor response. In the next step of optimization process, significant factors affecting the performance of the MIP sensor were investigated using CCD. The data from CCD used to train the ANN using Bayesian regularization. The ANN was trained with mean square error (MSE) of 0.0336. The predicted model obtained from the trained ANN was introduced to GA as the fitness function to be optimized. GA optimized the fitness function using the defined constraints. Under the obtained optimal conditions a linear calibration graph in the range 5.0×10−3–20μM was obtained with a calibration correlation coefficient of 0.9985. The limit of detection (3sb/slope) was obtained 2.34×10−3μM. The real sample analysis was performed to determine CXB in pharmaceutical and human serum samples. The repeatability of method (n=3) were obtained 3.03%.