Code Monkey home page Code Monkey logo

npbnn's People

Contributors

alrichardbollans avatar andermannt avatar dsilvestro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

npbnn's Issues

Feature blocks type

feature_blocks = [[0,1,2,3,4,5,6,7],[8,9,10],[11,12,13,14,15,16,17,18,19,20]],

In the example, feature_blocks are given as a list which, for me, raises the error: "AttributeError: 'list' object has no attribute 'keys'", as the function expects feature_blocks to be a dict

pickle5

Is pickle5 really required? I'm having trouble installing it on a server but npBNN appears to run as expected without it

Setting random seeds

In a few of the bn functions (e.g. get_data, npBNN.init) the global seed is being set --- np.random.seed(seed). This is causing issues for me with other processes that use randoms numbers. In my case, this is affecting the generation of train/test indices in cross validation. If running the following example, the train/test indices are simply repeated where they shouldn't be. I believe the fix to this is to use a Random object and set its seed instead of the global seed.

    import np_bnn as bn
    import pandas as pd
    from sklearn.model_selection import RepeatedKFold

    # Example data
    from import_trait_data import NUMERIC_TRAITS, IMPORTED_TRAIT_CSV
    train_data = pd.read_csv(IMPORTED_TRAIT_CSV)
    X = train_data[NUMERIC_TRAITS]
    y = train_data['Activity_Antimalarial']

    rskf = RepeatedKFold(n_splits=2, n_repeats=5)

    for i, (train_index, test_index) in enumerate(rskf.split(X, y)):
        print(f'Fold: {i}')
        print(train_index)
        print(test_index)
        y_train, y_test = y.iloc[train_index], y.iloc[test_index]
        X_train, X_test = X.iloc[train_index], X.iloc[test_index]

        train_dat = bn.get_data(X_train, y_train,
                                seed=1234,
                                testsize=0,
                                randomize_order=False,
                                instance_id=None, from_file=False)

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.