Skip to content

Commit

Permalink
Update train.py
Browse files Browse the repository at this point in the history
  • Loading branch information
brip2001 authored Oct 11, 2024
1 parent aeab0cd commit 31ebbd8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,20 @@ def main():
# TODO: Create TabularDataset using TabularDatasetFactory
# Data is located at:
# "https://automlsamplenotebookdata.blob.core.windows.net/automl-sample-notebook-data/bankmarketing_train.csv"
data_path="https://automlsamplenotebookdata.blob.core.windows.net/automl-sample-notebook-data/bankmarketing_train.csv"

ds = ### YOUR CODE HERE ###
ds = TabularDatasetFactory.from_delimited_files(path=data_path)

x, y = clean_data(ds)

# TODO: Split data into train and test sets.

### YOUR CODE HERE ###a
x_train,x_test,y_train, y_test=train_test_splits(x,y,test_size=0.2,random_state=42)

model = LogisticRegression(C=args.C, max_iter=args.max_iter).fit(x_train, y_train)

accuracy = model.score(x_test, y_test)
run.log("Accuracy", np.float(accuracy))

if __name__ == '__main__':
main()
main()

0 comments on commit 31ebbd8

Please sign in to comment.