# C3W1\_UNQ\_C9 T learner predict method returned unexpected type

**URL:** <https://community.deeplearning.ai/t/c3w1-unq-c9-t-learner-predict-method-returned-unexpected-type/770585>\
**Category:** AI For Medical Treatment\
**Tags:** week-module-3\
**Created:** [February 15, 2025, 8:01pm UTC](https://community.deeplearning.ai/t/c3w1-unq-c9-t-learner-predict-method-returned-unexpected-type/770585 "2025-02-15T20:01:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahwtsang](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@ahwtsang](https://community.deeplearning.ai/u/ahwtsang)\
**Post date:** [February 15, 2025, 8:01pm UTC](https://community.deeplearning.ai/t/c3w1-unq-c9-t-learner-predict-method-returned-unexpected-type/770585/1 "2025-02-15T20:01:54Z")

</div>

I am returning the pred\_risk\_reduction in the T learner prediction function as an np.array but I get an error later when I run the quantile\_benefit() cell. Can someone point out to me what I am doing wrong? Thanks

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [February 15, 2025, 8:28pm UTC](https://community.deeplearning.ai/t/c3w1-unq-c9-t-learner-predict-method-returned-unexpected-type/770585/2 "2025-02-15T20:28:07Z")

</div>

please avoid posting grade function codes on public post threads as they grade your assignment and is considered against community guidelines.

here is post comment which will help you debug your codes

> [@Week 1 Assignment Exercise 8 Issue](https://community.deeplearning.ai/t/week-1-assignment-exercise-8-issue/761361/3):
>
> This should help you debug/correct your codes point_down:t2 remember your data for your code assignment cell has been recalled as X and not data\_treatment or data\_control. Also you are suppose to use predict\_proba when you used your previous self recalled functions.

---

<div class="post-metadata">

**Author:** ![ahwtsang](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@ahwtsang](https://community.deeplearning.ai/u/ahwtsang)\
**Post date:** [February 15, 2025, 8:34pm UTC](https://community.deeplearning.ai/t/c3w1-unq-c9-t-learner-predict-method-returned-unexpected-type/770585/3 "2025-02-15T20:34:52Z")

</div>

This is helpful. Thank you

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [May 30, 2025, 7:57am UTC](https://community.deeplearning.ai/t/c3w1-unq-c9-t-learner-predict-method-returned-unexpected-type/770585/4 "2025-05-30T07:57:08Z")

</div>

Closed on May 30, 2025, 7:57am UTC


