This paper presents a novel pricing method for maximizing the profit of a cloud provider. Mostly, there are three different instances (on-demand, reserved, and spot instances) in big cloud providers. Each instance has its own characteristics. A user may choose one of the instances regarding his requirements and instance types. In this paper, different characteristics of instance types have been extracted as “features”. A sample initial data including users’ features and their subsequent choices on instances has been considered. By providing the sample initial data and using neural network to learn the effect of features on the chosen instance types, the feature weights is obtained. While data of new users’ features is given to the neural network, with respect to price sensitivity of users, the users’ preference for using each instance type can be achieved. Finally, optimum prices of instances for having highest profit for the provider have been achieved by using undefined particle swarm optimization (UPSO).