I am working on a ML problem to predict house prices and Zip Code is one feature which will be useful. I am also trying to use Random Forest Regressor to predict the log of the price.  However, should I use One Hot Encoding or Label Encoder for Zip Code? Because I have about 2000 Zip Codes in my dataset and performing One Hot Encoding will expand the columns significantly.
I have been building models with categorical data for a while now and when in this situation I basically default to using scikit-learn's LabelEncoder function to transform this data prior to building a model.  I understand the difference between OHE, LabelEncoder and DictVectorizor in terms of what they are doing to the data, but what is not clear to me is when you might choose to employ one technique over another.    Are there certain algorithms or situations in which one has advantages/disadvantages with respect to the others?
Generating random numbers in C What's the Linux equivalent to Windows batch files? I have a batch file which I use to create an .apk file on my Windows machine. Now I need to be able to create the .apk file in Ubuntu but I don't know how translate my .bat file to a script to be able to run it on Ubuntu.  Below is the batch file which works fine on Windows.  Will you please give me some hints on how I can run it on Ubuntu?  @echo off set PAUSE_ERRORS=0 :user_configuration  :: Path to Flex SDK  set FLEX_SDK=C:\sdk\flex_sdk_4.5.1.21328  :: Path to Android SDK set ANDROID_SDK=C:\sdk\android  :validation if not exist "%FLEX_SDK%\bin" goto flexsdk if not exist "%ANDROID_SDK%\platform-tools" goto androidsdk goto succeed  :validation if not exist "%FLEX_SDK%\bin" goto flexsdk if not exist "%ANDROID_SDK%\platform-tools" goto androidsdk goto succeed  :flexsdk echo. echo ERROR: incorrect path to Flex SDK echo. if %PAUSE_ERRORS%==1 pause exit  :androidsdk echo. echo ERROR: incorrect path to Android SDK in 'bat\SetupSDK.bat' echo.  if %PAUSE_ERRORS%==1 pause exit  :succeed set PATH=%PATH%;%FLEX_SDK%\bin set PATH=%PATH%;%ANDROID_SDK%\platform-tools  :: Android packaging set AND_CERT_NAME="PeymanApp" set AND_CERT_PASS=fd set AND_CERT_FILE=cert\SampleApp.p12 set AND_ICONS=icons/android  set AND_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%AND_CERT_FILE%" -storepass     %AND_CERT_PASS%  :: Application descriptor set APP_XML=application.xml  :: Files to package set APP_DIR=bin set FILE_OR_DIR=-C %APP_DIR% .  :: Your application ID (must match &lt;id&gt; of Application descriptor) set APP_ID=air.com.doitflash.SampleApp  :: Output packages set DIST_PATH=dist set DIST_NAME=PeymanApp  :validation %SystemRoot%\System32\find /C "&lt;id&gt;%APP_ID%&lt;/id&gt;" "%APP_XML%" &gt; NUL if errorlevel 1 goto badid goto end_validation  :badid echo. echo ERROR: Application ID (APP_ID) does NOT match Application descriptor '%APP_XML%'     (id)  echo.  :end_validation  set TARGET= set PLATFORM=android  ::call bat\Packager.bat if "%PLATFORM%"=="android" goto android-config  :android-config set CERT_FILE=%AND_CERT_FILE% set SIGNING_OPTIONS=%AND_SIGNING_OPTIONS% set ICONS=%AND_ICONS% set DIST_EXT=apk set TYPE=apk goto start  :start if not exist "%CERT_FILE%" goto certificate :: Output file set FILE_OR_DIR=%FILE_OR_DIR% -C "%ICONS%" . if not exist "%DIST_PATH%" md "%DIST_PATH%" set OUTPUT=%DIST_PATH%\%DIST_NAME%%TARGET%.%DIST_EXT% :: Package  echo true echo. call adt -package -target %TYPE%%TARGET% %OPTIONS% %SIGNING_OPTIONS% "%OUTPUT%"     "%APP_XML%" %FILE_OR_DIR% -extdir lib/ echo. if errorlevel 1 goto failed goto end  :certificate echo Certificate not found: %CERT_FILE% echo.  if %PAUSE_ERRORS%==1 pause exit  :failed echo APK setup creation FAILED.  if %PAUSE_ERRORS%==1 pause exit  :end Installing particular versions when repo has newer versions? Let's have a metapackage which depends on the following packages  Depends: A (=2),  B (=2),  C (=2)   Note the '=' - I want to install these particular versions, not the most recent ones.  Additionally:  B depends on A(>=1)  C depends on B(>=1) and A(>=1)  If the most recent versions of A,B,C in the repository are 2 then this works.  Since I have put version 3 of A and version 3 of B in the repo sudo apt-get install my-meta-package refuses to finish with the following info:  The following packages have unmet dependencies:   my-meta-package: Depends: B (= 2) but 3 is to be installed                    Depends: A (= 2) but 3 is to be installed   If I manually install versions 2 of A and B then the metapackage installs correctly, which strongly suggests that there is no hidden dependency on A3 or B3. This is not a solution for the problem as the metapackage is installed automatically on many machines.  QUESTION: What to do to make sudo apt-get install my-meta-package install versions 2,2,2?  Additionally, is there a way I could get an extended info what actually creates the need for version 3 of A and version 3 of B? Grant Select on all Tables Owned By Specific User Is there anyway in a flex application to figure out (in runtime) when the running swf was compiled?  I'd like to compare this with the latest file version of the swf on the server and detect if there's a newer version on the server and if so force the user to reload their browser to get the new version.   I need this to also work with swfs from the cache. I'm using Ubuntu 17.10 with GNOME 3. How can I show all open windows of a certain application using the sidebar (aka Ubuntu Dock)? Right now I have to right-click and select "all windows" to see my other open windows.   Is there a quicker way to do this? How can I make hibernate my desktop in UEFI with Secure boot on.  I used command "sudo pm-hibernate" to make hibernate my desktop but my machine did nothing (my desktop is booted up on UEFI with Secure boot on). But, if I boot my desktop on UEFI with Secure boot off, Hibernation is normal.  Sorry for my English, thanks, Callback after the record was created using e.force:createRecord Are there a way to add callback after the user created a record and clicked the Save button?  I am using a custom tab and custom components and open the Create a record modal window using e.force:createRecord, but I was not able to find out how to attach callback to the event.  I even found :     Currently force:createRecord event does not accept any callback method or any after save event to handle custom action. Current force:createRecord always redirects to the newly created record. But in case if you want to just close the force:createRecord popup after save and refresh some other related component using the refresh is not possible.    So, is it really impossible? If so, what are current workarounds here? I've got a generic dictionary Dictionary&lt;string, T&gt; that I would like to essentially make a Clone() of ..any suggestions. Let's say a 10N cube (in air, on Earth) rests flat on a scale at the bottom of a tank of water, and the scale reads 8N, so there is 2N of buoyant force on the cube.  How does the buoyant force manifest itself on the cube?  I assume the force is normal to the surface of the scale, but if there isn't any water under the cube, how does the water push up on the cube? I am able to locate files in a folder containing a specific text string using this command:  grep -lir 'string' ~/directory/*   How do I move the files that appear in the above result to another location? Assigning integer to finite CW complex such that following hold. How to prove that $\mathbb{Q}$ ( the rationals) is a countable set I want to prove that $\mathbb{Q}$ is countable. So basically, I could find a bijection from $\mathbb{Q}$ to $\mathbb{N}$. But I have also recently proved that $\mathbb{Z}$ is countable, so is it equivalent to find a bijection from $\mathbb{Q}$ to $\mathbb{Z}$? What makes a good tag separator? I'm building an application to allow technical people to enter configuration changes.  I'd like to add tags to each change.  Right now I'm using spaces, commas and semicolons.  It appears SO uses spaces and requires hyphens to make multiple words.  I read something that leads me to believe that WordPress uses commas and that a space isn't a separator.  Is there any best practice out there?  Has anyone had any good or bad experiences? Truncated alternating binomial sum Are Jedi bound by a code of honor or morals? In The Phantom Menace alone, Qui-Gon (and in part Obi-Wan) are quick to use Jedi mind tricks and not only gamble but also cheat at it. They seem happy with this fact.  Do Jedi have morals and ethics, or a code of honor? Can you clone a larger drive onto a smaller drive (used space fits on the smaller) I have a 500GB drive which is about 50GB full. I got a 80GB SSD, which has 74.5GB of available space. I want to clone the system drive onto the SSD.   DriveImage XML will not let me copy a larger drive to a smaller one. What are the differences between "lay" and "lie"? How does HOTP keep in sync? My understanding of  is that each password is unique and based on a counter.    $$PASSWORD = HOTP_1(K,C)$$  Where $C$ is an incremental counter.  What I wish to know, is how you keep the client and server in sync?  Looking at current systems (google authenticator), there appears to be no indication if the actual 'counter' number, but you can generate successive passwords at will.  What happens if, for example, the password you have generated uses $C = 5$, but the server is expecting $C = 3$?  Also, what is the 'integrity check' for?  Google cant seem to come up with a solution. How do I prevent yum from updating a particular RPM? For certain reasons I have to keep a slightly older version of a particular RPM installed on my box (Fedora 11). The problem is that every time I do a package update yum (or one of its GUI equivalents) wants to update this RPM to the latest version, which is annoying - especially when I update it by mistake.  Is there a way to 'pin' this version so that yum knows to never try and update it?