Context aware recommender system has become an area of rigorous research attributing to incorporate context features, thereby increases accuracy while making recommendations. Most of the researches have proved neighborhood based collaborative filtering to be one of the most efficient mechanisms in recommender systems because of its simplicity, intuitiveness and wide usage in commercial domains. However, the basic challenges observed in this area include sparsity of data, scalability and utilization of contexts effectively. In this study, a novel framework is proposed to generate recommendations independently of the count and type of context dimensions, hence pertinent for real life recommender systems. In the framework, we have used k-prototype clustering technique to group contextually similar users to get a reduced and effective set. Additionally, particle swarm optimization technique is applied on the closest cluster to find the contribution of different context features to control data sparsity problem. Also, the proposed framework employs an improved similarity measure which considers contextual condition of the user. The results came from the series of experiments using two context enriched datasets showcasing that the proposed framework increases the accuracy of recommendations over other techniques from the same domain without consuming extra cost in terms of time.