Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

mlflow_exp.py 829 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  1. import mlflow
  2. def mlflow_create_experiment():
  3. pass
  4. def mlflow_logging(exp_param, model, params:dict, metrics:dict):
  5. experiment_name = exp_param['name']
  6. run_name = exp_param['run_name']
  7. artifact_path = exp_param['artifact_path']
  8. model_name = exp_param['model_name']
  9. signature = exp_param['signature']
  10. # set experiment
  11. #mlflow.set_experiment(experiment_name)
  12. # initiate the logging
  13. with mlflow.start_run(run_name = run_name, nested=True) as run:
  14. mlflow.log_params(params)
  15. mlflow.log_metrics(metrics)
  16. # Log an instance of the trained model for later use
  17. mlflow.sklearn.log_model(
  18. sk_model=model,
  19. artifact_path=artifact_path,
  20. registered_model_name= model_name,
  21. signature=signature
  22. )
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...