dsilvestro / npbnn Goto Github PK
View Code? Open in Web Editor NEWBayesian neural networks using Numpy and Scipy
License: GNU Affero General Public License v3.0
Bayesian neural networks using Numpy and Scipy
License: GNU Affero General Public License v3.0
Line 96 in 9439b02
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
Is pickle5 really required? I'm having trouble installing it on a server but npBNN appears to run as expected without it
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.