Re: [sympy] EXOTIC STATS PROBLEM ; MODE, FUZZY CLUSTERS, ETC

2018-08-04 Thread docstar77
Thats a pretty interesting question you asked, not sure how to do it with
out the mode function.
I also do not know if the 'Frequency' function is available yet, sorry!
Hope someone else on here
can help you out, I'm interested in this now too!

On Fri, Aug 3, 2018 at 8:05 PM, Amy Valhausen 
wrote:

> EXOTIC STATS PROBLEM ; MODE, FUZZY CLUSTERS, ETC
>
> Hi I'm working on a math problem and not sure how to approach it.
>
> Trying to enumerate, rank and extract most common numeric ranges
> from a list, with a twist ;
>
> Basic operation example is, I have ten numeric values representing
> weights in variable unit measure types, i.e. grams, ounces, etc
>
> Each value is unique and is a decimal value,
> for example we have the following set of numbers
> shown below. In this set, we are interested in the
> most common magnitudinal range. Here the most
> common range value is shown by three values ;
>
> 295.999, 312.015, 330.111
>
> the complete set is shown ;
> .
> 102.35
> 8000.32
> 330.111
> 295.999
> 77.01
> 16.999
> 1099.222
> 645
> 890.01
> 312.015
> .
>
> What I want to be able to do, is to input a list of ten values similar to
> the above,
> and have some way, to simply, easily derive the most common value by range.
>
> If I was using values that were more static, for example if all value in
> the range
> in the list were all similar such as "310", then I could just use the mode
> function
> and it would easily tell me this.
>
> However since the values are variable decimal types, I am a bit stumped as
> to how
> I would accomplish this. I came across Python Fuzzy Clustering and it
> looks like
> this might work possibly in relation to mode but wondering if there is a
> simpler, easier, faster
> way to do this?
>
> The end goal is I want to be able to do pattern analysis on a list of
> numbers and return
> the most common range of highest magnitude.
>
> Outputs desired, as an example from the list above would be the thee
> values printed
> to screen, text file, or variable
>
>  better way to do this than ;
>
> 1.) Fuzzy Clustering
> 2.) Mode (most common value) of discrete data.
>
> What do I mean by define "most common value by range"
>
> Any set of ten values, there will be a few values
> that reoccur, but with slight variance. So for the above the most common
> range value would be 300 but with minor
> variance for each instance. What I need to do is to have a function that
> can tell what number magnitude
> occurs the most even though each instance is not fixed. If I had a set of
> ten numbers and out of ten
> I had three exact values occur I could just use a mode function, but since
> here - the magnitudes are comprable
> but not exact, mode wont work in the standard case, but there must be a
> way to achieve this?
>
> Why am I using "three" common range values?
>
> "three" is stated in the original post 'as an example'. Here, Im saying we
> have a fixed data set
> of ten decimal numeric values. In the set, a certain quantity of the ten
> values will approach a similiar
> threshold of magnitude, the other values with be random. The threshold
> 'cluster magnitude' could be any
> range, in a spectral type set. So here I chose three values, only to
> illustrate the concept I am after.
>
> This could change, so out of ten there could be four, five, six values
> with similiar magnitudes.
>
> Another way to view this problem might be like a sensor array, where each
> of the ten values in the set are picking
> up a pulse value represented by a decimal number and we want to interpret
> similiar values across the set as
> something like pressure, a curve, etc.
>
> The point is, while we can use a python mode type function to extract most
> common numeric values from a list
> where the values are exactly alike and fixed, here we cannot use mode,
> because the values are not exactly
> alike, only approximately alike, such as the examples I gave of ; 295.999,
> 312.015, 330.111
>
> In my situation, I need a
> mode like function but I do not think mode will work here. I wish this
> were the case.
> Ideally, it would be great if decimals could be retained, but it would be
> ok if we had
> to lose these. The problem however comes, where I am dealing with
> randomized data
> except that often numeric trends of similar magnitudes will occur in a
> set. It is the
> values of similar magnitude I want to capture. So for example if out of
> ten numbers,
> three of these values are close to, for example, 300 but may range up or
> down by say
> ten, then I want to grab these values. So for example ; 299, 308, 303 have
> similiar
> magnitudes but because they are not exact, mode wont return them if I
> understand correctly.
> I like your suggestion however, wondering, do you think some kind of
> simple iterative
> loop that checks and compares each number to all other numbers with an IF
> style statement
> checking upper, lower bounds of number value within +,- 10 would 

[sympy] Error? Mpmath Bound Method

2018-05-17 Thread docstar77
Hi, was trying to find a very large integer value, was taking large exponent
and the python command line through the following output, pardon my
 ignorance - am still a newb, is the following statement an error?
Following
the output I do get a resultant but am wondering if I can trust is, does
the following statement mean my output is skewed in any way?  See the below
;

>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAJiOfxTze%3D69g_%3Dn8tsohtfOEaJr%3D-%2Ban-CgSYQMvZL7gbxnBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] MultiProcessing for Simple Equations

2017-05-09 Thread docstar77 .
Im wondering if anyone cant tell me if multiprocessing can be used to speed
up equation solving for calculating really large numbers without having to
use a
user defined function?  Im trying to run a routine either in python 3.4
IDLE or as a simple script.  The below takes an average of about 10 seconds
to perform...
Id like to speed this up as much  as possible.  If I import
multiprocessessing
and if I use a pool ( I have two CPUS on my system), it seems the only thing
that  all the docs refer to is using this via a function (def), is there a
way  to
dump the below to multiprocessing with out having  to do that?  If  I cant
do that
- can someone give me a code tip on how to wrap the below in a function
statement that  will work in idle or as a script?  Am new to python and
also to Sympy.  thanks  for any feedback you can offer.  See code below
;

..

import sys
from sympy import mpmath
from mpmath import *
mpmath.mp.dps = 2

import time
e0=time.time()
c0=time.clock()

xxx = mpmath.power(1.41, 0.249429034 * 4500)
xy1 = xxx * 110.4807667
result1a = '%.2f'%((xy1) % 1080)
print(result1a)

elapsed_time=time.time() -e0
cpu_time=time.clock() -c0
print(cpu_time)

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAJiOfxTbr09YqHV%2BBmvFc3ABWWoL8zqfO0XyFaHhwtzmr7DYfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.