[Python-ideas] Re: Using "Get Satisfaction" for Python Suggestions
Hey Christ, We can always think in terms of weighted vote, the more your account is "well-established" (either by being ancient or by contributing) the more it's vote has weight. Anyway, just a suggestion. Regards, -- SENHAJI RHAZI Hamza Le dim. 20 févr. 2022 à 09:43, Chris Angelico a écrit : > On Sun, 20 Feb 2022 at 18:05, Steven D'Aprano wrote: > > > > On Sat, Feb 19, 2022 at 06:04:28AM +1100, Chris Angelico wrote: > > > > > Popularity is a *terrible* way to judge ideas. I'm currently fighting > > > with another platform on that same topic. > > > > Can we ask which platform? > > Not on-list, out of courtesy. It's unrelated. > > > > All you can see from a system like that is how many of the popular > > > ideas get implemented. It says nothing about how many good ideas end > > > up languishing with a small number of votes, simply because they never > > > reach critical mass and not enough people see them. > > > > Rather like the way we tell people to publish on PyPI and see if it > > becomes popular. > > Yes and no. Python doesn't use PyPI download counts to decide what > gets added to the standard library, for instance. A package is not > judged solely on the basis of some form of upvote. We tell people to > publish and see, but even if it isn't popular, it's still on PyPI and > has whatever value it has. > > > > Does GetSatisfaction allow downvotes? If yes: how do you stop a vocal > > > few from shooting down any idea they don't like? > > > > Nothing like Python-Ideas then :-) > > > > Typically voting systems only allow logged-in users to vote, and you can > > only vote once. You can change your vote at any time, but a vocal few is > > limited to only downvoting once each, they can't vote a thousand times > > each and overwhelm the popular voice. > > > > Same applies to up-voting. > > Question: Do votes from newly-created accounts have as much weight as > those from well-established accounts? I can assure you, from > experience, that there is no correct answer to this question, and that > the vocal few can always shoot down ideas they don't like, if > downvoting is a possibility. > > > > There is no way to make a popular vote fair. > > > > That's an odd take. > > "Fair" is such an ill-defined concept that the statement is almost > vacuously true. But here's one simple example: Politics in the United > Kingdom can be seen to be somewhat England-dominated, due to the > population density. This can lead to Scotland being underrepresented. > Or does it? Maybe Scotland is represented precisely as much as it > deserves to be. Or maybe not. What is fair? > > (It's quite amusing playing a grand strategy game and having Scotland > conquer all of England by forming military alliances with Austria as > well as France. Yeah, who's underrepresented now, huh?) > > > A better take is that, fair or not, popularity is not necessarily a good > > judge of what works well in a language. Language design requires skill > > and taste, and it is not obvious that the wisdom of the crowd extends > > that far. > > Yes, this is also true. And on the rare occasions when a poll is > conducted, it is purely for information, and is never binding. > Citation: PEP 308. > > https://www.python.org/dev/peps/pep-0308/#detailed-results-of-voting > > The C-like question/colon syntax and a parenthesized form of if > statement were both significantly more popular than the syntax that > ended up implemented. If the matter had been "put to a vote", we'd > have had a quite different result. And honestly, I'm glad of it. > > ChrisA > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/LCJJ7MGBUBD6UEIZW3B2U4XT4EXQMMSU/ > Code of Conduct: http://python.org/psf/codeofconduct/ > ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/I2WY6GLLEMSALT3RB26G5N4QVU3EEZMB/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-ideas] Re: Fwd: Optional kwarg for sequence methods in random module
Hey Steven, Thank you for having taken the time to comment qualitatively my response. For the first part : I think there is a way to map x <- [1; + inf] to y <- [0;1] by putting y = 1/x I didn't pay attention of the fact stated by @Richard Damon that the shape of distribution won't be preserved not only because of the argument that the distribution will goes from (0, 1] instead of [0. 1) but the pareto shape will change, and the solution shifted, scaled, and truncated Pareto make more sens For the second part But i think there is another issue to consider : for example if we want to sort : random.choice(['a', 'b', 'c'], random=lambda: random.paretovariate(1.75)), we should have a mapping between the elements of the list (here :a,b,c) to [0, 1] and the reverser mapping, having this mapping underline that we have a notion of order and distance, "measurement" between the elements, and it is not trivial to always have a notion of "order" or "distance" between the elements we manipulate, but it could be fun to have this possibility. At To answer the following questions : - What are you sorting ? - What is this reverser mapping ? - Why are you switching from probability concepts to metric theory halfway through the paragraph? - Maybe it would help if you could explain what you expected this to do. What should the odds of a, b, and c be in your function? At the best of my understanding, we define a probabilisable space by (omega, tribute, P) and *X* the random variable as the mesurable function that goes from (omega, tribute, P) to the measurable space (E, Eta) the space omega could be anything for example it could be *['a','b','c'] *but we need a function that knows how to go from subset *s *of omega (where *s* <- tribute) to a subset *s2* of E (where *s2* <- Eta) and actually by measuring, *P('a')* we are measuring *P(X^-1(b) =a)* = *Px(b)) *where (b <- Eta) As an example for bernnouli law (flipping coin for example) Ω = { ω 1 , ω 2 } ; E = {0,1} T (tribute) = P(Ω) ; P( ω 1 ) = p, P( ω 2 ) = 1 − p où p ∈]0, 1[. X( ω 1 ) = 1, X( ω 2 ) = 0. Px(1) = P(X −1 (1)) = P( ω 1 ) = p et Px(0) = P(X −1 (0)) = P( ω 2 ) = 1 − p. So the mapping function is *X *and the reverse mapping function is *X^-1* To resume the idea, the mapping *X *allow us to go from abstract elements ('a','b','c') that we do not measure directly (P(a)) to elements we can measure(Px(1)) and by having *X *we will be able to have the odds of a, b, and c so my idea was to give this function *X* as a helper function that the user should define, that will know how to map subsets of the starting space for example subsets from *ASCII* to subsets of a measurable spaces (the easiest one, would be [0,1], the measure in that space will be the identity) This is why i have bringed some metric concepts. I'm sorry i couldn't get the last part : It sounds like a good idea on the face of it. The only obvious problems are the limitations of only having a double rather than as many bits as needed, and coming from a PRNG with a limited period compared to 2^N for large N, both of which are if anything even bigger problems for shuffle, which already allows a random argument. So, why not choice and sample too? I don't know if we are better without it, but it seems to be complex for a practical daily use ! Best regards, -- SENHAJI RHAZI Hamza Le dim. 18 août 2019 à 23:16, Andrew Barnert a écrit : > On Aug 18, 2019, at 06:20, Senhaji Rhazi hamza < > hamza.senhajirh...@gmail.com> wrote: > > Hey Steven, > > I think there is a way to map x <- [1; + inf] to y <- [0;1] by putting y = > 1/x > > > Well, that gives you a distribution from (0, 1] instead of [0. 1), which > is technically not legal as a substitute for random, even though it’ll > actually only matter 1 in about 2^42 runs. You could pass this to shuffle > today and probably get away with it, so asking for the same in choice, etc. > isn’t too outrageous. But it’s still hard to judge whether it’s a good > suggestion, if we don’t actually know what you’re trying to accomplish. > > First, there’s no way random could even know that you needed anything > transformed. The distribution functions don’t come with metadata describing > their support, and, even if they did, a new lambda that you pass in > wouldn’t. As far as it could possibly tell, you passed in something that > claims to be a nullary function that returns values in [0, 1), and it is a > nullary function, and that’s all it knows. > > More importantly, even if that weren’t a problem, 1/x is hardly the one > and only one obvious guess at how to turn Pareto into something with the > appropriate support. In fact, I suspect more people would probably want a > shifted, scaled, and truncated Pareto if they asked for Pareto. (Much as > people often tall about things like the mean of a
[Python-ideas] Re: Fwd: Optional kwarg for sequence methods in random module
Hey Steven, I think there is a way to map x <- [1; + inf] to y <- [0;1] by putting y = 1/x But i think there is another issue to consider : for example if we want to sort : random.choice(['a', 'b', 'c'], random=lambda: random.paretovariate(1.75)), we should have a mapping between the elements of the list (here :a,b,c) to [0, 1] and the reverser mapping, having this mapping underline that we have a notion of order and distance, "measurement" between the elements, and it is not trivial to always have a notion of "order" or "distance" between the elements we manipulate, but it could be fun to have this possibility. What do you think ? Thank you ! Best regards, -- Hamza Le dim. 18 août 2019 à 11:56, Steven D'Aprano a écrit : > On Sat, Aug 17, 2019 at 09:02:54AM +0200, Patryk Gałczyński wrote: > > Hi! > > > > Recently I encountered a situation when I needed to pick a random > > population sample but with specific distribution function - > paretovariate in > > this particular case. > > Let me see if I understand... you have a paretovariate distribution, and > you want to generate a sample of values from that distribution? Or > another way of putting it, you want to generate random numbers from that > distribution? > > Use the random.paretovariate() function (which I see you know about). > There's no need for random.choice or other methods to be involved. > > That might not be what you *want*, but that is what you seem to be > describing. > > > > After poking around in the random module I found out > > that none of the so-called "sequence methods" methods support custom > random > > function except for random.shuffle > > > > I would like to propose a new optional keyword argument for all these > sequence > > methods (choice, sample, choices) that will - similarly to how shuffle > does > > - take a zero-argument random distribution function of the users choice. > > Because it should be a zero-argument function, it would most likely > require > > to pass "configured" distribution function with lambda. I would see it > > being used like this: > > > > ```python > > import random > > random.choice([1, 2, 3], random=lambda: random.paretovariate(1.75)) > > ``` > The docs for shuffle say that: > > The optional argument random is a 0-argument function returning > a random float in [0.0, 1.0); by default, this is the function > random(). > > but random.paretovariate returns a float between [1.0, ∞). By > definition, every value it produces is out of range, and there's no way > of compressing it to [0, 1) without changing the shape. > > I think you need to consider more strongly what you are actually trying > to solve, go back to trying to understand the requirements before > writing the program. Because I don't think that "Choose an item from > this finite list according to an infinite distribution" is meaningful. > > > -- > Steven > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/5SRPE5QGTXJT3VLQFQFF4QXMVWH7DS3G/ > Code of Conduct: http://python.org/psf/codeofconduct/ > ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/MFLJWVSOERUWQWN5JNN46N2MQW66YITO/ Code of Conduct: http://python.org/psf/codeofconduct/