Skip to main content

Kaggle Dataset Analysis : Is your Avocado organic or not?

Hey readers! Today, allow me to present you yet another dataset analysis of a rather gluttony topic, namely Avocado price analysis.

This Data set represents the historical data on avocado prices and sales volume in multiple US markets.



Our prime objectives will be to visualize the dataset, pre-process it and ultimately test multiple sklearn classifiers to checkout which one gives us the best confidence and accuracy for our Avocado's Organic assurance!

Note : I'd like to extend the kernel contribution to Shivam Negi. All this code belongs to him.

Data Visualization

This script must procure the following jointplot 




While a similar joint plot can be drawn for conluding the linearly exponent relations between extra large bags and the small ones.





Pre Processing

The following script has been used for pre processing the input data.




Model Definition and Comparisons

We will be looking mostly at three different models, namely random forest classifiers, KNN and our good old SVM.

Obviously, the Grid search optimization has been used for best results.

Random Forest Classifier





You can see that our model is giving (false positive) + (false negatives) = 3. Total 3 inaccurate predictions which is pretty awesome.



KNN Classifier




So, the performance drops by a total 0f 0.02, not bad at all!
For The SVM Part, I'd recommend that you visit the kernel itself (Link is at the top)

Conclusion

In the end, I would just like to say that we have tried Random Forest Classifier, KNN and SVM but most efficient among them is Random Forest Classifier giving 100% accuracy, KNN is also not too bad as it has 98% accuracy but Support Vector Classifier(SVC) is not that much efficient in predicting the values having only 54% accuracy for conventional and 100% accuracy for organic type. Recommended Model for prediction of TYPE(coventional and organic categories) columns is Random Forest Classifier.

Comments

Total Pageviews

Popular posts from this blog

Tackling MNIST Dataset : Deep Convolutional Neural Network 99.571% accurate

Hey there! My dear readers.  Today this kernel review is going to be about the famous MNIST data-set, one of the most famous introductory datasets which we encounter along side Iris dataset and the titanic survival challenge data sets.  Since it is a competition kernel, I have decided not to make it public. (yet) Also,  if you want to try your hands at the challenge itself, then you can find the challenge page here :  Note: This kernel has been largely focused on network modelling rather than Exploratory Data Analysis because it's simple, classic stuff. Still, I will try my best to explain that stuff here. Exploratory Data Analysis First indication of a great dataset is the face that it gives all the mentioned labels equal rows in it and this one doesn't disappoint. This data set maintains a fair 4000+ entries per label which actually is a great statistic for a good dataset. And the next thing one needs to know is how...

Datasets by Microsoft Research now available in the cloud : Microsoft announces open Datasets!

Hey Readers, today I bring forth an exciting news for you all aspiring data scientists and machine learners! Something new happened in Microsoft Research Blog :  The Microsoft Research Outreach team has worked extensively with the external research community to enable adoption of cloud-based research infrastructure over the past few years. Through this process, we experienced the ubiquity of Jim Gray’s fourth paradigm of discovery based on data-intensive science – that is, almost all research projects have a data component to them. This data deluge also demonstrated a clear need for curated and meaningful datasets in the research community, not only in computer science but also in interdisciplinary and domain sciences. Today we are excited to launch  Microsoft Research Open Data  – a new data repository in the cloud dedicated to facilitating collaboration across the global research community. Microsoft Research Open Data, in a single, convenient, cloud-hosted ...