Building linear model practical assignment

week module 1 i have done the assignment in Building linear models practice assignmet. when i do the exercise all my 4 exercises anre passed. but whe

[Build and Evaluate a Linear Risk model answers.docx|attachmentAssignment notebook removed as posting any codes, attaching assignment notebook which grades your assignment is considered direct violation of Code of Conduct. If a mentor wants to look at your codes, they will ask you to send the codes by personal DM, until then only post screenshot of grader feedback which provides information on why you scored less in your assignment grading.

n it comes to grades it gives only 75% and give output like Incorrect loop used in `add_interactions` function
Code Cell UNQ_C1: Function ‘make_standard_normal’ is correct.
Code Cell UNQ_C2: Function ‘lr_model’ is correct.
Code Cell UNQ_C3: Function ‘cindex’ is correct.
Code Cell UNQ_C4: Function ‘add_interactions’ is correct.
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors. what needs to be done. i am doing this assignment continuosly for 72 hours without rest. what needs to be done. tomorrow is the deadline for this assignment

hi @AREPRADEEPTHI_2025

click on my name and send me screenshot of the last exercise where the incorrect loop regarding add_interactions is mentioned, chances are your codes might be correct but the implementation might be incorrect.

Please don’t any grade function codes here as it is against community guidelines.

I just removed your notebook from your post And you again attached the notebook to the post. You are not suppose to post your notebook on public post. please click on name, then message me screenshot of codes where it points incorrect implementation.

I have sent you a direct DM, incase you are able to send me message. send me screenshots there.

images and attachments removed as I have already mentioned it is against code of conductit says all the tests are passed when codes are tested but during grades it doesnt scores

hi @AREPRADEEPTHI_2025

I just saw your screenshots of codes, looks like you have edited your notebook, I don’t see in any of the grade functions the code markers

###START YOUR CODE HERE### TO ###END YOUR CODE HERE###

Remember the auto grader can still fail your grader even if you delete anything that was present when you opened your notebook from classroom page. You are only suppose to write codes between these code markers with adding or deleting anything outside or insider these markers (only replace codes where None are mentioned or a given instructions is provided)

Please get a fresh copy and re-do the assignment by making surely to follow above instructions and then submit, let me know if you are still failing the grader.

Also adding screenshot of grade function without codes written compare with your screenshot, notice how much changes you have done. **You ave deleted the arguments, changed variable names already given and deleted many instructions which all causes grader error, used incorrect loops in last exercise as you changed the already given variable names. There are also some code error probably because you changed too many variables name from your side, so when you try again just replace the None placed between the code markers :backhand_index_pointing_down:t2:

Compare

@Mubsi

while I was checking this learner’s code I noticed she used the solver while creating lr_model in exercise 2 which was not required but looks like she was only following the hint provided under the header exercise 2 lr-model, so please update that hint as it can cause confusion for learners

Hint screenshot :backhand_index_pointing_down:t2:

@AREPRADEEPTHI_2025 This pointer is also for you, when you re-write your codes, the sk.learn hint is for import statement

then for model please use the model=model_name() :backhand_index_pointing_left:t2: (here the model_name need to be replaced by the model used in the lr_model exercise 2 as I cannot give direct answer I have provided an indirect hint for you to understand.

Regards

DP

Thanks for reporting @Deepti_Prasad, I have updated the hints.

1 Like

@AREPRADEEPTHI_2025

Kindly try to follow the instructions carefully as I already mentioned you, if you delete, add or edit anything outside the code markers, you will still fail grader. Here is a detail grade function wise issues with your code

  1. UNQ C2 code, there is a change def statement, causing you to use incorrect feature and training labels variables recall name. Notice and compare with your cell the def statement and model.fit statement. My suspect is you are copy pasting codes causing these inclusion of incorrect statements in your assignment.

  1. UNQC3 CODES PLEASE read the image instructions carefully I have shared

Your code screenshot without your grade codes :backhand_index_pointing_down:t2:

  1. UNQC4 code, you have done same mistake, removed/edited the arguments, deleted all the code instructions, your cell code instructions do not match with assignment instructions

So I am again stating the same statement as my previous response, if you want to pass your grader, stick to only writing codes by replacing None which are placed between ###START AND END CODE HERE###. Avoid copy pasting codes. There are some old assignment copies available openly on forum which are incorrect version of the copy, so please don’t refer them. Strictly focus only on the assignment you are working on. Or in case if you have referred ungraded labs, they are only provided for referral and understanding purpose, and is not meant use in graded assignments.

Give it again a fresh try, I am sure you will pass the assignment, read instructions, hints again and again. While doing C3 and C4 codes, make sure compare the conditions, especially case conditions like when taking the consider patient i doesn’t get disease, you missed mentioning in the same step patient j gets the disease for case, same way for case 2 you missed patient j condition.

for c4, codes are very simple, for example if a is a feature and code mentions get the name of feature a, it would be feature[a]

Subsequently when it is told to get the data from feature a, you use the dataframe variable recall name from arguments, implement that to the code name you wrote for get the name of feature a.

Further codes you already have written, which should easy to implement for interactions of these two features and subsequently multiple both features. But the most important, please please please do not delete instructions, just replace the None with the codes you wrote.

Best of luck, learn, enjoy, I know might be nerve wracking, but once you keep doing, learn from mistakes, you get better at coding.

Regards

DP