I have a dataset that I have created in Python with a category called change_label that has values "buy, hold, sell" (or alternatively I could use -1,0,1).   I am wondering, what is the best way to fit this data so that machine learning algorithms can be applied to it to make predictions?   My options are label encoding, label binzarization, or one-hot encoding. Basically, I thought that simply using sci-kit learn's LabelBinarizer() would be enough. However, I want to be sure. Any advice?
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?
In Avengers: Infinity War, up until Thanos      gets all six Stones   in order to use the Gauntlet he needs to close his fist, as we see in the fight scene on Titan.     Doctor Strange: "Don't let him close his fist!"   So why later does snapping work? Taking ownership of comments on migrated questions When a question is migrated to a SE site that I'm not registered to, I can't claim ownership of my comments. An example question:   I registered only after the question was migrated and can't delete my comments. I always like to perform some garbage collection of noise comments made by me. (like on the example question)  Would it be possible to claim ownership of comments in this scenario? Is this a bug? How do I show that if there are functions $f,g$ such that$$ f(g(x)+g(y))=bx+cy $$holds for all $b,c\in\mathbb{R}$, then we necessarily have $b=c$? Is this even true? It seems so, but I'm just not sure how to explain it in detail and using theory from functional equations. Any ideas?  Extra: In addition, I'd like to prove that there are no pair of functions $f,g$ such that$$ y^2+z^2=f(x,g(y-x)+g(z-x)). $$ Any ideas on how to prove this? Plus, does anyone know some literature regarding this type of problems? Limiting floats to two decimal points I want a to be rounded to 13.95.  &gt;&gt;&gt; a 13.949999999999999 &gt;&gt;&gt; round(a, 2) 13.949999999999999   The  function does not work the way I expected. My Situation:   About $36k USD in graduate student loans.  There are 4 different federal loans in play, each with a fixed rate of 6.8%.   $12k w/ ~$1.2k in unpaid interest  $10k w/ ~$1k in unpaid interest  $8k w/ no unpaid interest (all principal) $6k w/ no unpaid interest (all principal)  All loans are in repayment. Some loans are subsidized, some are not. This no longer matters now that they're all in repayment though, right?     Is there a most cost efficient way to pay these loans off?  Should the interest be ignored for now on the ones that have $1k in unpaid interest for the time being, because payments to the other two loans will will go directly to principal (minus the monthly compounded interest of course)?  On the surface, I would assume that since they're all the same interest rate, it doesn't really matter, but I'm not sure how the accrued interest would factor in. I'm not interested in psychological wins like debt snowballing. I'm looking for the route that will have me paying the least. I have a problem regarding alignment for my equations.  This dummy program shows the problem:  \documentclass{article} \usepackage{amsmath} \begin{document}  \begin{enumerate}     \item First do this     \begin{align}     c^2 &amp;= a^2 + b^2     \end{align}      \item Then do this      \begin{align}     variable &amp;= c^2     \end{align} \end{enumerate}  \end{document}     I would like the = to be aligned under each other, but still be able to list them inside the enumerate.  Any suggestions? MPPT charging a li-ion battery I just designed this MPPT solar charge controller which outputs 4.2 V regulated via MPPT, it uses the SPV1040 IC. This will be used on a satellite with 4 side panels, each with 8 solar cells in parallel outputting 2.6 V at approximately 122 Ma. Each panel will have this exact circuit and all the outputs will be connected in parallel to a 3.7 V lithium ion camera battery.  When active only 1 solar panel will be active and the other MPPT circuits will be offline or providing a very low amount of current. How should I connect the 4.2v to the battery, just directly or using some sort of controller to stop charging at 4.2v? Keep in mind the battery will always have a load and it will charge for around 50m in a 90m cycle due to being eclipsed. I would obviously like the battery to last as long as possible so I am not sure what are the implications of constantly having a battery connected to 4.2 V during 50m. Thanks.   The schematic was made based off a simulation made using the ST Edesignsuite directly from the provider.  Excuse my previous question about this, wasn't properly worded. How to pass arguments to addEventListener listener function? For every $g\in G$ there exists an $h\in G$ such that $g = h^3$ Let G be a finite group whose order is not divisible by $3$. Show that for every $g\in G$ there exists an $h\in G$ such that $g = h^3$. Draw ellipses with different coloring for their intersection in tikz? How do I color intersection of two ellipses in different color. For instances, the ellipses should themselves be colored as yellow and their intersection as red. My code for drawing ellipses is given below  \draw (-4,0) ellipse (8 and 3); \draw (8,0) ellipse (8 and 3);   UPDATE: In the comments to individual answers, I have requested to show it for three ellipses. Let $G$ be a lie group with lie algebra $\frak{g}$. Let $Aut(\frak g)$ be the automorphism group of $\frak{g}$.   Its clear to me that $Aut(\frak{g})$ $\subset GL(\frak{g})$ since any automorphism of $\frak{g}$ is also a linear transformation. Now i have several questions:   How do i prove that $Aut(\frak{g})$ is actually a lie subgroup of $GL(\frak{g})$? I've tried playing with actions to realize $Aut(\frak g)$ as an orbit or an isotropy subgroup but nothing worked out... Say $H \subset G$ is an abstract subgroup (not necessarily lie). Are the following statements equivalent?   $$\{T_e H \text{  is closed under the lie bracket of } \frak{g} \}$$  $$ \{H \text{is a lie subgroup of } G\}$$   How does the lie algebra of $Aut(\frak g)$ look like? When does $Aut(\frak g)$ $= G$? what does $Aut(\frak g)$ tell me about $G$? It seems that we are . This is the speed of our galaxy relative to the cosmic microwave background. Where does this rest frame come from? Is this special in any way (i.e., an absolute frame)? EDIT: I think the more important question is &quot;where does the CMB rest frame come from?&quot;. Test of whole distribution for two samples Java; String replace (using regular expressions)? As part of a project for school, I need to replace a string from the form:  5 * x^3 - 6 * x^1 + 1   to something like:  5x&lt;sup&gt;3&lt;/sup&gt; - 6x&lt;sup&gt;1&lt;/sup&gt; + 1   I believe this can be done with regular expressions, but I don't know how to do it yet.  Can you lend me a hand?   P.S. The actual assignment is to implement a Polynomial Processing Java application, and I'm using this to pass polynomial.toString() from the model to the view, and I want do display it using html tags in a pretty way. How could I retrive full internal storage of an Android smartphone in order to restore data? Can I move the Unity launcher? Deciphering the RSA encrypted message from three different public keys If a factor variable (e.g. gender with levels M and F) is used in the glm formula, dummy variable(s) are created, and can be found in the glm model summary along with their associated coefficients (e.g. genderM)  If, instead of relying on R to split up the factor in this way, the factor is encoded in a series of numeric 0/1 variables (e.g. genderM (1 for M, 0 for F), genderF (1 for F, 0 for M) and these variables are then used as numeric variables in the glm formula, would the coefficient result be any different?  Basically the question is: does R use a different coefficient calculation when working with factor variables versus numeric variables?  Follow-up question (possibly answered by the above): besides just the efficiency of letting R create dummy variables, is there any problem with re-coding factors as a series of numeric 0,1 variables and using those in the model instead? Invoking makeindex for nomencl I have spent many many hours failing to implement nomencl for my PhD thesis. The problem seems to be with invoking makeindex and creating the .nls file  I keep reading that I must invoke makeindex or write a Unix command:  makeindex filename.nlo  -s nomencl.ist -o filename.nls   But I don't know how to do this. I would be grateful for some instructions i.e. where do I type the command?    I am using TeXShop 2.43. Filtered Questions Asked By Accepted Answer/ No Accepted Answer I think it's helpful if we can go to a page and view all our own questions that   Does not have an accepted answer, and/or Does not have an answer yet.   The reason I asked for them is because, I sometimes need to review through all the questions, and pick those that don't have proper answers so that I can perform further operations on them ( such as offering a bounty, or accept an existing answer).