loop output dimension for y reshape



    The code first defines a range of values for the output_dim variable, which will be used to define the size of the data that will be used to train the model. It then Reshapes the original data, where the (-1, output_dim) range will be used to create the new data. Finally, the data is used to train the model.

    for output_dim in range(1, p+1):
      y_reshaped = y.reshape((-1, output_dim))
      # Use the reshaped data to train a model
    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.