Responder a: Colunas faltantes ao usar OneHotEncoder

#22652
Liah Oliveira
Participante

    Consegui resolver com o codigo abaixo:

     

    from sklearn.compose import ColumnTransformer
    columntransformer = ColumnTransformer([(‘encoder’, OneHotEncoder(), [1, 3, 5, 6, 7, 8, 9, 13])], remainder=’passthrough’)
    previsores = columntransformer.fit_transform(previsores).toarray()