Is abstract class field in python possible?

How would you design an abstract time series validation class in Python?

  • I'm trying to abstract all the work of doing time-series validation, so that I never have to think about it again.  Ideally, I would like to pass the Class a pandas dataframe, a time window, and a function which looks at data in some window and returns a single number (for one step ahead prediction).  It would loop through the data and return various things like predictions, error rates, and so on.  It's ok if it's blindingly slow.  Are there any good design tips to keep in mind when trying to implement this?

  • Answer:

    There is one design pattern that may solve your problemas that is the strategy pattern. If you are using OOP you can create a class with you data and the validator would be just another variable. If the solution above is too complicated for the problem you can always create an object with the data you need to validate...

Paulo Santos at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.