Thanks to visit codestin.com
Credit goes to github.com

Skip to content

makeCPO: Number of rows of numeric data returned by t-sne did not match input #75

@ghost

Description

cpoTsne = makeCPOExtendedTrafo("t-sne", # nolint
pSS(rank: integer[1, ]),
dataformat = "numeric",
cpo.trafo = function(data, target, rank) {
outTsne= Rtsne(as.matrix(data), dims = rank, perplexity = 10, max_iter = 100)
control = outTsne$Y
},
cpo.retrafo = function(data, control, rank) {
control
})
lrn = cpoTsne(rank=2)%>>%makeLearner("classif.ksvm")
resample(lrn, task, resampling = outer_loop, measures = list(mmce), show.info = FALSE)

Hello, if I execute the code above, I get the following error message:
Error in recombineLL(df, newdata, targetcols, strict.factors, subset.index, :
Number of rows of numeric data returned by t-sne did not match input
CPO must not change row number.

This error message only appears if I use makeLearner() and resample().
But the following comand works: data%>>%cpoTsne(rank=2)
classif V1 V2
1 0 -2.055749824 -1.801610596
2 1 -0.469646936 3.347391844
3 1 -0.194586726 0.057422613
4 0 1.070363088 3.380600350
5 1 -0.567965508 3.096630889
...
The number of rows are the same as in data. Where is the problem? Must be in cpo.retrafo. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions