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_base.py 1.9 KB

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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
  1. # import basic
  2. import pandas as pd
  3. import numpy as np
  4. # import mlflow
  5. import mlflow
  6. from mlflow import MlflowClient
  7. # from mlflow.models import infer_signature
  8. # # import hyper-parameter tuning tool
  9. # import optuna
  10. # # import compile steps
  11. # from dsteps import data_ingestion as di
  12. # from dsteps import data_transformation as dt
  13. # from dsteps import model_training as mt
  14. # import mlflow_exp as mle
  15. # # model
  16. # from sklearn.linear_model import LogisticRegression
  17. # from sklearn.ensemble import AdaBoostClassifier
  18. # # model validation include cross validation score
  19. # from sklearn.model_selection import cross_val_score
  20. # from sklearn.metrics import classification_report
  21. # from sklearn.metrics import accuracy_score
  22. # from sklearn.metrics import precision_score
  23. # os
  24. import os
  25. # MLFLOW_TRACKING_URI=https://dagshub.com/Syamil-Ali/E2E_Loan_Application.mlflow \
  26. # MLFLOW_TRACKING_USERNAME=Syamil-Ali \
  27. # MLFLOW_TRACKING_PASSWORD=2e6b27e2093c83eacbf6777913b6d087592d1710 \
  28. # python script.py
  29. # specify the mlflow credential
  30. MLFLOW_TRACKING_URI='https://dagshub.com/Syamil-Ali/E2E_Loan_Application.mlflow'
  31. MLFLOW_TRACKING_USERNAME='Syamil-Ali'
  32. MLFLOW_TRACKING_PASSWORD='2e6b27e2093c83eacbf6777913b6d087592d1710'
  33. # It's recommended to define this within the code, because it's project specific (but this works too)
  34. os.environ['MLFLOW_TRACKING_URI'] = MLFLOW_TRACKING_URI
  35. # Recommended to define as environment variables
  36. os.environ['MLFLOW_TRACKING_USERNAME'] = MLFLOW_TRACKING_USERNAME
  37. os.environ['MLFLOW_TRACKING_PASSWORD'] = MLFLOW_TRACKING_PASSWORD
  38. import dagshub
  39. # make a connection to dagshib repo
  40. dagshub.init(repo_owner='Syamil-Ali', repo_name='E2E_Loan_Application', mlflow=True)
  41. #import mlflow
  42. mlflow.set_tracking_uri(MLFLOW_TRACKING_URI)
  43. #client = MlflowClient(MLFLOW_TRACKING_URI)#tracking_uri = MLFLOW_TRACKING_URI)
  44. mlflow.start_run()
  45. mlflow.log_metric('accuracy', 42)
  46. mlflow.log_param('Param name', 'Value')
Tip!

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

Comments

Loading...