GithubHelp home page GithubHelp logo

Comments (2)

vnmabus avatar vnmabus commented on May 27, 2024

I wanted since a long time to rework the classes used to represent functions, in order to make them more general and move them to a separate package. Thus, some of the design choices taken for scikit-fda will be revisited.

In particular, I agree that metadata attributes, such as sample_names complicate a lot of things. On one hand, they are interesting for plotting and exploratory analysis. On the other hand, they work really bad with operations. For example, when taking the mean of a functional dataset, the sample_names need to be removed. This is not a new problem. Other libraries, such as xarray or scipp that deal with arrays including labels or units need to do something about it too. We should check what they do.

As for the copy method itself, I am unsure of the best way to deal with it. Right now it is more of an "utility" method, used for creating identical or almost identical copies of a FData object, that is why by default it tries to preseve everything. However I agree that this is problematic, and can create subtle bugs if one forgets about that behavior. I would love to have your feedback on how to better implement it.

from scikit-fda.

eliegoudout avatar eliegoudout commented on May 27, 2024

Other libraries, such as xarray or scipp that deal with arrays including labels or units need to do something about it too. We should check what they do.

I personally don't know these packages at all, so I would not be able to give you any insight at the moment.

As for the copy method itself, I am unsure of the best way to deal with it. [...] I would love to have your feedback on how to better implement it.

I don't have any strong opinion, but my main observation would be that it is currently impossible to set any argument to attr=None, because it is then treated as self.attr. I think this should be fixed, while retaining default behaviour.

skeleton.copy(data_matrix=data_matrix)  # Raises error if data_matrix has different number of samples
skeleton.copy(data_matrix=data_matrix, sample_names=None)  # Actively deleting sample names

This way, no sample name is silently deleted, but if the user encounters this error, she/he can fix it more easily.

As for implementation detail, I don't know what the best practise would be. Creating a DEF object to replace the default None values?

def copy(self: T, *, data_matrix=DEF, grid_points=DEF, [...]) -> T

There might be more pythonic ways I don't know of.

from scikit-fda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.