Subclass the classifier, implement a new "predict" method. 

Sent from my phone. Please forgive brevity and mis spelling



On Feb 23, 2015, 12:26, at 12:26, shalu jhanwar <shalu.jhanwa...@gmail.com> 
wrote:
>Hi guys,
>
>thanks a lot for all your interesting replies.
>
>i) How can I get threshold value which the classifier has decided to
>take
>the decision for a particular sample to be in 0 or 1 class in binary
>classification using scikit? The whole purpose of my previous questions
>were to know about that threshold value (either by visualising it or
>just
>get values)?
>
>ii) Also can I know the threshold values in each iteration which scikit
>used to generate each point on ROC curve using these below lines:
>
>fpr = dict()tpr = dict()roc_auc = dict()for i in range(n_classes):
>    fpr[i], tpr[i], _ = roc_curve
><http://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html#sklearn.metrics.roc_curve>(y_test[:,
>i], y_score[:, i])
>    roc_auc[i] = auc
><http://scikit-learn.org/stable/modules/generated/sklearn.metrics.auc.html#sklearn.metrics.auc>(fpr[i],
>tpr[i])
># Compute micro-average ROC curve and ROC areafpr["micro"],
>tpr["micro"], _ = roc_curve
><http://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html#sklearn.metrics.roc_curve>(y_test.ravel(),
>y_score.ravel())roc_auc["micro"] = auc
><http://scikit-learn.org/stable/modules/generated/sklearn.metrics.auc.html#sklearn.metrics.auc>(fpr["micro"],
>tpr["micro"])
>
>
>I'm just using this default code, but I would like to know about the
>threshold it uses to generate each point of ROC
>
>thanks!
>Shalu
>
>
>
>On Fri, Feb 20, 2015 at 5:27 PM, shalu jhanwar
><shalu.jhanwa...@gmail.com>
>wrote:
>
>> Hi Sebastian,
>>
>> Thanks a lot for your reply. Here in the examples, only 2 features
>are
>> used to generate these plots.
>>
>> i) Can I do it with more features (I have 16 features)?
>>
>> ii) I wanna see the decision boundary of my training and testing
>dataset
>> to see if the model is fine or it's overfitted on my data in case of
>both
>> Random Forest and SVM.
>>
>> iii) What would be the best way to know whether the model is fine or
>> overfitted according to your experience?
>>
>> Many thanks!
>> Shalu
>>
>> On Fri, Feb 20, 2015 at 5:07 PM, Sebastian Raschka
><se.rasc...@gmail.com>
>> wrote:
>>
>>> Hi, Shalu,
>>>
>>> One example for plotting decision regions would be here:
>>>
>http://scikit-learn.org/stable/auto_examples/plot_classifier_comparison.html
>>> It's basically a "brute force" approach: You define 2D grid of
>points and
>>> then classifier each of those points. Also, the downside is that you
>can
>>> only do that in 2D/3D.
>>>
>>> Best,
>>> Sebastian
>>>
>>> > On Feb 20, 2015, at 8:29 AM, shalu jhanwar
><shalu.jhanwa...@gmail.com>
>>> wrote:
>>> >
>>> > Hi guys,
>>> >
>>> > I am using SVM and Random forest classifiers from scikit learn. I
>>> wonder is it possible to plot the decision boundary of the model on
>my own
>>> training dataset so that I can have a feeling of the data? Is there
>any
>>> in-built example available in Scikit which I can refer to view "
>let's say
>>> margins and decision boundary" in SVM in my own data after selecting
>best
>>> model?
>>> >
>>> > I'd appreciate any suggestions.
>>> >
>>> > Thanks!
>>> > Shalu
>>> >
>>>
>------------------------------------------------------------------------------
>>> > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>> > from Actuate! Instantly Supercharge Your Business Reports and
>Dashboards
>>> > with Interactivity, Sharing, Native Excel Exports, App Integration
>&
>>> more
>>> > Get technology previously reserved for billion-dollar
>corporations, FREE
>>> >
>>>
>http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk_______________________________________________
>>> > Scikit-learn-general mailing list
>>> > Scikit-learn-general@lists.sourceforge.net
>>> > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>>>
>>>
>>>
>>>
>------------------------------------------------------------------------------
>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>> from Actuate! Instantly Supercharge Your Business Reports and
>Dashboards
>>> with Interactivity, Sharing, Native Excel Exports, App Integration &
>more
>>> Get technology previously reserved for billion-dollar corporations,
>FREE
>>>
>>>
>http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Scikit-learn-general mailing list
>>> Scikit-learn-general@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>>>
>>
>>
>
>
>------------------------------------------------------------------------
>
>------------------------------------------------------------------------------
>Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>from Actuate! Instantly Supercharge Your Business Reports and
>Dashboards
>with Interactivity, Sharing, Native Excel Exports, App Integration &
>more
>Get technology previously reserved for billion-dollar corporations,
>FREE
>http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Scikit-learn-general mailing list
>Scikit-learn-general@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to