Database Reference
In-Depth Information
3. Now that we have these, we can use Incanter to it the data:
(def lm (linear-model housing-units population))
4.
We'll talk more about graphing and plotting in a later chapter, but Incanter makes
it so easy that it's dificult not to look at it:
(def plot (scatter-plot population housing-units
:legend true))
(add-lines plot population (:fitted lm))
(view plot)
Here, you can see that the graph of housing units to families is a straight line:
How it works…
Under the hood, Incanter takes the data matrix and partitions it into chunks. It then
spreads those over the available CPUs to speed up processing. Of course, you don't have
to worry about this. This just works. That's part of what makes Incanter so powerful.
Partitioning Monte Carlo simulations for
better pmap performance
In the Parallelizing processing with pmap recipe we found that while using pmap is easy
enough, knowing when to use it is more complicated. Processing each task in the collection
has to take enough time to make the costs of threading, coordinating processing, and
communicating the data worth it. Otherwise, the program will spend more time with how
the parallelization is done and not enough time with what the task is.
 
Search WWH ::




Custom Search