@operator( value = {"clustering_em"}, content_type = IType.LIST, category = {IOperatorCategory.STATISTICAL}, concept = {IConcept.STATISTIC}) @doc( value = "A list of agent groups clustered by EM Algorithm based on the given attributes. Some paremeters can be defined: " + "max_iterations: the maximum number of iterations to perform;" + "num_clusters: the number of clusters; minStdDev: minimum allowable standard deviation", examples = { @example( value = "clustering_em([ag1, ag2, ag3, ag4, ag5],[\"size\",\"age\", \"weight\"],[\"max_iterations\"::10, \"num_clusters\"::3])", equals = "for example, can return [[ag1, ag3], [ag2], [ag4, ag5]]", isExecutable = false) }, see = { "clustering_xmeans", "clustering_simple_kmeans", "clustering_farthestFirst", "clustering_DBScan", "clustering_cobweb" }) public static IList<IList<IAgent>> primClusteringEM( final IScope scope, final IAddressableContainer<Integer, IAgent, Integer, IAgent> agents, final IList<String> attributes, final GamaMap<String, Object> parameters) { EM em = new EM(); em.setSeed(Cast.asInt(scope, scope.getRandom().getSeed())); if (parameters != null) { try { if (parameters.containsKey("max_iterations")) { em.setMaxIterations(Cast.asInt(scope, parameters.get("max_iterations"))); } if (parameters.containsKey("num_clusters")) { em.setNumClusters(Cast.asInt(scope, parameters.get("num_clusters"))); } if (parameters.containsKey("minStdDev")) { em.setMinStdDev(Cast.asFloat(scope, parameters.get("minStdDev"))); } } catch (Exception e) { } } IList<IList<IAgent>> groupes = clusteringUsingWeka(scope, em, attributes, agents); return groupes; }