Last active
August 29, 2015 14:22
-
-
Save ldacosta/173a3be8bc1ec9580ad9 to your computer and use it in GitHub Desktop.
I am not sure how to get the `R` out of the way
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class BrainRecommender[R[_], Path, C[_], CleanedData, KPI, T](actorSystem: ActorSystem, | |
modelsLocation: R[Path], | |
readModels: Path => C[Model[Continuous[T]]], | |
rec: Seq[Continuous[T]] => Recommendation[T]) | |
(implicit opts: Optimizable[Continuous[T]], mR: Monad[R], rC: Read[R, Path, C, Model[Continuous[T]]], fC: Functor[C]) { | |
def issueRecommendation(): C[BrainRecommendation] = { | |
val models = mR.map(modelsLocation)(p => fC.map(readModels(p))(m => m)) | |
val RCollOfOptimal = mR.map(models)(collOfModels => fC.map(collOfModels)(m => opts.optimize(m, x => Set.empty))) | |
mR.map(RCollOfOptimal)(collOfOptimal => fC.map(collOfOptimal)(o => rec(o))) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment