proxies = {
        'http': args.http_proxy,
        'https': args.https_proxy
    }
    print(proxies)
    # binary classification: Beta prior
    prior = (1, 1)

    # Bayesian decision tree parameters
    partition_prior = 0.9
    delta = 0

    root = BinaryClassificationNode(partition_prior, prior)

    # training/test data
    train, test = load_ripley(proxies)

    # train
    X_train = train[:, :-1]
    y_train = train[:, -1]
    X_test = test[:, :-1]
    y_test = test[:, -1]
    root.fit(X_train, y_train, delta)
    print(root)
    print()
    print('Tree depth and number of leaves:', root.depth_and_leaves())

    # compute accuracy
    prediction_train = root.predict(X_train)
    prediction_test = root.predict(X_test)
    accuracy_train = (prediction_train == y_train).mean()
    # y_train = np.zeros((n, 1))
    # y_train[(X_train[:, 0] >= 1) & (X_train[:, 0] < 2) & (X_train[:, 1] <= 3)] = 1
    # y_train[(X_train[:, 0] >= 2) & (X_train[:, 0] < 3) & (X_train[:, 1] <= 1)] = 1
    # y_train[(X_train[:, 0] >= 3)] = 1
    #
    # angle = 30*np.pi/180
    # X_train_rot = X_train.copy()
    # X_train_rot[:, 0] = np.cos(angle)*X_train[:, 0] + np.sin(angle)*X_train[:, 1]
    # X_train_rot[:, 1] = -np.sin(angle)*X_train[:, 0] + np.cos(angle)*X_train[:, 1]
    # X_train = X_train_rot
    #
    # train = np.hstack((X_train, y_train))
    # test = train

    # or, alternatively, load a UCI dataset
    train, test = helper.load_ripley(proxies)

    n_dim = len(np.unique(train[:, -1]))

    if train is test:
        # perform a 50:50 train:test split if no test data is given
        train = train[0::2]
        test = test[1::2]

    X_train = train[:, :-1]
    y_train = train[:, -1]
    X_test = test[:, :-1]
    y_test = test[:, -1]

    # prior
    prior_pseudo_observations = 1