JuliaAI / ScientificTypes.jl

An API for dispatching on the "scientific" type of data instead of the machine type
MIT License
96 stars 8 forks source link

Elements of scitype `Textual` cannot be coerced to `Textual` #193

Open EssamWisam opened 10 months ago

EssamWisam commented 10 months ago
 X = (Column1=[1, 2, 3, 4, 5],
         Column2=["a", "b", "c", "d", "e"],
         Column3=["a", "b", "c", "d", "e"],
         Column4=[1.0, 2.0, 3.0, 4.0, 5.0]
    )
    y = [1, 2, 3, 4, 5]
    X = Tables.columntable(X)
    # coerce first column to multiclass and last column to continuous
    # second and third column to text
    X = coerce(X, :Column1=>Multiclass, :Column2=>Textual, :Column3=>Textual, :Column4=>Continuous)

In particular, running this example yields

ScientificTypes.CoercionError("Coercion of eltype `String` to element scitype `Textual` is not supported. ")

Shouldn't this be a no-op?

ablaom commented 5 months ago

Agreed.