tag:blogger.com,1999:blog-1693014329567144872.post7636916215973029358..comments2023-08-27T06:49:20.658+01:00Comments on The Glowing Python: Combining Scikit-Learn and NTLKJustGlowinghttp://www.blogger.com/profile/17212021288715206641noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-1693014329567144872.post-26853868125352692642018-02-15T04:32:09.165+00:002018-02-15T04:32:09.165+00:00Hi, thanks for posting your work online. I want to...Hi, thanks for posting your work online. I want to use your code to detect outlier in a time-series data. Hence it is an 1D clustering problem. Please help me using your code for such an one dimensional problem.<br /><br />ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-11853731911743080272014-08-04T09:22:04.520+01:002014-08-04T09:22:04.520+01:00Hi Hock, you canàt get the probability with Linear...Hi Hock, you canàt get the probability with LinearSVC. Nut, there are other classifiers, the ones in sklearn.naive_bayes or sklearn.svm.SVC for example, that expose the method predict_proba that gives you what you need.JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-51957647479907690092014-08-04T05:09:05.085+01:002014-08-04T05:09:05.085+01:00How do I output the probability of the predicted i...How do I output the probability of the predicted instead of the classes?hockhttps://www.blogger.com/profile/10309046010042259212noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-27326951846491266182014-03-23T08:22:00.738+00:002014-03-23T08:22:00.738+00:00This comment has been removed by a blog administrator.Anonymoushttps://www.blogger.com/profile/16725708969492646525noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-83949570317959629552014-02-25T19:39:01.157+00:002014-02-25T19:39:01.157+00:00Initializing the classifier this way should work:
...Initializing the classifier this way should work:<br /><br />classif = SklearnClassifier(RandomForestClassifier())JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-26505583748061090602014-02-25T19:16:58.662+00:002014-02-25T19:16:58.662+00:00How would you do this with a Random Forest classif...How would you do this with a Random Forest classifier?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-38845564112024954102013-08-10T22:03:31.760+01:002013-08-10T22:03:31.760+01:00Thank you Ruben, I fixed the code and the report.Thank you Ruben, I fixed the code and the report.JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-82801321433703969282013-08-10T20:47:16.511+01:002013-08-10T20:47:16.511+01:00Oh dear, I have been typing for too long today... ...Oh dear, I have been typing for too long today... Should have been:<br /><br />"for *your example"<br />"you should *switch"<br /><br />I hope I caught all of my errors..Rubenhttps://www.blogger.com/profile/05913984727794050815noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-30559564596069032872013-08-10T20:44:10.912+01:002013-08-10T20:44:10.912+01:00Thank you very much for you example. It was very h...Thank you very much for you example. It was very helpful for getting me started with my experiments.<br /><br />You left a minor error, however: you should witch the order of 'p' and 't_test_skl' when asking for the classification report. The API lists the true labels first and then the predicted labels second:<br /><br />http://scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html#sklearn.metrics.classification_reportRubenhttps://www.blogger.com/profile/05913984727794050815noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-40400704958280802072013-07-23T11:24:21.185+01:002013-07-23T11:24:21.185+01:00thanks rolisz!thanks rolisz!JustGlowinghttps://www.blogger.com/profile/17212021288715206641noreply@blogger.comtag:blogger.com,1999:blog-1693014329567144872.post-64212718418530435632013-07-23T11:23:10.446+01:002013-07-23T11:23:10.446+01:00The link to the NLTK book is broken.
Also, you ca...The link to the NLTK book is broken.<br /><br />Also, you can use train_test_split function to do the random splitting into train/test data in one line. scikit-learn http://scikit-learn.org/stable/modules/generated/sklearn.cross_validation.train_test_split.html#sklearn.cross_validation.train_test_splitroliszhttps://www.blogger.com/profile/00586349535528498987noreply@blogger.com