Reshaping training inputs 1D

    0

    0

    x_train_reshaped.

    
    sample_size = x_train.shape[0] # Nn of samples in the train set # x_train is the input name
    time_steps = x_train.shape[1]# Number of features in the train set
    input_dimension = 1 # Each number represented by 1
    
    x_train_reshaped = x_train.reshape(sample_size, time_steps, input_dimension)
    print("After reshape train data set shape:\n",x_train_reshaped.shape)
    print("1 sample shape:\n",x_train_reshaped[0].shape)
    print ("an example sample:\n", x_train_reshaped[0])
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.