Skip to content

Commit d02648f

Browse files
committed
Developing DS Code
1 parent 6f9cc76 commit d02648f

File tree

4 files changed

+11
-18
lines changed

4 files changed

+11
-18
lines changed

data_science/src_nyc_taxi/registration/__init__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,6 @@ def evaluation(
109109
# Get the latest model version in the production stage
110110

111111
mlflow_client = MlflowClient()
112-
#latest_production_version = mlflow_client.get_latest_versions(
113-
# name=model_name,
114-
# stages=[production_stage],
115-
# order_by=['creation_time desc'],
116-
# max_results=1
117-
#)[0].version
118-
119112

120113
latest_production_version = mlflow_client.get_latest_versions(
121114
name=model_name,
@@ -126,9 +119,10 @@ def evaluation(
126119

127120

128121
# Promote Latest Model To Production
122+
latest_model_version = get_latest_model_version(model_name)
129123
mlflow_client.transition_model_version_stage(
130124
name=model_name,
131-
version=latest_production_version,
125+
version=latest_model_version,
132126
stage="production",
133127
archive_existing_versions = True
134128
)

experiments/notebooks/ciaran_experiments/nyc_taxi/nyc_taxi_lgbm_1.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
run_feature_store_refresh()
55

66
# COMMAND ----------
7-
from training import run_training
8-
from databricks.sdk.runtime import *
7+
from training import run_training
8+
99
run_training(
1010
experiment_name = "ciaran_experiment_nyc_taxi",
1111
model_name = "taxi_example_fare_packaged",
1212
model_params = {
1313
"objective": "regression",
1414
"metric": "rmse",
1515
"num_leaves": 32,
16-
"learning_rate": 0.1,
16+
"learning_rate": 0.2,
1717
"bagging_fraction": 0.9,
1818
"feature_fraction": 0.9,
1919
"bagging_seed": 42,
@@ -22,7 +22,6 @@
2222
}
2323
)
2424
# COMMAND ----------
25-
from databricks.sdk.runtime import *
2625
from registration import run_registration
2726
run_registration(
2827
model_name = "taxi_example_fare_packaged"

infrastructure/bicep/main.bicep

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ resource azResourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
3333
// KEY VAULT - SELECT KV //
3434
// ################################################################################################################################################################//
3535

36-
module azKeyVault '../az_templates/az_key_vault/az_key_vault.bicep' = {
36+
module azKeyVault 'az_templates/az_key_vault/az_key_vault.bicep' = {
3737
dependsOn: [
3838
azResourceGroup
3939

@@ -50,7 +50,7 @@ module azKeyVault '../az_templates/az_key_vault/az_key_vault.bicep' = {
5050
// Module for Create Azure Data Lake Storage
5151
// RBAC is assigned -> azDatabricks given access to Storage
5252
// ################################################################################################################################################################//
53-
module azDataLake '../az_templates/az_data_lake/az_data_lake.bicep' = {
53+
module azDataLake 'az_templates/az_data_lake/az_data_lake.bicep' = {
5454
dependsOn: [
5555
azResourceGroup
5656
]
@@ -71,7 +71,7 @@ module azDataLake '../az_templates/az_data_lake/az_data_lake.bicep' = {
7171
}
7272

7373

74-
module logAnalytics '../az_templates/az_app_insights/az_app_insights.bicep'= {
74+
module logAnalytics 'az_templates/az_app_insights/az_app_insights.bicep' = {
7575
dependsOn: [
7676
azResourceGroup
7777
]
@@ -89,7 +89,7 @@ module logAnalytics '../az_templates/az_app_insights/az_app_insights.bicep'= {
8989
// Module for Creating Azure Machine Learning Workspace
9090
// Outputs AzDatabricks Workspace ID, which is used when Assigning RBACs.
9191
// ################################################################################################################################################################//
92-
module azMachineLearning '../az_templates/az_machine_learning/az_machine_learning.bicep' = {
92+
module azMachineLearning 'az_templates/az_machine_learning/az_machine_learning.bicep' = {
9393
dependsOn: [
9494
logAnalytics
9595
azDataLake
@@ -114,7 +114,7 @@ module azMachineLearning '../az_templates/az_machine_learning/az_machine_learnin
114114
// Module for Creating Azure Databricks Workspace
115115
// Outputs AzDatabricks Workspace ID, which is used when Assigning RBACs
116116
// ################################################################################################################################################################//
117-
module azDatabricks '../az_templates/az_databricks/az_databricks.bicep' = {
117+
module azDatabricks 'az_templates/az_databricks/az_databricks.bicep' = {
118118
dependsOn: [
119119
azMachineLearning
120120
]

infrastructure/databricks/databricks_utils/python/utils_create_azure_resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class LoadJson():
1111
def __init__(self):
12-
self.json_file = 'mlOps/devOps/infra/master_templates/params/' + ENVIRONMENT + '/bicep.parameters.json'
12+
self.json_file = 'infrastructure/bicep/params/' + ENVIRONMENT + '/bicep.parameters.json'
1313

1414
def load_json(self):
1515
with open(self.json_file, 'r') as f:

0 commit comments

Comments
 (0)