I am working on binary classification problem, I try to evaluate the performance of some classification algorithms (LR,Decission Tree , Random forest ...). I am using a 10 fold cross-validation technique (to avoid over-fitting) with AUC ROC as scoring function to compare the performance of the algorithms, but I am getting a weird results with Random forest and AdbBoost, I have a perfect AUC_ROC score (i.e. =1) despite the fact that the Recall(TPR) and FPR of this algorithms are different from 1 and 0 respectively .
I am working on binary classification problem, I try to evaluate the performance of some classification algorithms (LR,Decission Tree , Random forest ...). I am using  a cross validation technique (to avoid over-fitting) with AUC ROC as scoring function to compare the performance of the algorithms, but I am getting a weird results with Random forest and AdbBoost, I have a perfect AUC_ROC score (i.e. =1) despite the fact that the recall(TPR) and FPR of this algorithms are different from 1 and 0 respectively .  def FPR(y_true, y_pred):     tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel()     result = fp / (fp+tn)     return result def FNR(y_true, y_pred):     tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel()     result = fn / (tp+fn)     return result FPR_scorer = make_scorer(FPR) FNR_scorer = make_scorer(FNR)     def get_CrossValResults2(model,cv_rst,bestIndx):     best=pd.DataFrame.from_dict(cv_rst).iloc[bestIndx]     roc=&quot;{:.12f}&quot;.format(best['mean_test_roc_auc'])     acc =&quot;{:.0%}&quot;.format(best['mean_test_accuracy'])     prec =&quot;{:.0%}&quot;.format(best['mean_test_precision'])     rec =&quot;{:.0%}&quot;.format( best['mean_test_recall'])     f1 =&quot;{:.0%}&quot;.format(best['mean_test_f1'])     r2=&quot;{:.2f}&quot;.format(best['mean_test_r2'])     g_mean=&quot;{:.2f}&quot;.format(best['mean_test_gmean'])     pr_auc=&quot;{:.8f}&quot;.format(best['mean_test_pr'])     fnr=&quot;{:.0%}&quot;.format(best['mean_test_fnr'])     fpr=&quot;{:.0%}&quot;.format(best['mean_test_fpr'])     rst = pd.DataFrame([[ model, acc,prec,rec,fpr,fnr,f1,roc,pr_auc,g_mean,r2]],columns = ['Model', 'Accuracy', 'Precision', 'Recall','FPR','FNR', 'F1-Score','ROC_auc','PR_auc','gmean','r2'])     return rst        cross_val_rst = pd.DataFrame(columns = ['Model', 'Accuracy', 'Precision', 'Recall','FPR','FNR', 'F1-Score','ROC_auc','PR_auc','gmean','r2'])              scoring = {'accuracy':'accuracy','recall':'recall','precision':'precision','fpr':FPR_scorer,'fnr':FNR_scorer,'f1':'f1' ,'roc_auc':'roc_auc','pr':'average_precision','gmean':Gmean_scorer,'r2':'r2'}     param_grid = {'n_estimators': [200],               'max_depth': [80,90],               'min_samples_leaf': [2,3, 4],             'min_samples_split': [2,5,12],             'criterion': [ 'gini'],              'class_weight' : [class_weights], 'n_jobs' : [-1]}  clf = GridSearchCV(RandomForestClassifier(class_weight=class_weights), param_grid, cv=kfold,scoring=scoring,refit=refit)#Fit the model bestmodel = clf.fit(X,Y)       cross_val_rst = cross_val_rst.append(get_CrossValResults2(model='Random Forrest',bestIndx=bestmodel.best_index_,cv_rst=bestmodel.cv_results_),ignore_index=True)
Local explanation of the Aharonov-Bohm effect in terms of force fields Here is an interesting paper for the Physics SE community:      On the role of potentials in the Aharonov-Bohm effect. Lev Vaidman. .  [quant-ph].   You should check it out because it's an amusing read, but I will summarise the argument to whet your appetite, assuming you have basic familiarity with the . In the traditional AB setup, one considers an electron in a superposition of paths, taking it in two opposite directions around a solenoid treated as a classical source of the electromagnetic field. The observable relative phase acquired between the electron's paths is attributed to the influence of the magnetic vector potential on the electron, which cannot be globally gauged away - despite the absence of a physical field anywhere along the electron's path(s) - due to a topological obstruction.  Instead, Vaidman considers the effect of the electron on the sources of the field, treating the latter as quantum particles. He shows that the relative phase between the two branches of the wavefunction can be considered as arising from the action of the physical field of the electron, which is not zero at the position of the sources. However, Vaidman uses highly contrived gedankenexperiments and completely semi-classical arguments, which begs a pair of concrete and related questions.  1) Can Vaidman's first, electric AB effect gedankenexperiment be described in a fully quantum manner, by solving (at least approximately) the three-particle Schroedinger equation? If not, why not?  2) Is it possible to explain within this formalism the experiments of Tonomura et al. (), who used a superconductor to completely shield the magnetic field of the source? US Customs when coming through Canada I have an upcoming trip where I will be flying to and from Copenhagen, through Toronto.  I notice that my departure and return gate in the Philadelphia airport is not in the international terminal.  Where will I clear customs? Should initial e's after h-dropping be capitalized? A new Victorian-set British novel begins sentences containing h-dropping with lower-case e's, as in " 'e took my money, 'e did." This seems incorrect but I'm at a loss to find the rule. ‘And what on earth’s a Squib?’ said Harry.   To his surprise, Ron stifled a snigger.   ‘Well – it’s not funny really – but as it’s Filch ...’ he said. ‘A Squib is someone who was born into a wizarding family but hasn’t got any magic powers. Kind of the opposite of Muggle-born wizards, but Squibs are quite unusual. If Filch’s trying to learn magic from a Kwikspell course, I reckon he must be a Squib. It would explain a lot. Like why he hates students so much.’ Ron gave a satisfied smile. ‘He’s bitter.’   Chamber of Secrets - pages 110-111 - British Hardcover   If a Squib is 'kind of the opposite of a Muggle-born wizards' wouldn't that make a Squib more Muggle than wizard? Does a Muggle strictly have to be born to Muggle parents to be considered a Muggle, or can the lack of magic render a person, even of wizarding parentage, a Muggle?  Hermione can say in all truthfulness that she is a 'Muggle-born witch.' The nickname (albeit derogatory) for a Muggle-born is 'Mudblood.' Filch can say in all truthfulness that he is a 'wizarding-born non-magic person,' which, according to Hagrid is a Muggle.  'Squib' may be derogatory in the same way as 'Mudblood' is. Neville laments his family thought he was a Squib when he showed no magical tendencies as a child; the Longbottoms were so rattled at the thought of Neville being a Squib that they, among other things, threw him out a second-story window to see if he would bounce. So could 'Squib' actually be a derogatory term meaning the opposite of 'Mudblood'? After all, the Ministry doesn't allow Squibs to register as magical beings, and many Squibs are schooled and trained in Muggle professions. Squibs don't get a Hogwarts letter.    Wizards can be born to Muggles. Can Muggles be born to wizards?  ETA 11.22.14: In regard to this question, I was glancing through Philosopher's Stone, and I came across this, that Neville said:     ‘Well, my gran brought me up and she’s a witch,’ said Neville, ‘but the family thought I was all Muggle for ages. My great-uncle Algie kept trying to catch me off my guard and force some magic out of me – he pushed me off the end of Blackpool pier once, I nearly drowned – but nothing happened until I was eight.’   Philosopher's Stone - page 93 - Bloomsbury - chapter seven, The Sorting Hat   Could what Neville says contribute to the theory and/or conclusion that Squibs are, or are not, Muggles? How do we apply what Neville said? Help us test the shiny new "User Activity" page! (Plus a bunch of new features.) Is there any standard notation for specifying dimension of a matrix after the matrix symbol? I want to explicitly specify dimension of matrices in some expressions, something like   $$\boldsymbol{A}_{m \times n} \boldsymbol{B}_{n \times m} = \boldsymbol{C}_{m \times m} \, .$$  Is there any more or less standard notation for this?    While this notation is generally unambiguous, I think it become ambiguous, for example, in the following case. Suppose that I have some column or row vector which is conjugate transpose of correspondingly row or column vector. If I write it in the following way  $$\boldsymbol{A}_{n \times 1}^{\dagger} \, ,$$ we can have 2 different interpretations:   matrix $\boldsymbol{A}_{n \times 1}$ is $n \times 1$ column vector and by $\boldsymbol{A}_{n \times 1}^{\dagger}$ I'm referring to its conjugate transpose which is $1 \times n$ row vector; matrix $\boldsymbol{A}_{n \times 1}^{\dagger}$ itself is $n \times 1$ column vector which is conjugate transpose of $1 \times n$ row vector $\boldsymbol{A}$. Im trying to run the following code  \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{width = 7cm, compat = 1.8} \begin{document} \begin{tikzpicture} \begin{axis}[domain = -2:2, domain y = 0:2*pi] \addplot3[contour gnuplot = {output point meta = rawz, number=10, labels=false}, samples = 41, z filter/.code=\def\pgfmathresult{-1.6}] {exp(-x^2) * sin(deg(y))}; \addplot3[surf, samples = 25] {exp(-x^2) * sin(deg(y))}; \end{axis} \end{tikzpicture} \end{document}   and I'm getting the error  Package pgfplots Error: sorry, plot file{Utitlled_contourmp0.table} could not be opened   through a quick search I found out that contour maps require pgfplots and gnuplot to talk to each other. In theory the way to make them interact is adding  !TEX option = --enable-write18   or   %!TEX option = --enable-escape   at the top of the file. Unfortunately this has not worked for me. Any suggestions? If $I$ and $J$ are ideals in a ring $R$ with $1$ such that $I+J = R$, show that $I^m$ and $J^n$ are co-maximal for all $m,n \in \mathbb{N}$ If $I$ and $J$ are ideals in a ring $R$ with 1 which are  co-maximal, i.e $I+J = R$, show that $I^m$ and $J^n$ are co-maximal for all $m,n$ in $\mathbb{N}$  Work done:     Should I proceed using    By taking $$K=I^m+J^m \neq R$$  Let $$S=\{I,J \in R \mid I^m+J^n \neq R \}$$ be the required partially order set ordered by inclusion then  $$I+J \subseteq I^n+J \subseteq I^n+J^m \subseteq \ldots $$  Then, I think this chain doesn't have an upper bound...as $I^m+J^n \neq R$ for all $ m,n \in \mathbb N$. Am I right??  Thanks for any help!! MongoDB could not connect local server I had mongdb installed and evrything was working fine. I wanted to delete the mongodb lock. By mistake the directory /var/lib/mongodb/ got deleted.  So, I uninstalled mongo db and installed again. But now i always keep getting this error:  Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145 exception: connect fail   The error remains same even if I try to login from terminal or rockmongo or my application. I am using ubuntu12.04 and have latest version of mongo. Prove for any $a&gt;1$ there exist a natural number, $N$, such that $a^n&gt;n$ for all $n \ge N$  My attempt:  By definition, for $N$ to be a natural number $1\le N \le ∞$ for any integer $N$.  By induction, the base case $n=1$ is true because $a^1&gt;1$ which is true.  Now assume that $a^k&gt;k$ is true, then it is also true for $n= k+1$.  Hypothesis  $a^{k+1}&gt;k+1$  Now I am not sure if I am on the right track i am finding nowhere a solution I am running UBUNTU 12.04 and using GNOME desktop, which I installed additionally. Logging into classic GNOME I see the following:     WHAT is this "earth globe" icon coming from?Seems to be named "starter". It is configured to open a website, from my bookmarks. WHY is it not showing the TIME?   Using dconf-editor I had no luck in answering the above questions.  Any idea? Why can a discontinuous function not be differentiable? Distance between two hyperplanes I have two parallel hyper planes $$a^Tx=b_1,a^Tx=b_2$$ where $a \in \mathbb{R}^n, x \in \mathbb{R}^n ,b \in \mathbb{R}$ and I want to find the distance between the two. I have read that the distance between the two hyperplanes is also the distance between the two points $x_1$ and $x_2$ where the hyperplane intersects the line through the origin and parallel to the normal vector $\vec a$. These points are given by $$x_1=\frac{b_1}{\|a\|^2_2}a$$ and $$x_2=\frac{b_2}{\|a\|^2_2}a$$ Then the distance is $|x_1-x_2|$ but I don't really understand how we got $x_1$ and $x_2$. What desktop environments can group window icons in the taskbar like Windows 7? I find it much faster to identify a window in the taskbar (window list) by its icon,    rather than by its text:    The problem with most graphical interfaces I've  is that they don't group windows, and if you have more terminals or file managers, they'll just clutter the taskbar and you won't know which is which. Windows 7 offers a relatively elegant solution to this by grouping similar window icons together.  Question: What Linux  have this functionality? If addons exist that provide it, that's alright.  For reference, a Cinnamon applet that sort of does this is . $2 \otimes_{R} 2 + x \otimes_{R} x$ is not a simple tensor in $I \otimes_R I$ Trying to show that $\ln(x) = \lim_{n\to\infty} n(x^{1/n} -1)$ How do I show that $\ln(x) = \lim_{n\to\infty} n (x^{1/n} - 1)$?  I ran into this identity on . I haven't been able to find any proof online and my efforts to get from $\ln(x) := \int_1^x \frac{\mathrm dt}t$ to that limit have been a failure. In my case I'm talking about Assassin's Stance, but I'd like to know the answer for stances in general.  I feel like I might be missing something incredibly obvious caused by missing a word or two (or a paragraph), but I can't find anything that explicitly states whether or not I can use the Tome of Battle stances with ranged weapons like the bow (or crossbow).  I realize that half the classes have "blade" in their names so using ranged weapons is not in the spirit of things, but I'm looking for an explicit answer (or as close to one as possible) from any WotC official resource. If this has already been answered I'm sorry, but I could not find the answer myself from searching. Code snippets for methods in Visual Studio I have been attempting to solve this integral for several days in preparation for an exam and keep reaching dead ends.  I(a,b) = $\int_0^{\pi/2} \ln(a^{2}\cos^2(x)+b^{2}\sin^2(x)) dx$, where $a,b&gt;0$  My best approach so far is defining:  $F(x) = I(x, b)$  Then, I know:  $F(b) = I(b, b) = \pi/2 * \ln(b^2)$  Then I am now attempting to find $F'(x)$ using differentiation under the integral sign, and integrating from b to a.  This is where I am stuck - no matter what I do, I cannot solve the integral. Am I in the right direction or should this be solved in a different manner? I also considered something elliptical due to the acos, bsin in the original integral, yet it has also reached a dead end. How to determine equality for two JavaScript objects? A strict equality operator will tell you if two object types are equal. However, is there a way to tell if two objects are equal, much like the hash code value in Java?  Stack Overflow question  is similar to this question, but requires a more academic answer. The scenario above demonstrates why it would be necessary to have one, and I'm wondering if there is any equivalent solution.