private[group] class MemberMetadata(var memberId: String, val groupId: String, val groupInstanceId: Option[String], val clientId: String, val clientHost: String, val rebalanceTimeoutMs: Int, val sessionTimeoutMs: Int, val protocolType: String, var supportedProtocols: List[(String, Array[Byte])]) {
for alpha in 0 1 0.5 do for l1_ratio in 1 0.5 0.2 0 do python ~/Sources/mlflow/examples/sklearn_elasticnet_wine/train.py ${alpha} ${l1_ratio} done done
def __exit__(self, exc_type, exc_val, exc_tb): status = RunStatus.FINISHED if exc_type is None else RunStatus.FAILED end_run(RunStatus.to_string(status)) return exc_type is None
def ui(backend_store_uri, default_artifact_root, port): """ Launch the MLflow tracking UI for local viewing of run results. To launch a production server, use the "mlflow server" command instead.
The UI will be visible at http://localhost:5000 by default.
def _run_server(file_store_path, default_artifact_root, host, port, workers, static_prefix, gunicorn_opts): """ Run the MLflow server, wrapping it in gunicorn :param static_prefix: If set, the index.html asset will be served from the path static_prefix. If left None, the index.html asset will be served from the root path. :return: None """ env_map = {} if file_store_path: env_map[BACKEND_STORE_URI_ENV_VAR] = file_store_path if default_artifact_root: env_map[ARTIFACT_ROOT_ENV_VAR] = default_artifact_root if static_prefix: env_map[STATIC_PREFIX_ENV_VAR] = static_prefix bind_address = "%s:%s" % (host, port) opts = shlex.split(gunicorn_opts) if gunicorn_opts else [] exec_cmd(["gunicorn"] + opts + ["-b", bind_address, "-w", "%s" % workers, "mlflow.server:app"], env=env_map, stream_output=True)
The server which listen on http://localhost:5000 by default, and only accept connections from the local machine. To let the server accept connections from other machines, you will need to pass --host 0.0.0.0 to listen on all network interfaces (or a specific interface address).
Options: --backend-store-uri PATH URI to which to persist experiment and run data. Acceptable URIs are SQLAlchemy-compatible database connection strings (e.g. 'sqlite:///path/to/file.db') or local filesystem URIs (e.g. 'file:///absolute/path/to/directory'). By default, data will be logged to the ./mlruns directory. --default-artifact-root URI Local or S3 URI to store artifacts, for new experiments. Note that this flag does not impact already-created experiments. Default: Within file store, if a file:/ URI is provided. If a sql backend is used, then this option is required. -h, --host HOST The network address to listen on (default: 127.0.0.1). Use 0.0.0.0 to bind to all addresses if you want to access the tracking server from other machines. -p, --port INTEGER The port to listen on (default: 5000). -w, --workers INTEGER Number of gunicorn worker processes to handle requests (default: 4). --static-prefix TEXT A prefix which will be prepended to the path of all static paths. --gunicorn-opts TEXT Additional command line options forwarded to gunicorn processes. --help Show this message and exit.
# Serve the index.html for the React App for all other routes. @app.route(_add_static_prefix('/')) def serve(): return send_from_directory(STATIC_DIR, 'index.html')
# Read the wine-quality csv file (make sure you're running this from the root of MLflow!) wine_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "wine-quality.csv") data = pd.read_csv(wine_path)
# Split the data into training and test sets. (0.75, 0.25) split. train, test = train_test_split(data)
# The predicted column is "quality" which is a scalar from [3, 9] train_x = train.drop(["quality"], axis=1) test_x = test.drop(["quality"], axis=1) train_y = train[["quality"]] test_y = test[["quality"]]
MLflowのセッションを開始
train.py:47
1
with mlflow.start_run():
モデルを定義し、学習。その後テストデータを用いて予測値を算出し、メトリクスを計算する。
train.py:48
1 2 3 4 5 6 7
lr = ElasticNet(alpha=alpha, l1_ratio=l1_ratio, random_state=42) lr.fit(train_x, train_y)
try { // Use the class loader of User.class to construct the LoginContext. LoginContext uses this // class loader to dynamically instantiate login modules. This enables // Subject#getPrincipals to use reflection to search for User.class instances. LoginContext loginContext = createLoginContext(authType, subject, User.class.getClassLoader(), new LoginModuleConfiguration(), conf); loginContext.login();
/** * User is aware in Alluxio. On the client side, the login username is determined by the * "alluxio.security.login.username" property, or the OS user upon failure. * On the server side, the verification of client user is disabled. */ SIMPLE,
/** * User is aware in Alluxio. On the client side, the login username is determined by the * "alluxio.security.login.username" property, or the OS user upon failure. * On the server side, the user is verified by a Custom authentication provider * (Specified by property "alluxio.security.authentication.custom.provider.class"). */ CUSTOM,
CUSTOM Authentication is enabled. Alluxio file system can know the
user accessing it, and use customized AuthenticationProvider to verify
the user is the one he/she claims.
Experimental. This mode is only used in tests currently.
switch (authType) { case SIMPLE: return new SimpleAuthenticationProvider(); case CUSTOM: String customProviderName = conf.get(PropertyKey.SECURITY_AUTHENTICATION_CUSTOM_PROVIDER_CLASS); return new CustomAuthenticationProvider(customProviderName); default: throw new AuthenticationException("Unsupported AuthType: " + authType.getAuthName());