I'm learning about the Statistical learning and in the section comparing Lasso and Ridge Regression it shows that the main difference between these two problems is the way the constraint/penalty is formulated.   In Lasso, the penalty is $\ell_1$ norm: $\lambda \sum |\beta_j|$, while in regression, the penalty is $\ell_2$: $\lambda \sum \beta_j^2$.   Geometrically, this means that the lasso will have a constraint in the form of a diamond (in 2 dimensions), and in higher dimensions it will have vertices and edges. For ridge regression, in 2D, it is a circle, and hypersphere in higher dimensions.   My question is: The author claims that you get SPARSITY in the lasso. I do not understand why, even with the geometric picture above. And what is the clear advantage of Lasso over ridge regression?   Your insights would be very valuable. I appreciate if your answer would contain some mathematics, but more importantly, intuition. Thanks
I've been reading , and I would like to know why the Lasso provides variable selection and ridge regression doesn't.  Both methods minimize the residual sum of squares and have a constraint on the possible values of the parameters $\beta$. For the Lasso, the constraint is $||\beta||_1 \le t$, whereas for ridge it is $||\beta||_2 \le t$, for some $t$.  I've seen the diamond vs ellipse picture in the book and I have some intuition as for why the Lasso can hit the corners of the constrained region, which implies that one of the coefficients is set to zero. However, my intuition is rather weak, and I'm not convinced. It should be easy to see, but I don't know why this is true.  So I guess I'm looking for a mathematical justification, or an intuitive explanation of why the contours of the residual sum of squares are likely to hit the corners of the  $||\beta||_1$ constrained region (whereas this situation is unlikely if the constraint is $||\beta||_2$).
Prevent area light from being reflected on glass? I did setup an easy scene with an area light behind a window. In the glass (simple plane) which is in front the area light is visible - how can I turn this off so that the background is shining throgh? How can I change what keys on my keyboard do? (How can I create custom keyboard commands/shortcuts?) I want to change the key bindings on some of the keys on my keyboard.  I want some to run commands and others to activate different keys.  What applications can I use to do this?      Index:       (from within System Settings)             I'm still looking for answers using dconf and any other method. How can I get a new browser session when opening a new tab or window on Firefox/Chrome? When opening new Internet Explorer window, a new browser session is issued. Therefore you can login with two different accounts on the same service (let's say ). The same does not apply when opening a new tab in the same window in Internet&nbsp;Explorer.  How can I get a new browser session when opening a new tab or window on Firefox?  How about Google Chrome? Probability of complete coupon set in $K$ boxes where a box has $N$ distinct coupons? Power series of a function I am wondering if there are any functions $f(x)$ such that it cannot be expressed as a power series of $x$? This might turn out to be a silly question, but I can't think of one at the moment.   Thanks! Thunderbolt 2 docks have been quite expensive and they will be obsolete once I purchase the new Macbooks with USB-C ports. I currently use a 2014 MacBook Pro with Thunderbolt 2 ports, and I want to futureproof my purchase by acquiring a cheaper USB-C dock now.  The cheapest Thunderbolt 2 dock costs around $200 while USB-C docks cost around $30. Being able to use a USB-C dock with older Thunderbolt 2 Macbook Pros would not only be cheaper but also allows me to use the same USB-C dock if I decided to upgrade to a future Macbook.  For that to work I need a Thunderbolt 2 (male) to USB-C female adaptor, after some searching it doesn't seem to exist. Is there a reason why something like this hasn't been made? Or is the USB-C specification designed such that it is impossible? (hence businesses can still continue to sell expensive Thunderbolt 2 docks...)  I will accept an answer that meets the following requirements:   If there is such an adapter please give a link and some form of evidence that these would have 100% compatibility with USB-C docks. If there is no such adapter please explain:   Is it impossible to produce? If not, why hasn't a vendor created one yet? I've explained that its a better financial investment than buying a TB2 dock... surely there's a market for those still using TB2 MBPs wanting to upgrade in the next couple of years. Not only docks but it would open a gateway to cheaper alternatives to those hideously expensive TB2 peripherals. Is there a limit as to how fast a black hole can grow? Can I cast a Warlock spell with another (higher) spell slot from a different multiclass? Reviewing an answer to a recent question I posted, I had a thought about Armor of Agathys. In the event of a Sorcerer 18 / Warlock 2 build, would the character be able to cast Armor of Agathys with a 9th level spell slot, thus getting 45 Temporary Hit Points and dealing 45 damage when hit?   Is the spell in any way limited to being cast using Warlock spell slots or to a maximum of a 5th level spell slot? Text won't appear in interface? There is one problem, it seems that text won't appear on my program. The three images show the errors and also my laptop specs (I believe I just have very small amount of laptop power that makes Blender glitch).  Everything else works fine (zooming, panning, rotating, etc.) and the buttons are still there and do what they're supposed to do, but the text just won't appear.  Might anybody know how to fix this?        The drive update didn't help either. I know a way around it though, does anybody know a page which shows screenshots of more or less the buttons on blender Drupal site moved from development to live - IE won't load stylesheets anymore Before you ask ... I have looked everywhere for a solution, even drupal.org but nothing so far seems to work.  I developed a Drupal site (custom child theme for Zen) and on the development server everything looks fine in all browsers.  I did a test migration to another server before the launch. This move went well and everything looks fine in all browsers.  Then I moved the site to its live server where everything looks fine in all browsers except Internet Explorer which is not loading the stylesheets.  I know Drupal is known for generating many stylesheets and Internet Explorer will not load them if there are more than 31 (I believe) of them, but I did set the "Aggregate and compress CSS files" feature and clear the cache. This did not seem to help.  Could the answer be in one of the two following things?   The development site and backup site are both with one hosting provider. The live site is with a different hosting provider. The development site and backup site are in subfolders of two different portfolio sites ... ie www.portfoliosite.com/Newsite. The live site is a subdomain of the parent site ... ie www.newsite.parentsite.com.   I have run out of ideas so if anyone has a possible solution or direction to look, please let me know. Thanks How to get apache to send a 404 based on no matching VirtualHost section (based on ServerName) being found? I am rebuilding an old server.  Only one of the five old sites need to go live and all five of the old sites point to the same IP address.  Unfortunately any time a request is made for one of the old sites via their own unique domain names they are passed the pages from the one site that I'm trying to make live.  I would just like the old sites to display a 404 instead of the one site that I'm actually trying to make live.  As an example:   Site 1 (192.168.0.1) [www.first.com] Site 2 (192.168.0.1) [www.second.com] Site 3 (192.168.0.1) [www.third.com]   I want to move site 1 live again.  So I turned on apache on the machine with the IP address of 192.168.0.1, with all of site 1's files in the /var/www directory.  When I browse to 192.168.0.1 or www.first.com I correctly see site 1. When I browse to www.second.com and www.third.com I also receive site 1 which is the problem.  Is there a way I can 404 any request which comes in without www.first.com?  Here is my sites-available:  NameVirtualHost *:80  LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common  &lt;Files ~ "^\.ht"&gt;     Order allow,deny     Deny from all     Satisfy All &lt;/Files&gt;  &lt;Directory /&gt;   Order Deny,Allow   Deny from all   Options None   AllowOverride None   Options None &lt;/Directory&gt;  &lt;Directory /var/www&gt;   Order Allow,Deny   Allow from all &lt;/Directory&gt;  &lt;VirtualHost *:80&gt;         ServerName first.com         ServerAlias www.first.com         DocumentRoot /var/www         ErrorLog /var/log/first.com.err         CustomLog /var/log/first.com.log common &lt;/VirtualHost&gt;  &lt;VirtualHost _default_:*&gt;         ServerName unknown         DocumentRoot /var/www_404 &lt;/VirtualHost&gt; Why aren't particles constantly "measured" by the whole universe? Let's say we are doing the double slit experiment with electrons. We get an interference pattern, and if we put detectors at slits, then we get two piles pattern because we measure electrons' positions when going through slits. But an electron interacts with other particles in a lot of different ways, e.g. electric field, gravity. Seems like the whole universe is receiving information about the electron's position. Why is it not the case and the electron goes through slits "unmeasured"?  Bonus question: in real experiments do we face the problem of not "shielding" particles from "measurement" good enough and thus getting a mix of both patterns on the screen? Formatting OGR VRT file to convert CSV to KML? When I try to run Maya from the terminal, I get:  error while loading shared libraries: libtiff.so.3: cannot open shared object file: No such file or directory.   How do I solve this?  Note: Maya is a third-party software. Order of the Rubik's cube group How to evaluate environment variables into a string in Python? I have a string representing a path.  Because this application is used on Windows, OSX and Linux, we've defined environment variables to properly map volumes from the different file systems.  The result is:  "$C/test/testing"   What I want to do is evaluate the environment variables in the string so that they're replaced by their respective volume names.  Is there a specific command I'm missing, or do I have to take os.environ.keys() and manually replace the strings? In terminal emulation applications, pressing CTRL + Left / Right arrows jumps from one word to the previous or next one. Is it possible to have the same functionality in a Linux console, whether it is in text or in framebuffer modes?  In my configuration, the CTRL + arrow keys are transformed into escaped character sequences and not interpreted. How to turn off Facebook notifications on Mac OS X? How to turn off Facebook notifications on Mac OS X Mountain Lion? Let $\{X_n\}_{n=1}^\infty$ be a sequence of random variables converging to a random variable $X$. Does this fact implies that $\lim\limits_{n\to \infty} EX_n = EX$?  If not, is there any other sufficient condition? How to open terminal, split to 9 terminals and switch between them using one script?