@disclaimer: this answer just adds extra arguments to @Slava's answer (but is too long for a comment).
You probably should not return a lambda, but a function pointer or a std::function.
Efficiency concerns asside (see below), the declaration of an API should tell you how to use it. A lambda is a temporary function - something designed to make sense where you use it (in a local context).
If you write this:
std::function<double( double )> makeFunction(double ratio);
Your code will be much more flexible (not depending on C++14), much better defined (you can look at the signature and know what it does) and future-proof (it is easy to understand the intent behind the API, which makes easy to extend later without screwing up client code).
If you write this:
auto makeFunction(double ratio);
You have to define it inline (I guess).
For an implementation similar to MikeSeymour's answer, you need to add an extra lambda, to avoid a limitation of the compiler. Reading an implementation with a lambda returning a lambda just to figure what the API returns, is a big no-no.
First, because it is non-obvious and obscure.
Second, it will impose on client code, an API that either needs a comment/explanatory note to make sense, or forces clients to read it's implementation to know how to use it.
If you cannot guarantee this is throw-away code, you will:
increase WTF/SLOC ratio of your code (code is not clear in purpose, if you need to read the implementation to figure out what it returns)
have something non-obvious, that you will have to maintain for the whole project. This is called cruft and is what makes sucky legacy code be sucky legacy code).
If you need to return a functor, you're better off returning a std::function; The return type practically screams "returning a functor".
If this is too inefficient for your needs, you can optimize/particularize it later) - for example, by returning a struct X { double operator()(double); } instance.
A note about being able to guarantee that this is not production code:
I've seen many cases where:
I was looking at horrible three-year old code, where people told me originally this was the prototype, but we showed the app to the clients, they asked for it "as it is", and now clients depend on it, but we don't have the time budget to clean it up.
I sent ugly prototype code to someone else (as in "we could do something that follows this algorithm") and saw it committed as a solution in source control later.
People wrote hacks over hacks because the code was already hacky and one more hack doesn't matter (that's a very common excuse actually).