Search in sources :

Example 1 with Function

use of org.opensearch.ml.engine.annotation.Function in project ml-commons by opensearch-project.

the class MLEngineClassLoader method loadClassMapping.

public static void loadClassMapping() {
    Reflections reflections = new Reflections("org.opensearch.ml.engine.algorithms");
    Set<Class<?>> classes = reflections.getTypesAnnotatedWith(Function.class);
    // Load ML algorithm parameter class
    for (Class<?> clazz : classes) {
        Function function = clazz.getAnnotation(Function.class);
        FunctionName functionName = function.value();
        if (functionName != null) {
            mlAlgoClassMap.put(functionName, clazz);
        }
    }
}
Also used : Function(org.opensearch.ml.engine.annotation.Function) FunctionName(org.opensearch.ml.common.parameter.FunctionName) Reflections(org.reflections.Reflections)

Aggregations

FunctionName (org.opensearch.ml.common.parameter.FunctionName)1 Function (org.opensearch.ml.engine.annotation.Function)1 Reflections (org.reflections.Reflections)1