ML Optimization and graphs
ml optimml optimml optimml optimml mcmcml mcmcml mcmcml graph communitiesml graph pagerankml graph centrality

ml optim <method> <expression> <json_bounds>


Description

    Minimize a function in a box with a metaheuristic and the default parameters.
Methods: de (differential evolution), pso (particle swarm), ga (genetic algorithm), anneal (simulated annealing), cmaes (CMA-ES).
Returns the best point, the value and the number of evaluations.

Parameters

    method:   de, pso, ga, anneal or cmaes - String - required
    expression:   The function, ex: (x-1)^2 + y^2 - String - required
    json_bounds:   The box, ex: {"x": [-5, 5], "y": [0, 10]} - String - required
admin
ml optim "de" "x^2 + y^2 - 10*cos(2*pi*x) - 10*cos(2*pi*y) + 20" "{\"x\": [-5.12, 5.12], \"y\": [-5.12, 5.12]}"
mentdb
{"x": {"x": -9.381357644183546E-10, "y": -2.477949455712503E-9}, "value": 0, "evaluations": 6022, "method": "de"}
Rosenbrock valley with CMA-ES
admin
ml optim "cmaes" "(1-x)^2 + 100*(y-x^2)^2" "{\"x\": [-2, 2], \"y\": [-1, 3]}"
mentdb
{"x": {"x": 1.0000000059956073, "y": 1.0000000121826966}, "value": 3.961384081139789E-17, "evaluations": 849, "method": "cmaes"}

ml optim <method> <expression> <json_bounds> <json_params>


Description

    Minimize or maximize a function with parameters:
- de {population, generations: 300, f: 0.8, cr: 0.9}
- pso {particles: 30, iterations: 300, inertia: 0.72, c1: 1.49, c2: 1.49}
- ga {population: 60, generations: 300, mutation: 0.1, elite: 2}
- anneal {iterations: 20000, t0: 1, cooling: 0.9995}
- cmaes {population, max_evals: 30000}
Every method takes {"maximize": true} and {"seed": 42}.

Parameters

    method:   The method - String - required
    expression:   The function - String - required
    json_bounds:   The box - String - required
    json_params:   The parameters - String - required
admin
ml optim "pso" "x*sin(x)" "{\"x\": [0, 10]}" "{\"maximize\": true}"
mentdb
{"x": {"x": 7.978665713503389}, "value": 7.916727371587783, "evaluations": 9032, "method": "pso"}
Genetic algorithm, 100 individuals
admin
ml optim "ga" "(x-3)^2 + (y+1)^2 + abs(z)" "{\"x\": [-10, 10], \"y\": [-10, 10], \"z\": [-10, 10]}" "{\"population\": 100, \"generations\": 200}"
mentdb
{"x": {"x": 3, "y": -1, "z": -3.56866824055463E-44}, "value": 3.56866824055463E-44, "evaluations": 19702, "method": "ga"}

ml optim <method> <json_objectives> <json_bounds>


Description

    Multi-objective optimization with the method nsga2 (NSGA-II): the objectives are a JSON array of expressions to minimize; returns the Pareto front (non-dominated solutions) and its knee point

Parameters

    method:   nsga2 - String - required
    json_objectives:   The objectives, ex: ["cost", "-quality"] - String - required
    json_bounds:   The bounds {"x": [min, max]} - String - required
admin
ml optim "nsga2" "[\"x^2\", \"(x-2)^2\"]" "{\"x\": [-5, 5]}"
mentdb
{"objectives": 2, "variables": 1, "front_size": 100, "evaluations": 20100, "knee": {"variables": {"x": 1.0057876734346567}, "objectives": [1.0116088440330997, 0.9884581502944728]}, "front": [{"variables": {"x": -3.2033717809687445E-5}, "objectives": [1.0261590767106867E-9, 4.000128135897398]}, {"variables": {"x": 0.004446482173683208}, "objectives": [1.9771203720882548E-5, 3.9822338425089883]}, {"variables": {"x": 0.0503106303287125}, "objectives": [0.0025311595240723656, 3.801288638209223]}, {"variables": {"x": 0.0654095084288886}, "objectives": [0.004278403792908848, 3.7426403700773543]}, {"variables": {"x": 0.08499146585638126}, "objectives": [0.007223549268416421, 3.667257685842891]}, {"variables": {"x": 0.10095989989228898}, "objectives": [0.010192901386261013, 3.6063533018171055]}, {"variables": {"x": 0.11914878943076396}, "objectives": [0.014196434022816529, 3.537601276299761]}, {"variables": {"x": 0.1389222478768648}, "objectives": [0.019299390955161068, 3.4636103994477017]}, {"variables": {"x": 0.15648527381827543}, "objectives": [0.024487640921980636, 3.398546545648879]}, {"variables": {"x": 0.19946304264442888}, "objectives": [0.03978550538097325, 3.241933334803258]}, {"variables": {"x": 0.2124836781951906}, "objectives": [0.045149313499357316, 3.195214600718595]}, {"variables": {"x": 0.23205444515660156}, "objectives": [0.0538492655169382, 3.125631484890532]}, {"variables": {"x": 0.2574521088844086}, "objectives": [0.06628158836902939, 3.036473152831395]}, {"variables": {"x": 0.2914224383448225}, "objectives": [0.08492703757084187, 2.919237284191552]}, {"variables": {"x": 0.31173375371223266}, "objectives": [0.09717793320351893, 2.850242918354588]}, {"variables": {"x": 0.3331994767515347}, "objectives": [0.11102189130749653, 2.778223984301358]}, {"variables": {"x": 0.35202209720728717}, "objectives": [0.12391955692221673, 2.715831168093068]}, {"variables": {"x": 0.3790688716979052}, "objectives": [0.1436932094903229, 2.627417722698702]}, {"variables": {"x": 0.3953665293141482}, "objectives": [0.15631469250191518, 2.5748485752453223]}, {"variables": {"x": 0.4266696706410822}, "objectives": [0.18204700784496955, 2.4753683252806407]}, {"variables": {"x": 0.4487186397715408}, "objectives": [0.2013484176784218, 2.4064738585922587]}, {"variables": {"x": 0.4877051437540538}, "objectives": [0.23785630724416232, 2.287035732227947]}, {"variables": {"x": 0.4968137515026717}, "objectives": [0.24682390368215842, 2.259568897671472]}, {"variables": {"x": 0.5295962188028533}, "objectives": [0.2804721549702797, 2.1620872797588664]}, {"variables": {"x": 0.5430828664875935}, "objectives": [0.2949389998723813, 2.1226075339220074]}, {"variables": {"x": 0.5620339786561885}, "objectives": [0.315882193164105, 2.067746278539351]}, {"variables": {"x": 0.5946568700279478}, "objectives": [0.35361679307143556, 1.9749893129596445]}, {"variables": {"x": 0.6360682305897634}, "objectives": [0.4045827939655924, 1.860309871606539]}, {"variables": {"x": 0.6497354024324108}, "objectives": [0.4221560931740068, 1.823214483444364]}, {"variables": {"x": 0.6711417105522248}, "objectives": [0.4504311956429663, 1.765864353434067]}, {"variables": {"x": 0.6885475008735187}, "objectives": [0.4740976609591682, 1.7199076574650936]}, {"variables": {"x": 0.7047427594946098}, "objectives": [0.4966623570600775, 1.677691319081638]}, {"variables": {"x": 0.7191490708305297}, "objectives": [0.5171753860764142, 1.6405791027542955]}, {"variables": {"x": 0.7509632948753675}, "objectives": [0.5639458702500681, 1.5600926907485981]}, {"variables": {"x": 0.771918349148111}, "objectives": [0.5958579377515449, 1.508184541159101]}, {"variables": {"x": 0.7847209715640033}, "objectives": [0.6157870032123534, 1.47690311695634]}, {"variables": {"x": 0.801263061909643}, "objectives": [0.6420224943808164, 1.4369702467422443]}, {"variables": {"x": 0.8109781393242188}, "objectives": [0.657685542461772, 1.4137729851648968]}, {"variables": {"x": 0.851566212136583}, "objectives": [0.7251650136526478, 1.318900165106316]}, {"variables": {"x": 0.8712751768333395}, "objectives": [0.759120433765967, 1.274019726432609]}, {"variables": {"x": 0.8979695474843246}, "objectives": [0.8063493082092026, 1.2144711182719043]}, {"variables": {"x": 0.922469881302014}, "objectives": [0.8509506819093519, 1.1610711567012957]}, {"variables": {"x": 0.9365487639694954}, "objectives": [0.8771235872927896, 1.130928531414808]}, {"variables": {"x": 0.9515344152676639}, "objectives": [0.9054177434387751, 1.0992800823681195]}, {"variables": {"x": 0.9710311417152953}, "objectives": [0.9429014781809099, 1.0587769113197287]}, {"variables": {"x": 1.0057876734346567}, "objectives": [1.0116088440330997, 0.9884581502944728]}, {"variables": {"x": 1.0173622724909264}, "objectives": [1.0350259934879018, 0.9655769035241965]}, {"variables": {"x": 1.0427547773821495}, "objectives": [1.0873375257532962, 0.9163184162246981]}, {"variables": {"x": 1.0572830939210711}, "objectives": [1.1178475406913124, 0.8887151650070281]}, {"variables": {"x": 1.0696497796771827}, "objectives": [1.1441506511634454, 0.8655515324547147]}, {"variables": {"x": 1.086517516227282}, "objectives": [1.180520313068702, 0.834450248159574]}, {"variables": {"x": 1.0909916101871593}, "objectives": [1.1902626934987706, 0.8262962527501334]}, {"variables": {"x": 1.1086929138728785}, "objectives": [1.229199977271934, 0.79442832178042]}, {"variables": {"x": 1.1287662805535117}, "objectives": [1.274113316114609, 0.7590481939005623]}, {"variables": {"x": 1.1494793366644498}, "objectives": [1.3213027454185435, 0.7233853987607444]}, {"variables": {"x": 1.1642079731519723}, "objectives": [1.3553802047506236, 0.6985483121427342]}, {"variables": {"x": 1.174508387539206}, "objectives": [1.3794699523999456, 0.6814364022431219]}, {"variables": {"x": 1.2046734090942475}, "objectives": [1.4512380225787562, 0.6325443862017662]}, {"variables": {"x": 1.2331992015618338}, "objectives": [1.5207802707327445, 0.5879834644854092]}, {"variables": {"x": 1.2416475812858627}, "objectives": [1.541688716113033, 0.5750983909695822]}, {"variables": {"x": 1.267309940081875}, "objectives": [1.6060744842303256, 0.5368347239028256]}, {"variables": {"x": 1.3086927264920571}, "objectives": [1.7126766523732142, 0.47790574640498573]}, {"variables": {"x": 1.3250637136693713}, "objectives": [1.7557938452832655, 0.45553899060578046]}, {"variables": {"x": 1.353021406379883}, "objectives": [1.8306669261221968, 0.41858130060266435]}, {"variables": {"x": 1.3714115541159775}, "objectives": [1.8807696507628007, 0.3951234342988907]}, {"variables": {"x": 1.385196990430464}, "objectives": [1.9187707022976148, 0.37798274057575904]}, {"variables": {"x": 1.3928324005298167}, "objectives": [1.9399820959656517, 0.36865249384638493]}, {"variables": {"x": 1.40877456861142}, "objectives": [1.9846457851662922, 0.34954751072061263]}, {"variables": {"x": 1.4272136509542979}, "objectives": [2.0369388054702964, 0.3280842016531049]}, {"variables": {"x": 1.4493467430779856}, "objectives": [2.1006059816707645, 0.303219009358822]}, {"variables": {"x": 1.4559550461231157}, "objectives": [2.1198050963313637, 0.2959849118389012]}, {"variables": {"x": 1.4716442415094821}, "objectives": [2.165736773568019, 0.27915980753009045]}, {"variables": {"x": 1.4862423210289732}, "objectives": [2.2089162368175894, 0.2639469527016966]}, {"variables": {"x": 1.5096803500858818}, "objectives": [2.2791347594354305, 0.24041335909190348]}, {"variables": {"x": 1.5369116152662528}, "objectives": [2.362097313140322, 0.21445085207531112]}, {"variables": {"x": 1.5708770182739193}, "objectives": [2.4676546065411595, 0.18414653344548215]}, {"variables": {"x": 1.5958750950672764}, "objectives": [2.5468173190559886, 0.16331693878688286]}, {"variables": {"x": 1.6181109741378894}, "objectives": [2.6182831246254694, 0.14583922807391178]}, {"variables": {"x": 1.6526361662139497}, "objectives": [2.731206297878342, 0.12066163302254278]}, {"variables": {"x": 1.679883037825218}, "objectives": [2.822007020772883, 0.10247486947201076]}, {"variables": {"x": 1.6851550629277756}, "objectives": [2.839747586111115, 0.09912733440001294]}, {"variables": {"x": 1.7024215585801155}, "objectives": [2.8982391631183493, 0.08855292879788766]}, {"variables": {"x": 1.718723617640259}, "objectives": [2.954010873834419, 0.07911640327338325]}, {"variables": {"x": 1.7382099599539405}, "objectives": [3.0213738648830795, 0.06853402506731746]}, {"variables": {"x": 1.7579573984830432}, "objectives": [3.090414214881269, 0.058584620949096326]}, {"variables": {"x": 1.7746937400827019}, "objectives": [3.1495378710887287, 0.0507629107579211]}, {"variables": {"x": 1.7902492412969604}, "objectives": [3.2049923459643423, 0.043995380776500746]}, {"variables": {"x": 1.811542188703557}, "objectives": [3.2816851014528736, 0.035516346638645724]}, {"variables": {"x": 1.823667703548511}, "objectives": [3.3257638929658997, 0.031093078771855825]}, {"variables": {"x": 1.8372044810459098}, "objectives": [3.375320305175171, 0.02650238099153153]}, {"variables": {"x": 1.8513350827390966}, "objectives": [3.427441588580578, 0.022101257624191243]}, {"variables": {"x": 1.8640922387301255}, "objectives": [3.4748398744938913, 0.018470919573389193]}, {"variables": {"x": 1.8824356553838917}, "objectives": [3.543563996660582, 0.013821375125015077]}, {"variables": {"x": 1.910243823362314}, "objectives": [3.6490314646938717, 0.008056171244615487]}, {"variables": {"x": 1.9294007565288194}, "objectives": [3.7225872792939807, 0.00498425317870304]}, {"variables": {"x": 1.9435335950910881}, "objectives": [3.7773228352476895, 0.0031884548833371854]}, {"variables": {"x": 1.962584473693265}, "objectives": [3.8517378163818696, 0.0013999216088099833]}, {"variables": {"x": 1.980144592531688}, "objectives": [3.920972607332485, 3.942372057326974E-4]}, {"variables": {"x": 1.9941745092506988}, "objectives": [3.9767319733452657, 3.3936342470193455E-5]}, {"variables": {"x": 1.999990444879367}, "objectives": [3.9999617796087685, 9.130033031008356E-11]}]}

ml optim <method> <json_objectives> <json_bounds> <json_params>


Description

    NSGA-II with parameters: population (100, even), generations (200), constraints (expressions g <= 0), maximize (one true / false per objective), seed

Parameters

    method:   nsga2 - String - required
    json_objectives:   The objectives - String - required
    json_bounds:   The bounds - String - required
    json_params:   The parameters - String - required
admin
ml optim "nsga2" "[\"x\", \"(1+y)/x\"]" "{\"x\": [0.1, 1], \"y\": [0, 5]}" "{\"constraints\": [\"6 - (y+9*x)\", \"1 - (9*x-y)\"], \"generations\": 100}"
mentdb
{"objectives": 2, "variables": 2, "front_size": 100, "evaluations": 10100, "knee": {"variables": {"x": 0.5982145387724666, "y": 0.6193753437053338}, "objectives": [0.5982145387724666, 2.7070143547970003]}, "front": [{"variables": {"x": 0.390502381817038, "y": 2.4913025707622163}, "objectives": [0.390502381817038, 8.940541039767577]}, {"variables": {"x": 0.390502381817038, "y": 2.4913025707622163}, "objectives": [0.390502381817038, 8.940541039767577]}, {"variables": {"x": 0.3911991977009646, "y": 2.4913025707622163}, "objectives": [0.3911991977009646, 8.924615876720157]}, {"variables": {"x": 0.3945638538537516, "y": 2.452093220634288}, "objectives": [0.3945638538537516, 8.74913702032583]}, {"variables": {"x": 0.39909651676597174, "y": 2.4758149159349414}, "objectives": [0.39909651676597174, 8.709208850282055]}, {"variables": {"x": 0.4009171893812429, "y": 2.39218349429755}, "objectives": [0.4009171893812429, 8.461057754926621]}, {"variables": {"x": 0.4019122569790034, "y": 2.39218349429755}, "objectives": [0.4019122569790034, 8.440109589578313]}, {"variables": {"x": 0.4046467630473584, "y": 2.368370028870373}, "objectives": [0.4046467630473584, 8.324223338655871]}, {"variables": {"x": 0.40802487288096195, "y": 2.37107465767249}, "objectives": [0.40802487288096195, 8.261934214623173]}, {"variables": {"x": 0.4086593035318771, "y": 2.3235063338191733}, "objectives": [0.4086593035318771, 8.132706890790082]}, {"variables": {"x": 0.4128823818092859, "y": 2.3028692186855038}, "objectives": [0.4128823818092859, 7.9995402182385416]}, {"variables": {"x": 0.41586350345567147, "y": 2.3028692186855038}, "objectives": [0.41586350345567147, 7.942195434896031]}, {"variables": {"x": 0.4182271958553442, "y": 2.2456271765906086}, "objectives": [0.4182271958553442, 7.760440279242867]}, {"variables": {"x": 0.4231021709940811, "y": 2.2727835883866394}, "objectives": [0.4231021709940811, 7.735208686585594]}, {"variables": {"x": 0.42597390555932985, "y": 2.2456271765906086}, "objectives": [0.42597390555932985, 7.6193098549755085]}, {"variables": {"x": 0.427090865509902, "y": 2.164065779380774}, "objectives": [0.427090865509902, 7.408413606793508]}, {"variables": {"x": 0.4282898934568765, "y": 2.164065779380774}, "objectives": [0.4282898934568765, 7.38767322722117]}, {"variables": {"x": 0.432176671183908, "y": 2.1347815466916016}, "objectives": [0.432176671183908, 7.253472377637038]}, {"variables": {"x": 0.43386670328672, "y": 2.0955836758799538}, "objectives": [0.43386670328672, 7.134872651968047]}, {"variables": {"x": 0.4403841029346961, "y": 2.061547793545479}, "objectives": [0.4403841029346961, 6.951994345716588]}, {"variables": {"x": 0.4403841029346961, "y": 2.061547793545479}, "objectives": [0.4403841029346961, 6.951994345716588]}, {"variables": {"x": 0.4448349462702811, "y": 2.0054963632612632}, "objectives": [0.4448349462702811, 6.756430420902966]}, {"variables": {"x": 0.44867245656479154, "y": 1.9972347422777816}, "objectives": [0.44867245656479154, 6.6802289697606145]}, {"variables": {"x": 0.4542224397891678, "y": 1.9323446665213801}, "objectives": [0.4542224397891678, 6.455745928982414]}, {"variables": {"x": 0.45474277231547294, "y": 1.920974754459543}, "objectives": [0.45474277231547294, 6.423356086753036]}, {"variables": {"x": 0.4594051310243723, "y": 1.877323483538685}, "objectives": [0.4594051310243723, 6.263150516240181]}, {"variables": {"x": 0.4611435619633529, "y": 1.8568422259453736}, "objectives": [0.4611435619633529, 6.195125469782461]}, {"variables": {"x": 0.4656161635218779, "y": 1.8201061450757492}, "objectives": [0.4656161635218779, 6.056718743921443]}, {"variables": {"x": 0.4699601106991667, "y": 1.7908856460219296}, "objectives": [0.4699601106991667, 5.938558576535117]}, {"variables": {"x": 0.47244804912205535, "y": 1.757944251997686}, "objectives": [0.47244804912205535, 5.837560885525385]}, {"variables": {"x": 0.477002030560958, "y": 1.7082957492081465}, "objectives": [0.477002030560958, 5.6777446964390705]}, {"variables": {"x": 0.4828513806829812, "y": 1.6991852859728898}, "objectives": [0.4828513806829812, 5.590095408146]}, {"variables": {"x": 0.4863522881929447, "y": 1.6264192033817904}, "objectives": [0.4863522881929447, 5.400240252061573]}, {"variables": {"x": 0.49248068172653015, "y": 1.6264192033817904}, "objectives": [0.49248068172653015, 5.333040057884374]}, {"variables": {"x": 0.49277628081755664, "y": 1.5661733268926261}, "objectives": [0.49277628081755664, 5.207582886568996]}, {"variables": {"x": 0.4991311965028065, "y": 1.5615735459212245}, "objectives": [0.4991311965028065, 5.132064603192603]}, {"variables": {"x": 0.5015864745556683, "y": 1.4908779926820919}, "objectives": [0.5015864745556683, 4.9659991228604055]}, {"variables": {"x": 0.5028223173354573, "y": 1.4908779926820919}, "objectives": [0.5028223173354573, 4.953793630087237]}, {"variables": {"x": 0.5099659506383377, "y": 1.4908720491852225}, "objectives": [0.5099659506383377, 4.884388940217152]}, {"variables": {"x": 0.5106089837321767, "y": 1.4276367240594967}, "objectives": [0.5106089837321767, 4.754394852819186]}, {"variables": {"x": 0.5130829093173123, "y": 1.3823416780490918}, "objectives": [0.5130829093173123, 4.643190476211615]}, {"variables": {"x": 0.5171528239599615, "y": 1.3493661067925855}, "objectives": [0.5171528239599615, 4.542885580326011]}, {"variables": {"x": 0.5222947587044192, "y": 1.3493661067925855}, "objectives": [0.5222947587044192, 4.498161368918035]}, {"variables": {"x": 0.5247711712022195, "y": 1.285534060183763}, "objectives": [0.5247711712022195, 4.355296528480672]}, {"variables": {"x": 0.5247711712022195, "y": 1.285534060183763}, "objectives": [0.5247711712022195, 4.355296528480672]}, {"variables": {"x": 0.5347173741635942, "y": 1.237082489360049}, "objectives": [0.5347173741635942, 4.183672716562271]}, {"variables": {"x": 0.5375276308101807, "y": 1.1637241600619286}, "objectives": [0.5375276308101807, 4.025326394478896]}, {"variables": {"x": 0.5495849973079587, "y": 1.1178718034818205}, "objectives": [0.5495849973079587, 3.853583729279051]}, {"variables": {"x": 0.5505270199636029, "y": 1.0471848011188676}, "objectives": [0.5505270199636029, 3.7185909626274363]}, {"variables": {"x": 0.5563372347054074, "y": 1.0295959149748015}, "objectives": [0.5563372347054074, 3.6481396325189634]}, {"variables": {"x": 0.559515656862443, "y": 0.9739105715800552}, "objectives": [0.559515656862443, 3.5278915743824157]}, {"variables": {"x": 0.559515656862443, "y": 0.9739105715800552}, "objectives": [0.559515656862443, 3.5278915743824157]}, {"variables": {"x": 0.5678472902244058, "y": 0.8894983874679778}, "objectives": [0.5678472902244058, 3.327476277506357]}, {"variables": {"x": 0.5741373465233661, "y": 0.8894983874679778}, "objectives": [0.5741373465233661, 3.291021562888488]}, {"variables": {"x": 0.5780262738885945, "y": 0.8719916944954781}, "objectives": [0.5780262738885945, 3.2385927406065886]}, {"variables": {"x": 0.5829039963428857, "y": 0.8132627159891793}, "objectives": [0.5829039963428857, 3.110739894331675]}, {"variables": {"x": 0.5893849783296028, "y": 0.7252185736487434}, "objectives": [0.5893849783296028, 2.9271505672544413]}, {"variables": {"x": 0.5894866255791782, "y": 0.7071963801739422}, "objectives": [0.5894866255791782, 2.8960731356654614]}, {"variables": {"x": 0.594134387424121, "y": 0.659205332926696}, "objectives": [0.594134387424121, 2.79264315960604]}, {"variables": {"x": 0.5982145387724666, "y": 0.6193753437053338}, "objectives": [0.5982145387724666, 2.7070143547970003]}, {"variables": {"x": 0.6009280395563759, "y": 0.6114008109755357}, "objectives": [0.6009280395563759, 2.6815204232525462]}, {"variables": {"x": 0.6052349273198883, "y": 0.5652924928451794}, "objectives": [0.6052349273198883, 2.586256050649017]}, {"variables": {"x": 0.6052349273198883, "y": 0.5652924928451794}, "objectives": [0.6052349273198883, 2.586256050649017]}, {"variables": {"x": 0.614456482193179, "y": 0.491830780496184}, "objectives": [0.614456482193179, 2.427886797078604]}, {"variables": {"x": 0.6250180430177015, "y": 0.44450945384487}, "objectives": [0.6250180430177015, 2.3111484060052314]}, {"variables": {"x": 0.6314088005628605, "y": 0.41703161575227393}, "objectives": [0.6314088005628605, 2.244237987321496]}, {"variables": {"x": 0.6332837673611452, "y": 0.3132586615631776}, "objectives": [0.6332837673611452, 2.0737286020064056]}, {"variables": {"x": 0.6422357720152042, "y": 0.23983189616231182}, "objectives": [0.6422357720152042, 1.9304933642546467]}, {"variables": {"x": 0.6489228361951807, "y": 0.23017103528197974}, "objectives": [0.6489228361951807, 1.8957123507855305]}, {"variables": {"x": 0.6490598569885041, "y": 0.17143210404981266}, "objectives": [0.6490598569885041, 1.8048136723244625]}, {"variables": {"x": 0.6517557630892764, "y": 0.14228050382736598}, "objectives": [0.6517557630892764, 1.7526204884066339]}, {"variables": {"x": 0.658750508545848, "y": 0.07239194703837437}, "objectives": [0.658750508545848, 1.6279182074646363]}, {"variables": {"x": 0.6638923907304001, "y": 0.04874405311983354}, "objectives": [0.6638923907304001, 1.5796898228732943]}, {"variables": {"x": 0.6706678526581964, "y": 0}, "objectives": [0.6706678526581964, 1.4910510411919902]}, {"variables": {"x": 0.6909816634083736, "y": 0}, "objectives": [0.6909816634083736, 1.447216406680527]}, {"variables": {"x": 0.696180665316556, "y": 0}, "objectives": [0.696180665316556, 1.4364087510894836]}, {"variables": {"x": 0.7037183238932462, "y": 0}, "objectives": [0.7037183238932462, 1.4210231083192593]}, {"variables": {"x": 0.7217262695762593, "y": 0}, "objectives": [0.7217262695762593, 1.385566858453304]}, {"variables": {"x": 0.7320698901136861, "y": 0}, "objectives": [0.7320698901136861, 1.3659897961992482]}, {"variables": {"x": 0.7437883109787482, "y": 0}, "objectives": [0.7437883109787482, 1.3444685607980364]}, {"variables": {"x": 0.7616897943077966, "y": 0}, "objectives": [0.7616897943077966, 1.3128704197865397]}, {"variables": {"x": 0.7732275483785058, "y": 0}, "objectives": [0.7732275483785058, 1.2932803572467724]}, {"variables": {"x": 0.786135212722653, "y": 0}, "objectives": [0.786135212722653, 1.272045805627585]}, {"variables": {"x": 0.7972173664111486, "y": 0}, "objectives": [0.7972173664111486, 1.2543630409128224]}, {"variables": {"x": 0.8151572376196615, "y": 0}, "objectives": [0.8151572376196615, 1.2267571872637693]}, {"variables": {"x": 0.8237083789099094, "y": 0}, "objectives": [0.8237083789099094, 1.214021886390659]}, {"variables": {"x": 0.8299181634929069, "y": 0}, "objectives": [0.8299181634929069, 1.2049380818360012]}, {"variables": {"x": 0.8553298075732652, "y": 0}, "objectives": [0.8553298075732652, 1.1691396595158912]}, {"variables": {"x": 0.8723142545082484, "y": 0}, "objectives": [0.8723142545082484, 1.1463758557559423]}, {"variables": {"x": 0.8776105349471597, "y": 0}, "objectives": [0.8776105349471597, 1.1394576069670919]}, {"variables": {"x": 0.8895863314282287, "y": 0}, "objectives": [0.8895863314282287, 1.12411799133031]}, {"variables": {"x": 0.902027726812664, "y": 0}, "objectives": [0.902027726812664, 1.1086133721560016]}, {"variables": {"x": 0.9172923285401867, "y": 0}, "objectives": [0.9172923285401867, 1.0901650094375448]}, {"variables": {"x": 0.9278948003533621, "y": 0}, "objectives": [0.9278948003533621, 1.0777083777376257]}, {"variables": {"x": 0.9438150124420864, "y": 0}, "objectives": [0.9438150124420864, 1.0595296608098412]}, {"variables": {"x": 0.9553633609041163, "y": 0}, "objectives": [0.9553633609041163, 1.0467221592563916]}, {"variables": {"x": 0.97298897544164, "y": 0.013349465586953158}, "objectives": [0.97298897544164, 1.0414809326354326]}, {"variables": {"x": 0.9872885269508576, "y": 0}, "objectives": [0.9872885269508576, 1.0128751349804506]}, {"variables": {"x": 1, "y": 0}, "objectives": [1, 1]}, {"variables": {"x": 1, "y": 0}, "objectives": [1, 1]}]}
Used in use cases (1 recipe)

    Process & reactor engineer › Fit Arrhenius parameters with a global optimizer
Often used with

    math exp

ml mcmc <log_density> <json_init>


Description

    Sample a posterior with MCMC (adaptive random walk Metropolis-Hastings, 4 chains of 5000 draws after 2000 of warm-up): the log density is an expression in the parameters (same syntax as ml optim, ln = natural logarithm); mean, sd, median, 95 % credible interval, split R-hat (< 1.05) and effective sample size of each parameter

Parameters

    log_density:   The log posterior (up to a constant) - String - required
    json_init:   The initial values {"name": value} - String - required
admin
ml mcmc "-21*ln(s) - (76 + 20*(m-5)^2)/(2*s^2)" "{\"m\": 4, \"s\": 1}" "{\"bounds\": {\"s\": [0, null]}}"
mentdb
{"parameters": [{"parameter": "s", "mean": 2.095942992368577, "sd": 0.3628258958553108, "median": 2.0431875728536957, "lower": 1.5417615591765041, "upper": 2.9507669125464377, "rhat": 1.0012095199984568, "ess": 2057.3683271401496}, {"parameter": "m", "mean": 4.99707151660001, "sd": 0.46471191558126196, "median": 4.994923661386166, "lower": 4.072259239193639, "upper": 5.884783561375852, "rhat": 1.0006907197061314, "ess": 2496.6456593822436}], "acceptance": 0.2617, "chains": 4, "draws": 20000, "converged": true}

ml mcmc <log_density> <json_init> <json_params>


Description

    MCMC with parameters: chains (4), iterations (5000), burn_in (2000), thin (1), bounds {"name": [min, max]} (null = no limit), level, seed, samples (number of draws returned)

Parameters

    log_density:   The log posterior - String - required
    json_init:   The initial values - String - required
    json_params:   The parameters - String - required
admin
ml mcmc "2*(a+b*1) - 20*ln(1+exp(a+b*1)) + 8*(a+b*2) - 20*ln(1+exp(a+b*2)) + 17*(a+b*3) - 20*ln(1+exp(a+b*3))" "{\"a\": 0, \"b\": 0}" "{\"iterations\": 4000, \"samples\": 3}"
mentdb
{"parameters": [{"parameter": "a", "mean": -4.56786909898477, "sd": 1.1217755929420508, "median": -4.474129247812157, "lower": -6.955034088089458, "upper": -2.540138920758467, "rhat": 1.0022951421838078, "ess": 2158.8062419124763}, {"parameter": "b", "mean": 2.1133067385740034, "sd": 0.5064875881673842, "median": 2.070598467618345, "lower": 1.2083323050935233, "upper": 3.192129340169593, "rhat": 1.0017959229560722, "ess": 2228.0255418194292}], "acceptance": 0.2930625, "chains": 4, "draws": 16000, "converged": true, "samples": [[-4.987180230664025, 2.6115746269592846], [-8.020412334287773, 3.5576870718337874], [-4.477884366880547, 2.4790781760144345]]}

ml mcmc <log_density> <json_init> <json_params>


Description

    MCMC with the No-U-Turn sampler: {"method": "nuts"} (Hoffman and Gelman, exact gradients of the expression, step size by dual averaging, 1000 draws after 1000 of warm-up): much larger effective sample sizes on correlated posteriors; max_depth (10), target_accept (0.8); divergent transitions reported

Parameters

    log_density:   The log posterior - String - required
    json_init:   The initial values - String - required
    json_params:   The parameters - String - required
admin
ml mcmc "-0.5*(x^2 + (y/10)^2) - 0.5*((x+y/10)^2)" "{\"x\": 0, \"y\": 0}" "{\"method\": \"nuts\", \"chains\": 2}"
mentdb
{"parameters": [{"parameter": "x", "mean": -0.02683366646795284, "sd": 0.7999993366575558, "median": -0.014109147025500868, "lower": -1.6007893167377594, "upper": 1.5338771180765702, "rhat": 0.9999529593885311, "ess": 1061.7095386946817}, {"parameter": "y", "mean": 0.14042155321776068, "sd": 8.280891955235793, "median": 0.06151259496861991, "lower": -15.620968718313279, "upper": 16.63528149232199, "rhat": 1.0016366798815968, "ess": 387.4727948337872}], "acceptance": 0.862792, "chains": 2, "draws": 2000, "converged": true, "method": "nuts", "divergent_transitions": 0}
Used in use cases (1 recipe)

    Statistician & biostatistician › Bayesian logistic regression by MCMC

ml graph communities <json_edges> <method>


Description

    Communities of an undirected graph: louvain (maximum of the modularity) or label_propagation; returns the community of each node, the sizes and the modularity

Parameters

    json_edges:   The edges [[a, b], [a, b, weight], ...] - String - required
    method:   louvain or label_propagation - String - required
admin
ml graph communities "[[\"a\", \"b\"], [\"b\", \"c\"], [\"a\", \"c\"], [\"c\", \"d\"], [\"d\", \"e\"], [\"e\", \"f\"], [\"d\", \"f\"]]" "louvain"
mentdb
{"communities": {"a": 0, "b": 0, "c": 0, "d": 1, "e": 1, "f": 1}, "n_communities": 2, "sizes": [3, 3], "modularity": 0.3571428571428571}
Used in use cases (1 recipe)

    Epidemiologist › Clusters and super-spreaders of a contact network
Often used with

    ml graph centrality

ml graph pagerank <json_edges> <damping>


Description

    PageRank of the nodes of a directed graph (the dangling nodes spread their rank uniformly)

Parameters

    json_edges:   The directed edges [[from, to], ...] - String - required
    damping:   The damping factor, ex: 0.85 - Number - required
admin
ml graph pagerank "[[\"a\", \"b\"], [\"b\", \"c\"], [\"c\", \"a\"], [\"d\", \"c\"]]" 0.85
mentdb
{"a": 0.3202137998054778, "b": 0.30968172983465614, "c": 0.33260447035986596, "d": 0.037500000000000006}

ml graph centrality <json_edges> <type>


Description

    Centrality of the nodes of an undirected graph: degree (normalized), weighted_degree, betweenness (Brandes, normalized) or closeness (Wasserman and Faust)

Parameters

    json_edges:   The edges - String - required
    type:   degree, weighted_degree, betweenness or closeness - String - required
admin
ml graph centrality "[[\"a\", \"b\"], [\"b\", \"c\"], [\"c\", \"d\"], [\"d\", \"e\"]]" "betweenness"
mentdb
{"a": 0, "b": 0.5, "c": 0.6666666666666666, "d": 0.5, "e": 0}
admin
ml graph centrality "[[\"a\", \"b\"], [\"b\", \"c\"], [\"a\", \"c\"], [\"c\", \"d\"], [\"d\", \"e\"], [\"e\", \"f\"], [\"d\", \"f\"]]" "closeness"
mentdb
{"a": 0.5, "b": 0.5, "c": 0.7142857142857143, "d": 0.7142857142857143, "e": 0.5, "f": 0.5}
Used in use cases (1 recipe)

    Epidemiologist › Clusters and super-spreaders of a contact network
Often used with

    ml graph communities