QUANDO ESTOU EXECUTANDO ESSE CODIGO:
Xtest = torch.stack([tup[0] for tup in test_set])
Xtest = Xtest.to(args['device'])
ytest = torch.stack([tup[1] for tup in test_set])
ypred = net(Xtest).cpu().data
data = torch.cat((ytest, ypred), axis=1)
df_results = pd.DataFrame(data, columns=['ypred', 'ytest'] )
df_results.head(20)
ESTOU TENTO O SEGUINTE TIPO DE ERRO:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-66-4b2c6245e309> in <cell line: 10>()
8 data = torch.cat((ytest, ypred), axis=1)
9
---> 10 df_results = pd.DataFrame(data, columns=['ypred', 'ytest'] )
11 df_results.head(20)
2 frames
/usr/local/lib/python3.10/dist-packages/pandas/core/frame.py in __init__(self, data, index, columns, dtype, copy)
760 )
761 else:
--> 762 mgr = ndarray_to_mgr(
763 data,
764 index,
/usr/local/lib/python3.10/dist-packages/pandas/core/internals/construction.py in ndarray_to_mgr(values, index, columns, dtype, copy, typ)
347 )
348
--> 349 _check_values_indices_shape_match(values, index, columns)
350
351 if typ == "array":
/usr/local/lib/python3.10/dist-packages/pandas/core/internals/construction.py in _check_values_indices_shape_match(values, index, columns)
418 passed = values.shape
419 implied = (len(index), len(columns))
--> 420 raise ValueError(f"Shape of passed values is {passed}, indices imply {implied}")
421
422
ValueError: Shape of passed values is (3476, 11), indices imply (3476, 2)
PODERIA ME EXPLICA A ONDE EU DEVO ALTERAR?