How to implement Leave-One-Out with scikit learn - scikit-learn

I would like to implement Leave-one-out CV with scikit learn, but do not understand the guidelines on scikit learn internet site. I have 10 articles classified into two classes, five articles in each class. Do not know how to proceed after importing the articles with load_files option.
Some brainstorming would be appreciated.
Thanks

Related

Tensorflow and Bert What are they exactly and what's the difference between them?

I'm interested in NLP and I come up with Tensorflow and Bert, both seem to be from Google and both seem to be the best thing for Sentiment Analysis as of today but I don't understand what are they exactly and what is the difference between them... Can someone explain?
Tensorflow is an open-source library for machine learning that will let you build a deep learning model/architecture. But the BERT is one of the architectures itself. You can build many models using TensorFlow including RNN, LSTM, and even the BERT. The transformers like the BERT are a good choice if you just want to deploy a model on your data and you don't care about the deep learning field itself. For this purpose, I recommended the HuggingFace library that provides a straightforward way to employ a transformer model in just a few lines of code. But if you want to take a deeper look at these models, I will suggest you to learns about the well-known deep learning architectures for text data like RNN, LSTM, CNN, etc., and try to implement them using an ML library like Tensorflow or PyTorch.
Bert and Tensorflow is not different thing , There are not only 2, but many implementations of BERT. Most are basically equivalent.
The implementations that you mentioned are:
The original code by Google, in Tensorflow. https://github.com/google-research/bert
Implementation by Huggingface, in Pytorch and Tensorflow, that reproduces the same results as the original implementation and uses the same checkpoints as the original BERT article. https://github.com/huggingface/transformers
These are the differences regarding different aspects:
In terms of results, there is no difference in using one or the other, as they both use the same checkpoints (same weights) and their results have been checked to be equal.
In terms of reusability, HuggingFace library is probably more reusable, as it is designed specifically for that. Also, it gives you the freedom of choosing TensorFlow or Pytorch as deep learning framework.
In terms of performance, they should be the same.
In terms of community support (e.g. asking questions in github or stackoverflow about them), HuggingFace library is better suited, as there are a lot of people using it.
Apart from BERT, the transformers library by HuggingFace has implementations for lots of models: OpenAI GPT-2, RoBERTa, ELECTRA, ...

How to build Classifiers which is used in creating the models?

I was going through the tutorial of speech emotion recognition and in between saw an "MLPClassifier(Multilayer_perceptron)" which was imported from the sklearn. And there are lots of other like Random forest and linear Regression, standardscalar, GridSearchCV, etc. I was searching for tutorials or steps to how can I create these types of classifiers or modules on my own?
When I searched regarding these, I was getting examples of tutorials of the use cases of predefined classifiers of sklearn and third party claassifiers. Like above specified.
If you guys know any tutorial or steps to achieve these please suggest to me.
Fro MLP, The implementation is quite easy, there is good explanation on how to implement on the Coursera's ML introdcution look to week 4 and week 5, for Linear and logistic regression look to week 2 and week 3. Look at this link for implementing CART, random forests are quite similar I think you can figure out how to implement them easily if you are able to implement CART. For SVM and kernel methods you can look to this repo

Replicating Semantic Analysis Model in Demo

Good day, I am a student that is interested in NLP. I have come across the demo on AllenNLP's homepage, which stated that:
The model is a simple LSTM using GloVe embeddings that is trained on the binary classification setting of the Stanford Sentiment Treebank. It achieves about 87% accuracy on the test set.
Is there any reference to the sample code or any tutorial that I can follow to replicate this result, so that I can learn more about this subject? I am trying to obtain a Regression Output (Instead of classification).
I hope that someone can point me in the right direction.. Any help is much appreciated. Thank you!
AllenAI provides all code for examples and lib opensource on Git, including AllenNLP.
I found exactly how the example was run here: https://github.com/allenai/allennlp/blob/master/allennlp/tests/data/dataset_readers/stanford_sentiment_tree_bank_test.py
However, to make it a Regression task, you'll have to tweak directly on Pytorch, which is the underlying technology for AllenNLP.

Keras layers explaination

I want to get a deep idea about how this keras layers works in a model. What does each layer doing in the model etc. I followed kers documentation and information isn't enough. If any of you know place to get more knowledge let me know.Thanks in advance
Keras layers are widely used CNN, DNN and RNN layers. There is atleast one research paper for each of them and there is a lot of educational material out there. If you are really curious you could look at keras' code. Some links for you:
https://github.com/keras-team/keras/tree/master/keras/layers
http://cs231n.github.io/convolutional-networks/
https://leonardoaraujosantos.gitbooks.io/artificial-inteligence
http://www.jmlr.org/papers/volume15/srivastava14a/srivastava14a.pdf

Support Vector Machine Example

Could anyone give me an Example in detail which show how SVM exactly work with all the necessary Mathematics?
As I tried to search in the internet and found very little example about SVM.
Thank you.
You can watch the stanford lectures on machine learning from lectures 6 to 8. Its on youtube. It teaches you everything on SVM and the mathematics involved in SVM. Have a look at it..

Resources