I'm doing a data analysis on data with more than 100 dimensions.  After that different ML-Algorithms like NN are applied to it.  When I do a PCA in the first place to reduce dimensionality to somewhat like 3-10, I persistently get better results (as in less miss-predictions) than without it.  My thought was that PCA should just speed up NN, etc, but not make them better?  Is this improvement realistic or did I make a mistake with my PCA?    This is how I´m doing it concretely:  Data; % training input Test_Data; % test input pca_size = 3; % pca size  %Scaling and Centering of Data Scaled = (Data - mean(Data))./std(Data);  coeff = pca(Scaled);  Data_Reduced = Data * coeff(:, 1:pca_size); Test_Data_Reduced = Test_Data * coeff(:, 1:pca_size);
Suppose I am running a regression $Y \sim X$. Why by selecting top $k$ principle components of $X$, does the model retain its predictive power on $Y$?   I understand that from dimensionality-reduction/feature-selection point of view, if $v_1, v_2, ... v_k$ are the eigenvectors of covariance matrix of $X$ with top $k$ eigenvalues, then $Xv_1, Xv_2 ... Xv_k$ are top $k$ principal components with maximum variances. We can thereby reduce the number of features to $k$ and retain most of the predictive power, as I understand it.   But why do top $k$ components retain the predictive power on $Y$?   If we talk about a general OLS $Y \sim Z$, there is no reason to suggest that if feature $Z_i$ has maximum variance, then $Z_i$ has the most predictive power on $Y$.   Update after seeing comments: I guess I have seen tons of examples of using PCA for dimensionality reduction. I have been assuming that means the dimensions we are left with have the most predictive power. Otherwise what's the point of dimensionality reduction?
Showing range on hexagonal grid Here is the situation.  I have hexagonal board,and a unit on it,with speed or move value 4.Diffrent terrain has a diffrent cost.When i click on the unit,game should show me a move range.  My solution was to check each  hex in range of 4,with A* pathfinding,and if path cost was less than 4 then this hex was in range.Finally game nicely show me range of that unit.  My question is:   Is there other solution to search for range on hex grids or square grid,because even if i am really proud of what i did in my solution,i think,it is a little to exaggerated?:))  What make me ask this question?I noticed that when unit speed is 4 or 6 or even 8,time to computing range for my computer was really good,but when speed was 10 and more i noticed that i needed to wait few second to compute.Well in real games i rather dont see something like this and my A* pathfinding is rather well optimized,so im thinking that my solution is wrong.  Thanks for any replies. Usage and origin of "sister" in expressions like "sister company, sister ship, sister site" etc The term  is often  used figuratively  to refer, for instance,  to a “sister company” for a company  within the same group, or to a “sister  site” for  sites that belong to the same family. This connotation as explained by the   means:         belonging to a pair or group of similar and related things, such as businesses, usually owned or operated by the same person or organization:         our sister company in Australia.          also, from :        You can use sister to describe something that is of the same type or is connected in some way to another thing you have mentioned.    ⇒ ...the International Monetary Fund and its sister organisation, the World Bank.   ⇒ ...Voyager 2 and its sister ship, Voyager 1.       This usage appears to be common with things that are  regarded as feminine and are associated, as if by kinship,  with other similar things that belong to the same group. An early  usage example of this is the "sister" referred to  ships:         the US battleship Missouri and her sister ship, the Wisconsin.      In other instances,  the "feminine" issue is less explicit as in the case of internet sites, so I guess this usage has to do with the fact that English is less gender specific when it comes to things or abstract entities.   Questions:    Does “sister” apply to whatever entity that belongs to the same group irrespective of its real or perceived gender? or could "brother" be used instead?  Where does this usage come from? How did planets have an elliptical orbit in the first place? I know that planets speed up when getting closer to the sun, but they speed up because they have an elliptical orbit, and they have an elliptical orbit because they speed up. Why did they have an elliptical orbit in the first place? I'm looking for an understandable proof of this theorem, and also a complex one involving beautiful math techniques such as analytic number theory, or something else. I hope you can help me on that. Thank you very much My Déjà Dup backups have become quiet large and I noticed they contain a huge number of unnecessary files (e.g. *.pyc files, **__pycache__ folders and other build related temporary stuff).   I know that I can ignore specific folders, but is there a way to exclude files and or folders by patterns?  I thought there might be more options usable trough a configuration file, but Déjà Dup doesn't use one. So I looked at duplicity (the CLI it is based on), but the man page doesn't mention a configuration file either. I know that duplicity can ignore files and folders based on patterns (--exclude, --exclude-filelist), but I have no idea how to combine this with Déjà Dup.  Do I have to ditch Déjà Dup and use duplicity manually? Or is there a way to set the needed options, so that they are used automatically, when duplicity is used by Déjà Dup? I found this animal, which I suspect it's an insect, on the floor of a kitchen in Spain some days ago. It's about 8-10 mm long. I don't think I've ever seen it before. What is it? Since 11.10 nautilus shows my Desktop in Unity. As I remember correctly, tthis wasn't in 11.04. How can I disable that? How to generate a random alpha-numeric string I've been looking for a simple Java algorithm to generate a pseudo-random alpha-numeric string.  In my situation it would be used as a unique session/key identifier that would "likely" be unique over 500K+ generation (my needs don't really require anything much more sophisticated).    Ideally, I would be able to specify a length depending on my uniqueness needs. For example, a generated string of length 12 might look something like "AEYGF7K0DM1X". What is a Windows Handle? "India has" or "India have" Stack Overflow duplicated layer bug Originally posted on Stack Overflow:   Requirements to reproduce:  Windows 7 x64  Firefox 71.0 x64  Steps to reproduce:   Go to the ask question section Write something to the title field Start scrolling similar questions Change the title field Start scrolling the similar questions again When should a supervisor be an author? In some cases, questions and answers that have been deleted are still showing up on /review pages. They do not have "Improve" buttons, but they can still be approved or rejected. I'm not sure what causes a post to end up in this limbo state instead of being removed from the queue entirely, which I think is what's supposed to happen.  The suggested edit I noticed this on was , but it just leads to a "Page Not Found" message now.  Tim Stone provided the following screenshot of another instance : System freezes/unresponsive/unusable when copying large file to USB "Examine whether the given progressions converge (eventually improperly) and determine their limits where applicable.  (a) $$(a_n)_{n\in\mathbb{N}}:=\frac{n^n}{n!}$$  [...]"  I am having problems getting this homework done as I have no clue about convergency at all. Through Mathematica I know that $\lim\limits_{n\to\infty}a_n=+\infty$ however I don't know how to proove it! During my research I found out that for sufficient big $n$ the inequality $x^n\leq n!\leq n^n$ for $x\in\mathbb{R}$ and $n\in\mathbb{N}$ is true. However this doesn't help me at all. Having a look at our lecture notes I developed the following statement: every $x^n$ with $|x| \geq 1$ diverges as $x^n$ is unbounded and therefore has the improper limit $\lim\limits_{n\to\infty}x^n=+\infty$. Furthermore it seems obvious to me that I need to express the terms in a simpler way, like fractions converging to 0 etc, but I don't know how. Neither some work with the $\varepsilon$-definition of limits in combination with the triangle inequality helped me out. Any suggestions or hints?  Information: This is "Analysis for computer scientist" and therefore we haven't "officially" learned any fancy tricks like L'Hôpital's rule etc. just basic properties of $\mathbb{R}$ and some inequalities as this is an introductory lecture. Send file using POST from a Python script My network includes machines running Linux and others running Windows. And my machine is running Linux. Make clear in the logon screen you can log in with your SE account don't really understand how to log on with your SE account in the new logon screen.  And although it might be obvious to most of us, some people find the new dialog hard to understand.        Can we add a logo and some text to make clear users can log on with their SE account? Something like:     [SE LOGO] Log on using your StackExchange account   Followed by the two boxes for email and password. I am encountering two definitions of the special orthogonal lie algebra, and I would like to know if they are equivalent, and if there are advantages to working with one over the other.  If we begin with an $n$-dimensional vector space $V$ over a field $k$ and a chosen basis, we can define a bilinear form on $V$ by a matrix $S\in M_n(k)$, ie, let $\langle v,w\rangle=v^tSw$ for all $v,w\in V$.  Now $g\in GL_n(k)$ preserves the form ($\langle g(v),g(w)\rangle=\langle v,w\rangle$) if and only if $g^tSg=S$, so all such $g$ form a linear algebraic group $G$.  The tangent space at the identity of $G$ will be contained in that of $GL_n(k)$, so $T_eG\subset T_eGL_n(k)=M_n(k)$, and in fact, $T_eG=\{B\in M_n(k)\mid B^tS+SB=0\}$.  $T_eG$ becomes a lie algebra, $Lie(G)$, if we define the bracket to be the commutator of two matrices.  Now, if $S=I_n$, it follows that $G=O_n(k)$ is the orthogonal group of matrices satisfying $g^tg=I_n$, and $Lie(G)=\mathfrak{so}_n$ is the lie algebra of antisymmetric matrices.  In Humphrey's Introduction to Lie Algebras and Representation Theory, he defines $\mathfrak{so}_n$ to be all matrices $B$ satisyfing $B^tS+SB=0$, where $$ S=\begin{pmatrix} 1&amp;0&amp;0\\ 0&amp;O&amp;I_l\\ 0&amp;I_l&amp;O \end{pmatrix} \hspace{.5in}\text{or}\hspace{.5in} S=\begin{pmatrix} O&amp;I_l\\ I_l&amp;O \end{pmatrix} $$ depending on the parity of $n$.  The matrices obtained in this way are not antisymmetric, nor is the group $G$ preserving the form defined by $S$ the orthogonal group $O_n(k)$.  Are the two groups obtained from considering different $S$ isomorphic?  Are the two lie algebras isomorphic?  If so, why would one prefer one form to the other? BAV99 forward voltage