Beispiel #1
0
    def test_establish_reducer_use_existing(self):
        from cupcake.smush.base import SmushPlotterBase

        pca_kws = {}
        n_components = 2
        reducer = PCA(n_components=n_components, **pca_kws)

        p = SmushPlotterBase()
        p.establish_reducer(reducer)

        assert isinstance(p.reducer, type(reducer))
        pdt.assert_dict_equal(p.reducer.get_params(), reducer.get_params())
Beispiel #2
0
    def test_establish_reducer_use_existing(self):
        from cupcake.smush.base import SmushPlotterBase

        pca_kws = {}
        n_components = 2
        reducer = PCA(n_components=n_components, **pca_kws)

        p = SmushPlotterBase()
        p.establish_reducer(reducer)

        assert isinstance(p.reducer, type(reducer))
        pdt.assert_dict_equal(p.reducer.get_params(), reducer.get_params())