Coder Social home page Coder Social logo

xam's Introduction

xam Build Status

xam is my personal data science and machine learning toolbox. It is written in Python 3 and stands on the shoulders of giants (mainly pandas and scikit-learn). It loosely follows scikit-learn's fit/transform/predict convention.

Installation

โš ๏ธ Because xam is a personal toolkit, the --upgrade flag will install the latest releases of each dependency (scipy, pandas etc.). I like to stay up-to-date with the latest library versions.

Table of contents

Usage example is available in the docs folder. Each example is tested with doctest.

Other Python data science and machine learning toolkits

License

The MIT License (MIT). Please see the license file for more information.

xam's People

Contributors

maxhalford avatar

Stargazers

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

Watchers

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

xam's Issues

BayesianTargetEncoder can not be pickled

I tried pickle.dump the BayesianTargetEncoder after fit(), but get this error
AttributeError: Can't pickle local object 'BayesianTargetEncoder.fit..'

It is for sure a problem in deployment, if you can not store away a pre-trained encoder. Is this a known issue? Can we get a fix for it? Thanks

Error while pip install xam

It does install the package but when the import has to be done in the code, it reports an error saying that "ModuleNotFoundError: No module named 'repos'
After doing pip install repos, again the error shows up as:
ModuleNotFoundError: No module named 'fabric.api'

Feature extraction methods in sklearn pipeline

Hey, I'm facing an issue with implementing BayesianTargetEncoder and CycleTransformer in a pipeline that I've made. This might be because of my lack of experience but any help would still be appreciated.

The pipeline I currently have is

model = RandomForestRegressor(n_estimators = 1000, min_samples_split = 2, max_features = 'sqrt',
max_depth = 20, random_state = 42, bootstrap = True, oob_score = True, n_jobs = 4)

ss = StandardScaler()
bte = BayesianTargetEncoder()
ct = CycleTransformer()

rf = Pipeline(
    [
    ("transformer", ColumnTransformer
        (
            [
                ("scaler", ss, num_cols),
                ("bayesian_target_encoder", bte, cat_cols),
                ("cycle_transformer"), ct, times
            ]
        )
    ),
    ("reg", model) 
    ]
)  

and the issue that I am facing is that it says TypeError: 'CycleTransformer' object is not iterable

If I remove CycleTransformer and proceed without it, then I get this issue:

C:\py\lib\site-packages\xam\feature_extraction\encoding\bayesian_target.py in transform(self, X, y)
     73             raise ValueError('X has to be a pandas.DataFrame')
     74 
---> 75         for cols in self.columns:
     76 
     77             if isinstance(cols, list):

TypeError: 'NoneType' object is not iterable

I understand it says that X has to be a pandas dataframe but i'm not sure what the work around to this would be.
Thank you

smooth target encoding

Hi,

thanks a lot for this handy toolkit! May i make a minor observation? It would be useful to cast the transformed column types into np.float32 explicitly here, while sometimes for unclear to me reason the type remains 'category', while in other cases it is casted into a float

cannot save count encoder to pickle

Hi,
I have problem to save count encoder into pickle. It throw the error below :
AttributeError: Can't pickle local object 'CountEncoder.fit..'
thank you

meaning of prior_weight

there is a prior_weight param used in Bayesian Target Encoding and a reference to a page to Additive Smoothing. However, on that page, I don't see any reference to the prior weight parameter. Is there some kind of explanation what that parameter means?

AUC regressor range value

is it normal if we get prediction using AUC regressor with the range not between 0-1? does predict method here similar to predict_proba ? I am working on binary classification.

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.