Skip to content

Issue passing Target from integer to string #2

@LucaNicoliYT88

Description

@LucaNicoliYT88

in Tutorial-4, for some reason in the notebook, you transformed the target values from integer to string as:
df['Outcome'] = np.where(df['Outcome']==1, "Diabetic", "No Diabetic")

When in the next steps, you tried:
y_train=torch.LongTensor(y_train)
there is the following problem:
TypeError: can't convert np.ndarray of type numpy.object. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint8, and bool._

Also the other issue open now, it is the same problem: #1

If i comment the row df['Outcome'] = np.where(df['Outcome']==1, "Diabetic", "No Diabetic"), everything works correctly.

Best,
Luca

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions