Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] impute: Remove class vars from input data for ReplaceUnknownsModel #5083

Merged
merged 1 commit into from
Nov 13, 2020

Conversation

ales-erjavec
Copy link
Contributor

@ales-erjavec ales-erjavec commented Nov 11, 2020

Issue

impute.Model does not work on input dataset with class_vars since gh-3925 due to error raised by backmapping.

import Orange
from Orange.modelling import ConstantLearner
from Orange.preprocess import impute

data = Orange.data.Table("brown-selected")
impvar = impute.Model(ConstantLearner())(data, data.domain[0])
impvar.compute_value(data)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/aleserjavec/Documents/workspace/orange3/Orange/preprocess/impute.py", line 175, in __call__
    predicted = self.model(data[mask])
  File "/Users/aleserjavec/Documents/workspace/orange3/Orange/base.py", line 437, in __call__
    backmappers, n_values = self.get_backmappers(data)
  File "/Users/aleserjavec/Documents/workspace/orange3/Orange/base.py", line 248, in get_backmappers
    f"Model for '{modelclass.name}' "
Orange.data.table.DomainTransformationError: Model for 'alpha 0' cannot predict 'function'
Description of changes

Remove class vars from input data for ReplaceUnknownsModel

Includes
  • Code changes
  • Tests
  • Documentation

`ReplaceUnknownsModel` did not work on input dataset with `class_vars`
since biolabgh-3925 due to error raised by backmapping.
@codecov
Copy link

codecov bot commented Nov 11, 2020

Codecov Report

Merging #5083 (d061f53) into master (29e992f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #5083   +/-   ##
=======================================
  Coverage   84.74%   84.74%           
=======================================
  Files         286      286           
  Lines       60036    60037    +1     
=======================================
+ Hits        50876    50878    +2     
+ Misses       9160     9159    -1     

@janezd janezd self-assigned this Nov 13, 2020
@janezd janezd merged commit 838e5fa into biolab:master Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants