Been doing reading on feature selection and hyperparameter tuning but I'm getting lost on how to properly code/set up the experiment. I am doing a classified ML experiment, I have 1200 samples and 400 features, and would like to optimize my models. My plan is to do a stratified k-fold analysis, use RFE for feature selection and do hyperparameter tuning for models where applicable. My understanding is that both the feature selection + hyperparameter tuning should occur at each fold of the looping process? I was wondering how that would be done in python. My instinct is that I have to use some combination of RFE (or RFECV) and GridSearchCV?  Does this thought process make sense?   Split the data into training/test set, discard the test set for now. Using the training set, use GridSearchCV to do the cross-validation w/ stratified K-fold, and embed RFE within the loop Select the best model Fit to Test set   OR   Split data in training/test K-Fold RFE selection for a given model Select those features identified by RFE Then perform hyperparameter tuning on those features   Does this make sense? Could someone provide an example code so I can see it laid out?  Thanks!
My  objective is to classify sensor signals.  The concept of my solution so far is : i) Engineering features from raw signal ii) Selecting relevant features with ReliefF and a clustering approach iii) Apply N.N, Random Forest and SVM  However I am trapped in a dilemma. In ii) and iii), there are hyperparameters like k-Nearest Neigbours for ReliefF or the window length, for which the sensor signal is evaluated, or the number of hidden units in each layer of N.N.  There are 3 Problems I see here : 1) Tuning feature selection parameters will influence the classifier performance 2) Optimizing hyperparameters of classifier will influence the choice of features. 3) Evaluating each possible combination of configuration is intractable.  So my questions are : a) Can I make a simplifying assumption, s.t. tuning feature selection parameters can be decoupled from tuning classifier parameters ? b) Are there any other possible solutions ?
Timeout on a function call The probability that an initial quantum state $|\psi_i\rangle$ becomes the final quantum state $|\psi_f\rangle$ is given by  \begin{eqnarray} P(i \rightarrow f) &amp;=&amp; |\langle\psi_f|\psi_i\rangle|^2 \tag{1}\\ &amp;=&amp; \langle\psi_f|\psi_i\rangle^*\langle\psi_f|\psi_i\rangle \\ &amp;=&amp; \langle\psi_i|\psi_f\rangle\langle\psi_f|\psi_i\rangle. \end{eqnarray}  Equation (1) seems to show that the probability for the transition ($i\rightarrow f$) can be interpreted as the system both moving forward in time ($i\rightarrow f$) with amplitude $\langle\psi_f|\psi_i\rangle$ and backward in time ($f\rightarrow i$) with amplitude $\langle\psi_i|\psi_f\rangle$ simultaneously.  Does this reasoning help to explain the Born rule? (Is it like the Transactional Interpretation of QM?)  I guess we must experience the macroscopic direction of time ($i\rightarrow f$) in accord with increasing entropy in an expanding universe whereas microscopically QM works both forwards and backwards in time.  Addition  This is an improved version of the argument including time-evolution operators.  The probability that an initial quantum state $|\psi_i\rangle$ evolves to become the final quantum state $|\psi_f\rangle$ is given by  \begin{eqnarray} P_{i \rightarrow f} &amp;=&amp; |\langle\psi_f|U_{i \rightarrow f}|\psi_i\rangle|^2 \tag{2}\\ &amp;=&amp; \langle\psi_f|U_{i \rightarrow f}|\psi_i\rangle^*\langle\psi_f|U_{i \rightarrow f}|\psi_i\rangle \\ &amp;=&amp; \langle\psi_i|U^\dagger_{i \rightarrow f}|\psi_f\rangle\langle\psi_f|U_{i \rightarrow f}|\psi_i\rangle \\ &amp;=&amp; \langle\psi_i|U_{f \rightarrow i}|\psi_f\rangle\langle\psi_f|U_{i \rightarrow f}|\psi_i\rangle \end{eqnarray} where $U_{i \rightarrow f}$ is the forward-time evolution operator and $U_{f \rightarrow i}=U^\dagger_{i \rightarrow f}$ is the corresponding backward-time evolution operator.  Equation (2) seems to show that the probability $P_{i\rightarrow j}$ can be interpreted as the system first evolving forwards in time and then evolving backwards in time.  Perhaps this is an example of Murray Gell-Mann's  that "Everything not forbidden is compulsory"? At the quantum level, below observable probabilities, there is nothing to stop time flowing both forwards and backwards. $$\lim_{x\to 0}\frac{10^x - 2^x - 5 ^ x + 1 } {x\tan x} $$ This is an indeterminate limit.  I want help in solving this problem. Thanks in advance Statistical inference when the sample "is" the population The strange thing about the maximum in Planck's law I read that it makes a difference whether you calculate $\frac{dE(\lambda) }{d \lambda}=0$ or $\frac{dE(\omega)}{d \omega}=0$ in the sense that the maximum energy density with respect to the wavelength does not coincide with the frequency maximum that one would assume to be at $\omega_{max} = \frac{c}{\lambda_{max}}$. Actually, I do not understand why this is so ( Now, I am only interested in a pure physical explanation, mathematically this is clear and due to the chain rule). Does anybody know how to explain this odd thing?  Somehow I feel that the core of the question has not been completely answered. Although I can easily look up wikipedia, where the need for the chain rule is explained, I am rather interested in understanding where the following argument breaks down, which seems to be why this question has caused some confusion in the past(as you can see by googling this question):  So we have $E(\omega)$ the energy radiated at a given frequency. Now this function has a maximum somewhere, so there is a frequency where a maximal amount of energy is emitted. In other words: If you add the sum of the photon's energies at each frequency that are emitted, you will notice that the maximum is reached at this frquency. Now $E(\lambda)$ tells you basically the same for the wavelength, but again: We know where at which frequency the maximal amount of energy is radiated, so we know the corresponding wavelength.   I think there is a need to explain this.   If anything is unclear, please let me know. How do I tell if ACR will work with my camera and how do I get the correct version for Photoshop? I am a beginner photographer with a Canon 7d and MacBook Pro. I'm not sure if Adobe camera Raw is compatible with either and really need advice on how to go about downloading the correct version. How do I add the kernel PPA? I'm working on creating an illustration that I will need in many, different guises in differential geometry/manifold theory etc. Following on from a previous (answered) question of mine (, I want to show how two coordinate lines in the plane originate from two curves on a surface via the chosen map:  \begin{tikzpicture}     \begin{axis}[             name=mfd,             declare function={                     f(\x,\y)=10-(\x^2+\y^2);             },                   declare function={                     c_x(\t)=(cos(\t)+(sin(5*\t)/10))/3+1;             },                   declare function={                     c_y(\t)=(sin(\t))/2-1;             },                   declare function={                     c_z(\t)=f(c_x(\t),c_y(\t));             },           ]                    \addplot3[surf,domain=-2:2,domain y=-2:2,]{f(x,y)};             \addplot3[black,opacity=1.0,variable=t,domain=0:360,dashed,thin] ({c_x(t)},{c_y(t)},{c_z(t)});             \addplot3[black,opacity=1.0,variable=t,domain=-2:2,thin] (t,-1.2,{f(t,-1.2)});             \addplot3[black,opacity=1.0,variable=t,domain=-2:2,thin] (0.8,t,{f(t,-1.2)});             \addplot3[black,opacity=1.0,only marks,mark=text,text mark=$\cdot$] (1,-1,{f(1,-1)}) coordinate (a);     \end{axis}     \begin{axis}[             at={($(mfd.north east)+(1cm,-2cm)$)},             anchor=north west,             declare function={                     c_x(\t)=(cos(\t)+(sin(5*\t)/10))/3+1;             },                   declare function={                     c_y(\t)=(sin(\t))/2-1;             }            ]                    \addplot[variable=t,domain=0:360]({c_x(t)},{c_y(t)});             \addplot[black,opacity=1.0,only marks,mark=text,text mark=$\cdot$] (1,-1) coordinate (b);             \addplot[variable=t,domain=0.6:1.4](t,-1.2);             \addplot[variable=t,domain=-1.5:-0.5](0.8,t);     \end{axis}     \draw [-stealth, shorten &lt;= 3pt, shorten &gt;= 3pt] (a) to[bend left] (b); \end{tikzpicture}   However, I have a couple of problems:   The curves representing the coordinate axes pulled back from the plane via the coordinate map insist on being closed off with a straight line - is there a way to avoid that? I want to draw all the black curves with a thin, dashed line, but I probably don't understand how to set those options. What am I doing wrong?   I apologise if these questions are rather elementary, but I find the relevant manuals difficult to search through; they seem to be meant for reading cover to cover rather than reference. Topologist's sine curve is not path-connected What does a "Legacy USB Mouse" option in a BIOS mean?  Yes legacy usually means older revision, or obsolete. So legacy usb mouse means support for "old style usb mouses".     That's not really answering the question. As Mr. Tamm, my high school electricity teacher, liked to say, "Yes, and oranges taste orangey."   What does legacy USB mouse support mean?   What is a legacy USB mouse?  There's an "old style" USB mouse?  What changed between what version of usb and what version of usb that made mice incompatible? Why was the change made?  When was the change made? Who made the change? What was the virtue of the "new USB mouses" over the "old USB mouses"?   Put it another way:     What is the BIOS doing when "Legacy USB Mouse" option is enabled?   What is the BIOS doing when "Legacy USB Mouse" option is disabled?   See also Why did Eve die with Maelon's data available? I saved Wrex in ME1, I saved Maelon's data in ME2, the import screen in ME3 confirmed this.    When I get to the missions on Tuchanka, I completed every one of the side missions before starting the mission where they take down the Reaper and distribute the genophage cure.  Then when I finally get to the lab, Mordin tells me that Eve has died.    Yet every site I've been to says that keeping the data allows her to live.  So why did she die? Reading Excel files from C# Is there a free or open source library to read Excel files (.xls) directly from a C# program?   It does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've been using Export to Unicode text function of Excel, and parsing the resulting (tab-delimited) file, but I'd like to eliminate the manual step. I am trying to follow Blender Guru's beginner tutorial. He went to the Compositor tab and was using it to Denoise an image but when I got there, no nodes show up. Can you guys help? Why haven't I received the "Curious" badge? As you can see in the picture, I have 13 out of 5. But it's been like this for about two months! What's the reason for that? Something small goes wrong, and this triggers something slightly bigger, which triggers something slightly bigger, and so on and so forth until you end up with a chain of problems of increasing severity until it ends in catastrophy.  Something like the old saying "for want of a nail the battle was lost", only highlighting that each intermediate issue was a problem in its own right, not just a stepping-stone to the final disaster.  Is there a common word/phrase that specifically describes this? I'm thinking "cascade of ever-increasing problems", but this seems clumsy, and I suspect there might already be a neat word or expression that covers it. Looking for intro to Conformal Bootstrap How can I set the drawableRight resource via code? Copyright of a set of colors? I often see color combinations on webpages, images, posters, products etc. that harmonize really well. Am I allowed to use those colors in my own design?   This is solely about the colors. I will not use images, logos or shapes from that source, and my content is not related to the original color source. I am also far from any commercial aspect here. After my online research on the subject, I learnt that, biologically speaking, many scientists believe that there is no such thing as a race. Homo sapiens as a species is only 200,000 years old, which has not allowed for any significant genetic diversification yet, and our DNA is 99.99% similar. I've read statements that there can be more genetic variation inside a racial group than between different racial groups, meaning that, for example, two individuals from the same "race" can have less in common with each other than with an individual from another "race".  :     Scientists consider biological essentialism obsolete, and generally discourage racial explanations for collective differentiation in both physical and behavioral traits     Q1: If Homo sapiens has no races (according to biologists), why are we so different morphologically? (hair/eyes/skin colour and even athletic performance seem to differ between human populations)  Q2: Is it common for other species too, when genetically close populations have very different morphological traits? Are there any other mammal or animal species that exhibit biological diversity comparable to human diversity, and how do taxonomists treat these species? (excluding intentionally bred domestic species to keep the comparison fair)    The question has been paraphrased to emphasize that it is the biological debate that is in question, not the sociopolitical. I.e., why is there no consensus in evidence and opinions of scientists? Given a function:  function x(arg) { return 30; }   You can call it two ways:  result = x(4); result = new x(4);   The first returns 30, the second returns an object.  How can you detect which way the function was called inside the function itself?  Whatever your solution is, it must work with the following invocation as well:  var Z = new x();  Z.lolol = x;  Z.lolol();   All the solutions currently think the Z.lolol() is calling it as a constructor.