- object: df
  method: fill_nan
  args: []
  kwargs: {}
  setas: df
- object: df
  method: astype
  args:
    [
      {
        "ProteinBreedCodesIRN_Progeny": "object",
        "ProteinProductsAnimalsIRN_Progeny": "object",
        "ProteinProductsAnimalsIRN_OS": "object",
        "ProteinFarmsIRN": "object",
        "ProteinBreedCodesIRN": "object",
        "ProteinGrowoutCodesIRN": "object",
        "ProteinFacilityFeedMillsIRN": "object",
        "ProteinProductsAnimalsIRN": "object",
        "ProteinTechAdvisorsIRN": "object",
        "ComplexEntityNo": "object",
        "SpeciesType": "int64",
        "DivisionNo": "object",
        "ProteinFacilityHatcheriesIRN": "object",
        "MonthPlaced": "int64",
        "ProteinEntitiesIRN": "object",
        "ProductionPercent": "float64",
        "xDate": "datetime64[ns]",
        "StartDate": "datetime64[ns]",
        "Age": "float64",
        "TransferAge": "int64",
        "CityNo": "object",
        "CityName": "object",
        "StateNo": "object",
        "StateName": "object",
        "CountryNo": "object",
        "CountryName": "object",
        "Zip": "object",
        "FeelsLikeTemp": "float64",
        "Temp": "float64",
        "HighTemp": "float64",
        "LowTemp": "float64",
        "MonthNo": "int64",
        "WeekPlaced": "int64",
        "WOL": "int64",
        "TransferAgeDays": "int64",
        "WeekNo": "int64",
        "PrecipitationPercentage": "float64",
        "DaylightHours": "float64",
        "HumidityPercentage": "float64",
        "PercentMaleMortality": "float64",
        "PercentFemaleMortality": "float64",
        "HatchabilityPercent": "float64",
        "FemaleInventory": "int64",
        "MaleInventory": "int64",
        "EggsSet": "int64",
        "ChicksHatch": "int64",
        "AvgEggAge": "float64",
      },
    ]
  kwargs: {}
  setas: df
- object: df
  method: sort_values
  args: []
  kwargs: { by: ["ProteinEntitiesIRN", "Age"] }
  setas: df
- object: df
  method: query
  args: ["0.0 < HatchabilityPercent < 100.0 and WOL > -3"]
  kwargs: {}
  setas: df
# - object: df
#   method: filter_out_last_rows
#   args: []
#   kwargs: { groupby: ["ProteinEntitiesIRN"], n: 2 }
#   setas: df
- object: df
  method: generate_previous_values
  args: []
  kwargs:
    {
      groupby: ["ProteinEntitiesIRN", "Age"],
      targets: ["HatchabilityPercent", "Age"],
      n: 1,
      prefixes: ["Previous", "SecondPrevious", "ThirdPrevious"],
    }
  setas: df
- object: df
  method: generate_future_values
  args: []
  kwargs:
    {
      groupby: ["ProteinEntitiesIRN", "Age"],
      targets: ["HatchabilityPercent", "Age"],
      prefix: "Predicted",
    }
  setas: df
- object: builtins
  method: eval
  args: ["round(self.df['Age'] + 0.21)"]
  kwargs: {}
  setas: df["stdAge"]
- object: builtins
  method: eval
  args: ["round(self.df['PredictedAge'] + 0.21)"]
  kwargs: {}
  setas: df["stdPredAge"]
- object: builtins
  method: eval
  args: ["self.df['PredictedAge'] - self.df['Age']"]
  kwargs: {}
  setas: df["weeks_out"]
- object: builtins
  method: eval
  args: ["self.df['xDate'] + pd.to_timedelta(self.df['weeks_out'], unit='w')"]
  kwargs: {}
  setas: df["PredDate"]
- object: builtins
  method: eval
  args: ["self.df['PredDate'].dt.isocalendar().week"]
  kwargs: {}
  setas: df["WeekNo"]
- object: df
  method: rename
  args: []
  kwargs:
    {
      columns:
        {
          "PredDate": "Date",
          "PredictedHatchabilityPercent": "Label",
          "PreviousHatchabilityPercent": "PreviousHatch",
          "SecondPreviousHatchabilityPercent": "SecondPreviousHatch",
          "ThirdPreviousHatchabilityPercent": "ThirdPreviousHatch",
        },
    }
  setas: df
- object: df
  method: filter
  args: []
  kwargs:
    {
      items:
        [
          "Date",
          "ProteinBreedCodesIRN_Progeny",
          "ProteinProductsAnimalsIRN_Progeny",
          "ProteinProductsAnimalsIRN_OS",
          "ProteinFarmsIRN",
          "ProteinBreedCodesIRN",
          "ProteinGrowoutCodesIRN",
          "ProteinFacilityFeedMillsIRN",
          "ProteinProductsAnimalsIRN",
          "ProteinTechAdvisorsIRN",
          "DivisionNo",
          "ProteinFacilityHatcheriesIRN",
          "MonthPlaced",
          "TransferAge",
          "MonthNo",
          "WeekPlaced",
          "WOL",
          "TransferAgeDays",
          "WeekNo",
          "HatchabilityPercent",
          "PreviousAge",
          "SecondPreviousAge",
          "ThirdPreviousAge",
          "PreviousHatch",
          "SecondPreviousHatch",
          "ThirdPreviousHatch",
          "weeks_out",
          "stdAge",
          "stdPredAge",
          "Label",
        ],
    }
  setas: df
- object: df
  method: rename
  args: []
  kwargs:
    {
      columns:
        {
          "Date": "date",
          "ProteinBreedCodesIRN_Progeny": "proteinBreedCodesIRN_Progeny",
          "ProteinProductsAnimalsIRN_Progeny": "proteinProductsAnimalsIRN_Progeny",
          "ProteinProductsAnimalsIRN_OS": "proteinProductsAnimalsIRN_OS",
          "ProteinFarmsIRN": "proteinFarmsIRN",
          "ProteinBreedCodesIRN": "proteinBreedCodesIRN",
          "ProteinGrowoutCodesIRN": "proteinGrowoutCodesIRN",
          "ProteinFacilityFeedMillsIRN": "proteinFacilityFeedMillsIRN",
          "ProteinProductsAnimalsIRN": "proteinProductsAnimalsIRN",
          "ProteinTechAdvisorsIRN": "proteinTechAdvisorsIRN",
          "DivisionNo": "divisionNo",
          "ProteinFacilityHatcheriesIRN": "proteinFacilityHatcheriesIRN",
          "MonthPlaced": "monthPlaced",
          "TransferAge": "transferAge",
          "MonthNo": "monthNo",
          "WeekPlaced": "weekPlaced",
          "WOL": "wol",
          "TransferAgeDays": "transferAgeDays",
          "WeekNo": "weekNo",
          "HatchabilityPercent": "hatchabilityPercent",
          "PreviousAge": "previousAge",
          "SecondPreviousAge": "secondPreviousAge",
          "ThirdPreviousAge": "thirdPreviousAge",
          "PreviousHatch": "previousHatch",
          "SecondPreviousHatch": "secondPreviousHatch",
          "ThirdPreviousHatch": "thirdPreviousHatch",
          "weeks_out": "weeksOut",
          "stdAge": "stdAge",
          "stdPredAge": "stdPredAge",
          "Label": "label",
        },
    }
  setas: df
- object: df
  method: astype
  args:
    [
      {
        "date": "datetime64[ns]",
        "proteinBreedCodesIRN_Progeny": "object",
        "proteinProductsAnimalsIRN_Progeny": "object",
        "proteinProductsAnimalsIRN_OS": "object",
        "proteinFarmsIRN": "object",
        "proteinBreedCodesIRN": "object",
        "proteinGrowoutCodesIRN": "object",
        "proteinFacilityFeedMillsIRN": "object",
        "proteinProductsAnimalsIRN": "object",
        "proteinTechAdvisorsIRN": "object",
        "divisionNo": "object",
        "proteinFacilityHatcheriesIRN": "object",
        "monthPlaced": "int64",
        "transferAge": "int64",
        "monthNo": "int64",
        "weekPlaced": "int64",
        "wol": "int64",
        "transferAgeDays": "int64",
        "weekNo": "int64",
        "hatchabilityPercent": "float64",
        "previousAge": "float64",
        "secondPreviousAge": "float64",
        "thirdPreviousAge": "float64",
        "previousHatch": "float64",
        "secondPreviousHatch": "float64",
        "thirdPreviousHatch": "float64",
        "weeksOut": "int64",
        "stdAge": "int64",
        "stdPredAge": "int64",
        "label": "float64",
      },
    ]
  kwargs: {}
  setas: df
- object: df
  method: time_train_test_split
  args: []
  kwargs: { test_size: 0.1, date_col: "date" }
  setas: [train, test]
