AI for Medicine - AI for Medical Treatment W1Assignment

Hi, I need help with this assignment.

I don’t understand why the solution to exercises 7-8-9 gives me a result different from expected. Who can help me with the solution?

Hi @tmmg ,
Could you post a screenshot of the errors reported to help with diagnosis.

1 Like

The first step to getting help would be to show us your results versus the expected results. How are they different?

please keep in mind to avoid posting any grade function codes here as it is against community guidelines.

post screenshot of your output with the expected output only.

Your topic header mentions course as medical treatment but you have chosen category medical diagnosis. please! choose the right category to avoid any unnecessary confusion.

I report the errors below:

Ex 6 (lr_ARR_quantile)

ailed test case: lr_ARR_quantile returned incorrect ARR values. Check your logic for calculating the mean of 'y' for treatment and baseline groups, and the subtraction order..
Expected: [ 0.089744  0.042857 -0.014604  0.122222  0.142857 -0.104072  0.15
  0.293706  0.083333  0.2     ]
Got: [ 0.07575758  0.00809717  0.14393939 -0.09267241 -0.06042885 -0.10084034
  0.25        0.125       0.12962963  0.17391304]

I checked the subtraction, the mean of ‘y’ for treatment and baseline groups but they seem correct.

Exercise 7 - c_for_benefit_score

Failed test case: c_for_benefit_score returned incorrect value. Check your logic for permissible pairs, concordant pairs, and risk ties..
Expected: 0.75
Got: 0.5833333333333334

also in this ex. I checked the formula but seems like the lessons.

Exercise 8 - c_statistic

obviously, since c_for_benefit is wrong, c_statistics is also wrong c_statistics

Failed test case: c_statistic returned incorrect value. Check your logic for matching patients (random sampling, sorting, zipping) and calling c_for_benefit_score..
Expected: 0.6
Got: 0.5

@tmmg

responding as I am mentor for this course. I am moving your topic also to the right course category (from medical diagnosis to medical treatment).

kindly make sure to choose right categories related to your query, so mentor are aligned with your query.

I am sharing my earlier post comment solutions related to the same assignment.

Kindly refer them to debug/correct your codes

[Solution comment 1]( C3_W1_Assignment UNQW5 - #4 by Deepti_Prasad )

Solution comment 2( AI4M C3W1 Assignment - All tests passed, but computations after #UNQ_C11 fail - #7 by Deepti_Prasad )

Solution comment 3( C3_W1_Assignment_Exercise 6 - lr_ARR_quantile - #10 by Deepti_Prasad )

Solution comment 4( Week 1 Assignment Exercise 8 Issue - #3 by Deepti_Prasad

Solution comment 5( Lr_model' is not defined - #6 by Deepti_Prasad )

if any of these post comments still don’t help you debug/correct your code, then click on my name and then message me screenshots of all your grade function codes, or let me know it didn’t resolve your issue, I will send you DM invitation then

Good luck debugging!!!

Regards

Dr. Deepti

1 Like

hi @tmmg

The lrr quantile post comment 3 link I shared had the solution to your incorrect codes.

Another issue please do not touch the CODE MARKERS, YOU ARE ONLY SUPPOSE TO REPLACE THE NONE PLACE BETWEEN THE CODE MARKERS WITHOUT ADDING/DELETING/EDITING ANYTHING OUTSIDE OR INSIDE THOSE MARKERS, FOR SUCCESSFUL SUBMISSION GRADING.

Please refer this image to understand where you codes are incorrect :backhand_index_pointing_down:t2:

Let me know if issue is resolved.

Regards

Dr. Deepti