Skip to content

Commit 78a9da5

Browse files
committed
Developing DS Code
1 parent bbc4878 commit 78a9da5

File tree

2 files changed

+6
-38
lines changed

2 files changed

+6
-38
lines changed

data_science/src_nyc_taxi/training/__init__.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,6 @@ def evaluate(training_df,random_state, model):
358358
)
359359

360360
evaluation_dict["r2"] = r2
361-
362-
#import pdb; pdb.set_trace()
363361

364362
mlflow.log_metric(
365363
"r2",
@@ -398,11 +396,10 @@ def train_model_lgbm(
398396
# Collect data into a Pandas array for training
399397
data = training_df.toPandas()[features_and_label]
400398
train, test = train_test_split(data, random_state=123)
399+
401400
X_train = train.drop(["fare_amount"], axis=1)
402401
y_train = train.fare_amount
403402

404-
405-
406403
mlflow.end_run()
407404
mlflow.autolog(exclusive=False)
408405
with mlflow.start_run():
@@ -416,29 +413,26 @@ def train_model_lgbm(
416413
# label=y_test.values
417414
# )
418415

419-
416+
num_rounds = model_params["num_rounds"]
417+
420418
# Train a lightGBM model
421419
model = lgb.train(
422-
#param,
423420
model_params,
424421
train_lgb_dataset,
425422
num_rounds
426423
)
427424

428-
425+
mlflow.log_param("num_rounds", num_rounds)
429426
mlflow.log_param("local_model_file_path", model_file_path)
430427

431428
evaulation_dict = evaluate(
432429
training_df=training_df,
433430
random_state=123,
434431
model=model
435432
)
436-
437-
#import pdb; pdb.set_trace()
438433

439434
mlflow.log_metrics(evaulation_dict)
440435

441-
442436
fs.log_model(
443437
model,
444438
artifact_path="model_packaged",
@@ -621,7 +615,8 @@ def dbx_execute_functions():
621615
"feature_fraction": 0.9,
622616
"bagging_seed": 42,
623617
"verbosity": -1,
624-
"seed": 42
618+
"seed": 42,
619+
"num_rounds": 100
625620
}
626621
)
627622

infrastructure/bicep/az_templates/az_key_vault/az_key_vault.bicep

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,6 @@ resource azKeyVault 'Microsoft.KeyVault/vaults@2021-10-01' = {
2323
enableSoftDelete: true
2424
enabledForTemplateDeployment: true
2525
accessPolicies: [
26-
{
27-
//applicationId: '<>' // Application ID of databricks SPN
28-
permissions: {
29-
// Give it the ability to set secrets // we can then get rid of the Key Vault Admin permission set in the main pipeline
30-
// Can we do this for the main spn , the equivalent of serviceConnect1
31-
secrets: [
32-
'set'
33-
'list'
34-
'get'
35-
]
36-
}
37-
tenantId: subscription().tenantId
38-
objectId: '<>'
39-
}
40-
41-
{
42-
//applicationId: '<>' // Application ID of serviceConnect1
43-
permissions: {
44-
secrets: [
45-
'set'
46-
'list'
47-
'get'
48-
]
49-
}
50-
tenantId: subscription().tenantId
51-
objectId: '<>'
52-
}
5326
]
5427
}
5528

0 commit comments

Comments
 (0)