Question: for the above code 1) Add 2-3 variables that produce a race condition. Explain why the variables produce race conditions.Show the code in python 2)Run

for the above code
1) Add 2-3 variables that produce a race condition. Explain why the variables produce race conditions.Show the code in python
2)Run the code with the race conditions and see if you can catch the wrong results. Record the execution time.
3)Run the code with various options (critical, atomic, reduction) of solving the race condition and see both the result and the execution time.
4)Analyze which code is faster. Analyze the execution of all options.
Note: solve all questions in python
start_timel = time.time() with parallel_backend ('loky'): xgb.fit (X_train,y_train) Y_pred = xgb.predict(X_test) predictions = [round(value) for value in Y_pred] \# evaluate predictions accuracy = accuracy_score(y_test, predictions) print("Accuracy: \%.2f\%\%" % (accuracy 100.0)) LR_time= time.time() Accuracy: 59.16\% totalTime = LR_time-start_timel print("time: \%.2f seconds" \% (totalTime)) MinuteTime= (totalTime /160) print("time: \%.2f minutes" \% (MinuteTime)) time: 325.07 seconds time: 5.00 minutes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
