Code Monkey home page Code Monkey logo

sktutor's Introduction

sktutor's People

Contributors

alecwallace2001 avatar dfd avatar garzillo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

alecwallace2001

sktutor's Issues

explicitly set regex = True in ColumnNameCleaner

  • sktutor version:
  • Python version:
  • Operating System:

Warning from pandas that the default will switch from True to False on this option in str.replace.

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

Mismatched args for StandardScaler and PolynomialFeatures

  • sktutor version: 0.21.2
  • Python version: 3.6.4
  • Operating System: Linux

Description

When running a pipeline with StandardScaler an error is thrown saying:
TypeError: fit_transform() takes 2 positional arguments but 3 were given

What I Did

prep_pipe1 = Pipeline([
    ('features', FeatureUnion([
        ('continuous', Pipeline([
            ('extract', ColumnExtractor(CONTINUOUS_FIELDS)),
            ('drop missing threshold', OverMissingThresholdDropper(.5)), 
            ('remove too many same', SingleValueAboveThresholdDropper(threshold=.99)),
            ('impute missing by X', GroupByImputer(impute_type='median', group='x')),
            ('impute missing by Y', GroupByImputer(impute_type='median', group='y')),
            ('impute missing by Z', GroupByImputer(impute_type='median', group='z')),
            ('drop column', ColumnDropper(['x', 'y', 'z'])),
            ('impute missing overall', GroupByImputer(impute_type='median')),
            ('standardization', StandardScaler()),
            ('clean column names', ColumnNameCleaner())
        ])),                                       
        ('factors', Pipeline([
            ('extract', ColumnExtractor(FACTOR_FIELDS)),  
            ('drop missing threshold', OverMissingThresholdDropper(.6)), 
            ('drop single value', SingleValueDropper()), 
            ('missing value filler', MissingValueFiller('0Missing')),
            ('remove too many same', SingleValueAboveThresholdDropper(threshold=.99)),#change from 0.999 to 0.99
            ('replace values', ValueReplacer(inverse_mapper=inverse_map)),
            ('limit factor', FactorLimiter(factors_per_column=factors_per_col)),
            ('convert to dummies', DummyCreator(drop_first=True)),
            ('clean column names', ColumnNameCleaner())
        ])) ])),
    ])
df_transform = prep_pipe1.fit_transform(data)

/opt/conda/lib/python3.6/site-packages/sklearn/pipeline.py in _fit_transform_one(transformer, X, y, weight, message_clsname, message, **fit_params)
    714     with _print_elapsed_time(message_clsname, message):
    715         if hasattr(transformer, 'fit_transform'):
--> 716             res = transformer.fit_transform(X, y, **fit_params)
    717         else:
    718             res = transformer.fit(X, y, **fit_params).transform(X)

TypeError: fit_transform() takes 2 positional arguments but 3 were given

FeatureUnion issue

  • sktutor version: Master
  • Python version: All
  • Operating System: All

Description

Using feature union transform an error is returned saying _transform_one() got an unexpected keyword argument 'transforme'
This is due to the featureunion function in pipeline.py misspelling the argument 'transform'

What I Did

concurrent.futures.process._RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/usr/local/lib/python3.6/concurrent/futures/process.py", line 153, in _process_chunk
    return [fn(*args) for args in chunk]
  File "/usr/local/lib/python3.6/concurrent/futures/process.py", line 153, in <listcomp>
    return [fn(*args) for args in chunk]
  File "/usr/local/lib/python3.6/site-packages/sklearn/pipeline.py", line 426, in _transform
    Xt = transform.transform(Xt)
  File "/usr/local/lib/python3.6/site-packages/sktutor/pipeline.py", line 70, in transform
    for name, trans, weight in self._iter())
  File "/usr/local/lib/python3.6/site-packages/joblib/parallel.py", line 779, in __call__
    while self.dispatch_one_batch(iterator):
  File "/usr/local/lib/python3.6/site-packages/joblib/parallel.py", line 625, in dispatch_one_batch
    self._dispatch(tasks)
  File "/usr/local/lib/python3.6/site-packages/joblib/parallel.py", line 588, in _dispatch
    job = self._backend.apply_async(batch, callback=cb)
  File "/usr/local/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 111, in apply_async
    result = ImmediateResult(func)
  File "/usr/local/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 332, in __init__
    self.results = batch()
  File "/usr/local/lib/python3.6/site-packages/joblib/parallel.py", line 131, in __call__
    return [func(*args, **kwargs) for func, args, kwargs in self.items]
  File "/usr/local/lib/python3.6/site-packages/joblib/parallel.py", line 131, in <listcomp>
    return [func(*args, **kwargs) for func, args, kwargs in self.items]
TypeError: _transform_one() got an unexpected keyword argument 'transforme'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/process.py", line 366, in _chain_from_iterable_of_lists
    for element in iterable:
  File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 586, in result_iterator
    yield fs.pop().result()
  File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/local/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
TypeError: _transform_one() got an unexpected keyword argument 'transforme'
ERROR: Job failed: command terminated with exit code 1

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.