Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Categorizar el score de credito
- EVALUATE
- ADDCOLUMNS(
- Loan_Default,
- "Categorized credit score",
- SWITCH(
- TRUE(),
- Loan_Default[Credit_Score] < 500, "mala",
- AND (Loan_Default[Credit_Score] >= 500, Loan_Default[Credit_Score] < 650), "regular",
- AND (Loan_Default[Credit_Score] >= 650, Loan_Default[Credit_Score] < 700), "buena",
- Loan_Default[Credit_Score] >= 700, "Excelente"
- )
- )
- %Contar todos los valores nulos
- EVALUATE
- VAR nulosEdad = CALCULATE(
- COUNTROWS(Loan_Default),
- ISBLANK(Loan_Default[age])
- )
- RETURN
- ROW(
- "Conteo", nulosEdad
- )
- %Cambiar los valores nulos por el promedio
- EVALUATE
- VAR promedio = AVERAGEX(
- Loan_Default,
- Loan_Default[rate_of_interest]
- )
- RETURN
- ADDCOLUMNS(
- Loan_Default,
- "rate_of_interest_processed",
- IF(
- ISBLANK(Loan_Default[rate_of_interest]),
- promedio,
- Loan_Default[rate_of_interest]
- )
- )
- %Agregar nueva tabla
- Loan_Rate_Interest =
- ADDCOLUMNS(
- Loan_Default,
- "interest_rate_v2", IF(
- ISBLANK(Loan_Default[rate_of_interest]),
- AVERAGEX(
- Loan_Default,
- Loan_Default[rate_of_interest]
- ),
- Loan_Default[rate_of_interest]
- ))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement