Skip to content

CCF - predict from raster brick fail  #2

@hnthang

Description

@hnthang

Hi,

Thank you so much for your contribution!

I used your CCF to train and predict for 5 classes as follows:

ccf <- canonical_correlation_forest(Xtr_ccf, Ytr_ccf, ntree = 100, verbose=TRUE)
YpredCCF <- predict(ccf, Xtest_ccf, verbose=TRUE) (1)

Instead of using Xtest_ccf, I would like to predict from a raster brick which have 4 bands (raster brick: taur) to create a classified map (similar to do with random forest):

use predict from raster package
YpredCCF <- predict(taur, model=ccf, na.rm=TRUE) (2)

but always get the error (although works for random forest):

Error in setValues(predrast, v) :
values must be numeric, integer, logical or factor

Something is wrong with my data or your package will not work with the code 2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions