Skip to content

Statistics.stack: Move to statistics module#2696

Closed
pavlin-policar wants to merge 1 commit intobiolab:masterfrom
pavlin-policar:statistics-util-stack
Closed

Statistics.stack: Move to statistics module#2696
pavlin-policar wants to merge 1 commit intobiolab:masterfrom
pavlin-policar:statistics-util-stack

Conversation

@pavlin-policar
Copy link
Collaborator

@pavlin-policar pavlin-policar commented Oct 20, 2017

Issue

hstack and vstack existed in Orange.data.util, however all the other functions that handle sparse and dense data are situated in Orange.statistics.util.

Description of changes

Move functions and tests to Orange.statistics.util module to keep all functions that deal with sparse/dense compatibility in same module.

Based on #2572.

Includes
  • Code changes
  • Tests
  • Documentation

import numpy as np
import bottleneck as bn
from scipy import sparse as sp
import numpy as np
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add

from Orange.statistics.util import hstack, vstack  # back-compat

@pavlin-policar pavlin-policar force-pushed the statistics-util-stack branch 2 times, most recently from d2286a4 to 86ef0f9 Compare October 20, 2017 12:25
@nikicc
Copy link
Contributor

nikicc commented Oct 20, 2017

Hmmm ... I like that we have everything together but importing vstack and hstack from Orange.statistics.util seems strange to me.

Perhaps, should we introduce a separate module for this sparse/dense compatibility methods? Some other methods from Orange.statistics.util could be moved there.

@pavlin-policar
Copy link
Collaborator Author

pavlin-policar commented Oct 20, 2017

I agree, Orange.statistics.util is probably not the best place for this. I think Orange.data.util would be a much better module, or something new altogether.

Of course, we'd have to move a large number of functions from there.

@pavlin-policar pavlin-policar force-pushed the statistics-util-stack branch 3 times, most recently from 79a6bf9 to 2a7c36d Compare October 21, 2017 16:28
@pavlin-policar
Copy link
Collaborator Author

This had conflicts and it would be easier to simply start fresh from master, since the changes in this PR were quite trivial.

We had decided that it would be strange to have common functions (such as vstack and hstack in a module named statistics; a different module would have to be made where we move all the methods that are essentially wrappers around sparse and numpy functions. This introduces backwards compatibility issues.

@pavlin-policar pavlin-policar deleted the statistics-util-stack branch April 4, 2018 05:06
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.

3 participants