3

I'm trying to implement the cost function to estimate the SVM models I've trained with scikit-learn for a classification problem.

Unfortunately, from my course (Andrew Ng's Coursera course on Machine Learning), I have not understood whether the cost function should use 10-based logarithm, or the natural logarithm.

Here's the formula: formula for cost function

Could I use both logarithm functions? Does it have any influence? Which is more appropriate in general?

Stephane Rolland
  • 654
  • 6
  • 13
  • I take it that "Neper" should read "Napier", after [John Napier](https://en.wikipedia.org/wiki/John_Napier), but in English the usual terminology is "[natural logarithm](https://en.wikipedia.org/wiki/Natural_logarithm)". – Silverfish Apr 12 '16 at 21:20
  • you're right, I have checked wikipedia, and Neper is just the french translation for Napier. thx for the correction. – Stephane Rolland Apr 12 '16 at 21:23
  • Ahh, *[John Napier, en France Neper, né à Merchiston, près d'Édimbourg](https://fr.wikipedia.org/wiki/John_Napier)* ... I had no idea he had a different name in French! I also see that the logarithm is *[logarithme naturel ou logarithme népérien, ou encore logarithme hyperbolique](https://fr.wikipedia.org/wiki/Logarithme_naturel)*. (When I edited I also deleted some spaces in front of question marks... that's a typography convention that is [standard in French](http://french.stackexchange.com/q/46), but is not standard in English. Hope you don't mind.) – Silverfish Apr 12 '16 at 21:24
  • Two closely related questions you might want to look at: [In statistics, should I assume $\log$ to mean $\log_{10}$ or the natural logarithm $\ln$?](http://stats.stackexchange.com/q/205312/22228) effectively answers most of your question but doesn't concern logistic regression specifically. There's also [What is the reason why we use natural logarithm (ln) rather than log to base 10 in specifying function in econometrics?](http://stats.stackexchange.com/q/27682/22228) which is somewhat related. – Silverfish Apr 12 '16 at 21:26
  • many thanks for the edit. I've looked at the questions you've mentioned, and obviously we can consider mine as duplicate. It does answer my question. Feel free to ask for closing my question, if you think that's adequate. Or maybe should I delete it ? – Stephane Rolland Apr 12 '16 at 21:32
  • 2
    I shouldn't recommend to delete it, actually duplicates are good because they can help people who use different search terms to get to the answer they want. I will flag this as a duplicate of the former question, and if enough people agree then this will be closed as such. – Silverfish Apr 12 '16 at 21:33

0 Answers0