python - fitting curve: which model to describe distribution in weighted knowledge graphs -


as simple model represent knowledge network , learn properties of weighted graphs, computed cosine similarity between wikipedia articles.

i looking @ distribution of similarity weights each article (see pictures ).

in pictures, see curve changes derivative around value (maybe exponential, linear) : fit curve , extract value, derivate visibly (or expectedly) change, can divide similar articles in 2 sets: "most similar" (left side of threshold) , "others" (right side of threshold).

i want fit curve each article distribution; compare distribution respect mean distribution of articles; compare distribution respect distribution of random weighted network. (you're suggestions welcome in defining working procedure: know use model toy model train how network, or article, may evolve in time).

my background user experience twist data science, wish comprehend better model may describe distribution of values observed, proper way compare distributions, , python tools (or mathematica 11) fit curve , obtain derivative each point.

  • which model suggest describe distribution of observed values similarity between objects in weighted network (here, collaborative knowledge base represented weighted network, weight similarity value of 2 given articles - should expect exponential? poissonian ? why ?)
  • how compute curve fit , extract derivative of curve @ given point (python or mathematica 11)

enter image description here enter image description here

enter image description here enter image description here


enter image description here

working mathematica, suppose data in list data. if want find cubic polynomial best fits data, use fit function:

fit[data, {1, x, x^2, x^3}, x] 

in general usage fit command looks like

fit["data set", "list of functions", "independent variable"]  

where mathematica tries fit linear combination of functions in list data set. i'm not sure sort of curve expect data best modeled by, remember smooth function can approximated arbitrary precision polynomial sufficiently many terms. if have computational power spare, let list of functions long list of powers of x. although have asymptote @ x=0, maybe allow there 1/x term in there capture that. , of course can use plot plot curve on top of data compare them visually.

now best fit curve function in mathematica can take derivative of:

f[x_] := fit[data, {1, x, x^2, x^3}, x] 

and obvious change talking occurs when second derivative zero, x value:

nsolve[f''[x] == 0, x] 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -