forest-confidence-interval icon indicating copy to clipboard operation
forest-confidence-interval copied to clipboard

ValueError on multiple output problems

Open IguanasInPyjamas opened this issue 4 years ago • 1 comments

Training set is of the form (n_training_samples, n_features) = (14175.34) Testing set is of the form (n_testing_samples, n_features) = (4725,34) Running - forestci.random_forest_error(randomFor, X_train, X_test) Yields the following error;

ValueError Traceback (most recent call last) in 21 print(X_test.shape) 22 mpg_V_IJ_unbiased = forestci.random_forest_error(randomFor, X_train, ---> 23 X_test) 24 hat = randomFor.predict(X_test) 25 print(' The score for is {}'.format(score[-13::]))

~\Anaconda3\lib\site-packages\forestci\forestci.py in random_forest_error(forest, X_train, X_test, inbag, calibrate, memory_constrained, memory_limit) 241 n_trees = forest.n_estimators 242 V_IJ = _core_computation(X_train, X_test, inbag, pred_centered, n_trees, --> 243 memory_constrained, memory_limit) 244 V_IJ_unbiased = _bias_correction(V_IJ, inbag, pred_centered, n_trees) 245

~\Anaconda3\lib\site-packages\forestci\forestci.py in _core_computation(X_train, X_test, inbag, pred_centered, n_trees, memory_constrained, memory_limit, test_mode) 110 """ 111 if not memory_constrained: --> 112 return np.sum((np.dot(inbag - 1, pred_centered.T) / n_trees) ** 2, 0) 113 114 if not memory_limit:

<array_function internals> in dot(*args, **kwargs)

ValueError: shapes (14175,700) and (700,4725,2) not aligned: 700 (dim 1) != 4725 (dim 1)

IguanasInPyjamas avatar May 21 '21 12:05 IguanasInPyjamas

Fixed in https://github.com/scikit-learn-contrib/forest-confidence-interval/commit/ffa722702ed51f13b464fe8228cf72f456dd3db5

@arokem there are many redoundant issues mentioning the problem I solved: I guess you can close them pointing to this last commint

danieleongari avatar Sep 13 '22 08:09 danieleongari