1
$\begingroup$

i'am working on a case study, i'am having train data in which there are 45 columns out of which 28 are useful, case study is related to loan approval.

all the columns in dataset are int64 format.

and are in range as

14256 to 168956 1587 to 3456 10 to 95 33456 to 99875

and likewise.

so these columns vary a lot from one column to another columns and are having different ranges, so will i have to scale every column ?

which scalar should i use ?

I want to apply xgboost, RF, logistic regression, svm, Naive Bayes on these data.

$\endgroup$
4
  • $\begingroup$ This is unclear to me. If you're asking what (best) to do in your particular software you would need to tell us what it is, but the question might then be off-topic (see guidelines in the Help Center). If it's about any software conceivable, a good answer might be elusive, except that vacuously you can always try scaling and see if it makes any difference to your results or the ease of getting them. $\endgroup$
    – Nick Cox
    Apr 13, 2019 at 9:52
  • $\begingroup$ Your last sentence scares me and reminds me of the expression "if you torture the data enough, they will confess to anything". $\endgroup$
    – Peter Flom
    Apr 13, 2019 at 11:52
  • $\begingroup$ now edited @NickCox $\endgroup$
    – torBhakt
    Apr 13, 2019 at 13:17
  • $\begingroup$ is it clear now ? @PeterFlom $\endgroup$
    – torBhakt
    Apr 13, 2019 at 14:45

1 Answer 1

0
$\begingroup$

I want to remind you that, this is merely a simple guideline of what you should consider/be careful while applying the listed algorithms.

Random Forest, XGBoost and Naive Bayes doesn’t require feature scaling, but it doesn’t harm also. SVM needs it and logistic regression might or might not need it depending on the implementation, especially in your case because variable ranges are not even close to each other. So, first scale your data and apply these algorithms to be safe. You can use StandardScaler for example.

Note: Writers in Elements of Stat. Learning recommend feature scaling for logistic regression (with regularization) (Pg. 63). But, depending on your implementation it might not be required, however doing so will not harm you.

$\endgroup$
8
  • $\begingroup$ Any decent implementation of logistic regression would not require prior scaling of variables such as those implied by the evidence in this question. Oddly, or not, the OP did not mention any variable (“column”) with values 0 and 1. $\endgroup$
    – Nick Cox
    Apr 13, 2019 at 7:43
  • $\begingroup$ I think scikit learn implementation doesn’t do it beforehand and some solvers (sag, saga) in it might need they say. $\endgroup$
    – gunes
    Apr 13, 2019 at 7:49
  • $\begingroup$ I don’t see any mention of software in the question, so commenting on specific software is at best a partial answer. $\endgroup$
    – Nick Cox
    Apr 13, 2019 at 8:11
  • $\begingroup$ @NickCox I’ve added a note for logistic regression. And, I’m asking because I’m not certain about it, and interested in knowing if I implement a vanilla logistic regression with stochastic gradient descent, do I need it or not? I’m interested in insights because, practically, I had convergence issues in the past, due to learning rate and varying feature scales. $\endgroup$
    – gunes
    Apr 13, 2019 at 8:58
  • $\begingroup$ Are you asking another question? A question about software implementation with a statistical problem at its heart might be on-topic here. $\endgroup$
    – Nick Cox
    Apr 13, 2019 at 9:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.