Code Duplication    Length = 12-13 lines in 2 locations

diff_classifier/tests/test_pca.py 2 locations

@@ 174-186 (lines=13) @@
171
    # assert len(xy[1]) == 250
172
173
174
def test_feature_plot_3D():
175
176
    np.random.seed(seed=1)
177
    dataset = {'label': 250*['yes'] + 250*['no'],
178
               0: np.random.normal(0.5, 1, size=500),
179
               1: np.random.normal(1, 2, size=500),
180
               2: np.random.normal(3, 10, size=500)
181
               }
182
    df = pd.DataFrame(data=dataset)
183
184
    xy = pca.feature_plot_3D(df, label='label', features=[0, 1, 2],
185
                             lvals=['yes', 'no'], randsel=True,
186
                             fname='test1.png')
187
    # assert len(xy[1]) == 200
188
    # assert os.path.isfile('test1.png')
189
    #
@@ 155-166 (lines=12) @@
152
    assert np.round(np.mean(to_violin['Feature Value']), 1) == 2.1
153
154
155
def test_feature_plot_2D():
156
157
    np.random.seed(seed=1)
158
    dataset = {'label': 250*['yes'] + 250*['no'],
159
               0: np.random.normal(0.5, 1, size=500),
160
               1: np.random.normal(1, 2, size=500),
161
               2: np.random.normal(3, 10, size=500)
162
               }
163
    df = pd.DataFrame(data=dataset)
164
165
    xy = pca.feature_plot_2D(df, label='label', features=[0, 1], randsel=True,
166
                             lvals=['yes', 'no'], fname='test1.png')
167
    # assert len(xy[1]) == 200
168
    # assert os.path.isfile('test1.png')
169
    #