1
$\begingroup$

I have a dataset for cancer and non-cancer patients and would like to prepare it for classification.

Each sample has 4 columns and 1298 rows. The total number of samples is 68. So my X_train shape is: (68, 1298, 4) and Y_train shape is (68).

Now, if I reshape the data to be in 2D array, how can I tell the model to separate these 68 samples?

My question is: how should I reshape the dataset and how should be the input shape format to the model?

$\endgroup$
1
  • $\begingroup$ Welcome to DataScienceSE. The basic method is to just concatenate everything in a sample, so you obtain 1298 * 4 columns for every sample. For a more specific answer you should probably give more detail about what the data represents. $\endgroup$
    – Erwan
    Feb 2 at 22:15

1 Answer 1

0
$\begingroup$

To make the data amenable to machine learning, each row should be an instance and each column should be a feature.

You state that you have 68 samples/instances, those are the rows. It is unclear from your description how to structure the 1298 x 4 dimensions. One brute force method is to take the Cartesian product which would result in 5,192 columns/features. The result is a matrix that is 68x5192 and ready for classification. The number of columns/features may be reduced through feature engineering and/or feature selection.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.