New answers tagged

5

Right now you can use MDPtoolbox via RLink. Reinforcement learning is expected in the next version of Mathematica. You can see this presentation from the Wolfram Conference 2015. A lot of interesting things are expected in the machine learning functionality (slides 10, 11 or images below).


3

You draft code gives on my PC 1.11 s. This version is better (the best I've got so far is 0.26 s), though Permutations preserved (I cannot see how to avoid them efficiently): ({p2, p3} = DeleteCases[Permutations[Range[0, 9], {#}], {0, __}] & /@ {2, 3}; list = Flatten[Outer[Join, p3, p2, 1], 1]; tmp2 = (FromDigits[#] & /@ list[[All, 1 ;; ...


0

This may be of some use to you: HornerForm[-1 - x + 3 x^3 - x^4 + x^5 - 3 x^6 + 2 x^7 + x^9] -1 + x (-1 + x^2 (3 + x (-1 + x (1 + x (-3 + x (2 + x^2))))))


4

I couldn't figure out a quick way to import the data how you had your paste formatted (with curly brackets for each element, but no outer curly brackets) so I reformatted it and repasted it. data = Import["http://pastebin.com/raw/V8807EsY", "Table"]; You say you'd like to average the duplicate points, so using Mean in combination with GatherBy should ...


3

Most of your time is spent in defining PolarCoords. Let's take a look at your code. It looks like you've tried to optimize it already. Let's try to simplify it first: PolarCoords = Map[Function[i, ToPolarCoordinates /@ newCoord[[i]] /. {x_, y_} /; y < 0 -> {x, y + 2 \[Pi]}], Range@Length@pts] Simpler: PolarCoords = ...


3

If you use float instead integer you can reduce the computing time. data = RandomInteger[{1, 400}, {5000, 2}]; c = 10.; r = 60.; pts = c + r {Cos[#], Sin[#]} & /@ Range[0., 2. π, 2. π/16.]; newCoord = Table[(# - pts[[i]]) & /@ data, {i, 1, Length@pts}]; PolarCoords = Table[ToPolarCoordinates[#] & /@ ...



Top 50 recent answers are included