Skip to content

Instantly share code, notes, and snippets.

@ABeltramo
Created February 27, 2018 08:50
Show Gist options
  • Save ABeltramo/c58e0ef852b6cee25d57103ef6646459 to your computer and use it in GitHub Desktop.
Save ABeltramo/c58e0ef852b6cee25d57103ef6646459 to your computer and use it in GitHub Desktop.
\begin{algorithm}
\caption{ConcurrentGain - Le chiamate al calcolo dell'information gain vengono eseguite in parallelo utilizzando tutti i core disponibili.}
\label{alg:ID3_concurrentGain}
\begin{algorithmic}[1]
\Procedure{maxInformationGain}{$Dataset, Attributes, TargetAttributes$}
\Statex Calcola parallelamente l'attributo che meglio suddivide il dataset in input per classificare il target.
\State $Threads \gets $ [ ] \Comment{Creo un array di riferimenti ai Thread}
\ForAll{$Attribute$ in $Attributes$}
\If{$Attribute \not= TargetAttributes$} \Comment{Salto l'attributo Target}
\State $Threads[i] \gets concurrentGain(Attribute)$
\EndIf
\EndFor
\State Attendi il completamento dei Threads
\State $MaxGain \gets maxGain(Threads)$ \Comment{Ricerca il massimo IG}
\State \Return $MaxGain$
\EndProcedure
\end{algorithmic}
\end{algorithm}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment