biolab / orange3

🍊 :bar_chart: :bulb: Orange: Interactive data analysis
https://orangedatamining.com
Other
4.85k stars 1.01k forks source link

Test and Score Error "Test and train dataset have different target variables" #5311

Closed IKetchup closed 3 years ago

IKetchup commented 3 years ago

Im having a problem on the widget "Test and score" used for classification. Im doing a classification on images and i would like to use the widget "test and score" with the option "Test on test data". I used select columns to select the feature "category" as target variable for the two datasets.

The training dataset is ordered in folders (so in class) with 1 image per folder. The feature "category is created by orange using the folder architecture. For the test dataset the widget "create feature" create the feature "class_name" using a substring of each image and then I create the target variable "category" using the widget "create class". Finaly the feature category is setted as target variable with "select columns" widget.

The two datasets are passed to the "test and score" widget with the option "test on test data"

However I get the error "Test and train dataset have different target variables". I checked my datasets and i have the same target variable: category.

Error message Test and train dataset have different target variables

For each dataset (train and test) i used the widget select columns to choose the target variable as "category". Then i pass the datasets to the test and score widget and i got the following error: "Test and train dataset have different target variables"

Screeenshot of the ows file image image image

Zip of the ows file (datasets are too big)

save.zip

IKetchup commented 3 years ago

The problem come from Orange who create target variable when a folder have underfolder but doesn't associate this target variable with a same one but created manually

ajdapretnar commented 3 years ago

You can change this with Edit Domain - Unlink variable from its source variable. In this way all variables with the same names will be considered equal.

IKetchup commented 3 years ago

Its working well thanks