def _func_fit(sessionId, objs, datatype, **kwargs): from cuml.cluster.kmeans_mg import KMeansMG as cumlKMeans handle = worker_state(sessionId)["handle"] inp_data = concatenate(objs) return cumlKMeans(handle=handle, output_type=datatype, **kwargs).fit(inp_data)
def _func_create_model(sessionId, **kwargs): try: from cuml.neighbors.kneighbors_classifier_mg import \ KNeighborsClassifierMG as cumlKNN except ImportError: raise_mg_import_exception() handle = worker_state(sessionId)["handle"] return cumlKNN(handle=handle, **kwargs)
def _func_create_model(sessionId, **kwargs): try: from cuml.neighbors.nearest_neighbors_mg import \ NearestNeighborsMG as cumlNN except ImportError: raise_mg_import_exception() handle = worker_state(sessionId)["handle"] return cumlNN(handle=handle, **kwargs)
def _create_model(sessionId, datatype, **kwargs): from cuml.linear_model.linear_regression_mg import LinearRegressionMG handle = worker_state(sessionId)["handle"] return LinearRegressionMG(handle=handle, output_type=datatype, **kwargs)
def _create_model(sessionId, model_func, datatype, **kwargs): handle = worker_state(sessionId)["handle"] return model_func(handle, datatype, **kwargs)
def _create_model(sessionId, datatype, **kwargs): from cuml.linear_model.ridge_mg import RidgeMG handle = worker_state(sessionId)["handle"] return RidgeMG(handle=handle, output_type=datatype, **kwargs)
def _create_model(sessionId, datatype, **kwargs): from cuml.solvers.cd_mg import CDMG handle = worker_state(sessionId)["handle"] return CDMG(handle=handle, output_type=datatype, **kwargs)