sklearn.feature_selection.f_regression()

sklearn.feature_selection.f_regression(X, y, center=True) [source] Univariate linear regression tests. Quick linear model for testing the effect of a single regressor, sequentially for many regressors. This is done in 2 steps: The cross correlation between each regressor and the target is computed, that is, ((X[:, i] - mean(X[:, i])) * (y - mean_y)) / (std(X[:, i]) * std(y)). It is converted to an F score then to a p-value. Read more in the User Guide. Parameters: X : {array-like, sparse m

sklearn.feature_extraction.image.reconstruct_from_patches_2d()

sklearn.feature_extraction.image.reconstruct_from_patches_2d(patches, image_size) [source] Reconstruct the image from all of its patches. Patches are assumed to overlap and the image is constructed by filling in the patches from left to right, top to bottom, averaging the overlapping regions. Read more in the User Guide. Parameters: patches : array, shape = (n_patches, patch_height, patch_width) or (n_patches, patch_height, patch_width, n_channels) The complete set of patches. If the patc

sklearn.feature_selection.chi2()

sklearn.feature_selection.chi2(X, y) [source] Compute chi-squared stats between each non-negative feature and class. This score can be used to select the n_features features with the highest values for the test chi-squared statistic from X, which must contain only non-negative features such as booleans or frequencies (e.g., term counts in document classification), relative to the classes. Recall that the chi-square test measures dependence between stochastic variables, so using this functio

sklearn.feature_extraction.image.img_to_graph()

sklearn.feature_extraction.image.img_to_graph(img, mask=None, return_as=, dtype=None) [source] Graph of the pixel-to-pixel gradient connections Edges are weighted with the gradient values. Read more in the User Guide. Parameters: img : ndarray, 2D or 3D 2D or 3D image mask : ndarray of booleans, optional An optional mask of the image, to consider only part of the pixels. return_as : np.ndarray or a sparse matrix class, optional The class to use to build the returned adjacency matrix.

sklearn.feature_extraction.image.grid_to_graph()

sklearn.feature_extraction.image.grid_to_graph(n_x, n_y, n_z=1, mask=None, return_as=, dtype=) [source] Graph of the pixel-to-pixel connections Edges exist if 2 voxels are connected. Parameters: n_x : int Dimension in x axis n_y : int Dimension in y axis n_z : int, optional, default 1 Dimension in z axis mask : ndarray of booleans, optional An optional mask of the image, to consider only part of the pixels. return_as : np.ndarray or a sparse matrix class, optional The class to use

sklearn.ensemble.partial_dependence.plot_partial_dependence()

sklearn.ensemble.partial_dependence.plot_partial_dependence(gbrt, X, features, feature_names=None, label=None, n_cols=3, grid_resolution=100, percentiles=(0.05, 0.95), n_jobs=1, verbose=0, ax=None, line_kw=None, contour_kw=None, **fig_kw) [source] Partial dependence plots for features. The len(features) plots are arranged in a grid with n_cols columns. Two-way partial dependence plots are plotted as contour plots. Read more in the User Guide. Parameters: gbrt : BaseGradientBoosting A fitt

sklearn.ensemble.partial_dependence.partial_dependence()

sklearn.ensemble.partial_dependence.partial_dependence(gbrt, target_variables, grid=None, X=None, percentiles=(0.05, 0.95), grid_resolution=100) [source] Partial dependence of target_variables. Partial dependence plots show the dependence between the joint values of the target_variables and the function represented by the gbrt. Read more in the User Guide. Parameters: gbrt : BaseGradientBoosting A fitted gradient boosting model. target_variables : array-like, dtype=int The target featur

sklearn.feature_extraction.image.extract_patches_2d()

sklearn.feature_extraction.image.extract_patches_2d(image, patch_size, max_patches=None, random_state=None) [source] Reshape a 2D image into a collection of patches The resulting patches are allocated in a dedicated array. Read more in the User Guide. Parameters: image : array, shape = (image_height, image_width) or (image_height, image_width, n_channels) The original image data. For color images, the last dimension specifies the channel: a RGB image would have n_channels=3. patch_size :

sklearn.decomposition.dict_learning_online()

sklearn.decomposition.dict_learning_online(X, n_components=2, alpha=1, n_iter=100, return_code=True, dict_init=None, callback=None, batch_size=3, verbose=False, shuffle=True, n_jobs=1, method='lars', iter_offset=0, random_state=None, return_inner_stats=False, inner_stats=None, return_n_iter=False) [source] Solves a dictionary learning matrix factorization problem online. Finds the best dictionary and the corresponding sparse code for approximating the data matrix X by solving: (U^*, V^*) =

sklearn.decomposition.sparse_encode()

sklearn.decomposition.sparse_encode(X, dictionary, gram=None, cov=None, algorithm='lasso_lars', n_nonzero_coefs=None, alpha=None, copy_cov=True, init=None, max_iter=1000, n_jobs=1, check_input=True, verbose=0) [source] Sparse coding Each row of the result is the solution to a sparse coding problem. The goal is to find a sparse array code such that: X ~= code * dictionary Read more in the User Guide. Parameters: X: array of shape (n_samples, n_features) : Data matrix dictionary: array of