Agriculture is backbone of any country's economy, and also, good crop yield is highly essential for supporting the growing demand of increasing population. By using machine learning, we will be able to predict the crop yield and also the right crop that can be grown in a particular area by analyzing the soil data and the weather data of the particular location. This study mainly focuses on how supervised and unsupervised machine learning approach help in the prediction. Different machine learning algorithms include KNN algorithm, SVM, linear regression, logistic regression, NB, LDA, and decision trees. Taking different dataset preprocessing operation is performed, and missing data are modified so that it does not affect the prediction. Then, the processed data are utilized by the machine learning algorithms for making the prediction. The dataset is divided into training set and test set, and the accuracy of prediction is verified. There are different performance metrics which can be used to evaluate the accuracy in prediction of the algorithms like MSE, MAE, and RMSE, coefficients of determination metrics (R-2), confusion matrix, accuracy, precision, recall, and F1-score.