Beispiel #1
0
    def define_inputs(self) -> tp.Dict[str, trac.ModelInputSchema]:

        customer_loans = trac.declare_input_table(
            trac.F("id", trac.BasicType.STRING, label="Customer account ID", business_key=True),
            trac.F("loan_amount", trac.BasicType.DECIMAL, label="Principal loan amount", format_code="CCY:EUR"),
            trac.F("total_pymnt", trac.BasicType.DECIMAL, label="Total amount repaid", format_code="CCY:EUR"),
            trac.F("region", trac.BasicType.STRING, label="Customer home region", categorical=True),
            trac.F("loan_condition_cat", trac.BasicType.INTEGER, label="Loan condition category", categorical=True))

        currency_data = trac.declare_input_table(
            trac.F("ccy_code", trac.BasicType.STRING, label="Currency code", categorical=True),
            trac.F("spot_date", trac.BasicType.DATE, label="Spot date for FX rate"),
            trac.F("dollar_rate", trac.BasicType.DECIMAL, label="Dollar FX rate", format_code="CCY:USD"))

        return {"customer_loans": customer_loans, "currency_data": currency_data}
Beispiel #2
0
    def define_inputs(self) -> tp.Dict[str, trac.ModelInputSchema]:

        customer_loans = trac.declare_input_table(
            trac.F("id",
                   trac.BasicType.STRING,
                   label="Customer account ID",
                   business_key=True),
            trac.F("loan_amount",
                   trac.BasicType.DECIMAL,
                   label="Principal loan amount",
                   format_code="CCY:EUR"),
            trac.F("total_pymnt",
                   trac.BasicType.DECIMAL,
                   label="Total amount repaid",
                   format_code="CCY:EUR"),
            trac.F("region",
                   trac.BasicType.STRING,
                   label="Customer home region",
                   categorical=True),
            trac.F("loan_condition_cat",
                   trac.BasicType.INTEGER,
                   label="Loan condition category",
                   categorical=True))

        return {"customer_loans": customer_loans}
Beispiel #3
0
    def define_inputs(self) -> tp.Dict[str, trac.ModelInputSchema]:

        input1 = trac.declare_input_table(
            trac.F("field1", trac.BasicType.INTEGER,
                   "Something about this field"),
            trac.F("field2", trac.BasicType.FLOAT,
                   "Something about this other field"))

        return {"input1": input1}
Beispiel #4
0
    def define_inputs(self) -> tp.Dict[str, trac.ModelInputSchema]:

        preprocessed = trac.declare_input_table(
            trac.F("id",
                   trac.BasicType.STRING,
                   label="Customer account ID",
                   business_key=True),
            trac.F("some_quantity_x",
                   trac.BasicType.DECIMAL,
                   label="Some quantity X",
                   format_code="CCY:EUR"))

        return {"preprocessed_data": preprocessed}
Beispiel #5
0
    def define_inputs(self) -> tp.Dict[str, api.ModelInputSchema]:

        input_table_1 = api.declare_input_table(
            api.F("input_field_1",
                  api.STRING,
                  label="Input field 1",
                  business_key=True),
            api.F("input_field_2", api.INTEGER, label="Input field 2"),
            api.F("input_field_3",
                  api.STRING,
                  label="Input field 3",
                  categorical=True),
            api.F("input_field_4", api.DECIMAL, label="Input field 4"))

        return {"input_table_1": input_table_1}
Beispiel #6
0
    def define_outputs(self) -> tp.Dict[str, trac.ModelOutputSchema]:

        round_trip_output = trac.declare_input_table(self.ROUND_TRIP_FIELDS)

        return {"round_trip_output": round_trip_output}