Exemple #1
0
def test_rowsum():
    assert str(dt.rowsum(f.A)) == str(f.A.rowsum())
    assert str(dt.rowsum(f[:])) == str(f[:].rowsum())
    DT = dt.Frame({"C": [2, 5, 30, 20, 10],
                   "D": [10, 8, 20, 20, 1]})

    assert_equals(DT[:, f[:].rowsum()], DT[:, dt.rowsum(f[:])])
Exemple #2
0
def test_rowsum_different_types():
    DT = dt.Frame(
        [[3, 4, 6, 9, None, 1], [True, False, False, None, True, True],
         [14, 15, -1, 2, 7, -11], [4, 10, 3, None, 0, -8]],
        stypes=[dt.int8, dt.bool8, dt.int64, dt.int32])
    RES = DT[:, rowsum(f[:])]
    assert_equals(RES, dt.Frame([22, 29, 8, 11, 8, -17], stype=dt.int64))
Exemple #3
0
def test_reprs():
    # Check that row-expressions can be repr'd without errors
    assert repr(rowall())
    assert repr(rowany())
    assert repr(rowsum())
    assert repr(rowcount())
    assert repr(rowmin())
    assert repr(rowmax())
    assert repr(rowfirst())
    assert repr(rowlast())
    assert repr(rowmean())
    assert repr(rowsd())
def leer_dataset(experimentos: list, foto_mes: int) -> Frame:
    dataset = None
    for experimento in experimentos:
        for file in os.listdir(f'../experimentos/{experimento}/'):
            if file.endswith('stacking_apply.csv'):
                campos_buenos = ['numero_de_cliente', 'estimulo']
                stacking = fread(f'../experimentos/{experimento}/{file}')[
                    f.foto_mes == foto_mes, :].sort(
                        ['foto_mes', 'numero_de_cliente'])[:, campos_buenos]
                if dataset is None:
                    dataset = stacking
                    dataset.names = {'estimulo': f'{experimento}_estimulo'}
                else:
                    dataset[f'{experimento}_estimulo'] = stacking[:,
                                                                  'estimulo']
                break
    dataset['votos'] = dataset[:, rowsum(f[:].remove([f.numero_de_cliente]))]
    return dataset[:, ['numero_de_cliente', 'votos']]
Exemple #5
0
def test_rowsum_promote_to_float64():
    DT = dt.Frame([[2], [3], [1], [5], [None]],
                  stypes=[dt.int8, dt.float64, dt.int64, dt.float32, dt.int16])
    assert_equals(rowsum(DT), dt.Frame([11], stype=dt.float64))
Exemple #6
0
def test_rowsum_promote_to_float32():
    DT = dt.Frame([[2], [7], [11]], stypes=[dt.int32, dt.float32, dt.int64])
    assert_equals(rowsum(DT), dt.Frame([20], stype=dt.float32))
Exemple #7
0
def test_rowsum_int8():
    DT = dt.Frame(
        [[3, 7, -1, 0, None], [15, 19, 1, None, 1], [0, 111, 88, 3, 4]],
        stype=dt.int8)
    RES = DT[:, rowsum(f[int])]
    assert_equals(RES, dt.Frame([18, 137, 88, 3, 5], stype=dt.int32))
Exemple #8
0
def test_rowsum_bools():
    DT = dt.Frame([[True, True, False, False, None, None],
                   [True, False, True, False, True, None],
                   [True, True, True, False, False, None]])
    RES = DT[:, rowsum(f[:])]
    assert_equals(RES, dt.Frame([3, 2, 2, 0, 1, 0], stype=dt.int32))
Exemple #9
0
    # remove black listed columns or column groups that smaller than minimal size
    col_groups = {
        key: val
        for key, val in all_col_groups.items()
        if not key in black_listed_columns or len(val) >= min_col_group_size
    }

    # list of column prefixes
    columns = list(col_groups.keys())
    # list of column ranges
    ranges = [(min(idx), max(idx)) for idx in col_groups.values()]

# produce tuple for column slices
col_slices = [((col + "%d") % (desde), (col + "%d") % (hasta))
              for (col, (desde, hasta)) in zip(columns, ranges)]

for c, r, s in zip(columns, ranges, col_slices):
    update_map = {
        c + "_sum": rowsum(f[s[0]:s[1]]),
        c + "_mean": rowmean(f[s[0]:s[1]]),
        c + "_sd": rowsd(f[s[0]:s[1]]),
        c + "_max": rowmax(f[s[0]:s[1]]),
        c + "_min": rowmin(f[s[0]:s[1]]),
        c + "_range": rowmax(f[s[0]:s[1]]) - rowmin(f[s[0]:s[1]]),
        c + "_first": rowfirst(f[s[0]:s[1]]),
        c + "_last": rowlast(f[s[0]:s[1]]),
        c + "_missing": (r[1] - r[0] + 1) - rowcount(f[s[0]:s[1]])
    }
    X[:, update(**update_map)]

return {"CreditCard-train-aug.csv": X}
    def create_data(
        X: dt.Frame = None
    ) -> Union[str, List[str], dt.Frame, List[dt.Frame], np.ndarray,
               List[np.ndarray], pd.DataFrame, List[pd.DataFrame], Dict[
                   str, str],  # {data set names : paths}
               Dict[str, dt.Frame],  # {data set names : dt frames}
               Dict[str, np.ndarray],  # {data set names : np arrays}
               Dict[str, pd.DataFrame],  # {data set names : pd frames}
               ]:
        if X is None:
            return []

        columns = None  # columns = ["PAY_AMT", "BILL_AMT", "PAY_"]
        ranges = None  # [(1, 6), (1, 6), (2, 6)]
        black_listed_columns = []
        min_col_group_size = 2

        # parse column names for time series column groups
        if columns is None or columns == [] or \
                ranges is None or ranges == []:
            # match any column names that consist of alpha name (prefix) followed by integer index (suffix)
            p = re.compile(r"^([a-zA-Z_]+)(\d+)$")
            matches = [p.match(c) for c in X.names]
            all_col_groups = defaultdict(list)
            for m in matches:
                if m is not None:
                    key = m.group(1)
                    val = int(m.group(2))
                    all_col_groups[key].append(val)

            # remove black listed columns or column groups that smaller than minimal size
            col_groups = {
                key: val
                for key, val in all_col_groups.items()
                if not key in black_listed_columns
                or len(val) >= min_col_group_size
            }

            # list of column prefixes
            columns = list(col_groups.keys())
            # list of column ranges
            ranges = [(min(idx), max(idx)) for idx in col_groups.values()]

        col_slices = [((col + "%d") % (desde), (col + "%d") % (hasta))
                      for (col, (desde, hasta)) in zip(columns, ranges)]

        for c, r, s in zip(columns, ranges, col_slices):
            update_map = {
                c + "_sum": rowsum(f[s[0]:s[1]]),
                c + "_mean": rowmean(f[s[0]:s[1]]),
                c + "_sd": rowsd(f[s[0]:s[1]]),
                c + "_max": rowmax(f[s[0]:s[1]]),
                c + "_min": rowmin(f[s[0]:s[1]]),
                c + "_range": rowmax(f[s[0]:s[1]]) - rowmin(f[s[0]:s[1]]),
                c + "_first": rowfirst(f[s[0]:s[1]]),
                c + "_last": rowlast(f[s[0]:s[1]]),
                c + "_missing": (r[1] - r[0] + 1) - rowcount(f[s[0]:s[1]])
            }
            X[:, update(**update_map)]

        return X
Exemple #11
0
def makeRKIAgeGroups(outputFile):
    Altersgruppen = ['A00-A04', 'A05-A14', 'A15-A34', 'A35-A59', 'A60-A79', 'A80+', 'unbekannt']
    AltersgruppenRange = [(0,4), (5,14), (15, 34), (35,59), (60,79), (80,150)]
    fullTable = dt.fread("Census.csv")
    RKITable = fullTable[:,['Code',"Name","Insgesamt-total", "Insgesamt-M", "Insgesamt-W"]]

    print(RKITable)
    for i, (fromAge, toAge) in enumerate(AltersgruppenRange):
        for postfix in ["total", "M", "W"]:
            print(Altersgruppen[i], fromAge, toAge)
            names = makeNames(fromAge, toAge, postfix)
            #print(names)
            tTable = fullTable[:, names]
            #print(tTable)
            print(tTable[0])
            newColName = Altersgruppen[i]+"-"+postfix
            sums = tTable[:, {newColName: dt.rowsum(dt.f[:])}]
            RKITable[newColName] = sums
            print(sums)
            print(RKITable)

    BerlinTable = dt.fread("Census-Berlin.csv")
    RKIBerlinTable = BerlinTable[:,['Code',"Name","Insgesamt-total", "Insgesamt-M", "Insgesamt-W"]]

    print(RKIBerlinTable)
    for i, (fromAge, toAge) in enumerate(AltersgruppenRange):
        for postfix in ["total", "M", "W"]:
            print(Altersgruppen[i], fromAge, toAge)
            names = makeBerlinNames(fromAge, toAge, postfix)
            print(names)
            tTable = BerlinTable[:, names]
            print(tTable)
            print(tTable[0])
            newColName = Altersgruppen[i]+"-"+postfix
            sums = tTable[:, {newColName: dt.rowsum(dt.f[:])}]
            RKIBerlinTable[newColName] = sums
            print(sums)
            print(RKIBerlinTable)

    # adjust berlin Number to Match nuw numbers
    oldBerlinRow = RKIBerlinTable[0,2:]
    newBerlinRow = RKITable[dt.f.Name == "Berlin",2:]
    print(oldBerlinRow)
    print(newBerlinRow)

    factors = newBerlinRow.to_numpy() / oldBerlinRow.to_numpy()
    print(factors)

    adjustedBerlin = (RKIBerlinTable[:,2:].to_numpy() * factors).astype(int)
    print(adjustedBerlin)
    RKIBerlinTable[:, 2:] = adjustedBerlin
    print(RKIBerlinTable)

    RKITable.rbind(RKIBerlinTable[1:,:])
    #print(RKITable)
    #RKITable.to_csv("raw.csv")

    # add Hamburg also as Landkreis
    Hamburg = RKITable[dt.f.Code == 2000,:]
    if Hamburg.nrows != 1:
        Hamburg = RKITable[dt.f.Code == 2, :]
        if Hamburg.nrows != 1:
            print("Hamburg not found in Census")
            exit(1)
        RKITable.rbind(Hamburg)
        RKITable[RKITable.nrows-1, "Code"] = 2000

    ## check for consistency
    latest = dt.fread("data.csv")
    latestList = latest[:,["IdLandkreis","Landkreis","IdBundesland","Bundesland"]]

    RKITable.names = {"Code" : "IdLandkreis"}
    #print(RKITable)

    check = join(RKITable, latestList, "IdLandkreis", overwriteSame=False)
    #print(check)
    #check.to_csv("check.csv")
    print("Trash:\n", check[(dt.f.IdBundesland == 0) & (dt.f.Landkreis != "Deutschland"),:])
    del check[(dt.f.IdBundesland == 0) & (dt.f.Landkreis != "Deutschland"),:]
    print(check)
    check.to_csv(outputFile)
Exemple #12
0
alt.Chart(weather_dt[:,f.temp_diff].to_pandas()).mark_bar().encode(
    alt.X('temp_diff',bin=True),
    alt.Y('count()')
).properties(

    title='Distribution of temparature differences'
)

# Downloading weather data and selecting specific columns related to weather conditions
weather_temp = dt.fread('https://assets.datacamp.com/production/repositories/1497/datasets/02f3fb2d4416d3f6626e1117688e0386784e8e55/weather.csv',na_strings=[""]
                       )[:,[f[1],f[7:]]]

weather_temp

# New column : sum of rows
weather_temp[:,update(tot_cond=dt.rowsum(f[1:]))]

# select few columms
weather_temp_1= weather_temp[:,[f[0],f[-1]]]

# renaming dataframe column
weather_temp_1.names = {'DATE':'stop_date'}

# apply a key
weather_temp_1.key="stop_date"

# Visualization
alt.Chart(weather_temp_1.to_pandas()).mark_bar().encode(
    alt.X('tot_cond',bin=True),
    alt.Y('count()')
).properties(
def agregar_variables_nuevas(dataset: Frame) -> Frame:
    dataset['tarjetas_status01'] = dataset[:,
                                           dt.rowmax([
                                               f.Master_status, f.Visa_status
                                           ])]  # 3
    dataset['tarjetas_status02'] = dataset[:,
                                           dt.rowmin([
                                               f.Master_status, f.Visa_status
                                           ])]  # 2
    dataset['tarjetas_fultimo_cierre01'] = dataset[:,
                                                   dt.rowmax([
                                                       f.Master_fultimo_cierre,
                                                       f.Visa_fultimo_cierre
                                                   ])]  # 479
    dataset['tarjetas_fultimo_cierre02'] = dataset[:,
                                                   dt.rowmin([
                                                       f.Master_fultimo_cierre,
                                                       f.Visa_fultimo_cierre
                                                   ])]  # 421
    dataset['tarjetas_Finiciomora'] = dataset[:,
                                              dt.rowmin([
                                                  f.Master_Finiciomora,
                                                  f.Visa_Finiciomora
                                              ])]  # 12
    dataset['tarjetas_Fvencimiento'] = dataset[:,
                                               dt.rowmin([
                                                   f.Master_Fvencimiento,
                                                   f.Visa_Fvencimiento
                                               ])]  # 359
    dataset['tarjetas_delinquency'] = dataset[:,
                                              dt.rowmax([
                                                  f.Master_delinquency,
                                                  f.Visa_delinquency
                                              ])]  # 18
    dataset[
        'tarjetas_mfinanciacion_limite'] = dataset[:,
                                                   dt.rowsum([
                                                       f.
                                                       Master_mfinanciacion_limite,
                                                       f.
                                                       Visa_mfinanciacion_limite
                                                   ])]  # 230
    dataset['tarjetas_msaldototal'] = dataset[:, f.Master_msaldototal +
                                              f.Visa_msaldototal]  # 57
    dataset['tarjetas_msaldopesos'] = dataset[:, f.Master_msaldopesos +
                                              f.Visa_msaldopesos]  # 46
    dataset[
        'tarjetas_msaldodolares'] = dataset[:, f.Master_msaldodolares + f.
                                            Visa_msaldodolares]  # 1142 pero una derivada 104
    dataset['tarjetas_mconsumospesos'] = dataset[:, f.Master_mconsumospesos +
                                                 f.Visa_mconsumospesos]  # 400
    dataset[
        'tarjetas_mconsumosdolares'] = dataset[:,
                                               f.Master_mconsumosdolares + f.
                                               Visa_mconsumosdolares]  # 891 pero con derivadas 352
    dataset[
        'tarjetas_mlimitecompra'] = dataset[:, f.Master_mlimitecompra + f.
                                            Visa_mlimitecompra]  # 186 pero con derivadas 26
    dataset[
        'tarjetas_madelantopesos'] = dataset[:, f.Master_madelantopesos + f.
                                             Visa_madelantopesos]  # 666 pero derivadas 26
    dataset[
        'tarjetas_madelantodolares'] = dataset[:,
                                               f.Master_madelantodolares + f.
                                               Visa_madelantodolares]  # 294 y derivadas 33
    dataset['tarjetas_fultimo_cierre'] = dataset[:,
                                                 dt.rowmax([
                                                     f.Master_fultimo_cierre,
                                                     f.Visa_fultimo_cierre
                                                 ])]  # 448
    dataset['tarjetas_mpagado'] = dataset[:, f.Master_mpagado +
                                          f.Visa_mpagado]  # 384 y derivadas 29
    dataset['tarjetas_mpagospesos'] = dataset[:, f.Master_mpagospesos +
                                              f.Visa_mpagospesos]  # 28
    dataset[
        'tarjetas_mpagosdolares'] = dataset[:, f.Master_mpagosdolares + f.
                                            Visa_mpagosdolares]  # 1017 y derivadas 255
    dataset['tarjetas_fechaalta'] = dataset[:,
                                            dt.rowmax([
                                                f.Master_fechaalta,
                                                f.Visa_fechaalta
                                            ])]  # 159
    dataset[
        'tarjetas_mconsumototal'] = dataset[:, f.Master_mconsumototal + f.
                                            Visa_mconsumototal]  # 512 y derivadas 365
    dataset['tarjetas_cconsumos'] = dataset[:, f.Master_cconsumos +
                                            f.Visa_cconsumos]  # 424
    dataset[
        'tarjetas_cadelantosefectivo'] = dataset[:,
                                                 f.Master_cadelantosefectivo +
                                                 f.
                                                 Visa_cadelantosefectivo]  # 750
    dataset['tarjetas_mpagominimo'] = dataset[:, f.Master_mpagominimo +
                                              f.Visa_mpagominimo]  # 98
    dataset[
        'ratio_tarjetas_msaldodolares__tarjetas_mlimitecompra'] = dataset[:, f.
                                                                          tarjetas_msaldodolares
                                                                          / f.
                                                                          tarjetas_mlimitecompra]  # 104
    dataset[
        'ratio_tarjetas_msaldodolares__tarjetas_msaldototal'] = dataset[:, f.
                                                                        tarjetas_msaldodolares
                                                                        / f.
                                                                        tarjetas_msaldototal]  # 611
    dataset[
        'ratio_tarjetas_mconsumospesos__tarjetas_mlimitecompra'] = dataset[:,
                                                                           f.
                                                                           tarjetas_mconsumospesos
                                                                           / f.
                                                                           tarjetas_mlimitecompra]  # 244
    dataset[
        'ratio_tarjetas_madelantopesos__tarjetas_mlimitecompra'] = dataset[:,
                                                                           f.
                                                                           tarjetas_madelantopesos
                                                                           / f.
                                                                           tarjetas_mlimitecompra]  # 26
    dataset[
        'ratio_tarjetas_madelantodolares__tarjetas_mlimitecompra'] = dataset[:,
                                                                             f.
                                                                             tarjetas_madelantodolares
                                                                             /
                                                                             f.
                                                                             tarjetas_mlimitecompra]  # 33
    dataset[
        'ratio_tarjetas_mpagospesos__tarjetas_mlimitecompra'] = dataset[:, f.
                                                                        tarjetas_mpagospesos
                                                                        / f.
                                                                        tarjetas_mlimitecompra]  # 38
    dataset[
        'ratio_tarjetas_mpagominimo__tarjetas_mlimitecompra'] = dataset[:, f.
                                                                        tarjetas_mpagominimo
                                                                        / f.
                                                                        tarjetas_mlimitecompra]  # 100
    dataset[
        'ratio_tarjetas_mpagado__tarjetas_mlimitecompra'] = dataset[:, f.
                                                                    tarjetas_mpagado
                                                                    / f.
                                                                    tarjetas_mlimitecompra]  # 29
    dataset[
        'ratio_tarjetas_mpagosdolares__tarjetas_mlimitecompra'] = dataset[:, f.
                                                                          tarjetas_mpagosdolares
                                                                          / f.
                                                                          tarjetas_mlimitecompra]  # 255
    dataset[
        'ratio_tarjetas_mconsumototal__tarjetas_mlimitecompra'] = dataset[:, f.
                                                                          tarjetas_mconsumototal
                                                                          / f.
                                                                          tarjetas_mlimitecompra]  # 365
    dataset[
        'ratio_tarjetas_mconsumosdolares__tarjetas_mlimitecompra'] = dataset[:,
                                                                             f.
                                                                             tarjetas_mconsumosdolares
                                                                             /
                                                                             f.
                                                                             tarjetas_mlimitecompra]  # 352
    dataset[
        'ratio_tarjetas_msaldopesos__tarjetas_mlimitecompra'] = dataset[:, f.
                                                                        tarjetas_msaldopesos
                                                                        / f.
                                                                        tarjetas_mlimitecompra]  # 270
    dataset[
        'ratio_tarjetas_msaldopesos__tarjetas_msaldototal'] = dataset[:, f.
                                                                      tarjetas_msaldopesos
                                                                      / f.
                                                                      tarjetas_msaldototal]  # 414
    dataset[
        'ratio_Master_mlimitecompra__tarjetas_mlimitecompra'] = dataset[:, f.
                                                                        Master_mlimitecompra
                                                                        / f.
                                                                        tarjetas_mlimitecompra]  # 367
    dataset[
        'ratio_Visa_mlimitecompra__tarjetas_mlimitecompra'] = dataset[:, f.
                                                                      Visa_mlimitecompra
                                                                      / f.
                                                                      tarjetas_mlimitecompra]  # 192

    # v2
    dataset['ctarjetas_credito'] = dataset[:, f.ctarjeta_master +
                                           f.ctarjeta_visa]  # 27
    dataset['ctarjetas'] = dataset[:, f.ctarjetas_credito +
                                   f.ctarjeta_debito]  # 623
    dataset[
        'ratio_mprestamos_personales__cprestamos_personales'] = dataset[:, f.
                                                                        mprestamos_personales
                                                                        / f.
                                                                        cprestamos_personales]  # 127
    dataset['cextracciones'] = dataset[:, f.cextraccion_autoservicio +
                                       f.ccajas_extracciones]  # 157
    dataset[
        'ratio_mextraccion_autoservicio__mcuentas_saldo'] = dataset[:, f.
                                                                    mextraccion_autoservicio
                                                                    / f.
                                                                    mcuentas_saldo]  # 565
    dataset['ccomisiones'] = dataset[:, f.ccomisiones_mantenimiento +
                                     f.ccomisiones_otras]  # 578
    dataset['ratio_mcomisiones__ccomisiones'] = dataset[:, f.mcomisiones /
                                                        f.ccomisiones]  # 508
    dataset['ctransacciones'] = dataset[:, f.ccallcenter_transacciones +
                                        f.chomebanking_transacciones +
                                        f.ccajas_transacciones]  # 485
    dataset['ratio_ctransacciones__cproductos'] = dataset[:, f.ctransacciones /
                                                          f.cproductos]  # 472

    # v3
    dataset['mpayroll_total'] = dataset[:, f.mpayroll + f.mpayroll2]  # 68
    dataset['ratio_mpayroll_total__cliente_edad'] = dataset[:,
                                                            f.mpayroll_total /
                                                            f.
                                                            cliente_edad]  # 87
    dataset['ratio_mcaja_ahorro__cliente_edad'] = dataset[:, f.mcaja_ahorro /
                                                          f.cliente_edad]  # 23
    dataset[
        'ratio_mcuentas_saldo__cliente_edad'] = dataset[:, f.mcuentas_saldo /
                                                        f.cliente_edad]  # 102
    dataset['cseguros_total'] = dataset[:, f.cseguro_vida + f.cseguro_auto +
                                        f.cseguro_vivienda +
                                        f.cseguro_accidentes_personales]  # 454
    dataset[
        'ratio_cseguros_total__cliente_antiguedad'] = dataset[:,
                                                              f.cseguros_total
                                                              / f.
                                                              cliente_antiguedad]  # 628

    # v7
    dataset['tarjetas_mconsumo_mes'] = dataset[:, f.mtarjeta_visa_consumo +
                                               f.mtarjeta_master_consumo]  # 45
    dataset['tarjetas_mconsumototal'] = dataset[:, f.Master_mconsumototal +
                                                f.Visa_mconsumototal]  # 419
    dataset[
        'ratio_tarjetas_consumo_mes__cliente_edad'] = dataset[:, f.
                                                              tarjetas_mconsumo_mes
                                                              / f.
                                                              cliente_edad]  # 51
    dataset['score_04'] = dataset[:, (f.ctarjetas_credito *
                                      f.tarjetas_delinquency) /
                                  f.cliente_edad]  # 695
    dataset['score_04_relativo'] = dataset[:, f.score_04 /
                                           mean(f.score_04)]  # 267

    # Resultaron no ser importantes

    # v1
    # dataset['ratio_tarjetas_msaldototal__tarjetas_mlimitecompra'] = dataset[:, f.tarjetas_mlimitecompra / f.tarjetas_mlimitecompra] # 2544

    # v2
    # dataset['ratio_mrentabilidad__cproductos'] = dataset[:, f.mrentabilidad / f.cproductos] # 911
    # dataset['dif_tarjetas_mconsumototal__tarjetas_mpagado'] = dataset[:, f.tarjetas_mconsumototal - f.tarjetas_mpagado] # 1277
    # dataset['ratio_mrentabilidad__mcomisiones'] = dataset[:, f.mrentabilidad / f.mcomisiones] # 1100

    # v3
    # dataset['ratio_mrentabilidad__mcuentas_saldo'] = dataset[:, f.mrentabilidad / f.mcuentas_saldo] # 2042
    # dataset['ratio_mrentabilidad__cliente_antiguedad'] = dataset[:, f.mrentabilidad / f.cliente_antiguedad] # 1854
    # dataset['ratio_mrentabilidad__cliente_edad'] = dataset[:, f.mrentabilidad / f.cliente_edad] # 1811
    # dataset['ratio_cliente_antiguedad__cliente_edad'] = dataset[:, f.cliente_antiguedad / f.cliente_edad] # 1719

    # v7
    # dataset['score_01_relativo'] = dataset[:, f.score_01 / mean(f.score_01)] # no aparece
    # dataset['score_02_relativo'] = dataset[:, f.score_02 / mean(f.score_02)] # 2507
    # dataset['score_03_relativo'] = dataset[:, f.score_03 / mean(f.score_03)] # 2454
    # dataset['ratio_tarjetas_mconsumototal__cliente_edad'] = dataset[:, f.tarjetas_mconsumototal / f.cliente_edad] # 2459
    # dataset['ratio_Visa_mconsumospesos__cliente_edad'] = dataset[:, f.Visa_mconsumospesos / f.cliente_edad] # 2485
    # dataset['ratio_Visa_mconsumosdolares__cliente_edad'] = dataset[:, f.Visa_mconsumosdolares / f.cliente_edad] # 2486
    # dataset['ratio_Visa_mconsumototal__cliente_edad'] = dataset[:, f.Visa_mconsumototal / f.cliente_edad] # 2429
    # dataset['ratio_Master_mconsumospesos__cliente_edad'] = dataset[:, f.Master_mconsumospesos / f.cliente_edad] # 2501
    # dataset['ratio_Master_mconsumosdolares__cliente_edad'] = dataset[:, f.Master_mconsumosdolares / f.cliente_edad] # 2345
    # dataset['ratio_Master_mconsumototal__cliente_edad'] = dataset[:, f.Master_mconsumototal / f.cliente_edad] # 2493
    # dataset['ratio_ctransacciones__cliente_edad'] = dataset[:, f.ctransacciones / f.cliente_edad] # 2508
    # dataset['score_01'] = dataset[:, (f.ctarjetas * f.mrentabilidad) / f.ctrx_quarter] # 2575
    # dataset['score_02'] = dataset[:, (f.ctarjetas * f.ctransacciones) / f.ctrx_quarter] # 2507
    # dataset['score_03'] = dataset[:, (f.ctarjetas * f.ctransacciones) / f.cliente_edad] # 2498

    return dataset