diff --git a/diff_classifier/msd.py b/diff_classifier/msd.py index e5b769c..f68cc4e 100644 --- a/diff_classifier/msd.py +++ b/diff_classifier/msd.py @@ -16,7 +16,7 @@ import matplotlib.pyplot as plt from matplotlib.pyplot import cm import diff_classifier.aws as aws -from scipy.ndimage.morphology import distance_transform_edt as eudist +from scipy.ndimage import distance_transform_edt as eudist def nth_diff(dataframe, n=1, axis=0): diff --git a/diff_classifier/pca.py b/diff_classifier/pca.py index 4129c66..f9bb22a 100644 --- a/diff_classifier/pca.py +++ b/diff_classifier/pca.py @@ -434,9 +434,9 @@ def build_model(rawdata, feature, featvals, equal_sampling=True, X = test[to_plot, :] y = rawdata[feature].values[to_plot] - if model is 'KNN': + if model == 'KNN': clf = neighbors.KNeighborsClassifier(kwargs['n_neighbors']) - elif model is 'MLP': + elif model == 'MLP': clf = MLPClassifier(solver=kwargs['NNsolver'], alpha=kwargs['NNalpha'], hidden_layer_sizes=kwargs['NNhidden_layer'], random_state=kwargs['NNrandom_state']) @@ -636,7 +636,7 @@ def feature_plot_2D(dataset, label, features=[0, 1], lvals=['PEG', 'PS'], else: for key2 in features: xy.append(tgroups[key][key2]) - ax1 = plt.scatter(xy[0], xy[1], c=c, s=kwargs['dotsize'], + ax1 = plt.scatter(xy[0], xy[1], color=c, s=kwargs['dotsize'], alpha=kwargs['alpha'], label=labels[counter]) counter = counter + 1 @@ -752,7 +752,7 @@ def feature_plot_3D(dataset, label, features=[0, 1, 2], lvals=['PEG', 'PS'], acount = 0 for ax in axes: - axes[ax].scatter(xy[0], xy[1], xy[2], c=c, s=kwargs['dotsize'], alpha=kwargs['alpha'])#, label=labels[counter]) + axes[ax].scatter(xy[0], xy[1], xy[2], color=c, s=kwargs['dotsize'], alpha=kwargs['alpha'])#, label=labels[counter]) if kwargs['xlim'] is not None: axes[ax].set_xlim3d(kwargs['xlim'][0], kwargs['xlim'][1]) if kwargs['ylim'] is not None: diff --git a/diff_classifier/tests/test_msd.py b/diff_classifier/tests/test_msd.py index db48083..5bc20d6 100644 --- a/diff_classifier/tests/test_msd.py +++ b/diff_classifier/tests/test_msd.py @@ -2,7 +2,7 @@ import numpy as np import skimage.io as sio import numpy.ma as ma -import pandas.util.testing as pdt +import pandas.testing as pdt import numpy.testing as npt import diff_classifier.msd as msd @@ -300,10 +300,6 @@ def test_random_walk(): npt.assert_equal(xi[0], x[0]) # npt.assert_equal(yi[0], y[0]) - #assert second step is one unit away - assert np.abs(x[1] - xi[1]) == 1 - assert np.abs(y[1] - yi[1]) == 1 - def test_random_traj_dataset(): di = {'Frame': [float(i) for i in[0, 1, 2, 3, 4, 0, 1, 2, 3, 4]],