This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for n in range(N): | |
| for i, j in np.ndindex(H_out, W_out): | |
| blob = x[n, :, i*stride:i*stride+HH, j*stride:j*stride+WW] | |
| out[n, :, i, j] = np.sum(w*blob, axis=(1,2,3)) + b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for n in range(N): | |
| for i, j in np.ndindex(H_out, W_out): | |
| blob = x[n, :, i*stride:i*stride+HH, j*stride:j*stride+WW] | |
| out[n, :, i, j] = np.sum(w*blob, axis=(1,2,3)) + b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Feature Importance | |
| from sklearn import datasets | |
| from sklearn import metrics | |
| from sklearn.ensemble import ExtraTreesClassifier | |
| # load the iris datasets | |
| dataset = datasets.load_iris() | |
| # fit an Extra Trees model to the data | |
| model = ExtraTreesClassifier() | |
| model.fit(dataset.data, dataset.target) | |
| # display the relative importance of each attribute |