{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5086","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5086/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5086/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5086/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/5086","id":99078505,"number":5086,"title":"CountVectorizer for  analyzer='char', for \"Bernoulli - Naive Bayes\" not detect trigrams from training set","user":{"login":"Sandy4321","id":11426119,"avatar_url":"https://avatars.githubusercontent.com/u/11426119?v=3","gravatar_id":"","url":"https://api.github.com/users/Sandy4321","html_url":"https://github.com/Sandy4321","followers_url":"https://api.github.com/users/Sandy4321/followers","following_url":"https://api.github.com/users/Sandy4321/following{/other_user}","gists_url":"https://api.github.com/users/Sandy4321/gists{/gist_id}","starred_url":"https://api.github.com/users/Sandy4321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sandy4321/subscriptions","organizations_url":"https://api.github.com/users/Sandy4321/orgs","repos_url":"https://api.github.com/users/Sandy4321/repos","events_url":"https://api.github.com/users/Sandy4321/events{/privacy}","received_events_url":"https://api.github.com/users/Sandy4321/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-04T22:52:30Z","updated_at":"2015-08-05T06:56:58Z","closed_at":null,"body":"count_vectorizer = CountVectorizer(binary=False, analyzer='char', ngram_range=(3,4), stop_words=None) #binary='true')\r\n\r\nfor file\r\n\r\n\r\n1\tsomeone\ten\tBulldog\r\n1\tsomeone\ten\tBulldog\r\n1\tsomeone\ten\tBulldog\r\n1\tsomeone\tes\tQQQQ\r\n1\tsomeone\tes\tQQQQ\r\n1\tsomeone\tes\tQQQQ\r\n1\tsomeone\tes\tQQQQ\r\n\r\n\r\n\r\nso I train\r\n\r\n    print(\"Bernoulli - Naive Bayes\")\r\n    classifier = BernoulliNB().fit(x_train,y_train)\r\n    y_predicted = classifier.predict(x_test)\r\n\r\nthen I test for bulldog and dog\r\nPlease enter sentence to test language identification. \\q to quit: Bulldog\r\nYou entered: Bulldog\r\nBulldog  is English\r\nPlease enter sentence to test language identification. \\q to quit: dog\r\nYou entered: dog\r\ndog  is NOT English\r\n\r\nSO DOG IS NOT DETECTED CORRECTLY\r\n\r\n\r\nIn short problem is: I use Bernoulli - Naive Bayes for language identification and gives for train 2 words \r\nBulldog and QQQQ, then I give short word dog and expect to classify it is English,\r\n since it is the part of English word from training, which consists this trigram dog\r\nbut this word is not detected correctly\r\n\r\nActually there is another big problem but this toy example show something wrong generally?"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/127894827","html_url":"https://github.com/scikit-learn/scikit-learn/issues/5086#issuecomment-127894827","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5086","id":127894827,"user":{"login":"larsmans","id":335383,"avatar_url":"https://avatars.githubusercontent.com/u/335383?v=3","gravatar_id":"","url":"https://api.github.com/users/larsmans","html_url":"https://github.com/larsmans","followers_url":"https://api.github.com/users/larsmans/followers","following_url":"https://api.github.com/users/larsmans/following{/other_user}","gists_url":"https://api.github.com/users/larsmans/gists{/gist_id}","starred_url":"https://api.github.com/users/larsmans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsmans/subscriptions","organizations_url":"https://api.github.com/users/larsmans/orgs","repos_url":"https://api.github.com/users/larsmans/repos","events_url":"https://api.github.com/users/larsmans/events{/privacy}","received_events_url":"https://api.github.com/users/larsmans/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T06:56:58Z","updated_at":"2015-08-05T06:56:58Z","body":"It's not clear to me what your training set looks like. Please show a [complete script](http://www.sscce.org/) that we can use to reproduce the error."}}