Scenario: I'm trying to build a random forest regressor to accelerate probing a large phase space.  I'm using python/scikit-learn to perform the regression, and I'm able to obtain a model that has a reasonably low cross-validation error on known data split into training/test sets.  Now I'd like to begin asking my model how confident it is (I'm a bit confused about the difference between confidence intervals and prediction intervals).  Currently I know how to return some estimator $y$ given data $x$, and now I'd like to be able to get a measure of uncertainty.  If the model is sufficiently uncertain, I'd like it to let me know so that I can add that case to the training set.  My impression is that random forests are an ensemble methods.  We grow $N$ decision trees, and then our predictor is given by: $$ y = \sum_i^N w_iT_i\left(x\right) $$ Where $w_i$ is some weight and $T_i(x)$ is the value predicted by the $i$-th tree.  Perhaps the simplest (and by no means most promising) approach would be to try to take something like a variance:  $$ \sigma^2 = \sum_i^N \left(T_i(x) - y(x)\right)^2 $$   seems to suggest we can do quantile analysis using each tree as an observation.  Unfortunately I'm not sure I follow that logic, because it seems to me that even for data points that were in the training set that there should be some variance among the trees.   seems to mention the flaws in the above methods, however I unfortunately can't really follow what they suggest we do instead (as my skills in R aren't what they could be).  Can someone weigh in on whether this is the train I should be following, and perhaps help me understand what's going on?  I can't understand where to work in assumptions about the sample.  Seeing similar code in Python would likely be really helpful to me.   also seems like it might be useful, but the terms/notations are entirely outside of my specialty, and its essentially unreadable to me right now.  While I've worked in statistics on an application level, it's been a while since my last formal class.  So part of the barrier to entry for me is terminology/symbol use.  Edited to provide more detail.
If I run a randomForest model, I can then make predictions based on the model.  Is there a way to get a prediction interval of each of the predictions such that I know how "sure" the model is of its answer.  If this is possible is it simply based on the variability of the dependent variable for the whole model or will it have wider and narrower intervals depending on the particular decision tree that was followed for a particular prediction?
Integral Representation of the Zeta Function: $\zeta(s)=\frac1{\Gamma(s)}\int_{0}^\infty \frac{x^{s-1}}{e^x-1}dx$ How does one get from this $$\zeta(s)=\sum_{k=1}^{\infty}\frac1{k^s}$$ to the integral representation $$\zeta(s)=\frac1{\Gamma(s)}\int_{0}^\infty \frac{x^{s-1}}{e^x-1}dx$$ of the Riemann Zeta function?  I can see that it can be rewritten as  $$\Gamma(s)\zeta(s)=\int_{0}^\infty \frac{x^{s-1}}{e^x-1}dx$$ and the Gamma function as an integral yields  $$\zeta(s)\int_{0}^\infty \frac{x^{s-1}}{e^x}dx=\int_{0}^\infty \frac{x^{s-1}}{e^x-1}dx$$  But this approach does not work as the right integral does not converge.  So how does one go from the summation to the integral representation? What is the solution to the following recurrence relation with square root: $T(n)=T (\sqrt{n}) + 1$? The double cone is not a surface. Running out of cards in Exploding Kittens In the Exploding Kittens game, the rules say     You won't ever run out of cards in the Draw Pile, so there is never any need for a reshuffle.   In every game I've played all the cards end up on the discard pile fairly quickly and there is nothing left in the draw pile, so we have to reuse them.  Is this meant to happen? Are we doing something wrong? I have a Spring MVC web app which uses Spring Security.  I want to know the username of the currently logged in user.  I'm using the code snippet given below .  Is this the accepted way?    I don't like having a call to a static method inside this controller - that defeats the whole purpose of Spring, IMHO.  Is there a way to configure the app to have the current SecurityContext, or current Authentication, injected instead?      @RequestMapping(method = RequestMethod.GET)   public ModelAndView showResults(final HttpServletRequest request...) {     final String currentUser = SecurityContextHolder.getContext().getAuthentication().getName();     ...   } SharePoint Current User View using JavaScript Let $C[0,1]$ denote the ring of continuous functions on $[0,1]$. Consider the maximal ideal $M_a =\{ f\in C[0,1] | f(a)=0 \}$ for $a$ $\in$ $[0,1]$. Is $M_a$ finitely generated?   Note: It may seem that $M_a = \langle x-a\rangle$ which is certainly not true because $ \vert x-a \vert $ is in $M_a$ but not in $\langle x-a\rangle$. Any ideas for solving this question? Modifying .sty files? Yesterday I did some changes in the layout of my TeX document. I couldn't accomplish the changes until I opened the .sty files and modified some of their code. I am sure this is not the best idea. For one reason, after the packages got an update, I will have to modify the file again (and again and again).  Another way would be to create my own version of that .sty file and call that instead of the original one, but this might not be the best idea either. (again: at least the updates speak against it)  How can I accomplish the following changes by adding code to a local file (e.g. my .tex preamble) instead of changing global files (like the package .sty files)?  I wanted to change the following lines in ledmac.sty:  \def\printlines#1|#2|#3|#4|#5|#6|#7|{\begingroup   \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}%   \ifl@d@pnum #1\fullstop\fi   \ifledplinenum \linenumrep{#2}\else \symplinenum\fi     %% #2 into: \arabtxt{\n{#2}}   \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi   \ifl@d@dash \endashchar\fi   \ifl@d@pnum #4\fullstop\fi   \ifl@d@elin \linenumrep{#5}\fi   \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi \endgroup}   The second thing is a line in ledpar.sty:  \newcommand*{\l@dlinenumR}{%   \numlabfont\linenumrepR{\line@numR}\Rlineflag%       %% numlabfont into: numlabfontR   \ifsublines@     \ifnum\subline@num&gt;\z@       \unskip\fullstop\sublinenumrepR{\subline@numR}%     \fi   \fi}   (In the latter case, just adding \renewcommand with the modified code did not work.) how to get the selected date in jquery Assume that $M$ and $N$ are two finitely generated $R$-modules. Then $\operatorname{Hom}_{R}(M,N)$ is a finitely generated $\mathbb Z$-module and/or $R$-module (in this case, assume that $R$ is commutative)?   Note that $R$ is not Noetherian ring. Is there any counterexample (for any cases)? Use of Predictable Network Interface Names with alternate kernels Almost constantly, I use kernels from the , or kernels I have compiled myself, using the Ubuntu kernel configuration.  The problem is when I am using the stock kernel it seems to default to using predictable network interface names (i.e. "p4p1"), but when I use any alternate kernel it seems to default to using the old method (i.e. "eth0").  While not really relevant to this question, I had a hard disk failure on my test computer and am doing a new install of Ubuntu Server 14.04.2.  I have not been able to determine what is the difference between the kernels. I suspect a kernel configuration parameter, but have been unable to identify which one.  My question: How can I make predictable network interface names work consistently across all kernels?  Additional notes: Somewhere I saw to disable predictable network interface names to add this to grub:  GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0"   so, I thought the opposite might help:  GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1 biosdevname=1"   but it made no difference. Actually, I can never get the non-stock kernel to use biosdevname, no matter the setting. And I can never get the stock kernel to generate a /etc/udev/rules.d/70-persistent-net.rules file (even though, that is not what I want), no matter the setting of net.ifnames. If I have net.ifnames=1, then at least the non-stock kernel doesn't generate an incorrect /etc/udev/rules.d/70-persistent-net.rules file.  Excerpts from /var/log/udev: stock kernel:  KERNEL[9.216730] add      /devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/p4p1 (net) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/p4p1 IFINDEX=2 INTERFACE=p4p1 SEQNUM=1945 SUBSYSTEM=net ... UDEV  [9.241073] add      /devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/p4p1 (net) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/p4p1 ID_BUS=pci ID_MODEL_FROM_DATABASE=P8P67 and other motherboards ID_MODEL_ID=0x8168 ID_NET_NAME_MAC=enxf46d04652d8e ID_NET_NAME_PATH=enp3s0 ID_OUI_FROM_DATABASE=ASUSTek COMPUTER INC. ID_PCI_CLASS_FROM_DATABASE=Network controller ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller ID_VENDOR_FROM_DATABASE=Realtek Semiconductor Co., Ltd. ID_VENDOR_ID=0x10ec IFINDEX=2 INTERFACE=p4p1   From Ubuntu PPA kernel 4.1RC5:  KERNEL[10.772566] add      /devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/eth0 (net) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/eth0 IFINDEX=2 INTERFACE=eth0 SEQNUM=1962 SUBSYSTEM=net ... UDEV  [11.185866] add      /devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/eth0 (net) ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/net/eth0 ID_BUS=pci ID_MODEL_FROM_DATABASE=P8P67 and other motherboards ID_MODEL_ID=0x8168 ID_NET_NAME_MAC=enxf46d04652d8e ID_NET_NAME_PATH=enp3s0 ID_OUI_FROM_DATABASE=ASUSTek COMPUTER INC. ID_PCI_CLASS_FROM_DATABASE=Network controller ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller ID_VENDOR_FROM_DATABASE=Realtek Semiconductor Co., Ltd. ID_VENDOR_ID=0x10ec IFINDEX=2 INTERFACE=eth0 SEQNUM=1962 SUBSYSTEM=net USEC_INITIALIZED=3227   Note: I have temporarily moved past this issue by allowing a /etc/udev/rules.d/70-persistent-net.rules file to be created, and then editing it for proper device names. Ultimately, I would like to get rid of the file. With the following circuits as examples :    and    How will the current I know how much to flow? Would any other wave travel first in the circuit and then come back and say so much current should flow? Why is defragmentation unnecessary? Where To start Learning With Salesforce Development Where should I start learning? There are various topics to learn like Objects, Classes, Apex, Visualforce, SOSL, SOQL, Triggers, etc. There are so many options out there to start learning. I couldn't decide what topic to learn first, and then step by step get proficiency in all aspects of Saleforce. I'm a C++ guy learning Java. I'm reading Effective Java and something confused me. It says never to write code like this:  String s = new String("silly");   Because it creates unnecessary String objects. But instead it should be written like this:  String s = "No longer silly";   Ok fine so far...However, given this class:  public final class CaseInsensitiveString {     private String s;     public CaseInsensitiveString(String s) {         if (s == null) {             throw new NullPointerException();         }         this.s = s;     }     :     : }  CaseInsensitiveString cis = new CaseInsensitiveString("Polish"); String s = "polish";    Why is the first statement ok? Shouldn't it be   CaseInsensitiveString cis = "Polish"; How do I make CaseInsensitiveString behave like String so the above statement is OK (with and without extending String)? What is it about String that makes it OK to just be able to pass it a literal like that? From my understanding there is no "copy constructor" concept in Java? Help me identify this fantasy book about two near-omnipotent wizard run empires My daughter asked me to cosign on a car loan.  Somehow I ended up as the borrower and she a the cosigner.  Is that legal? How can I parse integers passed to an application as command line arguments if the app is unicode?  Unicode apps have a main like this:  int _tmain(int argc, _TCHAR* argv[])   argv[?] is a wchar_t*. That means i can't use atoi. How can I convert it to an integer? Is stringstream the best option? Let $X \sim Bin(n,p)$ show that $X/n \nsim Bin()$ Let $X \sim Bin(n,p)$   Part A.  Show that the argument      "Then $X/n \sim Bin()$ with $E[X/n]=p$and $Var[X/n]=pq/n$"    is false.   My book says we can prove this result using a moment generating function. But to me it makes no intuitive sense: We have Bin-distributed RV $X$ and if we rescale it with $1/n$ of course it will be Bin-distributed.  And we know from standard formulas that $E[aX]=aE[X]$ and $Var[aX] = a^2Var[X]$ so I think the argument is correct.   (For full disclosure, the argument we should falsify according to the book is "Let X be a binomial random variable with mean np and variance np(1−p). Show that the ratio X/n also has a binomial distribution with mean p and variance p(1−p)/n." But I think the argument is correct. )    Ok, now I get part A. Here is Part B. Prove it using the moment generating function of $X/n$.   Attempt: I get $$m_X(t)=E[\exp(tX/n)]=(m_X(t))^{1/n}$$ A disabled module has a schema version of -1, how can I enable the module and then run DB updates using hook_update_N? The problem is, it seems when I enable a disabled module, the module's schema version in the system table is automatically updated to the latest version supplied by hook_update_N.  So my current module with the schema version -1 is modified to 7106 when I enable the module, and no hook_update_N functions are run.   So when I come to the next step of running database updates, no hook_update_N functions are run because the module thinks it's already the correct version.  The only method I can see is to manually set the module version in hook_enable, however I'll then need to update the module code to remove the hook_enable to make sure it doesn't run if the module is ever re-enabled in the future, so obviously this approach is a bit dirty.  I'm hoping there's a better solution?