About half of the population of India depends on agriculture for its livelihood, but its contribution towards the GDP of India is only 14 per cent. One possible reason for this is the lack of adequate crop planning by farmers. There is no system in place to advise farmers what crops to grow. In this paper we present an attempt to predict crop yield and price that a farmer can obtain from his land, by analysing patterns in past data. We make use of a sliding window non-linear regression technique to predict based on different factors affecting agricultural production such as rainfall, temperature, market prices, area of land and past yield of a crop. The analysis is done for several districts of the state of Karnataka, India. Our system intends to suggest the best crop choices for a farmer in order to address the prevailing socio-economic crisis facing many farmers today.