Code Monkey home page Code Monkey logo

pytorch-onfire's Introduction

PyTorch OnFire

PyTorch meets Sklearn Pipelines.

pytorch-onfire's People

Contributors

jmansilla avatar joshfp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pytorch-onfire's Issues

Confusing UX with default values

I saw in several places this pattern:

class ContinuousFeature(BaseFeature):
    def __init__(self, key=None, preprocessor=None, imputer=None, scaler=None, log=False,
                 log_auto_scale=True):
        self.key = key
        self.preprocessor = preprocessor
        self.imputer = (imputer or SimpleImputer()) if imputer != False else None
        self.scaler = (scaler or StandardScaler()) if scaler != False else None
        self.log = log
        self.log_auto_scale = log_auto_scale

Lets focus on '''scaler''' for instance.
Reading the code, what I'm guessing is that what you want to offer to the developer using the lib, the following choices:

  • leave parameter with default value None, which internally will invoke a StandardScaler
  • provide her own scaler
  • use no scaler at all, by providing False value on that parameter

Those seems too many options, not straightforward to think about, to use, or to code (onfire code is twisted for accomplishing this matter).
Not only that, but the code is also breaking the expectations. If the user writes ContinuousFeature(scaler=None) but instead get an instance with an StandardScaler, sounds like a bug to me (although you may say it's a feature).

Posible better UX:

  • default is None, and it's used as it is (which means, no scaler). And the usual python applies. False, 0, etc, are interpreted as None as well.

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.