partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
class_prediction_error
Quick method: Divides the dataset X and y into train and test splits, fits the model on the train split, then scores the model on the test split. The visualizer displays the support for each class in the fitted classification model displayed as a stacked bar plot Each bar is segmented to show the di...
yellowbrick/classifier/class_prediction_error.py
def class_prediction_error( model, X, y=None, ax=None, classes=None, test_size=0.2, random_state=None, **kwargs): """Quick method: Divides the dataset X and y into train and test splits, fits the model on the train split, then scores the model on the test split. The visualize...
def class_prediction_error( model, X, y=None, ax=None, classes=None, test_size=0.2, random_state=None, **kwargs): """Quick method: Divides the dataset X and y into train and test splits, fits the model on the train split, then scores the model on the test split. The visualize...
[ "Quick", "method", ":", "Divides", "the", "dataset", "X", "and", "y", "into", "train", "and", "test", "splits", "fits", "the", "model", "on", "the", "train", "split", "then", "scores", "the", "model", "on", "the", "test", "split", ".", "The", "visualizer...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/class_prediction_error.py#L179-L238
[ "def", "class_prediction_error", "(", "model", ",", "X", ",", "y", "=", "None", ",", "ax", "=", "None", ",", "classes", "=", "None", ",", "test_size", "=", "0.2", ",", "random_state", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Instantiate the v...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
ClassPredictionError.score
Generates a 2D array where each row is the count of the predicted classes and each column is the true class Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with m features y : ndarray or Series of length n An array o...
yellowbrick/classifier/class_prediction_error.py
def score(self, X, y, **kwargs): """ Generates a 2D array where each row is the count of the predicted classes and each column is the true class Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with m features y :...
def score(self, X, y, **kwargs): """ Generates a 2D array where each row is the count of the predicted classes and each column is the true class Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with m features y :...
[ "Generates", "a", "2D", "array", "where", "each", "row", "is", "the", "count", "of", "the", "predicted", "classes", "and", "each", "column", "is", "the", "true", "class" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/class_prediction_error.py#L75-L126
[ "def", "score", "(", "self", ",", "X", ",", "y", ",", "*", "*", "kwargs", ")", ":", "# We're relying on predict to raise NotFitted", "y_pred", "=", "self", ".", "predict", "(", "X", ")", "y_type", ",", "y_true", ",", "y_pred", "=", "_check_targets", "(", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
ClassPredictionError.draw
Renders the class prediction error across the axis.
yellowbrick/classifier/class_prediction_error.py
def draw(self): """ Renders the class prediction error across the axis. """ indices = np.arange(len(self.classes_)) prev = np.zeros(len(self.classes_)) colors = resolve_colors( colors=self.colors, n_colors=len(self.classes_)) for idx, ro...
def draw(self): """ Renders the class prediction error across the axis. """ indices = np.arange(len(self.classes_)) prev = np.zeros(len(self.classes_)) colors = resolve_colors( colors=self.colors, n_colors=len(self.classes_)) for idx, ro...
[ "Renders", "the", "class", "prediction", "error", "across", "the", "axis", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/class_prediction_error.py#L128-L145
[ "def", "draw", "(", "self", ")", ":", "indices", "=", "np", ".", "arange", "(", "len", "(", "self", ".", "classes_", ")", ")", "prev", "=", "np", ".", "zeros", "(", "len", "(", "self", ".", "classes_", ")", ")", "colors", "=", "resolve_colors", "...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
ClassPredictionError.finalize
Finalize executes any subclass-specific axes finalization steps. The user calls poof and poof calls finalize.
yellowbrick/classifier/class_prediction_error.py
def finalize(self, **kwargs): """ Finalize executes any subclass-specific axes finalization steps. The user calls poof and poof calls finalize. """ indices = np.arange(len(self.classes_)) # Set the title self.set_title("Class Prediction Error for {}".format(self...
def finalize(self, **kwargs): """ Finalize executes any subclass-specific axes finalization steps. The user calls poof and poof calls finalize. """ indices = np.arange(len(self.classes_)) # Set the title self.set_title("Class Prediction Error for {}".format(self...
[ "Finalize", "executes", "any", "subclass", "-", "specific", "axes", "finalization", "steps", ".", "The", "user", "calls", "poof", "and", "poof", "calls", "finalize", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/class_prediction_error.py#L147-L172
[ "def", "finalize", "(", "self", ",", "*", "*", "kwargs", ")", ":", "indices", "=", "np", ".", "arange", "(", "len", "(", "self", ".", "classes_", ")", ")", "# Set the title", "self", ".", "set_title", "(", "\"Class Prediction Error for {}\"", ".", "format"...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
missing_bar
The MissingValues Bar visualizer creates a bar graph that lists the total count of missing values for each selected feature column. When y targets are supplied to fit, the output is a stacked bar chart where each color corresponds to the total NaNs for the feature in that column. Parameters ------...
yellowbrick/contrib/missing/bar.py
def missing_bar(X, y=None, ax=None, classes=None, width=0.5, color='black', **kwargs): """The MissingValues Bar visualizer creates a bar graph that lists the total count of missing values for each selected feature column. When y targets are supplied to fit, the output is a stacked bar chart where each ...
def missing_bar(X, y=None, ax=None, classes=None, width=0.5, color='black', **kwargs): """The MissingValues Bar visualizer creates a bar graph that lists the total count of missing values for each selected feature column. When y targets are supplied to fit, the output is a stacked bar chart where each ...
[ "The", "MissingValues", "Bar", "visualizer", "creates", "a", "bar", "graph", "that", "lists", "the", "total", "count", "of", "missing", "values", "for", "each", "selected", "feature", "column", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/bar.py#L191-L247
[ "def", "missing_bar", "(", "X", ",", "y", "=", "None", ",", "ax", "=", "None", ",", "classes", "=", "None", ",", "width", "=", "0.5", ",", "color", "=", "'black'", ",", "*", "*", "kwargs", ")", ":", "# Instantiate the visualizer", "visualizer", "=", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
MissingValuesBar.draw
Called from the fit method, this method generated a horizontal bar plot. If y is none, then draws a simple horizontal bar chart. If y is not none, then draws a stacked horizontal bar chart for each nan count per target values.
yellowbrick/contrib/missing/bar.py
def draw(self, X, y, **kwargs): """Called from the fit method, this method generated a horizontal bar plot. If y is none, then draws a simple horizontal bar chart. If y is not none, then draws a stacked horizontal bar chart for each nan count per target values. """ nan_c...
def draw(self, X, y, **kwargs): """Called from the fit method, this method generated a horizontal bar plot. If y is none, then draws a simple horizontal bar chart. If y is not none, then draws a stacked horizontal bar chart for each nan count per target values. """ nan_c...
[ "Called", "from", "the", "fit", "method", "this", "method", "generated", "a", "horizontal", "bar", "plot", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/bar.py#L124-L140
[ "def", "draw", "(", "self", ",", "X", ",", "y", ",", "*", "*", "kwargs", ")", ":", "nan_col_counts", "=", "self", ".", "get_nan_col_counts", "(", ")", "# the x locations for the groups", "self", ".", "ind", "=", "np", ".", "arange", "(", "len", "(", "s...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
MissingValuesBar.draw_stacked_bar
Draws a horizontal stacked bar chart with different colors for each count of nan values per label.
yellowbrick/contrib/missing/bar.py
def draw_stacked_bar(self, nan_col_counts): """Draws a horizontal stacked bar chart with different colors for each count of nan values per label. """ for index, nan_values in enumerate(nan_col_counts): label, nan_col_counts = nan_values if index == 0: ...
def draw_stacked_bar(self, nan_col_counts): """Draws a horizontal stacked bar chart with different colors for each count of nan values per label. """ for index, nan_values in enumerate(nan_col_counts): label, nan_col_counts = nan_values if index == 0: ...
[ "Draws", "a", "horizontal", "stacked", "bar", "chart", "with", "different", "colors", "for", "each", "count", "of", "nan", "values", "per", "label", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/bar.py#L142-L163
[ "def", "draw_stacked_bar", "(", "self", ",", "nan_col_counts", ")", ":", "for", "index", ",", "nan_values", "in", "enumerate", "(", "nan_col_counts", ")", ":", "label", ",", "nan_col_counts", "=", "nan_values", "if", "index", "==", "0", ":", "# first draw shou...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
MissingValuesBar.finalize
Finalize executes any subclass-specific axes finalization steps. The user calls poof and poof calls finalize. Parameters ---------- kwargs: generic keyword arguments.
yellowbrick/contrib/missing/bar.py
def finalize(self, **kwargs): """ Finalize executes any subclass-specific axes finalization steps. The user calls poof and poof calls finalize. Parameters ---------- kwargs: generic keyword arguments. """ # Set the title self.set_title( ...
def finalize(self, **kwargs): """ Finalize executes any subclass-specific axes finalization steps. The user calls poof and poof calls finalize. Parameters ---------- kwargs: generic keyword arguments. """ # Set the title self.set_title( ...
[ "Finalize", "executes", "any", "subclass", "-", "specific", "axes", "finalization", "steps", ".", "The", "user", "calls", "poof", "and", "poof", "calls", "finalize", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/bar.py#L165-L185
[ "def", "finalize", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# Set the title", "self", ".", "set_title", "(", "'Count of Missing Values by Column'", ")", "tick_locations", "=", "np", ".", "arange", "(", "len", "(", "self", ".", "features_", ")", ")", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
feature_correlation
Displays the correlation between features and dependent variables. This visualizer can be used side-by-side with yellowbrick.features.JointPlotVisualizer that plots a feature against the target and shows the distribution of each via a histogram on each axis. Parameters ---------- X : ndarr...
yellowbrick/target/feature_correlation.py
def feature_correlation(X, y, ax=None, method='pearson', labels=None, sort=False, feature_index=None, feature_names=None, **kwargs): """ Displays the correlation between features and dependent variables. This visualizer can be used side-by-side with yello...
def feature_correlation(X, y, ax=None, method='pearson', labels=None, sort=False, feature_index=None, feature_names=None, **kwargs): """ Displays the correlation between features and dependent variables. This visualizer can be used side-by-side with yello...
[ "Displays", "the", "correlation", "between", "features", "and", "dependent", "variables", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L257-L326
[ "def", "feature_correlation", "(", "X", ",", "y", ",", "ax", "=", "None", ",", "method", "=", "'pearson'", ",", "labels", "=", "None", ",", "sort", "=", "False", ",", "feature_index", "=", "None", ",", "feature_names", "=", "None", ",", "*", "*", "kw...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
FeatureCorrelation.fit
Fits the estimator to calculate feature correlation to dependent variable. Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with m features y : ndarray or Series of length n An array or series of target or class value...
yellowbrick/target/feature_correlation.py
def fit(self, X, y, **kwargs): """ Fits the estimator to calculate feature correlation to dependent variable. Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with m features y : ndarray or Series of length n ...
def fit(self, X, y, **kwargs): """ Fits the estimator to calculate feature correlation to dependent variable. Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with m features y : ndarray or Series of length n ...
[ "Fits", "the", "estimator", "to", "calculate", "feature", "correlation", "to", "dependent", "variable", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L132-L179
[ "def", "fit", "(", "self", ",", "X", ",", "y", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_create_labels_for_features", "(", "X", ")", "self", ".", "_select_features_to_plot", "(", "X", ")", "# Calculate Features correlation with target variable", "if", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
FeatureCorrelation.draw
Draws the feature correlation to dependent variable, called from fit.
yellowbrick/target/feature_correlation.py
def draw(self): """ Draws the feature correlation to dependent variable, called from fit. """ pos = np.arange(self.scores_.shape[0]) + 0.5 self.ax.barh(pos, self.scores_) # Set the labels for the bars self.ax.set_yticks(pos) self.ax.set_yticklabels(self....
def draw(self): """ Draws the feature correlation to dependent variable, called from fit. """ pos = np.arange(self.scores_.shape[0]) + 0.5 self.ax.barh(pos, self.scores_) # Set the labels for the bars self.ax.set_yticks(pos) self.ax.set_yticklabels(self....
[ "Draws", "the", "feature", "correlation", "to", "dependent", "variable", "called", "from", "fit", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L181-L193
[ "def", "draw", "(", "self", ")", ":", "pos", "=", "np", ".", "arange", "(", "self", ".", "scores_", ".", "shape", "[", "0", "]", ")", "+", "0.5", "self", ".", "ax", ".", "barh", "(", "pos", ",", "self", ".", "scores_", ")", "# Set the labels for ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
FeatureCorrelation.finalize
Finalize the drawing setting labels and title.
yellowbrick/target/feature_correlation.py
def finalize(self): """ Finalize the drawing setting labels and title. """ self.set_title('Features correlation with dependent variable') self.ax.set_xlabel(self.correlation_labels[self.method]) self.ax.grid(False, axis='y')
def finalize(self): """ Finalize the drawing setting labels and title. """ self.set_title('Features correlation with dependent variable') self.ax.set_xlabel(self.correlation_labels[self.method]) self.ax.grid(False, axis='y')
[ "Finalize", "the", "drawing", "setting", "labels", "and", "title", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L195-L203
[ "def", "finalize", "(", "self", ")", ":", "self", ".", "set_title", "(", "'Features correlation with dependent variable'", ")", "self", ".", "ax", ".", "set_xlabel", "(", "self", ".", "correlation_labels", "[", "self", ".", "method", "]", ")", "self", ".", "...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
FeatureCorrelation._create_labels_for_features
Create labels for the features NOTE: this code is duplicated from MultiFeatureVisualizer
yellowbrick/target/feature_correlation.py
def _create_labels_for_features(self, X): """ Create labels for the features NOTE: this code is duplicated from MultiFeatureVisualizer """ if self.labels is None: # Use column names if a dataframe if is_dataframe(X): self.features_ = np.ar...
def _create_labels_for_features(self, X): """ Create labels for the features NOTE: this code is duplicated from MultiFeatureVisualizer """ if self.labels is None: # Use column names if a dataframe if is_dataframe(X): self.features_ = np.ar...
[ "Create", "labels", "for", "the", "features" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L205-L220
[ "def", "_create_labels_for_features", "(", "self", ",", "X", ")", ":", "if", "self", ".", "labels", "is", "None", ":", "# Use column names if a dataframe", "if", "is_dataframe", "(", "X", ")", ":", "self", ".", "features_", "=", "np", ".", "array", "(", "X...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
FeatureCorrelation._select_features_to_plot
Select features to plot. feature_index is always used as the filter and if filter_names is supplied, a new feature_index is computed from those names.
yellowbrick/target/feature_correlation.py
def _select_features_to_plot(self, X): """ Select features to plot. feature_index is always used as the filter and if filter_names is supplied, a new feature_index is computed from those names. """ if self.feature_index: if self.feature_names: ...
def _select_features_to_plot(self, X): """ Select features to plot. feature_index is always used as the filter and if filter_names is supplied, a new feature_index is computed from those names. """ if self.feature_index: if self.feature_names: ...
[ "Select", "features", "to", "plot", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L222-L250
[ "def", "_select_features_to_plot", "(", "self", ",", "X", ")", ":", "if", "self", ".", "feature_index", ":", "if", "self", ".", "feature_names", ":", "raise", "YellowbrickWarning", "(", "'Both feature_index and feature_names '", "'are specified. feature_names is ignored'"...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
feature_analysis
Create figures for feature analysis
paper/figures/figures.py
def feature_analysis(fname="feature_analysis.png"): """ Create figures for feature analysis """ # Create side-by-side axes grid _, axes = plt.subplots(ncols=2, figsize=(18,6)) # Draw RadViz on the left data = load_occupancy(split=False) oz = RadViz(ax=axes[0], classes=["unoccupied", "o...
def feature_analysis(fname="feature_analysis.png"): """ Create figures for feature analysis """ # Create side-by-side axes grid _, axes = plt.subplots(ncols=2, figsize=(18,6)) # Draw RadViz on the left data = load_occupancy(split=False) oz = RadViz(ax=axes[0], classes=["unoccupied", "o...
[ "Create", "figures", "for", "feature", "analysis" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/paper/figures/figures.py#L78-L101
[ "def", "feature_analysis", "(", "fname", "=", "\"feature_analysis.png\"", ")", ":", "# Create side-by-side axes grid", "_", ",", "axes", "=", "plt", ".", "subplots", "(", "ncols", "=", "2", ",", "figsize", "=", "(", "18", ",", "6", ")", ")", "# Draw RadViz o...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
regression
Create figures for regression models
paper/figures/figures.py
def regression(fname="regression.png"): """ Create figures for regression models """ _, axes = plt.subplots(ncols=2, figsize=(18, 6)) alphas = np.logspace(-10, 1, 300) data = load_concrete(split=True) # Plot prediction error in the middle oz = PredictionError(LassoCV(alphas=alphas), ax=...
def regression(fname="regression.png"): """ Create figures for regression models """ _, axes = plt.subplots(ncols=2, figsize=(18, 6)) alphas = np.logspace(-10, 1, 300) data = load_concrete(split=True) # Plot prediction error in the middle oz = PredictionError(LassoCV(alphas=alphas), ax=...
[ "Create", "figures", "for", "regression", "models" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/paper/figures/figures.py#L104-L127
[ "def", "regression", "(", "fname", "=", "\"regression.png\"", ")", ":", "_", ",", "axes", "=", "plt", ".", "subplots", "(", "ncols", "=", "2", ",", "figsize", "=", "(", "18", ",", "6", ")", ")", "alphas", "=", "np", ".", "logspace", "(", "-", "10...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
Visualizer.ax
The matplotlib axes that the visualizer draws upon (can also be a grid of multiple axes objects). The visualizer automatically creates an axes for the user if one has not been specified.
yellowbrick/base.py
def ax(self): """ The matplotlib axes that the visualizer draws upon (can also be a grid of multiple axes objects). The visualizer automatically creates an axes for the user if one has not been specified. """ if not hasattr(self, "_ax") or self._ax is None: se...
def ax(self): """ The matplotlib axes that the visualizer draws upon (can also be a grid of multiple axes objects). The visualizer automatically creates an axes for the user if one has not been specified. """ if not hasattr(self, "_ax") or self._ax is None: se...
[ "The", "matplotlib", "axes", "that", "the", "visualizer", "draws", "upon", "(", "can", "also", "be", "a", "grid", "of", "multiple", "axes", "objects", ")", ".", "The", "visualizer", "automatically", "creates", "an", "axes", "for", "the", "user", "if", "one...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L81-L89
[ "def", "ax", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "\"_ax\"", ")", "or", "self", ".", "_ax", "is", "None", ":", "self", ".", "_ax", "=", "plt", ".", "gca", "(", ")", "return", "self", ".", "_ax" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
Visualizer.size
Returns the actual size in pixels as set by matplotlib, or the user provided size if available.
yellowbrick/base.py
def size(self): """ Returns the actual size in pixels as set by matplotlib, or the user provided size if available. """ if not hasattr(self, "_size") or self._size is None: fig = plt.gcf() self._size = fig.get_size_inches()*fig.dpi return self._siz...
def size(self): """ Returns the actual size in pixels as set by matplotlib, or the user provided size if available. """ if not hasattr(self, "_size") or self._size is None: fig = plt.gcf() self._size = fig.get_size_inches()*fig.dpi return self._siz...
[ "Returns", "the", "actual", "size", "in", "pixels", "as", "set", "by", "matplotlib", "or", "the", "user", "provided", "size", "if", "available", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L96-L104
[ "def", "size", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "\"_size\"", ")", "or", "self", ".", "_size", "is", "None", ":", "fig", "=", "plt", ".", "gcf", "(", ")", "self", ".", "_size", "=", "fig", ".", "get_size_inches", "(...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
Visualizer.poof
Poof makes the magic happen and a visualizer appear! You can pass in a path to save the figure to disk with various backends, or you can call it with no arguments to show the figure either in a notebook or in a GUI window that pops up on screen. Parameters ---------- out...
yellowbrick/base.py
def poof(self, outpath=None, clear_figure=False, **kwargs): """ Poof makes the magic happen and a visualizer appear! You can pass in a path to save the figure to disk with various backends, or you can call it with no arguments to show the figure either in a notebook or in a GUI w...
def poof(self, outpath=None, clear_figure=False, **kwargs): """ Poof makes the magic happen and a visualizer appear! You can pass in a path to save the figure to disk with various backends, or you can call it with no arguments to show the figure either in a notebook or in a GUI w...
[ "Poof", "makes", "the", "magic", "happen", "and", "a", "visualizer", "appear!", "You", "can", "pass", "in", "a", "path", "to", "save", "the", "figure", "to", "disk", "with", "various", "backends", "or", "you", "can", "call", "it", "with", "no", "argument...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L187-L230
[ "def", "poof", "(", "self", ",", "outpath", "=", "None", ",", "clear_figure", "=", "False", ",", "*", "*", "kwargs", ")", ":", "# Ensure that draw has been called", "if", "self", ".", "_ax", "is", "None", ":", "warn_message", "=", "(", "\"{} does not have a ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
Visualizer.set_title
Sets the title on the current axes. Parameters ---------- title: string, default: None Add title to figure or if None leave untitled.
yellowbrick/base.py
def set_title(self, title=None): """ Sets the title on the current axes. Parameters ---------- title: string, default: None Add title to figure or if None leave untitled. """ title = self.title or title if title is not None: self.a...
def set_title(self, title=None): """ Sets the title on the current axes. Parameters ---------- title: string, default: None Add title to figure or if None leave untitled. """ title = self.title or title if title is not None: self.a...
[ "Sets", "the", "title", "on", "the", "current", "axes", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L236-L247
[ "def", "set_title", "(", "self", ",", "title", "=", "None", ")", ":", "title", "=", "self", ".", "title", "or", "title", "if", "title", "is", "not", "None", ":", "self", ".", "ax", ".", "set_title", "(", "title", ")" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
MultiModelMixin.generate_subplots
Generates the subplots for the number of given models.
yellowbrick/base.py
def generate_subplots(self): """ Generates the subplots for the number of given models. """ _, axes = plt.subplots(len(self.models), sharex=True, sharey=True) return axes
def generate_subplots(self): """ Generates the subplots for the number of given models. """ _, axes = plt.subplots(len(self.models), sharex=True, sharey=True) return axes
[ "Generates", "the", "subplots", "for", "the", "number", "of", "given", "models", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L407-L412
[ "def", "generate_subplots", "(", "self", ")", ":", "_", ",", "axes", "=", "plt", ".", "subplots", "(", "len", "(", "self", ".", "models", ")", ",", "sharex", "=", "True", ",", "sharey", "=", "True", ")", "return", "axes" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
MultiModelMixin.predict
Returns a generator containing the predictions for each of the internal models (using cross_val_predict and a CV=12). Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with m features y : ndarray or Series of length n ...
yellowbrick/base.py
def predict(self, X, y): """ Returns a generator containing the predictions for each of the internal models (using cross_val_predict and a CV=12). Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with m features ...
def predict(self, X, y): """ Returns a generator containing the predictions for each of the internal models (using cross_val_predict and a CV=12). Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with m features ...
[ "Returns", "a", "generator", "containing", "the", "predictions", "for", "each", "of", "the", "internal", "models", "(", "using", "cross_val_predict", "and", "a", "CV", "=", "12", ")", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L414-L433
[ "def", "predict", "(", "self", ",", "X", ",", "y", ")", ":", "for", "model", "in", "self", ".", "models", ":", "yield", "cvp", "(", "model", ",", "X", ",", "y", ",", "cv", "=", "12", ")" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
load_corpus
Loads and wrangles the passed in text corpus by path.
docs/api/text/corpus.py
def load_corpus(path): """ Loads and wrangles the passed in text corpus by path. """ # Check if the data exists, otherwise download or raise if not os.path.exists(path): raise ValueError(( "'{}' dataset has not been downloaded, " "use the yellowbrick.download module ...
def load_corpus(path): """ Loads and wrangles the passed in text corpus by path. """ # Check if the data exists, otherwise download or raise if not os.path.exists(path): raise ValueError(( "'{}' dataset has not been downloaded, " "use the yellowbrick.download module ...
[ "Loads", "and", "wrangles", "the", "passed", "in", "text", "corpus", "by", "path", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/docs/api/text/corpus.py#L6-L44
[ "def", "load_corpus", "(", "path", ")", ":", "# Check if the data exists, otherwise download or raise", "if", "not", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "raise", "ValueError", "(", "(", "\"'{}' dataset has not been downloaded, \"", "\"use the yellow...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
get_data_home
Return the path of the Yellowbrick data directory. This folder is used by dataset loaders to avoid downloading data several times. By default, this folder is colocated with the code in the install directory so that data shipped with the package can be easily located. Alternatively it can be set by the ...
yellowbrick/datasets/path.py
def get_data_home(path=None): """ Return the path of the Yellowbrick data directory. This folder is used by dataset loaders to avoid downloading data several times. By default, this folder is colocated with the code in the install directory so that data shipped with the package can be easily locate...
def get_data_home(path=None): """ Return the path of the Yellowbrick data directory. This folder is used by dataset loaders to avoid downloading data several times. By default, this folder is colocated with the code in the install directory so that data shipped with the package can be easily locate...
[ "Return", "the", "path", "of", "the", "Yellowbrick", "data", "directory", ".", "This", "folder", "is", "used", "by", "dataset", "loaders", "to", "avoid", "downloading", "data", "several", "times", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/path.py#L35-L56
[ "def", "get_data_home", "(", "path", "=", "None", ")", ":", "if", "path", "is", "None", ":", "path", "=", "os", ".", "environ", ".", "get", "(", "'YELLOWBRICK_DATA'", ",", "FIXTURES", ")", "path", "=", "os", ".", "path", ".", "expanduser", "(", "path...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
find_dataset_path
Looks up the path to the dataset specified in the data home directory, which is found using the ``get_data_home`` function. By default data home is colocated with the code, but can be modified with the YELLOWBRICK_DATA environment variable, or passing in a different directory. The file returned will be...
yellowbrick/datasets/path.py
def find_dataset_path(dataset, data_home=None, fname=None, ext=".csv.gz", raises=True): """ Looks up the path to the dataset specified in the data home directory, which is found using the ``get_data_home`` function. By default data home is colocated with the code, but can be modified with the YELLOWBRIC...
def find_dataset_path(dataset, data_home=None, fname=None, ext=".csv.gz", raises=True): """ Looks up the path to the dataset specified in the data home directory, which is found using the ``get_data_home`` function. By default data home is colocated with the code, but can be modified with the YELLOWBRIC...
[ "Looks", "up", "the", "path", "to", "the", "dataset", "specified", "in", "the", "data", "home", "directory", "which", "is", "found", "using", "the", "get_data_home", "function", ".", "By", "default", "data", "home", "is", "colocated", "with", "the", "code", ...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/path.py#L59-L128
[ "def", "find_dataset_path", "(", "dataset", ",", "data_home", "=", "None", ",", "fname", "=", "None", ",", "ext", "=", "\".csv.gz\"", ",", "raises", "=", "True", ")", ":", "# Figure out the root directory of the datasets", "data_home", "=", "get_data_home", "(", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
dataset_exists
Checks to see if a directory with the name of the specified dataset exists in the data home directory, found with ``get_data_home``. Parameters ---------- dataset : str The name of the dataset; should either be a folder in data home or specified in the yellowbrick.datasets.DATASETS vari...
yellowbrick/datasets/path.py
def dataset_exists(dataset, data_home=None): """ Checks to see if a directory with the name of the specified dataset exists in the data home directory, found with ``get_data_home``. Parameters ---------- dataset : str The name of the dataset; should either be a folder in data home or ...
def dataset_exists(dataset, data_home=None): """ Checks to see if a directory with the name of the specified dataset exists in the data home directory, found with ``get_data_home``. Parameters ---------- dataset : str The name of the dataset; should either be a folder in data home or ...
[ "Checks", "to", "see", "if", "a", "directory", "with", "the", "name", "of", "the", "specified", "dataset", "exists", "in", "the", "data", "home", "directory", "found", "with", "get_data_home", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/path.py#L131-L154
[ "def", "dataset_exists", "(", "dataset", ",", "data_home", "=", "None", ")", ":", "data_home", "=", "get_data_home", "(", "data_home", ")", "path", "=", "os", ".", "path", ".", "join", "(", "data_home", ",", "dataset", ")", "return", "os", ".", "path", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
dataset_archive
Checks to see if the dataset archive file exists in the data home directory, found with ``get_data_home``. By specifying the signature, this function also checks to see if the archive is the latest version by comparing the sha256sum of the local archive with the specified signature. Parameters ----...
yellowbrick/datasets/path.py
def dataset_archive(dataset, signature, data_home=None, ext=".zip"): """ Checks to see if the dataset archive file exists in the data home directory, found with ``get_data_home``. By specifying the signature, this function also checks to see if the archive is the latest version by comparing the sha2...
def dataset_archive(dataset, signature, data_home=None, ext=".zip"): """ Checks to see if the dataset archive file exists in the data home directory, found with ``get_data_home``. By specifying the signature, this function also checks to see if the archive is the latest version by comparing the sha2...
[ "Checks", "to", "see", "if", "the", "dataset", "archive", "file", "exists", "in", "the", "data", "home", "directory", "found", "with", "get_data_home", ".", "By", "specifying", "the", "signature", "this", "function", "also", "checks", "to", "see", "if", "the...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/path.py#L157-L192
[ "def", "dataset_archive", "(", "dataset", ",", "signature", ",", "data_home", "=", "None", ",", "ext", "=", "\".zip\"", ")", ":", "data_home", "=", "get_data_home", "(", "data_home", ")", "path", "=", "os", ".", "path", ".", "join", "(", "data_home", ","...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
cleanup_dataset
Removes the dataset directory and archive file from the data home directory. Parameters ---------- dataset : str The name of the dataset; should either be a folder in data home or specified in the yellowbrick.datasets.DATASETS variable. data_home : str, optional The path on dis...
yellowbrick/datasets/path.py
def cleanup_dataset(dataset, data_home=None, ext=".zip"): """ Removes the dataset directory and archive file from the data home directory. Parameters ---------- dataset : str The name of the dataset; should either be a folder in data home or specified in the yellowbrick.datasets.DAT...
def cleanup_dataset(dataset, data_home=None, ext=".zip"): """ Removes the dataset directory and archive file from the data home directory. Parameters ---------- dataset : str The name of the dataset; should either be a folder in data home or specified in the yellowbrick.datasets.DAT...
[ "Removes", "the", "dataset", "directory", "and", "archive", "file", "from", "the", "data", "home", "directory", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/path.py#L195-L234
[ "def", "cleanup_dataset", "(", "dataset", ",", "data_home", "=", "None", ",", "ext", "=", "\".zip\"", ")", ":", "removed", "=", "0", "data_home", "=", "get_data_home", "(", "data_home", ")", "# Paths to remove", "datadir", "=", "os", ".", "path", ".", "joi...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
FeatureVisualizer.fit_transform_poof
Fit to data, transform it, then visualize it. Fits the visualizer to X and y with opetional parameters by passing in all of kwargs, then calls poof with the same kwargs. This method must return the result of the transform method.
yellowbrick/features/base.py
def fit_transform_poof(self, X, y=None, **kwargs): """ Fit to data, transform it, then visualize it. Fits the visualizer to X and y with opetional parameters by passing in all of kwargs, then calls poof with the same kwargs. This method must return the result of the transform me...
def fit_transform_poof(self, X, y=None, **kwargs): """ Fit to data, transform it, then visualize it. Fits the visualizer to X and y with opetional parameters by passing in all of kwargs, then calls poof with the same kwargs. This method must return the result of the transform me...
[ "Fit", "to", "data", "transform", "it", "then", "visualize", "it", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/base.py#L57-L67
[ "def", "fit_transform_poof", "(", "self", ",", "X", ",", "y", "=", "None", ",", "*", "*", "kwargs", ")", ":", "Xp", "=", "self", ".", "fit_transform", "(", "X", ",", "y", ",", "*", "*", "kwargs", ")", "self", ".", "poof", "(", "*", "*", "kwargs...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
MultiFeatureVisualizer.fit
This method performs preliminary computations in order to set up the figure or perform other analyses. It can also call drawing methods in order to set up various non-instance related figure elements. This method must return self.
yellowbrick/features/base.py
def fit(self, X, y=None, **fit_params): """ This method performs preliminary computations in order to set up the figure or perform other analyses. It can also call drawing methods in order to set up various non-instance related figure elements. This method must return self. ...
def fit(self, X, y=None, **fit_params): """ This method performs preliminary computations in order to set up the figure or perform other analyses. It can also call drawing methods in order to set up various non-instance related figure elements. This method must return self. ...
[ "This", "method", "performs", "preliminary", "computations", "in", "order", "to", "set", "up", "the", "figure", "or", "perform", "other", "analyses", ".", "It", "can", "also", "call", "drawing", "methods", "in", "order", "to", "set", "up", "various", "non", ...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/base.py#L100-L121
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ",", "*", "*", "fit_params", ")", ":", "# Handle the feature names if they're None.", "if", "self", ".", "features_", "is", "None", ":", "# If X is a data frame, get the columns off it.", "if", "is_datafr...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
DataVisualizer.fit
The fit method is the primary drawing input for the visualization since it has both the X and y data required for the viz and the transform method does not. Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with m features ...
yellowbrick/features/base.py
def fit(self, X, y=None, **kwargs): """ The fit method is the primary drawing input for the visualization since it has both the X and y data required for the viz and the transform method does not. Parameters ---------- X : ndarray or DataFrame of shape n x m ...
def fit(self, X, y=None, **kwargs): """ The fit method is the primary drawing input for the visualization since it has both the X and y data required for the viz and the transform method does not. Parameters ---------- X : ndarray or DataFrame of shape n x m ...
[ "The", "fit", "method", "is", "the", "primary", "drawing", "input", "for", "the", "visualization", "since", "it", "has", "both", "the", "X", "and", "y", "data", "required", "for", "the", "viz", "and", "the", "transform", "method", "does", "not", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/base.py#L194-L227
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "DataVisualizer", ",", "self", ")", ".", "fit", "(", "X", ",", "y", ",", "*", "*", "kwargs", ")", "# Store the classes for the legend if they...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
color_palette
Return a color palette object with color definition and handling. Calling this function with ``palette=None`` will return the current matplotlib color cycle. This function can also be used in a ``with`` statement to temporarily set the color cycle for a plot or set of plots. Parameters ------...
yellowbrick/style/palettes.py
def color_palette(palette=None, n_colors=None): """ Return a color palette object with color definition and handling. Calling this function with ``palette=None`` will return the current matplotlib color cycle. This function can also be used in a ``with`` statement to temporarily set the color ...
def color_palette(palette=None, n_colors=None): """ Return a color palette object with color definition and handling. Calling this function with ``palette=None`` will return the current matplotlib color cycle. This function can also be used in a ``with`` statement to temporarily set the color ...
[ "Return", "a", "color", "palette", "object", "with", "color", "definition", "and", "handling", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L458-L553
[ "def", "color_palette", "(", "palette", "=", "None", ",", "n_colors", "=", "None", ")", ":", "if", "palette", "is", "None", ":", "palette", "=", "get_color_cycle", "(", ")", "if", "n_colors", "is", "None", ":", "n_colors", "=", "len", "(", "palette", "...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
set_color_codes
Change how matplotlib color shorthands are interpreted. Calling this will change how shorthand codes like "b" or "g" are interpreted by matplotlib in subsequent plots. Parameters ---------- palette : str Named yellowbrick palette to use as the source of colors. See Also -------- ...
yellowbrick/style/palettes.py
def set_color_codes(palette="accent"): """ Change how matplotlib color shorthands are interpreted. Calling this will change how shorthand codes like "b" or "g" are interpreted by matplotlib in subsequent plots. Parameters ---------- palette : str Named yellowbrick palette to use as...
def set_color_codes(palette="accent"): """ Change how matplotlib color shorthands are interpreted. Calling this will change how shorthand codes like "b" or "g" are interpreted by matplotlib in subsequent plots. Parameters ---------- palette : str Named yellowbrick palette to use as...
[ "Change", "how", "matplotlib", "color", "shorthands", "are", "interpreted", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L556-L594
[ "def", "set_color_codes", "(", "palette", "=", "\"accent\"", ")", ":", "if", "palette", "not", "in", "PALETTES", ":", "raise", "YellowbrickValueError", "(", "\"'{}' is not a recognized palette!\"", ".", "format", "(", "palette", ")", ")", "# Fetch the colors and adapt...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
color_sequence
Return a `ListedColormap` object from a named sequence palette. Useful for continuous color scheme values and color maps. Calling this function with ``palette=None`` will return the default color sequence: Color Brewer RdBu. Parameters ---------- palette : None or str or sequence Name...
yellowbrick/style/palettes.py
def color_sequence(palette=None, n_colors=None): """ Return a `ListedColormap` object from a named sequence palette. Useful for continuous color scheme values and color maps. Calling this function with ``palette=None`` will return the default color sequence: Color Brewer RdBu. Parameters -...
def color_sequence(palette=None, n_colors=None): """ Return a `ListedColormap` object from a named sequence palette. Useful for continuous color scheme values and color maps. Calling this function with ``palette=None`` will return the default color sequence: Color Brewer RdBu. Parameters -...
[ "Return", "a", "ListedColormap", "object", "from", "a", "named", "sequence", "palette", ".", "Useful", "for", "continuous", "color", "scheme", "values", "and", "color", "maps", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L601-L693
[ "def", "color_sequence", "(", "palette", "=", "None", ",", "n_colors", "=", "None", ")", ":", "# Select the default colormap if None is passed in.", "palette", "=", "palette", "or", "DEFAULT_SEQUENCE", "# Create a listed color map from the sequence", "if", "not", "isinstanc...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
ColorPalette.as_hex
Return a color palette with hex codes instead of RGB values.
yellowbrick/style/palettes.py
def as_hex(self): """ Return a color palette with hex codes instead of RGB values. """ hex = [mpl.colors.rgb2hex(rgb) for rgb in self] return ColorPalette(hex)
def as_hex(self): """ Return a color palette with hex codes instead of RGB values. """ hex = [mpl.colors.rgb2hex(rgb) for rgb in self] return ColorPalette(hex)
[ "Return", "a", "color", "palette", "with", "hex", "codes", "instead", "of", "RGB", "values", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L418-L423
[ "def", "as_hex", "(", "self", ")", ":", "hex", "=", "[", "mpl", ".", "colors", ".", "rgb2hex", "(", "rgb", ")", "for", "rgb", "in", "self", "]", "return", "ColorPalette", "(", "hex", ")" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
ColorPalette.as_rgb
Return a color palette with RGB values instead of hex codes.
yellowbrick/style/palettes.py
def as_rgb(self): """ Return a color palette with RGB values instead of hex codes. """ rgb = [mpl.colors.colorConverter.to_rgb(hex) for hex in self] return ColorPalette(rgb)
def as_rgb(self): """ Return a color palette with RGB values instead of hex codes. """ rgb = [mpl.colors.colorConverter.to_rgb(hex) for hex in self] return ColorPalette(rgb)
[ "Return", "a", "color", "palette", "with", "RGB", "values", "instead", "of", "hex", "codes", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L425-L430
[ "def", "as_rgb", "(", "self", ")", ":", "rgb", "=", "[", "mpl", ".", "colors", ".", "colorConverter", ".", "to_rgb", "(", "hex", ")", "for", "hex", "in", "self", "]", "return", "ColorPalette", "(", "rgb", ")" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
ColorPalette.plot
Plot the values in the color palette as a horizontal array. See Seaborn's palplot function for inspiration. Parameters ---------- size : int scaling factor for size of the plot
yellowbrick/style/palettes.py
def plot(self, size=1): """ Plot the values in the color palette as a horizontal array. See Seaborn's palplot function for inspiration. Parameters ---------- size : int scaling factor for size of the plot """ n = len(self) fig, ax = p...
def plot(self, size=1): """ Plot the values in the color palette as a horizontal array. See Seaborn's palplot function for inspiration. Parameters ---------- size : int scaling factor for size of the plot """ n = len(self) fig, ax = p...
[ "Plot", "the", "values", "in", "the", "color", "palette", "as", "a", "horizontal", "array", ".", "See", "Seaborn", "s", "palplot", "function", "for", "inspiration", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L432-L451
[ "def", "plot", "(", "self", ",", "size", "=", "1", ")", ":", "n", "=", "len", "(", "self", ")", "fig", ",", "ax", "=", "plt", ".", "subplots", "(", "1", ",", "1", ",", "figsize", "=", "(", "n", "*", "size", ",", "size", ")", ")", "ax", "....
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
SCurveExample._make_path
Makes directories as needed
docs/api/features/manifold.py
def _make_path(self, path, name): """ Makes directories as needed """ if not os.path.exists(path): os.mkdirs(path) if os.path.isdir(path) : return os.path.join(path, name) return path
def _make_path(self, path, name): """ Makes directories as needed """ if not os.path.exists(path): os.mkdirs(path) if os.path.isdir(path) : return os.path.join(path, name) return path
[ "Makes", "directories", "as", "needed" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/docs/api/features/manifold.py#L127-L137
[ "def", "_make_path", "(", "self", ",", "path", ",", "name", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "os", ".", "mkdirs", "(", "path", ")", "if", "os", ".", "path", ".", "isdir", "(", "path", ")", ":", "...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
SCurveExample.plot_manifold_embedding
Draw the manifold embedding for the specified algorithm
docs/api/features/manifold.py
def plot_manifold_embedding(self, algorithm="lle", path="images"): """ Draw the manifold embedding for the specified algorithm """ _, ax = plt.subplots(figsize=(9,6)) path = self._make_path(path, "s_curve_{}_manifold.png".format(algorithm)) oz = Manifold( ax=...
def plot_manifold_embedding(self, algorithm="lle", path="images"): """ Draw the manifold embedding for the specified algorithm """ _, ax = plt.subplots(figsize=(9,6)) path = self._make_path(path, "s_curve_{}_manifold.png".format(algorithm)) oz = Manifold( ax=...
[ "Draw", "the", "manifold", "embedding", "for", "the", "specified", "algorithm" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/docs/api/features/manifold.py#L145-L158
[ "def", "plot_manifold_embedding", "(", "self", ",", "algorithm", "=", "\"lle\"", ",", "path", "=", "\"images\"", ")", ":", "_", ",", "ax", "=", "plt", ".", "subplots", "(", "figsize", "=", "(", "9", ",", "6", ")", ")", "path", "=", "self", ".", "_m...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
download_data
Downloads the zipped data set specified at the given URL, saving it to the data directory specified by ``get_data_home``. This function verifies the download with the given signature and extracts the archive. Parameters ---------- url : str The URL of the dataset on the Internet to GET ...
yellowbrick/datasets/download.py
def download_data(url, signature, data_home=None, replace=False, extract=True): """ Downloads the zipped data set specified at the given URL, saving it to the data directory specified by ``get_data_home``. This function verifies the download with the given signature and extracts the archive. Parame...
def download_data(url, signature, data_home=None, replace=False, extract=True): """ Downloads the zipped data set specified at the given URL, saving it to the data directory specified by ``get_data_home``. This function verifies the download with the given signature and extracts the archive. Parame...
[ "Downloads", "the", "zipped", "data", "set", "specified", "at", "the", "given", "URL", "saving", "it", "to", "the", "data", "directory", "specified", "by", "get_data_home", ".", "This", "function", "verifies", "the", "download", "with", "the", "given", "signat...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/download.py#L38-L106
[ "def", "download_data", "(", "url", ",", "signature", ",", "data_home", "=", "None", ",", "replace", "=", "False", ",", "extract", "=", "True", ")", ":", "data_home", "=", "get_data_home", "(", "data_home", ")", "# Get the name of the file from the URL", "basena...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
set_aesthetic
Set aesthetic parameters in one step. Each set of parameters can be set directly or temporarily, see the referenced functions below for more information. Parameters ---------- palette : string or sequence Color palette, see :func:`color_palette` font : string Font family, see m...
yellowbrick/style/rcmod.py
def set_aesthetic(palette="yellowbrick", font="sans-serif", font_scale=1, color_codes=True, rc=None): """ Set aesthetic parameters in one step. Each set of parameters can be set directly or temporarily, see the referenced functions below for more information. Parameters -----...
def set_aesthetic(palette="yellowbrick", font="sans-serif", font_scale=1, color_codes=True, rc=None): """ Set aesthetic parameters in one step. Each set of parameters can be set directly or temporarily, see the referenced functions below for more information. Parameters -----...
[ "Set", "aesthetic", "parameters", "in", "one", "step", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/rcmod.py#L117-L144
[ "def", "set_aesthetic", "(", "palette", "=", "\"yellowbrick\"", ",", "font", "=", "\"sans-serif\"", ",", "font_scale", "=", "1", ",", "color_codes", "=", "True", ",", "rc", "=", "None", ")", ":", "_set_context", "(", "font_scale", ")", "set_style", "(", "r...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
_axes_style
Return a parameter dict for the aesthetic style of the plots. NOTE: This is an internal method from Seaborn that is simply used to create a default aesthetic in yellowbrick. If you'd like to use these styles then import Seaborn! This affects things like the color of the axes, whether a grid is ena...
yellowbrick/style/rcmod.py
def _axes_style(style=None, rc=None): """ Return a parameter dict for the aesthetic style of the plots. NOTE: This is an internal method from Seaborn that is simply used to create a default aesthetic in yellowbrick. If you'd like to use these styles then import Seaborn! This affects things lik...
def _axes_style(style=None, rc=None): """ Return a parameter dict for the aesthetic style of the plots. NOTE: This is an internal method from Seaborn that is simply used to create a default aesthetic in yellowbrick. If you'd like to use these styles then import Seaborn! This affects things lik...
[ "Return", "a", "parameter", "dict", "for", "the", "aesthetic", "style", "of", "the", "plots", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/rcmod.py#L165-L236
[ "def", "_axes_style", "(", "style", "=", "None", ",", "rc", "=", "None", ")", ":", "if", "isinstance", "(", "style", ",", "dict", ")", ":", "style_dict", "=", "style", "else", ":", "# Define colors here", "dark_gray", "=", "\".15\"", "light_gray", "=", "...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
set_style
Set the aesthetic style of the plots. This affects things like the color of the axes, whether a grid is enabled by default, and other aesthetic elements. Parameters ---------- style : dict, None, or one of {darkgrid, whitegrid, dark, white, ticks} A dictionary of parameters or the name of ...
yellowbrick/style/rcmod.py
def set_style(style=None, rc=None): """ Set the aesthetic style of the plots. This affects things like the color of the axes, whether a grid is enabled by default, and other aesthetic elements. Parameters ---------- style : dict, None, or one of {darkgrid, whitegrid, dark, white, ticks} ...
def set_style(style=None, rc=None): """ Set the aesthetic style of the plots. This affects things like the color of the axes, whether a grid is enabled by default, and other aesthetic elements. Parameters ---------- style : dict, None, or one of {darkgrid, whitegrid, dark, white, ticks} ...
[ "Set", "the", "aesthetic", "style", "of", "the", "plots", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/rcmod.py#L239-L256
[ "def", "set_style", "(", "style", "=", "None", ",", "rc", "=", "None", ")", ":", "style_object", "=", "_axes_style", "(", "style", ",", "rc", ")", "mpl", ".", "rcParams", ".", "update", "(", "style_object", ")" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
_set_context
Set the plotting context parameters. NOTE: This is an internal method from Seaborn that is simply used to create a default aesthetic in yellowbrick. If you'd like to use these styles then import Seaborn! This affects things like the size of the labels, lines, and other elements of the plot, but no...
yellowbrick/style/rcmod.py
def _set_context(context=None, font_scale=1, rc=None): """ Set the plotting context parameters. NOTE: This is an internal method from Seaborn that is simply used to create a default aesthetic in yellowbrick. If you'd like to use these styles then import Seaborn! This affects things like the si...
def _set_context(context=None, font_scale=1, rc=None): """ Set the plotting context parameters. NOTE: This is an internal method from Seaborn that is simply used to create a default aesthetic in yellowbrick. If you'd like to use these styles then import Seaborn! This affects things like the si...
[ "Set", "the", "plotting", "context", "parameters", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/rcmod.py#L351-L379
[ "def", "_set_context", "(", "context", "=", "None", ",", "font_scale", "=", "1", ",", "rc", "=", "None", ")", ":", "context_object", "=", "_plotting_context", "(", "context", ",", "font_scale", ",", "rc", ")", "mpl", ".", "rcParams", ".", "update", "(", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
set_palette
Set the matplotlib color cycle using a seaborn palette. Parameters ---------- palette : yellowbrick color palette | seaborn color palette (with ``sns_`` prepended) Palette definition. Should be something that :func:`color_palette` can process. n_colors : int Number of colors in ...
yellowbrick/style/rcmod.py
def set_palette(palette, n_colors=None, color_codes=False): """ Set the matplotlib color cycle using a seaborn palette. Parameters ---------- palette : yellowbrick color palette | seaborn color palette (with ``sns_`` prepended) Palette definition. Should be something that :func:`color_palet...
def set_palette(palette, n_colors=None, color_codes=False): """ Set the matplotlib color cycle using a seaborn palette. Parameters ---------- palette : yellowbrick color palette | seaborn color palette (with ``sns_`` prepended) Palette definition. Should be something that :func:`color_palet...
[ "Set", "the", "matplotlib", "color", "cycle", "using", "a", "seaborn", "palette", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/rcmod.py#L415-L441
[ "def", "set_palette", "(", "palette", ",", "n_colors", "=", "None", ",", "color_codes", "=", "False", ")", ":", "colors", "=", "color_palette", "(", "palette", ",", "n_colors", ")", "if", "mpl_ge_150", ":", "from", "cycler", "import", "cycler", "cyl", "=",...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
dispersion
Displays lexical dispersion plot for words in a corpus This helper function is a quick wrapper to utilize the DisperstionPlot Visualizer for one-off analysis Parameters ---------- words : list A list of words whose dispersion will be examined within a corpus y : ndarray or Series of ...
yellowbrick/text/dispersion.py
def dispersion(words, corpus, y=None, ax=None, colors=None, colormap=None, labels=None, annotate_docs=False, ignore_case=False, **kwargs): """ Displays lexical dispersion plot for words in a corpus This helper function is a quick wrapper to utilize the DisperstionPlot Visualizer for one-off ...
def dispersion(words, corpus, y=None, ax=None, colors=None, colormap=None, labels=None, annotate_docs=False, ignore_case=False, **kwargs): """ Displays lexical dispersion plot for words in a corpus This helper function is a quick wrapper to utilize the DisperstionPlot Visualizer for one-off ...
[ "Displays", "lexical", "dispersion", "plot", "for", "words", "in", "a", "corpus" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/dispersion.py#L252-L314
[ "def", "dispersion", "(", "words", ",", "corpus", ",", "y", "=", "None", ",", "ax", "=", "None", ",", "colors", "=", "None", ",", "colormap", "=", "None", ",", "labels", "=", "None", ",", "annotate_docs", "=", "False", ",", "ignore_case", "=", "False...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
DispersionPlot.fit
The fit method is the primary drawing input for the dispersion visualization. Parameters ---------- X : list or generator Should be provided as a list of documents or a generator that yields a list of documents that contain a list of words in the ord...
yellowbrick/text/dispersion.py
def fit(self, X, y=None, **kwargs): """ The fit method is the primary drawing input for the dispersion visualization. Parameters ---------- X : list or generator Should be provided as a list of documents or a generator that yields a list of docume...
def fit(self, X, y=None, **kwargs): """ The fit method is the primary drawing input for the dispersion visualization. Parameters ---------- X : list or generator Should be provided as a list of documents or a generator that yields a list of docume...
[ "The", "fit", "method", "is", "the", "primary", "drawing", "input", "for", "the", "dispersion", "visualization", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/dispersion.py#L123-L176
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "y", "is", "not", "None", ":", "self", ".", "classes_", "=", "np", ".", "unique", "(", "y", ")", "elif", "y", "is", "None", "and", "self", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
DispersionPlot.draw
Called from the fit method, this method creates the canvas and draws the plot on it. Parameters ---------- kwargs: generic keyword arguments.
yellowbrick/text/dispersion.py
def draw(self, points, target=None, **kwargs): """ Called from the fit method, this method creates the canvas and draws the plot on it. Parameters ---------- kwargs: generic keyword arguments. """ # Resolve the labels with the classes labels = sel...
def draw(self, points, target=None, **kwargs): """ Called from the fit method, this method creates the canvas and draws the plot on it. Parameters ---------- kwargs: generic keyword arguments. """ # Resolve the labels with the classes labels = sel...
[ "Called", "from", "the", "fit", "method", "this", "method", "creates", "the", "canvas", "and", "draws", "the", "plot", "on", "it", ".", "Parameters", "----------", "kwargs", ":", "generic", "keyword", "arguments", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/dispersion.py#L178-L226
[ "def", "draw", "(", "self", ",", "points", ",", "target", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Resolve the labels with the classes", "labels", "=", "self", ".", "labels", "if", "self", ".", "labels", "is", "not", "None", "else", "self", "."...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
DispersionPlot.finalize
The finalize method executes any subclass-specific axes finalization steps. The user calls poof & poof calls finalize. Parameters ---------- kwargs: generic keyword arguments.
yellowbrick/text/dispersion.py
def finalize(self, **kwargs): """ The finalize method executes any subclass-specific axes finalization steps. The user calls poof & poof calls finalize. Parameters ---------- kwargs: generic keyword arguments. """ self.ax.set_ylim(-1, len(self.indexed_wor...
def finalize(self, **kwargs): """ The finalize method executes any subclass-specific axes finalization steps. The user calls poof & poof calls finalize. Parameters ---------- kwargs: generic keyword arguments. """ self.ax.set_ylim(-1, len(self.indexed_wor...
[ "The", "finalize", "method", "executes", "any", "subclass", "-", "specific", "axes", "finalization", "steps", ".", "The", "user", "calls", "poof", "&", "poof", "calls", "finalize", ".", "Parameters", "----------", "kwargs", ":", "generic", "keyword", "arguments"...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/dispersion.py#L228-L246
[ "def", "finalize", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "ax", ".", "set_ylim", "(", "-", "1", ",", "len", "(", "self", ".", "indexed_words_", ")", ")", "self", ".", "ax", ".", "set_title", "(", "\"Lexical Dispersion Plot\"", "...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
manifold_embedding
Quick method for Manifold visualizer. The Manifold visualizer provides high dimensional visualization for feature analysis by embedding data into 2 dimensions using the sklearn.manifold package for manifold learning. In brief, manifold learning algorithms are unsuperivsed approaches to non-linear dimen...
yellowbrick/features/manifold.py
def manifold_embedding( X, y=None, ax=None, manifold="lle", n_neighbors=10, colors=None, target=AUTO, alpha=0.7, random_state=None, **kwargs): """Quick method for Manifold visualizer. The Manifold visualizer provides high dimensional visualization for feature analysi...
def manifold_embedding( X, y=None, ax=None, manifold="lle", n_neighbors=10, colors=None, target=AUTO, alpha=0.7, random_state=None, **kwargs): """Quick method for Manifold visualizer. The Manifold visualizer provides high dimensional visualization for feature analysi...
[ "Quick", "method", "for", "Manifold", "visualizer", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L441-L544
[ "def", "manifold_embedding", "(", "X", ",", "y", "=", "None", ",", "ax", "=", "None", ",", "manifold", "=", "\"lle\"", ",", "n_neighbors", "=", "10", ",", "colors", "=", "None", ",", "target", "=", "AUTO", ",", "alpha", "=", "0.7", ",", "random_state...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
Manifold.manifold
Creates the manifold estimator if a string value is passed in, validates other objects passed in.
yellowbrick/features/manifold.py
def manifold(self, transformer): """ Creates the manifold estimator if a string value is passed in, validates other objects passed in. """ if not is_estimator(transformer): if transformer not in self.ALGORITHMS: raise YellowbrickValueError( ...
def manifold(self, transformer): """ Creates the manifold estimator if a string value is passed in, validates other objects passed in. """ if not is_estimator(transformer): if transformer not in self.ALGORITHMS: raise YellowbrickValueError( ...
[ "Creates", "the", "manifold", "estimator", "if", "a", "string", "value", "is", "passed", "in", "validates", "other", "objects", "passed", "in", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L232-L260
[ "def", "manifold", "(", "self", ",", "transformer", ")", ":", "if", "not", "is_estimator", "(", "transformer", ")", ":", "if", "transformer", "not", "in", "self", ".", "ALGORITHMS", ":", "raise", "YellowbrickValueError", "(", "\"could not create manifold for '%s'\...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
Manifold.fit_transform
Fits the manifold on X and transforms the data to plot it on the axes. The optional y specified can be used to declare discrete colors. If the target is set to 'auto', this method also determines the target type, and therefore what colors will be used. Note also that fit records the amo...
yellowbrick/features/manifold.py
def fit_transform(self, X, y=None): """ Fits the manifold on X and transforms the data to plot it on the axes. The optional y specified can be used to declare discrete colors. If the target is set to 'auto', this method also determines the target type, and therefore what colors w...
def fit_transform(self, X, y=None): """ Fits the manifold on X and transforms the data to plot it on the axes. The optional y specified can be used to declare discrete colors. If the target is set to 'auto', this method also determines the target type, and therefore what colors w...
[ "Fits", "the", "manifold", "on", "X", "and", "transforms", "the", "data", "to", "plot", "it", "on", "the", "axes", ".", "The", "optional", "y", "specified", "can", "be", "used", "to", "declare", "discrete", "colors", ".", "If", "the", "target", "is", "...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L270-L319
[ "def", "fit_transform", "(", "self", ",", "X", ",", "y", "=", "None", ")", ":", "# Determine target type", "self", ".", "_determine_target_color_type", "(", "y", ")", "# Compute classes and colors if target type is discrete", "if", "self", ".", "_target_color_type", "...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
Manifold.transform
Returns the transformed data points from the manifold embedding. Parameters ---------- X : array-like of shape (n, m) A matrix or data frame with n instances and m features Returns ------- Xprime : array-like of shape (n, 2) Returns the 2-dimensi...
yellowbrick/features/manifold.py
def transform(self, X): """ Returns the transformed data points from the manifold embedding. Parameters ---------- X : array-like of shape (n, m) A matrix or data frame with n instances and m features Returns ------- Xprime : array-like of sh...
def transform(self, X): """ Returns the transformed data points from the manifold embedding. Parameters ---------- X : array-like of shape (n, m) A matrix or data frame with n instances and m features Returns ------- Xprime : array-like of sh...
[ "Returns", "the", "transformed", "data", "points", "from", "the", "manifold", "embedding", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L321-L338
[ "def", "transform", "(", "self", ",", "X", ")", ":", "try", ":", "return", "self", ".", "manifold", ".", "transform", "(", "X", ")", "except", "AttributeError", "as", "e", ":", "raise", "AttributeError", "(", "str", "(", "e", ")", "+", "\" try using fi...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
Manifold.draw
Draws the points described by X and colored by the points in y. Can be called multiple times before finalize to add more scatter plots to the axes, however ``fit()`` must be called before use. Parameters ---------- X : array-like of shape (n, 2) The matrix produced b...
yellowbrick/features/manifold.py
def draw(self, X, y=None): """ Draws the points described by X and colored by the points in y. Can be called multiple times before finalize to add more scatter plots to the axes, however ``fit()`` must be called before use. Parameters ---------- X : array-like of...
def draw(self, X, y=None): """ Draws the points described by X and colored by the points in y. Can be called multiple times before finalize to add more scatter plots to the axes, however ``fit()`` must be called before use. Parameters ---------- X : array-like of...
[ "Draws", "the", "points", "described", "by", "X", "and", "colored", "by", "the", "points", "in", "y", ".", "Can", "be", "called", "multiple", "times", "before", "finalize", "to", "add", "more", "scatter", "plots", "to", "the", "axes", "however", "fit", "...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L340-L387
[ "def", "draw", "(", "self", ",", "X", ",", "y", "=", "None", ")", ":", "scatter_kwargs", "=", "{", "\"alpha\"", ":", "self", ".", "alpha", "}", "# Determine the colors", "if", "self", ".", "_target_color_type", "==", "SINGLE", ":", "scatter_kwargs", "[", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
Manifold.finalize
Add title and modify axes to make the image ready for display.
yellowbrick/features/manifold.py
def finalize(self): """ Add title and modify axes to make the image ready for display. """ self.set_title( '{} Manifold (fit in {:0.2f} seconds)'.format( self._name, self.fit_time_.interval ) ) self.ax.set_xticklabels([]) se...
def finalize(self): """ Add title and modify axes to make the image ready for display. """ self.set_title( '{} Manifold (fit in {:0.2f} seconds)'.format( self._name, self.fit_time_.interval ) ) self.ax.set_xticklabels([]) se...
[ "Add", "title", "and", "modify", "axes", "to", "make", "the", "image", "ready", "for", "display", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L389-L407
[ "def", "finalize", "(", "self", ")", ":", "self", ".", "set_title", "(", "'{} Manifold (fit in {:0.2f} seconds)'", ".", "format", "(", "self", ".", "_name", ",", "self", ".", "fit_time_", ".", "interval", ")", ")", "self", ".", "ax", ".", "set_xticklabels", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
Manifold._determine_target_color_type
Determines the target color type from the vector y as follows: - if y is None: only a single color is used - if target is auto: determine if y is continuous or discrete - otherwise specify supplied target type This property will be used to compute the colors for each point.
yellowbrick/features/manifold.py
def _determine_target_color_type(self, y): """ Determines the target color type from the vector y as follows: - if y is None: only a single color is used - if target is auto: determine if y is continuous or discrete - otherwise specify supplied target type T...
def _determine_target_color_type(self, y): """ Determines the target color type from the vector y as follows: - if y is None: only a single color is used - if target is auto: determine if y is continuous or discrete - otherwise specify supplied target type T...
[ "Determines", "the", "target", "color", "type", "from", "the", "vector", "y", "as", "follows", ":" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L409-L434
[ "def", "_determine_target_color_type", "(", "self", ",", "y", ")", ":", "if", "y", "is", "None", ":", "self", ".", "_target_color_type", "=", "SINGLE", "elif", "self", ".", "target", "==", "\"auto\"", ":", "# NOTE: See #73 for a generalization to use when implemente...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
rfecv
Performs recursive feature elimination with cross-validation to determine an optimal number of features for a model. Visualizes the feature subsets with respect to the cross-validation score. This helper function is a quick wrapper to utilize the RFECV visualizer for one-off analysis. Parameters ...
yellowbrick/features/rfecv.py
def rfecv(model, X, y, ax=None, step=1, groups=None, cv=None, scoring=None, **kwargs): """ Performs recursive feature elimination with cross-validation to determine an optimal number of features for a model. Visualizes the feature subsets with respect to the cross-validation score. This h...
def rfecv(model, X, y, ax=None, step=1, groups=None, cv=None, scoring=None, **kwargs): """ Performs recursive feature elimination with cross-validation to determine an optimal number of features for a model. Visualizes the feature subsets with respect to the cross-validation score. This h...
[ "Performs", "recursive", "feature", "elimination", "with", "cross", "-", "validation", "to", "determine", "an", "optimal", "number", "of", "features", "for", "a", "model", ".", "Visualizes", "the", "feature", "subsets", "with", "respect", "to", "the", "cross", ...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rfecv.py#L261-L335
[ "def", "rfecv", "(", "model", ",", "X", ",", "y", ",", "ax", "=", "None", ",", "step", "=", "1", ",", "groups", "=", "None", ",", "cv", "=", "None", ",", "scoring", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Initialize the visualizer", "o...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
RFECV.fit
Fits the RFECV with the wrapped model to the specified data and draws the rfecv curve with the optimal number of features found. Parameters ---------- X : array-like, shape (n_samples, n_features) Training vector, where n_samples is the number of samples and n_fe...
yellowbrick/features/rfecv.py
def fit(self, X, y=None): """ Fits the RFECV with the wrapped model to the specified data and draws the rfecv curve with the optimal number of features found. Parameters ---------- X : array-like, shape (n_samples, n_features) Training vector, where n_samples...
def fit(self, X, y=None): """ Fits the RFECV with the wrapped model to the specified data and draws the rfecv curve with the optimal number of features found. Parameters ---------- X : array-like, shape (n_samples, n_features) Training vector, where n_samples...
[ "Fits", "the", "RFECV", "with", "the", "wrapped", "model", "to", "the", "specified", "data", "and", "draws", "the", "rfecv", "curve", "with", "the", "optimal", "number", "of", "features", "found", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rfecv.py#L145-L214
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ")", ":", "X", ",", "y", "=", "check_X_y", "(", "X", ",", "y", ",", "\"csr\"", ")", "n_features", "=", "X", ".", "shape", "[", "1", "]", "# This check is kind of unnecessary since RFE will do ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
RFECV.draw
Renders the rfecv curve.
yellowbrick/features/rfecv.py
def draw(self, **kwargs): """ Renders the rfecv curve. """ # Compute the curves x = self.n_feature_subsets_ means = self.cv_scores_.mean(axis=1) sigmas = self.cv_scores_.std(axis=1) # Plot one standard deviation above and below the mean self.ax.f...
def draw(self, **kwargs): """ Renders the rfecv curve. """ # Compute the curves x = self.n_feature_subsets_ means = self.cv_scores_.mean(axis=1) sigmas = self.cv_scores_.std(axis=1) # Plot one standard deviation above and below the mean self.ax.f...
[ "Renders", "the", "rfecv", "curve", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rfecv.py#L216-L240
[ "def", "draw", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# Compute the curves", "x", "=", "self", ".", "n_feature_subsets_", "means", "=", "self", ".", "cv_scores_", ".", "mean", "(", "axis", "=", "1", ")", "sigmas", "=", "self", ".", "cv_scores...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
scatterviz
Displays a bivariate scatter plot. This helper function is a quick wrapper to utilize the ScatterVisualizer (Transformer) for one-off analysis. Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with m features y : ndarray or Series of length n, def...
yellowbrick/contrib/scatter.py
def scatterviz(X, y=None, ax=None, features=None, classes=None, color=None, colormap=None, markers=None, alpha=1.0, **kwargs): """Displays a bivariate scatter plot. This helper...
def scatterviz(X, y=None, ax=None, features=None, classes=None, color=None, colormap=None, markers=None, alpha=1.0, **kwargs): """Displays a bivariate scatter plot. This helper...
[ "Displays", "a", "bivariate", "scatter", "plot", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/scatter.py#L32-L94
[ "def", "scatterviz", "(", "X", ",", "y", "=", "None", ",", "ax", "=", "None", ",", "features", "=", "None", ",", "classes", "=", "None", ",", "color", "=", "None", ",", "colormap", "=", "None", ",", "markers", "=", "None", ",", "alpha", "=", "1.0...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
ScatterVisualizer.fit
The fit method is the primary drawing input for the parallel coords visualization since it has both the X and y data required for the viz and the transform method does not. Parameters ---------- X : ndarray or DataFrame of shape n x m A matrix of n instances with 2 f...
yellowbrick/contrib/scatter.py
def fit(self, X, y=None, **kwargs): """ The fit method is the primary drawing input for the parallel coords visualization since it has both the X and y data required for the viz and the transform method does not. Parameters ---------- X : ndarray or DataFrame of ...
def fit(self, X, y=None, **kwargs): """ The fit method is the primary drawing input for the parallel coords visualization since it has both the X and y data required for the viz and the transform method does not. Parameters ---------- X : ndarray or DataFrame of ...
[ "The", "fit", "method", "is", "the", "primary", "drawing", "input", "for", "the", "parallel", "coords", "visualization", "since", "it", "has", "both", "the", "X", "and", "y", "data", "required", "for", "the", "viz", "and", "the", "transform", "method", "do...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/scatter.py#L194-L252
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ",", "*", "*", "kwargs", ")", ":", "_", ",", "ncols", "=", "X", ".", "shape", "if", "ncols", "==", "2", ":", "X_two_cols", "=", "X", "if", "self", ".", "features_", "is", "None", ":"...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
ScatterVisualizer.draw
Called from the fit method, this method creates a scatter plot that draws each instance as a class or target colored point, whose location is determined by the feature data set.
yellowbrick/contrib/scatter.py
def draw(self, X, y, **kwargs): """Called from the fit method, this method creates a scatter plot that draws each instance as a class or target colored point, whose location is determined by the feature data set. """ # Set the axes limits self.ax.set_xlim([-1,1]) ...
def draw(self, X, y, **kwargs): """Called from the fit method, this method creates a scatter plot that draws each instance as a class or target colored point, whose location is determined by the feature data set. """ # Set the axes limits self.ax.set_xlim([-1,1]) ...
[ "Called", "from", "the", "fit", "method", "this", "method", "creates", "a", "scatter", "plot", "that", "draws", "each", "instance", "as", "a", "class", "or", "target", "colored", "point", "whose", "location", "is", "determined", "by", "the", "feature", "data...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/scatter.py#L254-L300
[ "def", "draw", "(", "self", ",", "X", ",", "y", ",", "*", "*", "kwargs", ")", ":", "# Set the axes limits", "self", ".", "ax", ".", "set_xlim", "(", "[", "-", "1", ",", "1", "]", ")", "self", ".", "ax", ".", "set_ylim", "(", "[", "-", "1", ",...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
ScatterVisualizer.finalize
Finalize executes any subclass-specific axes finalization steps. The user calls poof and poof calls finalize. Parameters ---------- kwargs: generic keyword arguments.
yellowbrick/contrib/scatter.py
def finalize(self, **kwargs): """ Finalize executes any subclass-specific axes finalization steps. The user calls poof and poof calls finalize. Parameters ---------- kwargs: generic keyword arguments. """ # Divide out the two features feature_one...
def finalize(self, **kwargs): """ Finalize executes any subclass-specific axes finalization steps. The user calls poof and poof calls finalize. Parameters ---------- kwargs: generic keyword arguments. """ # Divide out the two features feature_one...
[ "Finalize", "executes", "any", "subclass", "-", "specific", "axes", "finalization", "steps", ".", "The", "user", "calls", "poof", "and", "poof", "calls", "finalize", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/scatter.py#L302-L321
[ "def", "finalize", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# Divide out the two features", "feature_one", ",", "feature_two", "=", "self", ".", "features_", "# Set the title", "self", ".", "set_title", "(", "'Scatter Plot: {0} vs {1}'", ".", "format", "("...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
gridsearch_color_plot
Quick method: Create a color plot showing the best grid search scores across two parameters. This helper function is a quick wrapper to utilize GridSearchColorPlot for one-off analysis. If no `X` data is passed, the model is assumed to be fit already. This allows quick exploration without wait...
yellowbrick/gridsearch/pcolor.py
def gridsearch_color_plot(model, x_param, y_param, X=None, y=None, ax=None, **kwargs): """Quick method: Create a color plot showing the best grid search scores across two parameters. This helper function is a quick wrapper to utilize GridSearchColorPlot for one-off analysi...
def gridsearch_color_plot(model, x_param, y_param, X=None, y=None, ax=None, **kwargs): """Quick method: Create a color plot showing the best grid search scores across two parameters. This helper function is a quick wrapper to utilize GridSearchColorPlot for one-off analysi...
[ "Quick", "method", ":", "Create", "a", "color", "plot", "showing", "the", "best", "grid", "search", "scores", "across", "two", "parameters", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/gridsearch/pcolor.py#L21-L76
[ "def", "gridsearch_color_plot", "(", "model", ",", "x_param", ",", "y_param", ",", "X", "=", "None", ",", "y", "=", "None", ",", "ax", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Instantiate the visualizer", "visualizer", "=", "GridSearchColorPlot", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
filter_missing
Removes rows that contain np.nan values in data. If y is given, X and y will be filtered together so that their shape remains identical. For example, rows in X with nans will also remove rows in y, or rows in y with np.nans will also remove corresponding rows in X. Parameters ------------ X : a...
yellowbrick/utils/nan_warnings.py
def filter_missing(X, y=None): """ Removes rows that contain np.nan values in data. If y is given, X and y will be filtered together so that their shape remains identical. For example, rows in X with nans will also remove rows in y, or rows in y with np.nans will also remove corresponding rows in X....
def filter_missing(X, y=None): """ Removes rows that contain np.nan values in data. If y is given, X and y will be filtered together so that their shape remains identical. For example, rows in X with nans will also remove rows in y, or rows in y with np.nans will also remove corresponding rows in X....
[ "Removes", "rows", "that", "contain", "np", ".", "nan", "values", "in", "data", ".", "If", "y", "is", "given", "X", "and", "y", "will", "be", "filtered", "together", "so", "that", "their", "shape", "remains", "identical", ".", "For", "example", "rows", ...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/nan_warnings.py#L10-L44
[ "def", "filter_missing", "(", "X", ",", "y", "=", "None", ")", ":", "if", "y", "is", "not", "None", ":", "return", "filter_missing_X_and_y", "(", "X", ",", "y", ")", "else", ":", "return", "X", "[", "~", "np", ".", "isnan", "(", "X", ")", ".", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
filter_missing_X_and_y
Remove rows from X and y where either contains nans.
yellowbrick/utils/nan_warnings.py
def filter_missing_X_and_y(X, y): """Remove rows from X and y where either contains nans.""" y_nans = np.isnan(y) x_nans = np.isnan(X).any(axis=1) unioned_nans = np.logical_or(x_nans, y_nans) return X[~unioned_nans], y[~unioned_nans]
def filter_missing_X_and_y(X, y): """Remove rows from X and y where either contains nans.""" y_nans = np.isnan(y) x_nans = np.isnan(X).any(axis=1) unioned_nans = np.logical_or(x_nans, y_nans) return X[~unioned_nans], y[~unioned_nans]
[ "Remove", "rows", "from", "X", "and", "y", "where", "either", "contains", "nans", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/nan_warnings.py#L47-L53
[ "def", "filter_missing_X_and_y", "(", "X", ",", "y", ")", ":", "y_nans", "=", "np", ".", "isnan", "(", "y", ")", "x_nans", "=", "np", ".", "isnan", "(", "X", ")", ".", "any", "(", "axis", "=", "1", ")", "unioned_nans", "=", "np", ".", "logical_or...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
warn_if_nans_exist
Warn if nans exist in a numpy array.
yellowbrick/utils/nan_warnings.py
def warn_if_nans_exist(X): """Warn if nans exist in a numpy array.""" null_count = count_rows_with_nans(X) total = len(X) percent = 100 * null_count / total if null_count > 0: warning_message = \ 'Warning! Found {} rows of {} ({:0.2f}%) with nan values. Only ' \ 'com...
def warn_if_nans_exist(X): """Warn if nans exist in a numpy array.""" null_count = count_rows_with_nans(X) total = len(X) percent = 100 * null_count / total if null_count > 0: warning_message = \ 'Warning! Found {} rows of {} ({:0.2f}%) with nan values. Only ' \ 'com...
[ "Warn", "if", "nans", "exist", "in", "a", "numpy", "array", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/nan_warnings.py#L56-L66
[ "def", "warn_if_nans_exist", "(", "X", ")", ":", "null_count", "=", "count_rows_with_nans", "(", "X", ")", "total", "=", "len", "(", "X", ")", "percent", "=", "100", "*", "null_count", "/", "total", "if", "null_count", ">", "0", ":", "warning_message", "...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
count_rows_with_nans
Count the number of rows in 2D arrays that contain any nan values.
yellowbrick/utils/nan_warnings.py
def count_rows_with_nans(X): """Count the number of rows in 2D arrays that contain any nan values.""" if X.ndim == 2: return np.where(np.isnan(X).sum(axis=1) != 0, 1, 0).sum()
def count_rows_with_nans(X): """Count the number of rows in 2D arrays that contain any nan values.""" if X.ndim == 2: return np.where(np.isnan(X).sum(axis=1) != 0, 1, 0).sum()
[ "Count", "the", "number", "of", "rows", "in", "2D", "arrays", "that", "contain", "any", "nan", "values", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/nan_warnings.py#L69-L72
[ "def", "count_rows_with_nans", "(", "X", ")", ":", "if", "X", ".", "ndim", "==", "2", ":", "return", "np", ".", "where", "(", "np", ".", "isnan", "(", "X", ")", ".", "sum", "(", "axis", "=", "1", ")", "!=", "0", ",", "1", ",", "0", ")", "."...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
StatsModelsWrapper.fit
Pretend to be a sklearn estimator, fit is called on creation
yellowbrick/contrib/statsmodels/base.py
def fit(self, X, y): """ Pretend to be a sklearn estimator, fit is called on creation """ # note that GLM takes endog (y) and then exog (X): # this is the reverse of sklearn's methods self.glm_model = self.glm_partial(y, X) self.glm_results = self.glm_model.fit()...
def fit(self, X, y): """ Pretend to be a sklearn estimator, fit is called on creation """ # note that GLM takes endog (y) and then exog (X): # this is the reverse of sklearn's methods self.glm_model = self.glm_partial(y, X) self.glm_results = self.glm_model.fit()...
[ "Pretend", "to", "be", "a", "sklearn", "estimator", "fit", "is", "called", "on", "creation" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/statsmodels/base.py#L69-L78
[ "def", "fit", "(", "self", ",", "X", ",", "y", ")", ":", "# note that GLM takes endog (y) and then exog (X):", "# this is the reverse of sklearn's methods", "self", ".", "glm_model", "=", "self", ".", "glm_partial", "(", "y", ",", "X", ")", "self", ".", "glm_resul...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
missing_dispersion
The Missing Values Dispersion visualizer shows the locations of missing (nan) values in the feature dataset by the order of the index. When y targets are supplied to fit, the output dispersion plot is color coded according to the target y that the element refers to. Parameters ---------- alpha...
yellowbrick/contrib/missing/dispersion.py
def missing_dispersion(X, y=None, ax=None, classes=None, alpha=0.5, marker="|", **kwargs): """ The Missing Values Dispersion visualizer shows the locations of missing (nan) values in the feature dataset by the order of the index. When y targets are supplied to fit, the output dispersion plot is color ...
def missing_dispersion(X, y=None, ax=None, classes=None, alpha=0.5, marker="|", **kwargs): """ The Missing Values Dispersion visualizer shows the locations of missing (nan) values in the feature dataset by the order of the index. When y targets are supplied to fit, the output dispersion plot is color ...
[ "The", "Missing", "Values", "Dispersion", "visualizer", "shows", "the", "locations", "of", "missing", "(", "nan", ")", "values", "in", "the", "feature", "dataset", "by", "the", "order", "of", "the", "index", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/dispersion.py#L176-L226
[ "def", "missing_dispersion", "(", "X", ",", "y", "=", "None", ",", "ax", "=", "None", ",", "classes", "=", "None", ",", "alpha", "=", "0.5", ",", "marker", "=", "\"|\"", ",", "*", "*", "kwargs", ")", ":", "# Instantiate the visualizer", "visualizer", "...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
MissingValuesDispersion.get_nan_locs
Gets the locations of nans in feature data and returns the coordinates in the matrix
yellowbrick/contrib/missing/dispersion.py
def get_nan_locs(self, **kwargs): """Gets the locations of nans in feature data and returns the coordinates in the matrix """ if np.issubdtype(self.X.dtype, np.string_) or np.issubdtype(self.X.dtype, np.unicode_): mask = np.where( self.X == '' ) nan_matrix = np.ze...
def get_nan_locs(self, **kwargs): """Gets the locations of nans in feature data and returns the coordinates in the matrix """ if np.issubdtype(self.X.dtype, np.string_) or np.issubdtype(self.X.dtype, np.unicode_): mask = np.where( self.X == '' ) nan_matrix = np.ze...
[ "Gets", "the", "locations", "of", "nans", "in", "feature", "data", "and", "returns", "the", "coordinates", "in", "the", "matrix" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/dispersion.py#L93-L115
[ "def", "get_nan_locs", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "np", ".", "issubdtype", "(", "self", ".", "X", ".", "dtype", ",", "np", ".", "string_", ")", "or", "np", ".", "issubdtype", "(", "self", ".", "X", ".", "dtype", ",", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
MissingValuesDispersion.draw
Called from the fit method, this method creates a scatter plot that draws each instance as a class or target colored point, whose location is determined by the feature data set. If y is not None, then it draws a scatter plot where each class is in a different color.
yellowbrick/contrib/missing/dispersion.py
def draw(self, X, y, **kwargs): """Called from the fit method, this method creates a scatter plot that draws each instance as a class or target colored point, whose location is determined by the feature data set. If y is not None, then it draws a scatter plot where each class is in a ...
def draw(self, X, y, **kwargs): """Called from the fit method, this method creates a scatter plot that draws each instance as a class or target colored point, whose location is determined by the feature data set. If y is not None, then it draws a scatter plot where each class is in a ...
[ "Called", "from", "the", "fit", "method", "this", "method", "creates", "a", "scatter", "plot", "that", "draws", "each", "instance", "as", "a", "class", "or", "target", "colored", "point", "whose", "location", "is", "determined", "by", "the", "feature", "data...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/dispersion.py#L117-L130
[ "def", "draw", "(", "self", ",", "X", ",", "y", ",", "*", "*", "kwargs", ")", ":", "nan_locs", "=", "self", ".", "get_nan_locs", "(", ")", "if", "y", "is", "None", ":", "x_", ",", "y_", "=", "list", "(", "zip", "(", "*", "nan_locs", ")", ")",...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
MissingValuesDispersion.draw_multi_dispersion_chart
Draws a multi dimensional dispersion chart, each color corresponds to a different target variable.
yellowbrick/contrib/missing/dispersion.py
def draw_multi_dispersion_chart(self, nan_locs): """Draws a multi dimensional dispersion chart, each color corresponds to a different target variable. """ for index, nan_values in enumerate(nan_locs): label, nan_locations = nan_values # if features passed in then...
def draw_multi_dispersion_chart(self, nan_locs): """Draws a multi dimensional dispersion chart, each color corresponds to a different target variable. """ for index, nan_values in enumerate(nan_locs): label, nan_locations = nan_values # if features passed in then...
[ "Draws", "a", "multi", "dimensional", "dispersion", "chart", "each", "color", "corresponds", "to", "a", "different", "target", "variable", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/dispersion.py#L132-L146
[ "def", "draw_multi_dispersion_chart", "(", "self", ",", "nan_locs", ")", ":", "for", "index", ",", "nan_values", "in", "enumerate", "(", "nan_locs", ")", ":", "label", ",", "nan_locations", "=", "nan_values", "# if features passed in then, label as such", "if", "sel...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
param_projection
Projects the grid search results onto 2 dimensions. The display value is taken as the max over the non-displayed dimensions. Parameters ---------- cv_results : dict A dictionary of results from the `GridSearchCV` object's `cv_results_` attribute. x_param : string The name ...
yellowbrick/gridsearch/base.py
def param_projection(cv_results, x_param, y_param, metric='mean_test_score'): """ Projects the grid search results onto 2 dimensions. The display value is taken as the max over the non-displayed dimensions. Parameters ---------- cv_results : dict A dictionary of results from the `GridS...
def param_projection(cv_results, x_param, y_param, metric='mean_test_score'): """ Projects the grid search results onto 2 dimensions. The display value is taken as the max over the non-displayed dimensions. Parameters ---------- cv_results : dict A dictionary of results from the `GridS...
[ "Projects", "the", "grid", "search", "results", "onto", "2", "dimensions", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/gridsearch/base.py#L21-L111
[ "def", "param_projection", "(", "cv_results", ",", "x_param", ",", "y_param", ",", "metric", "=", "'mean_test_score'", ")", ":", "# Extract the parameter values and score corresponding to each gridsearch", "# trial.", "# These are masked arrays where the cases where each parameter is...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
GridSearchVisualizer.param_projection
Projects the grid search results onto 2 dimensions. The wrapped GridSearch object is assumed to be fit already. The display value is taken as the max over the non-displayed dimensions. Parameters ---------- x_param : string The name of the parameter to be visualized...
yellowbrick/gridsearch/base.py
def param_projection(self, x_param, y_param, metric): """ Projects the grid search results onto 2 dimensions. The wrapped GridSearch object is assumed to be fit already. The display value is taken as the max over the non-displayed dimensions. Parameters ---------- ...
def param_projection(self, x_param, y_param, metric): """ Projects the grid search results onto 2 dimensions. The wrapped GridSearch object is assumed to be fit already. The display value is taken as the max over the non-displayed dimensions. Parameters ---------- ...
[ "Projects", "the", "grid", "search", "results", "onto", "2", "dimensions", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/gridsearch/base.py#L134-L163
[ "def", "param_projection", "(", "self", ",", "x_param", ",", "y_param", ",", "metric", ")", ":", "return", "param_projection", "(", "self", ".", "estimator", ".", "cv_results_", ",", "x_param", ",", "y_param", ",", "metric", ")" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
KneeLocator.__threshold
Calculates the difference threshold for a given difference local maximum. Parameters ----------- ymx_i : float The normalized y value of a local maximum.
yellowbrick/utils/kneed.py
def __threshold(self, ymx_i): """ Calculates the difference threshold for a given difference local maximum. Parameters ----------- ymx_i : float The normalized y value of a local maximum. """ return ymx_i - (self.S * np.diff(self.xsn).mean())
def __threshold(self, ymx_i): """ Calculates the difference threshold for a given difference local maximum. Parameters ----------- ymx_i : float The normalized y value of a local maximum. """ return ymx_i - (self.S * np.diff(self.xsn).mean())
[ "Calculates", "the", "difference", "threshold", "for", "a", "given", "difference", "local", "maximum", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/kneed.py#L143-L153
[ "def", "__threshold", "(", "self", ",", "ymx_i", ")", ":", "return", "ymx_i", "-", "(", "self", ".", "S", "*", "np", ".", "diff", "(", "self", ".", "xsn", ")", ".", "mean", "(", ")", ")" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
KneeLocator.find_knee
Finds and returns the "knee"or "elbow" value, the normalized knee value, and the x value where the knee is located.
yellowbrick/utils/kneed.py
def find_knee(self, ): """ Finds and returns the "knee"or "elbow" value, the normalized knee value, and the x value where the knee is located. """ if not self.xmx_idx.size: warning_message = \ 'No "knee" or "elbow point" detected ' \ '...
def find_knee(self, ): """ Finds and returns the "knee"or "elbow" value, the normalized knee value, and the x value where the knee is located. """ if not self.xmx_idx.size: warning_message = \ 'No "knee" or "elbow point" detected ' \ '...
[ "Finds", "and", "returns", "the", "knee", "or", "elbow", "value", "the", "normalized", "knee", "value", "and", "the", "x", "value", "where", "the", "knee", "is", "located", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/kneed.py#L155-L199
[ "def", "find_knee", "(", "self", ",", ")", ":", "if", "not", "self", ".", "xmx_idx", ".", "size", ":", "warning_message", "=", "'No \"knee\" or \"elbow point\" detected '", "'This could be due to bad clustering, no '", "'actual clusters being formed etc.'", "warnings", ".",...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
KneeLocator.plot_knee_normalized
Plots the normalized curve, the distance curve (xd, ysn) and the knee, if it exists.
yellowbrick/utils/kneed.py
def plot_knee_normalized(self, ): """ Plots the normalized curve, the distance curve (xd, ysn) and the knee, if it exists. """ import matplotlib.pyplot as plt plt.figure(figsize=(8, 8)) plt.plot(self.xsn, self.ysn) plt.plot(self.xd, self.yd, 'r') ...
def plot_knee_normalized(self, ): """ Plots the normalized curve, the distance curve (xd, ysn) and the knee, if it exists. """ import matplotlib.pyplot as plt plt.figure(figsize=(8, 8)) plt.plot(self.xsn, self.ysn) plt.plot(self.xd, self.yd, 'r') ...
[ "Plots", "the", "normalized", "curve", "the", "distance", "curve", "(", "xd", "ysn", ")", "and", "the", "knee", "if", "it", "exists", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/kneed.py#L201-L215
[ "def", "plot_knee_normalized", "(", "self", ",", ")", ":", "import", "matplotlib", ".", "pyplot", "as", "plt", "plt", ".", "figure", "(", "figsize", "=", "(", "8", ",", "8", ")", ")", "plt", ".", "plot", "(", "self", ".", "xsn", ",", "self", ".", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
KneeLocator.plot_knee
Plot the curve and the knee, if it exists
yellowbrick/utils/kneed.py
def plot_knee(self, ): """ Plot the curve and the knee, if it exists """ import matplotlib.pyplot as plt plt.figure(figsize=(8, 8)) plt.plot(self.x, self.y) plt.vlines(self.knee, plt.ylim()[0], plt.ylim()[1])
def plot_knee(self, ): """ Plot the curve and the knee, if it exists """ import matplotlib.pyplot as plt plt.figure(figsize=(8, 8)) plt.plot(self.x, self.y) plt.vlines(self.knee, plt.ylim()[0], plt.ylim()[1])
[ "Plot", "the", "curve", "and", "the", "knee", "if", "it", "exists" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/kneed.py#L217-L226
[ "def", "plot_knee", "(", "self", ",", ")", ":", "import", "matplotlib", ".", "pyplot", "as", "plt", "plt", ".", "figure", "(", "figsize", "=", "(", "8", ",", "8", ")", ")", "plt", ".", "plot", "(", "self", ".", "x", ",", "self", ".", "y", ")", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
AlphaSelection.fit
A simple pass-through method; calls fit on the estimator and then draws the alpha-error plot.
yellowbrick/regressor/alphas.py
def fit(self, X, y, **kwargs): """ A simple pass-through method; calls fit on the estimator and then draws the alpha-error plot. """ self.estimator.fit(X, y, **kwargs) self.draw() return self
def fit(self, X, y, **kwargs): """ A simple pass-through method; calls fit on the estimator and then draws the alpha-error plot. """ self.estimator.fit(X, y, **kwargs) self.draw() return self
[ "A", "simple", "pass", "-", "through", "method", ";", "calls", "fit", "on", "the", "estimator", "and", "then", "draws", "the", "alpha", "-", "error", "plot", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/regressor/alphas.py#L128-L135
[ "def", "fit", "(", "self", ",", "X", ",", "y", ",", "*", "*", "kwargs", ")", ":", "self", ".", "estimator", ".", "fit", "(", "X", ",", "y", ",", "*", "*", "kwargs", ")", "self", ".", "draw", "(", ")", "return", "self" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
AlphaSelection.score
Simply returns the score of the underlying CV model
yellowbrick/regressor/alphas.py
def score(self, X, y, **kwargs): """ Simply returns the score of the underlying CV model """ return self.estimator.score(X, y, **kwargs)
def score(self, X, y, **kwargs): """ Simply returns the score of the underlying CV model """ return self.estimator.score(X, y, **kwargs)
[ "Simply", "returns", "the", "score", "of", "the", "underlying", "CV", "model" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/regressor/alphas.py#L137-L141
[ "def", "score", "(", "self", ",", "X", ",", "y", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "estimator", ".", "score", "(", "X", ",", "y", ",", "*", "*", "kwargs", ")" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
AlphaSelection.draw
Draws the alpha plot based on the values on the estimator.
yellowbrick/regressor/alphas.py
def draw(self): """ Draws the alpha plot based on the values on the estimator. """ # Search for the correct parameters on the estimator. alphas = self._find_alphas_param() errors = self._find_errors_param() alpha = self.estimator.alpha_ # Get decision from the e...
def draw(self): """ Draws the alpha plot based on the values on the estimator. """ # Search for the correct parameters on the estimator. alphas = self._find_alphas_param() errors = self._find_errors_param() alpha = self.estimator.alpha_ # Get decision from the e...
[ "Draws", "the", "alpha", "plot", "based", "on", "the", "values", "on", "the", "estimator", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/regressor/alphas.py#L143-L162
[ "def", "draw", "(", "self", ")", ":", "# Search for the correct parameters on the estimator.", "alphas", "=", "self", ".", "_find_alphas_param", "(", ")", "errors", "=", "self", ".", "_find_errors_param", "(", ")", "alpha", "=", "self", ".", "estimator", ".", "a...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
AlphaSelection._find_alphas_param
Searches for the parameter on the estimator that contains the array of alphas that was used to produce the error selection. If it cannot find the parameter then a YellowbrickValueError is raised.
yellowbrick/regressor/alphas.py
def _find_alphas_param(self): """ Searches for the parameter on the estimator that contains the array of alphas that was used to produce the error selection. If it cannot find the parameter then a YellowbrickValueError is raised. """ # NOTE: The order of the search is ve...
def _find_alphas_param(self): """ Searches for the parameter on the estimator that contains the array of alphas that was used to produce the error selection. If it cannot find the parameter then a YellowbrickValueError is raised. """ # NOTE: The order of the search is ve...
[ "Searches", "for", "the", "parameter", "on", "the", "estimator", "that", "contains", "the", "array", "of", "alphas", "that", "was", "used", "to", "produce", "the", "error", "selection", ".", "If", "it", "cannot", "find", "the", "parameter", "then", "a", "Y...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/regressor/alphas.py#L181-L199
[ "def", "_find_alphas_param", "(", "self", ")", ":", "# NOTE: The order of the search is very important!", "for", "attr", "in", "(", "\"cv_alphas_\"", ",", "\"alphas_\"", ",", "\"alphas\"", ",", ")", ":", "try", ":", "return", "getattr", "(", "self", ".", "estimato...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
AlphaSelection._find_errors_param
Searches for the parameter on the estimator that contains the array of errors that was used to determine the optimal alpha. If it cannot find the parameter then a YellowbrickValueError is raised.
yellowbrick/regressor/alphas.py
def _find_errors_param(self): """ Searches for the parameter on the estimator that contains the array of errors that was used to determine the optimal alpha. If it cannot find the parameter then a YellowbrickValueError is raised. """ # NOTE: The order of the search is ve...
def _find_errors_param(self): """ Searches for the parameter on the estimator that contains the array of errors that was used to determine the optimal alpha. If it cannot find the parameter then a YellowbrickValueError is raised. """ # NOTE: The order of the search is ve...
[ "Searches", "for", "the", "parameter", "on", "the", "estimator", "that", "contains", "the", "array", "of", "errors", "that", "was", "used", "to", "determine", "the", "optimal", "alpha", ".", "If", "it", "cannot", "find", "the", "parameter", "then", "a", "Y...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/regressor/alphas.py#L201-L219
[ "def", "_find_errors_param", "(", "self", ")", ":", "# NOTE: The order of the search is very important!", "if", "hasattr", "(", "self", ".", "estimator", ",", "'mse_path_'", ")", ":", "return", "self", ".", "estimator", ".", "mse_path_", ".", "mean", "(", "1", "...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
ManualAlphaSelection.fit
The fit method is the primary entry point for the manual alpha selection visualizer. It sets the alpha param for each alpha in the alphas list on the wrapped estimator, then scores the model using the passed in X and y data set. Those scores are then aggregated and drawn using matplotlib...
yellowbrick/regressor/alphas.py
def fit(self, X, y, **args): """ The fit method is the primary entry point for the manual alpha selection visualizer. It sets the alpha param for each alpha in the alphas list on the wrapped estimator, then scores the model using the passed in X and y data set. Those scores are t...
def fit(self, X, y, **args): """ The fit method is the primary entry point for the manual alpha selection visualizer. It sets the alpha param for each alpha in the alphas list on the wrapped estimator, then scores the model using the passed in X and y data set. Those scores are t...
[ "The", "fit", "method", "is", "the", "primary", "entry", "point", "for", "the", "manual", "alpha", "selection", "visualizer", ".", "It", "sets", "the", "alpha", "param", "for", "each", "alpha", "in", "the", "alphas", "list", "on", "the", "wrapped", "estima...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/regressor/alphas.py#L316-L335
[ "def", "fit", "(", "self", ",", "X", ",", "y", ",", "*", "*", "args", ")", ":", "self", ".", "errors", "=", "[", "]", "for", "alpha", "in", "self", ".", "alphas", ":", "self", ".", "estimator", ".", "set_params", "(", "alpha", "=", "alpha", ")"...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
ManualAlphaSelection.draw
Draws the alphas values against their associated error in a similar fashion to the AlphaSelection visualizer.
yellowbrick/regressor/alphas.py
def draw(self): """ Draws the alphas values against their associated error in a similar fashion to the AlphaSelection visualizer. """ # Plot the alpha against the error self.ax.plot(self.alphas, self.errors, label=self.name.lower()) # Draw a dashed vline at the a...
def draw(self): """ Draws the alphas values against their associated error in a similar fashion to the AlphaSelection visualizer. """ # Plot the alpha against the error self.ax.plot(self.alphas, self.errors, label=self.name.lower()) # Draw a dashed vline at the a...
[ "Draws", "the", "alphas", "values", "against", "their", "associated", "error", "in", "a", "similar", "fashion", "to", "the", "AlphaSelection", "visualizer", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/regressor/alphas.py#L343-L361
[ "def", "draw", "(", "self", ")", ":", "# Plot the alpha against the error", "self", ".", "ax", ".", "plot", "(", "self", ".", "alphas", ",", "self", ".", "errors", ",", "label", "=", "self", ".", "name", ".", "lower", "(", ")", ")", "# Draw a dashed vlin...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
postag
Display a barchart with the counts of different parts of speech in X, which consists of a part-of-speech-tagged corpus, which the visualizer expects to be a list of lists of lists of (token, tag) tuples. Parameters ---------- X : list or generator Should be provided as a list of documen...
yellowbrick/text/postag.py
def postag( X, ax=None, tagset="penn_treebank", colormap=None, colors=None, frequency=False, **kwargs ): """ Display a barchart with the counts of different parts of speech in X, which consists of a part-of-speech-tagged corpus, which the visualizer expects to be a list of li...
def postag( X, ax=None, tagset="penn_treebank", colormap=None, colors=None, frequency=False, **kwargs ): """ Display a barchart with the counts of different parts of speech in X, which consists of a part-of-speech-tagged corpus, which the visualizer expects to be a list of li...
[ "Display", "a", "barchart", "with", "the", "counts", "of", "different", "parts", "of", "speech", "in", "X", "which", "consists", "of", "a", "part", "-", "of", "-", "speech", "-", "tagged", "corpus", "which", "the", "visualizer", "expects", "to", "be", "a...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/postag.py#L369-L421
[ "def", "postag", "(", "X", ",", "ax", "=", "None", ",", "tagset", "=", "\"penn_treebank\"", ",", "colormap", "=", "None", ",", "colors", "=", "None", ",", "frequency", "=", "False", ",", "*", "*", "kwargs", ")", ":", "# Instantiate the visualizer", "visu...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
PosTagVisualizer.fit
Fits the corpus to the appropriate tag map. Text documents must be tokenized & tagged before passing to fit. Parameters ---------- X : list or generator Should be provided as a list of documents or a generator that yields a list of documents that contain a list o...
yellowbrick/text/postag.py
def fit(self, X, y=None, **kwargs): """ Fits the corpus to the appropriate tag map. Text documents must be tokenized & tagged before passing to fit. Parameters ---------- X : list or generator Should be provided as a list of documents or a generator ...
def fit(self, X, y=None, **kwargs): """ Fits the corpus to the appropriate tag map. Text documents must be tokenized & tagged before passing to fit. Parameters ---------- X : list or generator Should be provided as a list of documents or a generator ...
[ "Fits", "the", "corpus", "to", "the", "appropriate", "tag", "map", ".", "Text", "documents", "must", "be", "tokenized", "&", "tagged", "before", "passing", "to", "fit", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/postag.py#L118-L152
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# TODO: add support for other tagsets?", "if", "self", ".", "tagset", "==", "\"penn_treebank\"", ":", "self", ".", "pos_tag_counts_", "=", "self", ".", "_penn_t...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
PosTagVisualizer._handle_universal
Scan through the corpus to compute counts of each Universal Dependencies part-of-speech. Parameters ---------- X : list or generator Should be provided as a list of documents or a generator that yields a list of documents that contain a list of senten...
yellowbrick/text/postag.py
def _handle_universal(self, X): """ Scan through the corpus to compute counts of each Universal Dependencies part-of-speech. Parameters ---------- X : list or generator Should be provided as a list of documents or a generator that yields a list of...
def _handle_universal(self, X): """ Scan through the corpus to compute counts of each Universal Dependencies part-of-speech. Parameters ---------- X : list or generator Should be provided as a list of documents or a generator that yields a list of...
[ "Scan", "through", "the", "corpus", "to", "compute", "counts", "of", "each", "Universal", "Dependencies", "part", "-", "of", "-", "speech", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/postag.py#L202-L236
[ "def", "_handle_universal", "(", "self", ",", "X", ")", ":", "jump", "=", "{", "# combine proper and regular nouns", "\"NOUN\"", ":", "\"noun\"", ",", "\"PROPN\"", ":", "\"noun\"", ",", "\"ADJ\"", ":", "\"adjective\"", ",", "\"VERB\"", ":", "\"verb\"", ",", "#...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
PosTagVisualizer._handle_treebank
Create a part-of-speech tag mapping using the Penn Treebank tags Parameters ---------- X : list or generator Should be provided as a list of documents or a generator that yields a list of documents that contain a list of sentences that contain (token, tag) tu...
yellowbrick/text/postag.py
def _handle_treebank(self, X): """ Create a part-of-speech tag mapping using the Penn Treebank tags Parameters ---------- X : list or generator Should be provided as a list of documents or a generator that yields a list of documents that contain a list of...
def _handle_treebank(self, X): """ Create a part-of-speech tag mapping using the Penn Treebank tags Parameters ---------- X : list or generator Should be provided as a list of documents or a generator that yields a list of documents that contain a list of...
[ "Create", "a", "part", "-", "of", "-", "speech", "tag", "mapping", "using", "the", "Penn", "Treebank", "tags" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/postag.py#L238-L293
[ "def", "_handle_treebank", "(", "self", ",", "X", ")", ":", "for", "tagged_doc", "in", "X", ":", "for", "tagged_sent", "in", "tagged_doc", ":", "for", "_", ",", "tag", "in", "tagged_sent", ":", "if", "tag", ".", "startswith", "(", "\"N\"", ")", ":", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
PosTagVisualizer.draw
Called from the fit method, this method creates the canvas and draws the part-of-speech tag mapping as a bar chart. Parameters ---------- kwargs: dict generic keyword arguments. Returns ------- ax : matplotlib axes Axes on which the PosTa...
yellowbrick/text/postag.py
def draw(self, **kwargs): """ Called from the fit method, this method creates the canvas and draws the part-of-speech tag mapping as a bar chart. Parameters ---------- kwargs: dict generic keyword arguments. Returns ------- ax : matpl...
def draw(self, **kwargs): """ Called from the fit method, this method creates the canvas and draws the part-of-speech tag mapping as a bar chart. Parameters ---------- kwargs: dict generic keyword arguments. Returns ------- ax : matpl...
[ "Called", "from", "the", "fit", "method", "this", "method", "creates", "the", "canvas", "and", "draws", "the", "part", "-", "of", "-", "speech", "tag", "mapping", "as", "a", "bar", "chart", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/postag.py#L295-L331
[ "def", "draw", "(", "self", ",", "*", "*", "kwargs", ")", ":", "colors", "=", "resolve_colors", "(", "n_colors", "=", "len", "(", "self", ".", "pos_tag_counts_", ")", ",", "colormap", "=", "self", ".", "colormap", ",", "colors", "=", "self", ".", "co...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
PosTagVisualizer.finalize
Finalize the plot with ticks, labels, and title Parameters ---------- kwargs: dict generic keyword arguments.
yellowbrick/text/postag.py
def finalize(self, **kwargs): """ Finalize the plot with ticks, labels, and title Parameters ---------- kwargs: dict generic keyword arguments. """ # NOTE: not deduping here, so this is total, not unique self.set_title( "PosTag plo...
def finalize(self, **kwargs): """ Finalize the plot with ticks, labels, and title Parameters ---------- kwargs: dict generic keyword arguments. """ # NOTE: not deduping here, so this is total, not unique self.set_title( "PosTag plo...
[ "Finalize", "the", "plot", "with", "ticks", "labels", "and", "title" ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/postag.py#L333-L361
[ "def", "finalize", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# NOTE: not deduping here, so this is total, not unique", "self", ".", "set_title", "(", "\"PosTag plot for {}-token corpus\"", ".", "format", "(", "(", "sum", "(", "self", ".", "pos_tag_counts_", "...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
tsne
Display a projection of a vectorized corpus in two dimensions using TSNE, a nonlinear dimensionality reduction method that is particularly well suited to embedding in two or three dimensions for visualization as a scatter plot. TSNE is widely used in text analysis to show clusters or groups of documents...
yellowbrick/text/tsne.py
def tsne(X, y=None, ax=None, decompose='svd', decompose_by=50, classes=None, colors=None, colormap=None, alpha=0.7, **kwargs): """ Display a projection of a vectorized corpus in two dimensions using TSNE, a nonlinear dimensionality reduction method that is particularly well suited to embeddin...
def tsne(X, y=None, ax=None, decompose='svd', decompose_by=50, classes=None, colors=None, colormap=None, alpha=0.7, **kwargs): """ Display a projection of a vectorized corpus in two dimensions using TSNE, a nonlinear dimensionality reduction method that is particularly well suited to embeddin...
[ "Display", "a", "projection", "of", "a", "vectorized", "corpus", "in", "two", "dimensions", "using", "TSNE", "a", "nonlinear", "dimensionality", "reduction", "method", "that", "is", "particularly", "well", "suited", "to", "embedding", "in", "two", "or", "three",...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/tsne.py#L38-L104
[ "def", "tsne", "(", "X", ",", "y", "=", "None", ",", "ax", "=", "None", ",", "decompose", "=", "'svd'", ",", "decompose_by", "=", "50", ",", "classes", "=", "None", ",", "colors", "=", "None", ",", "colormap", "=", "None", ",", "alpha", "=", "0.7...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
TSNEVisualizer.make_transformer
Creates an internal transformer pipeline to project the data set into 2D space using TSNE, applying an pre-decomposition technique ahead of embedding if necessary. This method will reset the transformer on the class, and can be used to explore different decompositions. Parameters ...
yellowbrick/text/tsne.py
def make_transformer(self, decompose='svd', decompose_by=50, tsne_kwargs={}): """ Creates an internal transformer pipeline to project the data set into 2D space using TSNE, applying an pre-decomposition technique ahead of embedding if necessary. This method will reset the transformer on ...
def make_transformer(self, decompose='svd', decompose_by=50, tsne_kwargs={}): """ Creates an internal transformer pipeline to project the data set into 2D space using TSNE, applying an pre-decomposition technique ahead of embedding if necessary. This method will reset the transformer on ...
[ "Creates", "an", "internal", "transformer", "pipeline", "to", "project", "the", "data", "set", "into", "2D", "space", "using", "TSNE", "applying", "an", "pre", "-", "decomposition", "technique", "ahead", "of", "embedding", "if", "necessary", ".", "This", "meth...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/tsne.py#L200-L255
[ "def", "make_transformer", "(", "self", ",", "decompose", "=", "'svd'", ",", "decompose_by", "=", "50", ",", "tsne_kwargs", "=", "{", "}", ")", ":", "# TODO: detect decompose by inferring from sparse matrix or dense or", "# If number of features > 50 etc.", "decompositions"...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
TSNEVisualizer.finalize
Finalize the drawing by adding a title and legend, and removing the axes objects that do not convey information about TNSE.
yellowbrick/text/tsne.py
def finalize(self, **kwargs): """ Finalize the drawing by adding a title and legend, and removing the axes objects that do not convey information about TNSE. """ self.set_title( "TSNE Projection of {} Documents".format(self.n_instances_) ) # Remove th...
def finalize(self, **kwargs): """ Finalize the drawing by adding a title and legend, and removing the axes objects that do not convey information about TNSE. """ self.set_title( "TSNE Projection of {} Documents".format(self.n_instances_) ) # Remove th...
[ "Finalize", "the", "drawing", "by", "adding", "a", "title", "and", "legend", "and", "removing", "the", "axes", "objects", "that", "do", "not", "convey", "information", "about", "TNSE", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/tsne.py#L352-L372
[ "def", "finalize", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "set_title", "(", "\"TSNE Projection of {} Documents\"", ".", "format", "(", "self", ".", "n_instances_", ")", ")", "# Remove the ticks", "self", ".", "ax", ".", "set_yticks", "(...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
get_version
Reads the python file defined in the VERSION_PATH to find the get_version function, and executes it to ensure that it is loaded correctly. Separating the version in this way ensures no additional code is executed.
setup.py
def get_version(path=VERSION_PATH): """ Reads the python file defined in the VERSION_PATH to find the get_version function, and executes it to ensure that it is loaded correctly. Separating the version in this way ensures no additional code is executed. """ namespace = {} exec(read(path), na...
def get_version(path=VERSION_PATH): """ Reads the python file defined in the VERSION_PATH to find the get_version function, and executes it to ensure that it is loaded correctly. Separating the version in this way ensures no additional code is executed. """ namespace = {} exec(read(path), na...
[ "Reads", "the", "python", "file", "defined", "in", "the", "VERSION_PATH", "to", "find", "the", "get_version", "function", "and", "executes", "it", "to", "ensure", "that", "it", "is", "loaded", "correctly", ".", "Separating", "the", "version", "in", "this", "...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/setup.py#L91-L99
[ "def", "get_version", "(", "path", "=", "VERSION_PATH", ")", ":", "namespace", "=", "{", "}", "exec", "(", "read", "(", "path", ")", ",", "namespace", ")", "return", "namespace", "[", "'get_version'", "]", "(", "short", "=", "True", ")" ]
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
get_requires
Yields a generator of requirements as defined by the REQUIRE_PATH which should point to a requirements.txt output by `pip freeze`.
setup.py
def get_requires(path=REQUIRE_PATH): """ Yields a generator of requirements as defined by the REQUIRE_PATH which should point to a requirements.txt output by `pip freeze`. """ for line in read(path).splitlines(): line = line.strip() if line and not line.startswith('#'): y...
def get_requires(path=REQUIRE_PATH): """ Yields a generator of requirements as defined by the REQUIRE_PATH which should point to a requirements.txt output by `pip freeze`. """ for line in read(path).splitlines(): line = line.strip() if line and not line.startswith('#'): y...
[ "Yields", "a", "generator", "of", "requirements", "as", "defined", "by", "the", "REQUIRE_PATH", "which", "should", "point", "to", "a", "requirements", ".", "txt", "output", "by", "pip", "freeze", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/setup.py#L102-L110
[ "def", "get_requires", "(", "path", "=", "REQUIRE_PATH", ")", ":", "for", "line", "in", "read", "(", "path", ")", ".", "splitlines", "(", ")", ":", "line", "=", "line", ".", "strip", "(", ")", "if", "line", "and", "not", "line", ".", "startswith", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
get_description_type
Returns the long_description_content_type based on the extension of the package describe path (e.g. .txt, .rst, or .md).
setup.py
def get_description_type(path=PKG_DESCRIBE): """ Returns the long_description_content_type based on the extension of the package describe path (e.g. .txt, .rst, or .md). """ _, ext = os.path.splitext(path) return { ".rst": "text/x-rst", ".txt": "text/plain", ".md": "text/...
def get_description_type(path=PKG_DESCRIBE): """ Returns the long_description_content_type based on the extension of the package describe path (e.g. .txt, .rst, or .md). """ _, ext = os.path.splitext(path) return { ".rst": "text/x-rst", ".txt": "text/plain", ".md": "text/...
[ "Returns", "the", "long_description_content_type", "based", "on", "the", "extension", "of", "the", "package", "describe", "path", "(", "e", ".", "g", ".", ".", "txt", ".", "rst", "or", ".", "md", ")", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/setup.py#L113-L123
[ "def", "get_description_type", "(", "path", "=", "PKG_DESCRIBE", ")", ":", "_", ",", "ext", "=", "os", ".", "path", ".", "splitext", "(", "path", ")", "return", "{", "\".rst\"", ":", "\"text/x-rst\"", ",", "\".txt\"", ":", "\"text/plain\"", ",", "\".md\"",...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
learning_curve
Displays a learning curve based on number of samples vs training and cross validation scores. The learning curve aims to show how a model learns and improves with experience. This helper function is a quick wrapper to utilize the LearningCurve for one-off analysis. Parameters ---------- mo...
yellowbrick/model_selection/learning_curve.py
def learning_curve(model, X, y, ax=None, groups=None, train_sizes=DEFAULT_TRAIN_SIZES, cv=None, scoring=None, exploit_incremental_learning=False, n_jobs=1, pre_dispatch="all", shuffle=False, random_state=None, **kwargs): """ Displays a learning curve b...
def learning_curve(model, X, y, ax=None, groups=None, train_sizes=DEFAULT_TRAIN_SIZES, cv=None, scoring=None, exploit_incremental_learning=False, n_jobs=1, pre_dispatch="all", shuffle=False, random_state=None, **kwargs): """ Displays a learning curve b...
[ "Displays", "a", "learning", "curve", "based", "on", "number", "of", "samples", "vs", "training", "and", "cross", "validation", "scores", ".", "The", "learning", "curve", "aims", "to", "show", "how", "a", "model", "learns", "and", "improves", "with", "experi...
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/model_selection/learning_curve.py#L289-L396
[ "def", "learning_curve", "(", "model", ",", "X", ",", "y", ",", "ax", "=", "None", ",", "groups", "=", "None", ",", "train_sizes", "=", "DEFAULT_TRAIN_SIZES", ",", "cv", "=", "None", ",", "scoring", "=", "None", ",", "exploit_incremental_learning", "=", ...
59b67236a3862c73363e8edad7cd86da5b69e3b2
train
LearningCurve.fit
Fits the learning curve with the wrapped model to the specified data. Draws training and test score curves and saves the scores to the estimator. Parameters ---------- X : array-like, shape (n_samples, n_features) Training vector, where n_samples is the number of sam...
yellowbrick/model_selection/learning_curve.py
def fit(self, X, y=None): """ Fits the learning curve with the wrapped model to the specified data. Draws training and test score curves and saves the scores to the estimator. Parameters ---------- X : array-like, shape (n_samples, n_features) Trainin...
def fit(self, X, y=None): """ Fits the learning curve with the wrapped model to the specified data. Draws training and test score curves and saves the scores to the estimator. Parameters ---------- X : array-like, shape (n_samples, n_features) Trainin...
[ "Fits", "the", "learning", "curve", "with", "the", "wrapped", "model", "to", "the", "specified", "data", ".", "Draws", "training", "and", "test", "score", "curves", "and", "saves", "the", "scores", "to", "the", "estimator", "." ]
DistrictDataLabs/yellowbrick
python
https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/model_selection/learning_curve.py#L191-L237
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ")", ":", "# arguments to pass to sk_learning_curve", "sklc_kwargs", "=", "{", "key", ":", "self", ".", "get_params", "(", ")", "[", "key", "]", "for", "key", "in", "(", "'groups'", ",", "'tra...
59b67236a3862c73363e8edad7cd86da5b69e3b2