Esempio n. 1
0
    def test_bootstrap_ranges(self):
        np.random.seed(42)
        X = np.random.normal(size=(50, 3))
        f = np.random.normal(size=(50, 1))
        df = np.random.normal(size=(50, 3))
        weights = np.ones((50, 1)) / 50

        e, W = ss.active_subspace(df, weights)
        ssmethod = lambda X, f, df, weights: ss.active_subspace(df, weights)
        d = ss._bootstrap_ranges(e,
                                 W,
                                 None,
                                 None,
                                 df,
                                 weights,
                                 ssmethod,
                                 nboot=10)

        e, W = ss.ols_subspace(X, f, weights)
        ssmethod = lambda X, f, df, weights: ss.ols_subspace(X, f, weights)
        d = ss._bootstrap_ranges(e, W, X, f, None, weights, ssmethod, nboot=10)

        e, W = ss.qphd_subspace(X, f, weights)
        ssmethod = lambda X, f, df, weights: ss.qphd_subspace(X, f, weights)
        d = ss._bootstrap_ranges(e, W, X, f, None, weights, ssmethod, nboot=10)

        e, W = ss.opg_subspace(X, f, weights)
        ssmethod = lambda X, f, df, weights: ss.opg_subspace(X, f, weights)
        d = ss._bootstrap_ranges(e, W, X, f, None, weights, ssmethod, nboot=10)
 def test_ladle_partition(self):
     np.random.seed(42)
     df = np.random.normal(size=(10,3))
     weights = np.ones((10,1)) / 10
     e, W = ss.active_subspace(df, weights)
     ssmethod = lambda X, f, df, weights: ss.active_subspace(df, weights)
     e_br, sub_br, li_F = ss._bootstrap_ranges(e, W, None, None, df, weights, ssmethod, nboot=10)
     d = ss.ladle_partition(e, li_F)
Esempio n. 3
0
 def test_ladle_partition(self):
     np.random.seed(42)
     df = np.random.normal(size=(10,3))
     weights = np.ones((10,1)) / 10
     e, W = ss.active_subspace(df, weights)
     ssmethod = lambda X, f, df, weights: ss.active_subspace(df, weights)
     e_br, sub_br, li_F = ss._bootstrap_ranges(e, W, None, None, df, weights, ssmethod, nboot=10)
     d = ss.ladle_partition(e, li_F)
 def test_errbnd_partition(self):
     np.random.seed(42)
     df = np.random.normal(size=(10,3))
     weights = np.ones((10,1)) / 10
     e, W = ss.active_subspace(df, weights)
     ssmethod = lambda X, f, df, weights: ss.active_subspace(df, weights)
     e_br, sub_br, li_F = ss._bootstrap_ranges(e, W, None, None, df, weights, ssmethod, nboot=10)
     sub_err = sub_br[:,1].reshape((2, 1))
     d = ss.errbnd_partition(e, sub_err)
Esempio n. 5
0
 def test_errbnd_partition(self):
     np.random.seed(42)
     df = np.random.normal(size=(10,3))
     weights = np.ones((10,1)) / 10
     e, W = ss.active_subspace(df, weights)
     ssmethod = lambda X, f, df, weights: ss.active_subspace(df, weights)
     e_br, sub_br, li_F = ss._bootstrap_ranges(e, W, None, None, df, weights, ssmethod, nboot=10)
     sub_err = sub_br[:,1].reshape((2, 1))
     d = ss.errbnd_partition(e, sub_err)
 def test_bootstrap_ranges(self):
     np.random.seed(42)
     X = np.random.normal(size=(50,3))
     f = np.random.normal(size=(50,1))
     df = np.random.normal(size=(50,3))
     weights = np.ones((50,1)) / 50
     
     e, W = ss.active_subspace(df, weights)
     ssmethod = lambda X, f, df, weights: ss.active_subspace(df, weights)
     d = ss._bootstrap_ranges(e, W, None, None, df, weights, ssmethod, nboot=10)
     
     e, W = ss.ols_subspace(X, f, weights)
     ssmethod = lambda X, f, df, weights: ss.ols_subspace(X, f, weights)
     d = ss._bootstrap_ranges(e, W, X, f, None, weights, ssmethod, nboot=10)
     
     e, W = ss.qphd_subspace(X, f, weights)
     ssmethod = lambda X, f, df, weights: ss.qphd_subspace(X, f, weights)
     d = ss._bootstrap_ranges(e, W, X, f, None, weights, ssmethod, nboot=10)
     
     e, W = ss.opg_subspace(X, f, weights)
     ssmethod = lambda X, f, df, weights: ss.opg_subspace(X, f, weights)
     d = ss._bootstrap_ranges(e, W, X, f, None, weights, ssmethod, nboot=10)