Agriculture contributes significantly to India’s economy. The most serious threat to food security is population growth. Population growth increases demand, forcing farmers to produce more to increase supply. Crop yield prediction technology can help farmers to increase their output. Optimal fertilizer dose are required for boosting oilseed crop yield cultivation. However, when nutrients are scarce or overfertilization occurs, yields are considerably lowered and the environmental burden is increased. To address these issues, our proposed work employs machine learning techniques in the prediction of crop yield using inorganic fertilizer as well as the amount and type of agricultural fertilizer to be used for a specific crop in various districts of Tamil Nadu. Actual yield data from 1961 to 2007 is used as a training set, and data from 2008 to 2019 is used as a validation set. The results of the proposed algorithm are compared with those of the other machine learning algorithms namely random forest, linear regression, support vector machine, and naive bayes with an accuracy rate of 94%, 91.33%, 88.4% and 75.56% respectively are observed. According to the study, random forest results outperform other algorithms for crop yield prediction, and the decision tree algorithm works better for recommendation systems. The research also helps farmers by providing a recommendation system for determining which crop to plant and which type of inorganic fertilizer and how much quantity of fertilizer to use in a specific area and time. The proposed study also seeks to examine different observations for each method by changing parameters to see if the varying parameter influences the accuracy rate or not.