Your general idea would work, here are some more details that will hopefully help you to proceed:
- Create an abstract Data class, with some generic methods like
load
,save
,print
etc. - Create concrete subclasses for each specific form of data you are interested in. This might be task-specific (e.g. data for natural language processing) or form-specific (data given as a matrix, where each row corresponds to a different observation)
- As you said, create an abstract Analysis class.
- Create concrete subclasses for each form of analysis. Each concrete subclass should override a method
process
which accepts a specific form of Data and returns a new instance of Data with the results (if you think the form of the results would be different of that of the input data, use a different class Result) - Create a Visualization class hierarchy. Each concrete subclass should override a method
visualize
which accepts a specific instance of Data (or Result if you use a different class) and returns some graph of some form.
I do have a warning: Python is abstract, powerful and high-level enough that you don't generally need to create your own OO design -- it is always possible to do what you want with mininal code using numpy
, scipy
, and matplotlib
, so before start doing the extra coding be sure you need it :)