repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DistrictDataLabs/yellowbrick | yellowbrick/classifier/threshold.py | DiscriminationThreshold._split_fit_score_trial | def _split_fit_score_trial(self, X, y, idx=0):
"""
Splits the dataset, fits a clone of the estimator, then scores it
according to the required metrics.
The index of the split is added to the random_state if the
random_state is not None; this ensures that every split is shuffled
... | python | def _split_fit_score_trial(self, X, y, idx=0):
"""
Splits the dataset, fits a clone of the estimator, then scores it
according to the required metrics.
The index of the split is added to the random_state if the
random_state is not None; this ensures that every split is shuffled
... | [
"def",
"_split_fit_score_trial",
"(",
"self",
",",
"X",
",",
"y",
",",
"idx",
"=",
"0",
")",
":",
"random_state",
"=",
"self",
".",
"random_state",
"if",
"random_state",
"is",
"not",
"None",
":",
"random_state",
"+=",
"idx",
"splitter",
"=",
"self",
".",... | Splits the dataset, fits a clone of the estimator, then scores it
according to the required metrics.
The index of the split is added to the random_state if the
random_state is not None; this ensures that every split is shuffled
differently but in a deterministic fashion for testing purp... | [
"Splits",
"the",
"dataset",
"fits",
"a",
"clone",
"of",
"the",
"estimator",
"then",
"scores",
"it",
"according",
"to",
"the",
"required",
"metrics",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/threshold.py#L272-L331 | train | Splits the dataset X y and scores it by fitting the model and then scores it according to the required metrics. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/classifier/threshold.py | DiscriminationThreshold.draw | def draw(self):
"""
Draws the cv scores as a line chart on the current axes.
"""
# Set the colors from the supplied values or reasonable defaults
color_values = resolve_colors(n_colors=4, colors=self.color)
for idx, metric in enumerate(METRICS):
# Skip any ex... | python | def draw(self):
"""
Draws the cv scores as a line chart on the current axes.
"""
# Set the colors from the supplied values or reasonable defaults
color_values = resolve_colors(n_colors=4, colors=self.color)
for idx, metric in enumerate(METRICS):
# Skip any ex... | [
"def",
"draw",
"(",
"self",
")",
":",
"# Set the colors from the supplied values or reasonable defaults",
"color_values",
"=",
"resolve_colors",
"(",
"n_colors",
"=",
"4",
",",
"colors",
"=",
"self",
".",
"color",
")",
"for",
"idx",
",",
"metric",
"in",
"enumerate... | Draws the cv scores as a line chart on the current axes. | [
"Draws",
"the",
"cv",
"scores",
"as",
"a",
"line",
"chart",
"on",
"the",
"current",
"axes",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/threshold.py#L333-L381 | train | Draws cv scores as a line chart on the current axes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/classifier/threshold.py | DiscriminationThreshold._check_quantiles | def _check_quantiles(self, val):
"""
Validate the quantiles passed in. Returns the np array if valid.
"""
if len(val) != 3 or not is_monotonic(val) or not np.all(val < 1):
raise YellowbrickValueError(
"quantiles must be a sequence of three "
"m... | python | def _check_quantiles(self, val):
"""
Validate the quantiles passed in. Returns the np array if valid.
"""
if len(val) != 3 or not is_monotonic(val) or not np.all(val < 1):
raise YellowbrickValueError(
"quantiles must be a sequence of three "
"m... | [
"def",
"_check_quantiles",
"(",
"self",
",",
"val",
")",
":",
"if",
"len",
"(",
"val",
")",
"!=",
"3",
"or",
"not",
"is_monotonic",
"(",
"val",
")",
"or",
"not",
"np",
".",
"all",
"(",
"val",
"<",
"1",
")",
":",
"raise",
"YellowbrickValueError",
"(... | Validate the quantiles passed in. Returns the np array if valid. | [
"Validate",
"the",
"quantiles",
"passed",
"in",
".",
"Returns",
"the",
"np",
"array",
"if",
"valid",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/threshold.py#L403-L412 | train | Validate the quantiles passed in. Returns the np array if valid. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/classifier/threshold.py | DiscriminationThreshold._check_cv | def _check_cv(self, val, random_state=None):
"""
Validate the cv method passed in. Returns the split strategy if no
validation exception is raised.
"""
# Use default splitter in this case
if val is None: val = 0.1
if isinstance(val, float) and val <= 1.0:
... | python | def _check_cv(self, val, random_state=None):
"""
Validate the cv method passed in. Returns the split strategy if no
validation exception is raised.
"""
# Use default splitter in this case
if val is None: val = 0.1
if isinstance(val, float) and val <= 1.0:
... | [
"def",
"_check_cv",
"(",
"self",
",",
"val",
",",
"random_state",
"=",
"None",
")",
":",
"# Use default splitter in this case",
"if",
"val",
"is",
"None",
":",
"val",
"=",
"0.1",
"if",
"isinstance",
"(",
"val",
",",
"float",
")",
"and",
"val",
"<=",
"1.0... | Validate the cv method passed in. Returns the split strategy if no
validation exception is raised. | [
"Validate",
"the",
"cv",
"method",
"passed",
"in",
".",
"Returns",
"the",
"split",
"strategy",
"if",
"no",
"validation",
"exception",
"is",
"raised",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/threshold.py#L414-L434 | train | Validate the cv method passed in. Returns the split strategy if validation exception is raised. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/classifier/threshold.py | DiscriminationThreshold._check_exclude | def _check_exclude(self, val):
"""
Validate the excluded metrics. Returns the set of excluded params.
"""
if val is None:
exclude = frozenset()
elif isinstance(val, str):
exclude = frozenset([val.lower()])
else:
exclude = frozenset(map(... | python | def _check_exclude(self, val):
"""
Validate the excluded metrics. Returns the set of excluded params.
"""
if val is None:
exclude = frozenset()
elif isinstance(val, str):
exclude = frozenset([val.lower()])
else:
exclude = frozenset(map(... | [
"def",
"_check_exclude",
"(",
"self",
",",
"val",
")",
":",
"if",
"val",
"is",
"None",
":",
"exclude",
"=",
"frozenset",
"(",
")",
"elif",
"isinstance",
"(",
"val",
",",
"str",
")",
":",
"exclude",
"=",
"frozenset",
"(",
"[",
"val",
".",
"lower",
"... | Validate the excluded metrics. Returns the set of excluded params. | [
"Validate",
"the",
"excluded",
"metrics",
".",
"Returns",
"the",
"set",
"of",
"excluded",
"params",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/threshold.py#L436-L452 | train | Validate the excluded metrics. Returns the set of excluded params. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/contrib/classifier/boundaries.py | decisionviz | def decisionviz(model,
X,
y,
colors=None,
classes=None,
features=None,
show_scatter=True,
step_size=0.0025,
markers=None,
pcolormesh_alpha=0.8,
scatter_alpha=1.... | python | def decisionviz(model,
X,
y,
colors=None,
classes=None,
features=None,
show_scatter=True,
step_size=0.0025,
markers=None,
pcolormesh_alpha=0.8,
scatter_alpha=1.... | [
"def",
"decisionviz",
"(",
"model",
",",
"X",
",",
"y",
",",
"colors",
"=",
"None",
",",
"classes",
"=",
"None",
",",
"features",
"=",
"None",
",",
"show_scatter",
"=",
"True",
",",
"step_size",
"=",
"0.0025",
",",
"markers",
"=",
"None",
",",
"pcolo... | DecisionBoundariesVisualizer is a bivariate data visualization algorithm
that plots the decision boundaries of each class.
This helper function is a quick wrapper to utilize the
DecisionBoundariesVisualizers for one-off analysis.
Parameters
----------
model : the Scikit-Learn estimator, re... | [
"DecisionBoundariesVisualizer",
"is",
"a",
"bivariate",
"data",
"visualization",
"algorithm",
"that",
"plots",
"the",
"decision",
"boundaries",
"of",
"each",
"class",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/classifier/boundaries.py#L32-L121 | train | This function is a quick wrapper to utilize the decision boundaries visualizer for one - off analysis. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/utils.py | find_text_color | def find_text_color(base_color, dark_color="black", light_color="white", coef_choice=0):
"""
Takes a background color and returns the appropriate light or dark text color.
Users can specify the dark and light text color, or accept the defaults of 'black' and 'white'
base_color: The color of the backgro... | python | def find_text_color(base_color, dark_color="black", light_color="white", coef_choice=0):
"""
Takes a background color and returns the appropriate light or dark text color.
Users can specify the dark and light text color, or accept the defaults of 'black' and 'white'
base_color: The color of the backgro... | [
"def",
"find_text_color",
"(",
"base_color",
",",
"dark_color",
"=",
"\"black\"",
",",
"light_color",
"=",
"\"white\"",
",",
"coef_choice",
"=",
"0",
")",
":",
"#Coefficients:",
"# option 0: http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-... | Takes a background color and returns the appropriate light or dark text color.
Users can specify the dark and light text color, or accept the defaults of 'black' and 'white'
base_color: The color of the background. This must be
specified in RGBA with values between 0 and 1 (note, this is the default
... | [
"Takes",
"a",
"background",
"color",
"and",
"returns",
"the",
"appropriate",
"light",
"or",
"dark",
"text",
"color",
".",
"Users",
"can",
"specify",
"the",
"dark",
"and",
"light",
"text",
"color",
"or",
"accept",
"the",
"defaults",
"of",
"black",
"and",
"w... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/utils.py#L12-L48 | train | This function returns the appropriate light or dark text color for the current locale. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/importances.py | feature_importances | def feature_importances(model, X, y=None, ax=None, labels=None,
relative=True, absolute=False, xlabel=None,
stack=False, **kwargs):
"""
Displays the most informative features in a model by showing a bar chart
of features ranked by their importances. Although p... | python | def feature_importances(model, X, y=None, ax=None, labels=None,
relative=True, absolute=False, xlabel=None,
stack=False, **kwargs):
"""
Displays the most informative features in a model by showing a bar chart
of features ranked by their importances. Although p... | [
"def",
"feature_importances",
"(",
"model",
",",
"X",
",",
"y",
"=",
"None",
",",
"ax",
"=",
"None",
",",
"labels",
"=",
"None",
",",
"relative",
"=",
"True",
",",
"absolute",
"=",
"False",
",",
"xlabel",
"=",
"None",
",",
"stack",
"=",
"False",
",... | Displays the most informative features in a model by showing a bar chart
of features ranked by their importances. Although primarily a feature
engineering mechanism, this visualizer requires a model that has either a
``coef_`` or ``feature_importances_`` parameter after fit.
Parameters
----------
... | [
"Displays",
"the",
"most",
"informative",
"features",
"in",
"a",
"model",
"by",
"showing",
"a",
"bar",
"chart",
"of",
"features",
"ranked",
"by",
"their",
"importances",
".",
"Although",
"primarily",
"a",
"feature",
"engineering",
"mechanism",
"this",
"visualize... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/importances.py#L320-L385 | train | Displays the most informative features in a model by ranking them by their importances. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/importances.py | FeatureImportances.fit | def fit(self, X, y=None, **kwargs):
"""
Fits the estimator to discover the feature importances described by
the data, then draws those importances as a bar plot.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m feat... | python | def fit(self, X, y=None, **kwargs):
"""
Fits the estimator to discover the feature importances described by
the data, then draws those importances as a bar plot.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m feat... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"FeatureImportances",
",",
"self",
")",
".",
"fit",
"(",
"X",
",",
"y",
",",
"*",
"*",
"kwargs",
")",
"# Get the feature importances from the... | Fits the estimator to discover the feature importances described by
the data, then draws those importances as a bar plot.
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",
"discover",
"the",
"feature",
"importances",
"described",
"by",
"the",
"data",
"then",
"draws",
"those",
"importances",
"as",
"a",
"bar",
"plot",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/importances.py#L116-L196 | train | Fits the estimator to discover the feature importances described by the data X then draws those importances as a bar plot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/importances.py | FeatureImportances.draw | def draw(self, **kwargs):
"""
Draws the feature importances as a bar chart; called from fit.
"""
# Quick validation
for param in ('feature_importances_', 'features_'):
if not hasattr(self, param):
raise NotFitted("missing required param '{}'".format(pa... | python | def draw(self, **kwargs):
"""
Draws the feature importances as a bar chart; called from fit.
"""
# Quick validation
for param in ('feature_importances_', 'features_'):
if not hasattr(self, param):
raise NotFitted("missing required param '{}'".format(pa... | [
"def",
"draw",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# Quick validation",
"for",
"param",
"in",
"(",
"'feature_importances_'",
",",
"'features_'",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"param",
")",
":",
"raise",
"NotFitted",
"("... | Draws the feature importances as a bar chart; called from fit. | [
"Draws",
"the",
"feature",
"importances",
"as",
"a",
"bar",
"chart",
";",
"called",
"from",
"fit",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/importances.py#L198-L237 | train | Draws the feature importances as a bar chart ; called from fit. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/importances.py | FeatureImportances.finalize | def finalize(self, **kwargs):
"""
Finalize the drawing setting labels and title.
"""
# Set the title
self.set_title('Feature Importances of {} Features using {}'.format(
len(self.features_), self.name))
# Set the xlabel
self.ax.set_xlabel(self._ge... | python | def finalize(self, **kwargs):
"""
Finalize the drawing setting labels and title.
"""
# Set the title
self.set_title('Feature Importances of {} Features using {}'.format(
len(self.features_), self.name))
# Set the xlabel
self.ax.set_xlabel(self._ge... | [
"def",
"finalize",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# Set the title",
"self",
".",
"set_title",
"(",
"'Feature Importances of {} Features using {}'",
".",
"format",
"(",
"len",
"(",
"self",
".",
"features_",
")",
",",
"self",
".",
"name",
")"... | Finalize the drawing setting labels and title. | [
"Finalize",
"the",
"drawing",
"setting",
"labels",
"and",
"title",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/importances.py#L239-L256 | train | Finalize the drawing setting labels and title. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/importances.py | FeatureImportances._find_classes_param | def _find_classes_param(self):
"""
Searches the wrapped model for the classes_ parameter.
"""
for attr in ["classes_"]:
try:
return getattr(self.estimator, attr)
except AttributeError:
continue
raise YellowbrickTypeError(
... | python | def _find_classes_param(self):
"""
Searches the wrapped model for the classes_ parameter.
"""
for attr in ["classes_"]:
try:
return getattr(self.estimator, attr)
except AttributeError:
continue
raise YellowbrickTypeError(
... | [
"def",
"_find_classes_param",
"(",
"self",
")",
":",
"for",
"attr",
"in",
"[",
"\"classes_\"",
"]",
":",
"try",
":",
"return",
"getattr",
"(",
"self",
".",
"estimator",
",",
"attr",
")",
"except",
"AttributeError",
":",
"continue",
"raise",
"YellowbrickTypeE... | Searches the wrapped model for the classes_ parameter. | [
"Searches",
"the",
"wrapped",
"model",
"for",
"the",
"classes_",
"parameter",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/importances.py#L258-L272 | train | Searches the wrapped model for the classes_ parameter. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/importances.py | FeatureImportances._get_xlabel | def _get_xlabel(self):
"""
Determines the xlabel based on the underlying data structure
"""
# Return user-specified label
if self.xlabel:
return self.xlabel
# Label for coefficients
if hasattr(self.estimator, "coef_"):
if self.relative:
... | python | def _get_xlabel(self):
"""
Determines the xlabel based on the underlying data structure
"""
# Return user-specified label
if self.xlabel:
return self.xlabel
# Label for coefficients
if hasattr(self.estimator, "coef_"):
if self.relative:
... | [
"def",
"_get_xlabel",
"(",
"self",
")",
":",
"# Return user-specified label",
"if",
"self",
".",
"xlabel",
":",
"return",
"self",
".",
"xlabel",
"# Label for coefficients",
"if",
"hasattr",
"(",
"self",
".",
"estimator",
",",
"\"coef_\"",
")",
":",
"if",
"self... | Determines the xlabel based on the underlying data structure | [
"Determines",
"the",
"xlabel",
"based",
"on",
"the",
"underlying",
"data",
"structure"
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/importances.py#L290-L307 | train | Determines the xlabel based on the underlying data structure
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/utils/target.py | target_color_type | def target_color_type(y):
"""
Determines the type of color space that will best represent the target
variable y, e.g. either a discrete (categorical) color space or a
continuous color space that requires a colormap. This function can handle
both 1D or column vectors as well as multi-output targets.
... | python | def target_color_type(y):
"""
Determines the type of color space that will best represent the target
variable y, e.g. either a discrete (categorical) color space or a
continuous color space that requires a colormap. This function can handle
both 1D or column vectors as well as multi-output targets.
... | [
"def",
"target_color_type",
"(",
"y",
")",
":",
"ttype",
"=",
"type_of_target",
"(",
"y",
")",
"if",
"ttype",
".",
"startswith",
"(",
"CONTINUOUS",
")",
":",
"return",
"CONTINUOUS",
"if",
"ttype",
".",
"startswith",
"(",
"\"binary\"",
")",
":",
"return",
... | Determines the type of color space that will best represent the target
variable y, e.g. either a discrete (categorical) color space or a
continuous color space that requires a colormap. This function can handle
both 1D or column vectors as well as multi-output targets.
Parameters
----------
y :... | [
"Determines",
"the",
"type",
"of",
"color",
"space",
"that",
"will",
"best",
"represent",
"the",
"target",
"variable",
"y",
"e",
".",
"g",
".",
"either",
"a",
"discrete",
"(",
"categorical",
")",
"color",
"space",
"or",
"a",
"continuous",
"color",
"space",... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/target.py#L38-L76 | train | Determines the type of color space that will best represent the target variable y. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/jointplot.py | JointPlot._layout | def _layout(self):
"""
Creates the grid layout for the joint plot, adding new axes for the histograms
if necessary and modifying the aspect ratio. Does not modify the axes or the
layout if self.hist is False or None.
"""
# Ensure the axes are created if not hist, then ret... | python | def _layout(self):
"""
Creates the grid layout for the joint plot, adding new axes for the histograms
if necessary and modifying the aspect ratio. Does not modify the axes or the
layout if self.hist is False or None.
"""
# Ensure the axes are created if not hist, then ret... | [
"def",
"_layout",
"(",
"self",
")",
":",
"# Ensure the axes are created if not hist, then return.",
"if",
"not",
"self",
".",
"hist",
":",
"self",
".",
"ax",
"return",
"# Ensure matplotlib version compatibility",
"if",
"make_axes_locatable",
"is",
"None",
":",
"raise",
... | Creates the grid layout for the joint plot, adding new axes for the histograms
if necessary and modifying the aspect ratio. Does not modify the axes or the
layout if self.hist is False or None. | [
"Creates",
"the",
"grid",
"layout",
"for",
"the",
"joint",
"plot",
"adding",
"new",
"axes",
"for",
"the",
"histograms",
"if",
"necessary",
"and",
"modifying",
"the",
"aspect",
"ratio",
".",
"Does",
"not",
"modify",
"the",
"axes",
"or",
"the",
"layout",
"if... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/jointplot.py#L208-L235 | train | Creates the grid layout for the joint plot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/jointplot.py | JointPlot.fit | def fit(self, X, y=None):
"""
Fits the JointPlot, creating a correlative visualization between the columns
specified during initialization and the data and target passed into fit:
- If self.columns is None then X and y must both be specified as 1D arrays
or X must be a... | python | def fit(self, X, y=None):
"""
Fits the JointPlot, creating a correlative visualization between the columns
specified during initialization and the data and target passed into fit:
- If self.columns is None then X and y must both be specified as 1D arrays
or X must be a... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
")",
":",
"# Convert python objects to numpy arrays",
"if",
"isinstance",
"(",
"X",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"X",
"=",
"np",
".",
"array",
"(",
"X",
")",
"if",
"y",
... | Fits the JointPlot, creating a correlative visualization between the columns
specified during initialization and the data and target passed into fit:
- If self.columns is None then X and y must both be specified as 1D arrays
or X must be a 2D array with only 2 columns.
- I... | [
"Fits",
"the",
"JointPlot",
"creating",
"a",
"correlative",
"visualization",
"between",
"the",
"columns",
"specified",
"during",
"initialization",
"and",
"the",
"data",
"and",
"target",
"passed",
"into",
"fit",
":"
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/jointplot.py#L237-L308 | train | Fits the JointPlot to create a correlative visualization between the columns X and y. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/jointplot.py | JointPlot.draw | def draw(self, x, y, xlabel=None, ylabel=None):
"""
Draw the joint plot for the data in x and y.
Parameters
----------
x, y : 1D array-like
The data to plot for the x axis and the y axis
xlabel, ylabel : str
The labels for the x and y axes.
... | python | def draw(self, x, y, xlabel=None, ylabel=None):
"""
Draw the joint plot for the data in x and y.
Parameters
----------
x, y : 1D array-like
The data to plot for the x axis and the y axis
xlabel, ylabel : str
The labels for the x and y axes.
... | [
"def",
"draw",
"(",
"self",
",",
"x",
",",
"y",
",",
"xlabel",
"=",
"None",
",",
"ylabel",
"=",
"None",
")",
":",
"# This is a little weird to be here, but it is the best place to perform",
"# this computation given how fit calls draw and returns.",
"self",
".",
"corr_",
... | Draw the joint plot for the data in x and y.
Parameters
----------
x, y : 1D array-like
The data to plot for the x axis and the y axis
xlabel, ylabel : str
The labels for the x and y axes. | [
"Draw",
"the",
"joint",
"plot",
"for",
"the",
"data",
"in",
"x",
"and",
"y",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/jointplot.py#L310-L368 | train | Draw the main joint plot for the data in x and y. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/jointplot.py | JointPlot.finalize | def finalize(self, **kwargs):
"""
Finalize executes any remaining image modifications making it ready to show.
"""
# Set the aspect ratio to make the visualization square
# TODO: still unable to make plot square using make_axes_locatable
# x0,x1 = self.ax.get_xlim()
... | python | def finalize(self, **kwargs):
"""
Finalize executes any remaining image modifications making it ready to show.
"""
# Set the aspect ratio to make the visualization square
# TODO: still unable to make plot square using make_axes_locatable
# x0,x1 = self.ax.get_xlim()
... | [
"def",
"finalize",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# Set the aspect ratio to make the visualization square",
"# TODO: still unable to make plot square using make_axes_locatable",
"# x0,x1 = self.ax.get_xlim()",
"# y0,y1 = self.ax.get_ylim()",
"# self.ax.set_aspect(abs(x1... | Finalize executes any remaining image modifications making it ready to show. | [
"Finalize",
"executes",
"any",
"remaining",
"image",
"modifications",
"making",
"it",
"ready",
"to",
"show",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/jointplot.py#L370-L394 | train | Finalize executes any remaining image modifications making it ready to show. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/jointplot.py | JointPlot._index_into | def _index_into(self, idx, data):
"""
Attempts to get the column from the data using the specified index, raises an
exception if this is not possible from this point in the stack.
"""
try:
if is_dataframe(data):
# Assume column indexing
... | python | def _index_into(self, idx, data):
"""
Attempts to get the column from the data using the specified index, raises an
exception if this is not possible from this point in the stack.
"""
try:
if is_dataframe(data):
# Assume column indexing
... | [
"def",
"_index_into",
"(",
"self",
",",
"idx",
",",
"data",
")",
":",
"try",
":",
"if",
"is_dataframe",
"(",
"data",
")",
":",
"# Assume column indexing",
"return",
"data",
"[",
"idx",
"]",
"# Otherwise assume numpy array-like indexing",
"return",
"data",
"[",
... | Attempts to get the column from the data using the specified index, raises an
exception if this is not possible from this point in the stack. | [
"Attempts",
"to",
"get",
"the",
"column",
"from",
"the",
"data",
"using",
"the",
"specified",
"index",
"raises",
"an",
"exception",
"if",
"this",
"is",
"not",
"possible",
"from",
"this",
"point",
"in",
"the",
"stack",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/jointplot.py#L396-L411 | train | Attempts to get the column from the data using the specified index raises an IndexError if this is not possible from this point in the stack. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/contrib/missing/base.py | MissingDataVisualizer.fit | 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
... | python | 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",
")",
":",
"if",
"is_dataframe",
"(",
"X",
")",
":",
"self",
".",
"X",
"=",
"X",
".",
"values",
"if",
"self",
".",
"features_",
"is",
"None",
":",
"self",
"."... | 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
... | [
"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",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/base.py#L32-L63 | train | Fit the missing data visualization to the data X and y. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | docs/tutorial.py | visualize_model | def visualize_model(X, y, estimator, path, **kwargs):
"""
Test various estimators.
"""
y = LabelEncoder().fit_transform(y)
model = Pipeline([
('one_hot_encoder', OneHotEncoder()),
('estimator', estimator)
])
_, ax = plt.subplots()
# Instantiate the classification mo... | python | def visualize_model(X, y, estimator, path, **kwargs):
"""
Test various estimators.
"""
y = LabelEncoder().fit_transform(y)
model = Pipeline([
('one_hot_encoder', OneHotEncoder()),
('estimator', estimator)
])
_, ax = plt.subplots()
# Instantiate the classification mo... | [
"def",
"visualize_model",
"(",
"X",
",",
"y",
",",
"estimator",
",",
"path",
",",
"*",
"*",
"kwargs",
")",
":",
"y",
"=",
"LabelEncoder",
"(",
")",
".",
"fit_transform",
"(",
"y",
")",
"model",
"=",
"Pipeline",
"(",
"[",
"(",
"'one_hot_encoder'",
","... | Test various estimators. | [
"Test",
"various",
"estimators",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/docs/tutorial.py#L61-L80 | train | Visualize the model. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/model_selection/cross_validation.py | cv_scores | def cv_scores(model, X, y, ax=None, cv=None, scoring=None, **kwargs):
"""
Displays cross validation scores as a bar chart and the
average of the scores as a horizontal line
This helper function is a quick wrapper to utilize the
CVScores visualizer for one-off analysis.
Parameters
---------... | python | def cv_scores(model, X, y, ax=None, cv=None, scoring=None, **kwargs):
"""
Displays cross validation scores as a bar chart and the
average of the scores as a horizontal line
This helper function is a quick wrapper to utilize the
CVScores visualizer for one-off analysis.
Parameters
---------... | [
"def",
"cv_scores",
"(",
"model",
",",
"X",
",",
"y",
",",
"ax",
"=",
"None",
",",
"cv",
"=",
"None",
",",
"scoring",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# Initialize the visualizer",
"visualizer",
"=",
"CVScores",
"(",
"model",
",",
"ax... | Displays cross validation scores as a bar chart and the
average of the scores as a horizontal line
This helper function is a quick wrapper to utilize the
CVScores visualizer for one-off analysis.
Parameters
----------
model : a scikit-learn estimator
An object that implements ``fit`` ... | [
"Displays",
"cross",
"validation",
"scores",
"as",
"a",
"bar",
"chart",
"and",
"the",
"average",
"of",
"the",
"scores",
"as",
"a",
"horizontal",
"line"
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/model_selection/cross_validation.py#L176-L241 | train | Generates a CVScores visualizer for one - off analysis of the base class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/model_selection/cross_validation.py | CVScores.fit | def fit(self, X, y, **kwargs):
"""
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)
Tr... | python | def fit(self, X, y, **kwargs):
"""
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)
Tr... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"cv_scores_",
"=",
"cross_val_score",
"(",
"self",
".",
"estimator",
",",
"X",
",",
"y",
",",
"cv",
"=",
"self",
".",
"cv",
",",
"scoring",
"=",
"sel... | 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... | [
"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",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/model_selection/cross_validation.py#L100-L128 | train | 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. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/model_selection/cross_validation.py | CVScores.draw | def draw(self, **kwargs):
"""
Creates the bar chart of the cross-validated scores generated from the
fit method and places a dashed horizontal line that represents the
average value of the scores.
"""
color = kwargs.pop("color", "b")
width = kwargs.pop("width", 0... | python | def draw(self, **kwargs):
"""
Creates the bar chart of the cross-validated scores generated from the
fit method and places a dashed horizontal line that represents the
average value of the scores.
"""
color = kwargs.pop("color", "b")
width = kwargs.pop("width", 0... | [
"def",
"draw",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"color",
"=",
"kwargs",
".",
"pop",
"(",
"\"color\"",
",",
"\"b\"",
")",
"width",
"=",
"kwargs",
".",
"pop",
"(",
"\"width\"",
",",
"0.3",
")",
"linewidth",
"=",
"kwargs",
".",
"pop",
... | Creates the bar chart of the cross-validated scores generated from the
fit method and places a dashed horizontal line that represents the
average value of the scores. | [
"Creates",
"the",
"bar",
"chart",
"of",
"the",
"cross",
"-",
"validated",
"scores",
"generated",
"from",
"the",
"fit",
"method",
"and",
"places",
"a",
"dashed",
"horizontal",
"line",
"that",
"represents",
"the",
"average",
"value",
"of",
"the",
"scores",
"."... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/model_selection/cross_validation.py#L130-L149 | train | Draws the cross - validated scores for the current locale. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/model_selection/cross_validation.py | CVScores.finalize | def finalize(self, **kwargs):
"""
Add the title, legend, and other visual final touches to the plot.
"""
# Set the title of the figure
self.set_title('Cross Validation Scores for {}'.format(self.name))
# Add the legend
loc = kwargs.pop("loc", "best")
edg... | python | def finalize(self, **kwargs):
"""
Add the title, legend, and other visual final touches to the plot.
"""
# Set the title of the figure
self.set_title('Cross Validation Scores for {}'.format(self.name))
# Add the legend
loc = kwargs.pop("loc", "best")
edg... | [
"def",
"finalize",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# Set the title of the figure",
"self",
".",
"set_title",
"(",
"'Cross Validation Scores for {}'",
".",
"format",
"(",
"self",
".",
"name",
")",
")",
"# Add the legend",
"loc",
"=",
"kwargs",
... | Add the title, legend, and other visual final touches to the plot. | [
"Add",
"the",
"title",
"legend",
"and",
"other",
"visual",
"final",
"touches",
"to",
"the",
"plot",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/model_selection/cross_validation.py#L151-L169 | train | Finalize the plot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/rankd.py | kendalltau | def kendalltau(X):
"""
Accepts a matrix X and returns a correlation matrix so that each column
is the variable and each row is the observations.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m features
"""
corrs = np.zeros((X.shape[1... | python | def kendalltau(X):
"""
Accepts a matrix X and returns a correlation matrix so that each column
is the variable and each row is the observations.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m features
"""
corrs = np.zeros((X.shape[1... | [
"def",
"kendalltau",
"(",
"X",
")",
":",
"corrs",
"=",
"np",
".",
"zeros",
"(",
"(",
"X",
".",
"shape",
"[",
"1",
"]",
",",
"X",
".",
"shape",
"[",
"1",
"]",
")",
")",
"for",
"idx",
",",
"cola",
"in",
"enumerate",
"(",
"X",
".",
"T",
")",
... | Accepts a matrix X and returns a correlation matrix so that each column
is the variable and each row is the observations.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m features | [
"Accepts",
"a",
"matrix",
"X",
"and",
"returns",
"a",
"correlation",
"matrix",
"so",
"that",
"each",
"column",
"is",
"the",
"variable",
"and",
"each",
"row",
"is",
"the",
"observations",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rankd.py#L37-L52 | train | Returns a correlation matrix so that each column is the variable and each row is the observations. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/rankd.py | rank1d | def rank1d(X, y=None, ax=None, algorithm='shapiro', features=None,
orient='h', show_feature_names=True, **kwargs):
"""Scores each feature with the algorithm and ranks them in a bar plot.
This helper function is a quick wrapper to utilize the Rank1D Visualizer
(Transformer) for one-off analysis.
... | python | def rank1d(X, y=None, ax=None, algorithm='shapiro', features=None,
orient='h', show_feature_names=True, **kwargs):
"""Scores each feature with the algorithm and ranks them in a bar plot.
This helper function is a quick wrapper to utilize the Rank1D Visualizer
(Transformer) for one-off analysis.
... | [
"def",
"rank1d",
"(",
"X",
",",
"y",
"=",
"None",
",",
"ax",
"=",
"None",
",",
"algorithm",
"=",
"'shapiro'",
",",
"features",
"=",
"None",
",",
"orient",
"=",
"'h'",
",",
"show_feature_names",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"# Ins... | Scores each feature with the algorithm and ranks them in a bar plot.
This helper function is a quick wrapper to utilize the Rank1D Visualizer
(Transformer) for one-off analysis.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m features
y : n... | [
"Scores",
"each",
"feature",
"with",
"the",
"algorithm",
"and",
"ranks",
"them",
"in",
"a",
"bar",
"plot",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rankd.py#L426-L474 | train | Generates a 1D ranking of each feature with the algorithm and ranks them in a bar plot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/rankd.py | rank2d | def rank2d(X, y=None, ax=None, algorithm='pearson', features=None,
show_feature_names=True, colormap='RdBu_r', **kwargs):
"""Displays pairwise comparisons of features with the algorithm and ranks
them in a lower-left triangle heatmap plot.
This helper function is a quick wrapper to utilize the R... | python | def rank2d(X, y=None, ax=None, algorithm='pearson', features=None,
show_feature_names=True, colormap='RdBu_r', **kwargs):
"""Displays pairwise comparisons of features with the algorithm and ranks
them in a lower-left triangle heatmap plot.
This helper function is a quick wrapper to utilize the R... | [
"def",
"rank2d",
"(",
"X",
",",
"y",
"=",
"None",
",",
"ax",
"=",
"None",
",",
"algorithm",
"=",
"'pearson'",
",",
"features",
"=",
"None",
",",
"show_feature_names",
"=",
"True",
",",
"colormap",
"=",
"'RdBu_r'",
",",
"*",
"*",
"kwargs",
")",
":",
... | Displays pairwise comparisons of features with the algorithm and ranks
them in a lower-left triangle heatmap plot.
This helper function is a quick wrapper to utilize the Rank2D Visualizer
(Transformer) for one-off analysis.
Parameters
----------
X : ndarray or DataFrame of shape n x m
... | [
"Displays",
"pairwise",
"comparisons",
"of",
"features",
"with",
"the",
"algorithm",
"and",
"ranks",
"them",
"in",
"a",
"lower",
"-",
"left",
"triangle",
"heatmap",
"plot",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rankd.py#L476-L527 | train | Displays pairwise comparisons of features with the algorithm and ranks them in a lower - left triangle heatmap plot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/rankd.py | RankDBase.transform | def transform(self, X, **kwargs):
"""
The transform method is the primary drawing hook for ranking classes.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m features
kwargs : dict
Pass generic arguments... | python | def transform(self, X, **kwargs):
"""
The transform method is the primary drawing hook for ranking classes.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m features
kwargs : dict
Pass generic arguments... | [
"def",
"transform",
"(",
"self",
",",
"X",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"ranks_",
"=",
"self",
".",
"rank",
"(",
"X",
")",
"self",
".",
"draw",
"(",
"*",
"*",
"kwargs",
")",
"# Return the X matrix, unchanged",
"return",
"X"
] | The transform method is the primary drawing hook for ranking classes.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m features
kwargs : dict
Pass generic arguments to the drawing method
Returns
------... | [
"The",
"transform",
"method",
"is",
"the",
"primary",
"drawing",
"hook",
"for",
"ranking",
"classes",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rankd.py#L122-L146 | train | This method draws the ranking matrix X and returns X. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/rankd.py | RankDBase.rank | def rank(self, X, algorithm=None):
"""
Returns the feature ranking.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m features
algorithm : str or None
The ranking mechanism to use, or None for the defaul... | python | def rank(self, X, algorithm=None):
"""
Returns the feature ranking.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m features
algorithm : str or None
The ranking mechanism to use, or None for the defaul... | [
"def",
"rank",
"(",
"self",
",",
"X",
",",
"algorithm",
"=",
"None",
")",
":",
"algorithm",
"=",
"algorithm",
"or",
"self",
".",
"ranking_",
"algorithm",
"=",
"algorithm",
".",
"lower",
"(",
")",
"if",
"algorithm",
"not",
"in",
"self",
".",
"ranking_me... | Returns the feature ranking.
Parameters
----------
X : ndarray or DataFrame of shape n x m
A matrix of n instances with m features
algorithm : str or None
The ranking mechanism to use, or None for the default
Returns
-------
ranks : ndar... | [
"Returns",
"the",
"feature",
"ranking",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rankd.py#L148-L179 | train | Returns the feature ranking for the given set of n - dimensional n - dimensional n - dimensional molecular features. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/rankd.py | RankDBase.finalize | def finalize(self, **kwargs):
"""
Finalize executes any subclass-specific axes finalization steps.
The user calls poof and poof calls finalize.
Parameters
----------
kwargs: dict
generic keyword arguments
"""
# Set the title
self.set_... | python | def finalize(self, **kwargs):
"""
Finalize executes any subclass-specific axes finalization steps.
The user calls poof and poof calls finalize.
Parameters
----------
kwargs: dict
generic keyword arguments
"""
# Set the title
self.set_... | [
"def",
"finalize",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# Set the title",
"self",
".",
"set_title",
"(",
"\"{} Ranking of {} Features\"",
".",
"format",
"(",
"self",
".",
"ranking_",
".",
"title",
"(",
")",
",",
"len",
"(",
"self",
".",
"feat... | Finalize executes any subclass-specific axes finalization steps.
The user calls poof and poof calls finalize.
Parameters
----------
kwargs: dict
generic keyword arguments | [
"Finalize",
"executes",
"any",
"subclass",
"-",
"specific",
"axes",
"finalization",
"steps",
".",
"The",
"user",
"calls",
"poof",
"and",
"poof",
"calls",
"finalize",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rankd.py#L181-L197 | train | Executes any subclass - specific axes finalization steps. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/rankd.py | Rank1D.draw | def draw(self, **kwargs):
"""
Draws the bar plot of the ranking array of features.
"""
if self.orientation_ == 'h':
# Make the plot
self.ax.barh(np.arange(len(self.ranks_)), self.ranks_, color='b')
# Add ticks and tick labels
self.ax.set_y... | python | def draw(self, **kwargs):
"""
Draws the bar plot of the ranking array of features.
"""
if self.orientation_ == 'h':
# Make the plot
self.ax.barh(np.arange(len(self.ranks_)), self.ranks_, color='b')
# Add ticks and tick labels
self.ax.set_y... | [
"def",
"draw",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"orientation_",
"==",
"'h'",
":",
"# Make the plot",
"self",
".",
"ax",
".",
"barh",
"(",
"np",
".",
"arange",
"(",
"len",
"(",
"self",
".",
"ranks_",
")",
")",
","... | Draws the bar plot of the ranking array of features. | [
"Draws",
"the",
"bar",
"plot",
"of",
"the",
"ranking",
"array",
"of",
"features",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rankd.py#L265-L303 | train | Draws the bar plot of the ranking array of features. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/rankd.py | Rank2D.draw | def draw(self, **kwargs):
"""
Draws the heatmap of the ranking matrix of variables.
"""
# Set the axes aspect to be equal
self.ax.set_aspect("equal")
# Generate a mask for the upper triangle
mask = np.zeros_like(self.ranks_, dtype=np.bool)
mask[np.triu_in... | python | def draw(self, **kwargs):
"""
Draws the heatmap of the ranking matrix of variables.
"""
# Set the axes aspect to be equal
self.ax.set_aspect("equal")
# Generate a mask for the upper triangle
mask = np.zeros_like(self.ranks_, dtype=np.bool)
mask[np.triu_in... | [
"def",
"draw",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# Set the axes aspect to be equal",
"self",
".",
"ax",
".",
"set_aspect",
"(",
"\"equal\"",
")",
"# Generate a mask for the upper triangle",
"mask",
"=",
"np",
".",
"zeros_like",
"(",
"self",
".",
... | Draws the heatmap of the ranking matrix of variables. | [
"Draws",
"the",
"heatmap",
"of",
"the",
"ranking",
"matrix",
"of",
"variables",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rankd.py#L383-L419 | train | Draws the heatmap of the ranking matrix of variables. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/classifier/class_prediction_error.py | class_prediction_error | 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... | python | 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",
")",
":",
"# Instantiate the v... | 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... | [
"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... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/class_prediction_error.py#L179-L238 | train | Plots a ClassPredictionError plot on the specified axes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/classifier/class_prediction_error.py | ClassPredictionError.draw | 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... | python | 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",
")",
":",
"indices",
"=",
"np",
".",
"arange",
"(",
"len",
"(",
"self",
".",
"classes_",
")",
")",
"prev",
"=",
"np",
".",
"zeros",
"(",
"len",
"(",
"self",
".",
"classes_",
")",
")",
"colors",
"=",
"resolve_colors",
"... | Renders the class prediction error across the axis. | [
"Renders",
"the",
"class",
"prediction",
"error",
"across",
"the",
"axis",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/class_prediction_error.py#L128-L145 | train | Draws the class prediction error across the axis. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/classifier/class_prediction_error.py | ClassPredictionError.finalize | 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... | python | 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",
")",
":",
"indices",
"=",
"np",
".",
"arange",
"(",
"len",
"(",
"self",
".",
"classes_",
")",
")",
"# Set the title",
"self",
".",
"set_title",
"(",
"\"Class Prediction Error for {}\"",
".",
"format"... | Finalize executes any subclass-specific axes finalization steps.
The user calls poof and poof calls finalize. | [
"Finalize",
"executes",
"any",
"subclass",
"-",
"specific",
"axes",
"finalization",
"steps",
".",
"The",
"user",
"calls",
"poof",
"and",
"poof",
"calls",
"finalize",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/classifier/class_prediction_error.py#L147-L172 | train | Finalize executes any subclass - specific axes finalization steps. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/contrib/missing/bar.py | missing_bar | 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 ... | python | 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",
")",
":",
"# Instantiate the visualizer",
"visualizer",
"=",
... | 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
------... | [
"The",
"MissingValues",
"Bar",
"visualizer",
"creates",
"a",
"bar",
"graph",
"that",
"lists",
"the",
"total",
"count",
"of",
"missing",
"values",
"for",
"each",
"selected",
"feature",
"column",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/bar.py#L191-L247 | train | Creates a MissingValues Bar visualizer that draws the missing values for each selected feature column. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/contrib/missing/bar.py | MissingValuesBar.draw | 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... | python | 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",
")",
":",
"nan_col_counts",
"=",
"self",
".",
"get_nan_col_counts",
"(",
")",
"# the x locations for the groups",
"self",
".",
"ind",
"=",
"np",
".",
"arange",
"(",
"len",
"(",
"s... | 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. | [
"Called",
"from",
"the",
"fit",
"method",
"this",
"method",
"generated",
"a",
"horizontal",
"bar",
"plot",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/bar.py#L124-L140 | train | Called from the fit method this method generates a horizontal bar chart for each nan count per
target values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/contrib/missing/bar.py | MissingValuesBar.draw_stacked_bar | 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:
... | python | 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",
")",
":",
"for",
"index",
",",
"nan_values",
"in",
"enumerate",
"(",
"nan_col_counts",
")",
":",
"label",
",",
"nan_col_counts",
"=",
"nan_values",
"if",
"index",
"==",
"0",
":",
"# first draw shou... | Draws a horizontal stacked bar chart with different colors
for each count of nan values per label. | [
"Draws",
"a",
"horizontal",
"stacked",
"bar",
"chart",
"with",
"different",
"colors",
"for",
"each",
"count",
"of",
"nan",
"values",
"per",
"label",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/bar.py#L142-L163 | train | Draws a horizontal stacked bar chart with different colors
for each count of nan values per label. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/contrib/missing/bar.py | MissingValuesBar.finalize | 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(
... | python | 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",
")",
":",
"# Set the title",
"self",
".",
"set_title",
"(",
"'Count of Missing Values by Column'",
")",
"tick_locations",
"=",
"np",
".",
"arange",
"(",
"len",
"(",
"self",
".",
"features_",
")",
")",
... | Finalize executes any subclass-specific axes finalization steps.
The user calls poof and poof calls finalize.
Parameters
----------
kwargs: generic keyword arguments. | [
"Finalize",
"executes",
"any",
"subclass",
"-",
"specific",
"axes",
"finalization",
"steps",
".",
"The",
"user",
"calls",
"poof",
"and",
"poof",
"calls",
"finalize",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/missing/bar.py#L165-L185 | train | Finalize executes any subclass - specific axes finalization steps. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/target/feature_correlation.py | feature_correlation | 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... | python | 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",
",",
"*",
"*",
"kw... | 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... | [
"Displays",
"the",
"correlation",
"between",
"features",
"and",
"dependent",
"variables",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L257-L326 | train | Visualize the feature correlation between two sets of target and class values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/target/feature_correlation.py | FeatureCorrelation.fit | 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
... | python | 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",
")",
":",
"self",
".",
"_create_labels_for_features",
"(",
"X",
")",
"self",
".",
"_select_features_to_plot",
"(",
"X",
")",
"# Calculate Features correlation with target variable",
"if",
... | 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... | [
"Fits",
"the",
"estimator",
"to",
"calculate",
"feature",
"correlation",
"to",
"dependent",
"variable",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L132-L179 | train | Fits the estimator to calculate feature correlation to the dependent variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/target/feature_correlation.py | FeatureCorrelation.draw | 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.... | python | 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",
")",
":",
"pos",
"=",
"np",
".",
"arange",
"(",
"self",
".",
"scores_",
".",
"shape",
"[",
"0",
"]",
")",
"+",
"0.5",
"self",
".",
"ax",
".",
"barh",
"(",
"pos",
",",
"self",
".",
"scores_",
")",
"# Set the labels for ... | Draws the feature correlation to dependent variable, called from fit. | [
"Draws",
"the",
"feature",
"correlation",
"to",
"dependent",
"variable",
"called",
"from",
"fit",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L181-L193 | train | Draw the feature correlation to dependent variable called from fit. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/target/feature_correlation.py | FeatureCorrelation.finalize | 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') | python | 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",
")",
":",
"self",
".",
"set_title",
"(",
"'Features correlation with dependent variable'",
")",
"self",
".",
"ax",
".",
"set_xlabel",
"(",
"self",
".",
"correlation_labels",
"[",
"self",
".",
"method",
"]",
")",
"self",
".",
"... | Finalize the drawing setting labels and title. | [
"Finalize",
"the",
"drawing",
"setting",
"labels",
"and",
"title",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L195-L203 | train | Finalize the drawing setting labels and title. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/target/feature_correlation.py | FeatureCorrelation._create_labels_for_features | 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... | python | 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",
")",
":",
"if",
"self",
".",
"labels",
"is",
"None",
":",
"# Use column names if a dataframe",
"if",
"is_dataframe",
"(",
"X",
")",
":",
"self",
".",
"features_",
"=",
"np",
".",
"array",
"(",
"X... | Create labels for the features
NOTE: this code is duplicated from MultiFeatureVisualizer | [
"Create",
"labels",
"for",
"the",
"features"
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L205-L220 | train | Create labels for the features in the features_ attribute of the features_ attribute. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/target/feature_correlation.py | FeatureCorrelation._select_features_to_plot | 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:
... | python | 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",
")",
":",
"if",
"self",
".",
"feature_index",
":",
"if",
"self",
".",
"feature_names",
":",
"raise",
"YellowbrickWarning",
"(",
"'Both feature_index and feature_names '",
"'are specified. feature_names is ignored'"... | 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. | [
"Select",
"features",
"to",
"plot",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/target/feature_correlation.py#L222-L250 | train | Select features to plot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | paper/figures/figures.py | feature_analysis | 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... | python | 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 side-by-side axes grid",
"_",
",",
"axes",
"=",
"plt",
".",
"subplots",
"(",
"ncols",
"=",
"2",
",",
"figsize",
"=",
"(",
"18",
",",
"6",
")",
")",
"# Draw RadViz o... | Create figures for feature analysis | [
"Create",
"figures",
"for",
"feature",
"analysis"
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/paper/figures/figures.py#L78-L101 | train | Create figures for feature analysis
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | paper/figures/figures.py | regression | 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=... | python | 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\"",
")",
":",
"_",
",",
"axes",
"=",
"plt",
".",
"subplots",
"(",
"ncols",
"=",
"2",
",",
"figsize",
"=",
"(",
"18",
",",
"6",
")",
")",
"alphas",
"=",
"np",
".",
"logspace",
"(",
"-",
"10... | Create figures for regression models | [
"Create",
"figures",
"for",
"regression",
"models"
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/paper/figures/figures.py#L104-L127 | train | Create figures for regression models
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/base.py | Visualizer.ax | 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... | python | 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",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"\"_ax\"",
")",
"or",
"self",
".",
"_ax",
"is",
"None",
":",
"self",
".",
"_ax",
"=",
"plt",
".",
"gca",
"(",
")",
"return",
"self",
".",
"_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. | [
"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... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L81-L89 | train | The matplotlib axes that the visualizer draws upon. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/base.py | Visualizer.size | 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... | python | 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",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"\"_size\"",
")",
"or",
"self",
".",
"_size",
"is",
"None",
":",
"fig",
"=",
"plt",
".",
"gcf",
"(",
")",
"self",
".",
"_size",
"=",
"fig",
".",
"get_size_inches",
"(... | Returns the actual size in pixels as set by matplotlib, or
the user provided size if available. | [
"Returns",
"the",
"actual",
"size",
"in",
"pixels",
"as",
"set",
"by",
"matplotlib",
"or",
"the",
"user",
"provided",
"size",
"if",
"available",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L96-L104 | train | Returns the actual size in pixels as set by matplotlib or the user provided size if available. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/base.py | Visualizer.poof | 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... | python | 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",
")",
":",
"# Ensure that draw has been called",
"if",
"self",
".",
"_ax",
"is",
"None",
":",
"warn_message",
"=",
"(",
"\"{} does not have a ... | 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... | [
"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... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L187-L230 | train | Makes the magic happen and a visualizer appear. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/base.py | Visualizer.set_title | 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... | python | 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",
")",
":",
"title",
"=",
"self",
".",
"title",
"or",
"title",
"if",
"title",
"is",
"not",
"None",
":",
"self",
".",
"ax",
".",
"set_title",
"(",
"title",
")"
] | Sets the title on the current axes.
Parameters
----------
title: string, default: None
Add title to figure or if None leave untitled. | [
"Sets",
"the",
"title",
"on",
"the",
"current",
"axes",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L236-L247 | train | Sets the title on the current axes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/base.py | MultiModelMixin.generate_subplots | 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 | python | 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",
")",
":",
"_",
",",
"axes",
"=",
"plt",
".",
"subplots",
"(",
"len",
"(",
"self",
".",
"models",
")",
",",
"sharex",
"=",
"True",
",",
"sharey",
"=",
"True",
")",
"return",
"axes"
] | Generates the subplots for the number of given models. | [
"Generates",
"the",
"subplots",
"for",
"the",
"number",
"of",
"given",
"models",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L407-L412 | train | Generates the subplots for the number of given models. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/base.py | MultiModelMixin.predict | 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
... | python | 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",
")",
":",
"for",
"model",
"in",
"self",
".",
"models",
":",
"yield",
"cvp",
"(",
"model",
",",
"X",
",",
"y",
",",
"cv",
"=",
"12",
")"
] | 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
... | [
"Returns",
"a",
"generator",
"containing",
"the",
"predictions",
"for",
"each",
"of",
"the",
"internal",
"models",
"(",
"using",
"cross_val_predict",
"and",
"a",
"CV",
"=",
"12",
")",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/base.py#L414-L433 | train | Returns a generator containing the predictions for each of the internal models in the set of target or class values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | docs/api/text/corpus.py | load_corpus | 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 ... | python | 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",
")",
":",
"# 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... | Loads and wrangles the passed in text corpus by path. | [
"Loads",
"and",
"wrangles",
"the",
"passed",
"in",
"text",
"corpus",
"by",
"path",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/docs/api/text/corpus.py#L6-L44 | train | Loads and wrangles the passed in text corpus by path. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/datasets/path.py | get_data_home | 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... | python | 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",
")",
":",
"if",
"path",
"is",
"None",
":",
"path",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'YELLOWBRICK_DATA'",
",",
"FIXTURES",
")",
"path",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"path... | 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 ... | [
"Return",
"the",
"path",
"of",
"the",
"Yellowbrick",
"data",
"directory",
".",
"This",
"folder",
"is",
"used",
"by",
"dataset",
"loaders",
"to",
"avoid",
"downloading",
"data",
"several",
"times",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/path.py#L35-L56 | train | Returns the path of the Yellowbrick data directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/datasets/path.py | find_dataset_path | 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... | python | 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",
")",
":",
"# Figure out the root directory of the datasets",
"data_home",
"=",
"get_data_home",
"(",
... | 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... | [
"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",
... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/path.py#L59-L128 | train | This function returns the path to the dataset specified in the data home directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/datasets/path.py | dataset_exists | 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
... | python | 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",
")",
":",
"data_home",
"=",
"get_data_home",
"(",
"data_home",
")",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"data_home",
",",
"dataset",
")",
"return",
"os",
".",
"path",
... | 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... | [
"Checks",
"to",
"see",
"if",
"a",
"directory",
"with",
"the",
"name",
"of",
"the",
"specified",
"dataset",
"exists",
"in",
"the",
"data",
"home",
"directory",
"found",
"with",
"get_data_home",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/path.py#L131-L154 | train | Checks to see if a dataset exists in the data home directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/datasets/path.py | dataset_archive | 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... | python | 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\"",
")",
":",
"data_home",
"=",
"get_data_home",
"(",
"data_home",
")",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"data_home",
","... | 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
----... | [
"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... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/path.py#L157-L192 | train | Checks to see if the dataset archive file exists in the data home directory and is the latest version of the dataset. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/datasets/path.py | cleanup_dataset | 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... | python | 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\"",
")",
":",
"removed",
"=",
"0",
"data_home",
"=",
"get_data_home",
"(",
"data_home",
")",
"# Paths to remove",
"datadir",
"=",
"os",
".",
"path",
".",
"joi... | 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... | [
"Removes",
"the",
"dataset",
"directory",
"and",
"archive",
"file",
"from",
"the",
"data",
"home",
"directory",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/path.py#L195-L234 | train | Removes the dataset directory and archive file from the data home directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/base.py | FeatureVisualizer.fit_transform_poof | 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... | python | 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",
")",
":",
"Xp",
"=",
"self",
".",
"fit_transform",
"(",
"X",
",",
"y",
",",
"*",
"*",
"kwargs",
")",
"self",
".",
"poof",
"(",
"*",
"*",
"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 method. | [
"Fit",
"to",
"data",
"transform",
"it",
"then",
"visualize",
"it",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/base.py#L57-L67 | train | Fit to data transform it then visualize it. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/base.py | MultiFeatureVisualizer.fit | 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.
... | python | 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",
")",
":",
"# 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... | 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",
... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/base.py#L100-L121 | train | Fits the object to the specified features. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/base.py | DataVisualizer.fit | 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
... | python | 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",
")",
":",
"super",
"(",
"DataVisualizer",
",",
"self",
")",
".",
"fit",
"(",
"X",
",",
"y",
",",
"*",
"*",
"kwargs",
")",
"# Store the classes for the legend if they... | 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
... | [
"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",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/base.py#L194-L227 | train | Fit the data to the target class and store the class labels for the target class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/palettes.py | color_palette | 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 ... | python | 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",
")",
":",
"if",
"palette",
"is",
"None",
":",
"palette",
"=",
"get_color_cycle",
"(",
")",
"if",
"n_colors",
"is",
"None",
":",
"n_colors",
"=",
"len",
"(",
"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
------... | [
"Return",
"a",
"color",
"palette",
"object",
"with",
"color",
"definition",
"and",
"handling",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L458-L553 | train | Returns a color palette object with color definition and handling. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/palettes.py | set_color_codes | 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... | python | 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\"",
")",
":",
"if",
"palette",
"not",
"in",
"PALETTES",
":",
"raise",
"YellowbrickValueError",
"(",
"\"'{}' is not a recognized palette!\"",
".",
"format",
"(",
"palette",
")",
")",
"# Fetch the colors and adapt... | 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
--------
... | [
"Change",
"how",
"matplotlib",
"color",
"shorthands",
"are",
"interpreted",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L556-L594 | train | Set the color codes of the base object in the current color cycle. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/palettes.py | color_sequence | 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
-... | python | 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",
")",
":",
"# 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... | 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... | [
"Return",
"a",
"ListedColormap",
"object",
"from",
"a",
"named",
"sequence",
"palette",
".",
"Useful",
"for",
"continuous",
"color",
"scheme",
"values",
"and",
"color",
"maps",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L601-L693 | train | Returns a ListedColormap object from a named color sequence palette. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/palettes.py | ColorPalette.as_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) | python | 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",
")",
":",
"hex",
"=",
"[",
"mpl",
".",
"colors",
".",
"rgb2hex",
"(",
"rgb",
")",
"for",
"rgb",
"in",
"self",
"]",
"return",
"ColorPalette",
"(",
"hex",
")"
] | Return a color palette with hex codes instead of RGB values. | [
"Return",
"a",
"color",
"palette",
"with",
"hex",
"codes",
"instead",
"of",
"RGB",
"values",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L418-L423 | train | Return a color palette with hex codes instead of RGB values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/palettes.py | ColorPalette.as_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) | python | 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",
")",
":",
"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. | [
"Return",
"a",
"color",
"palette",
"with",
"RGB",
"values",
"instead",
"of",
"hex",
"codes",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L425-L430 | train | Return a color palette with RGB values instead of hex codes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/palettes.py | ColorPalette.plot | 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... | python | 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",
")",
":",
"n",
"=",
"len",
"(",
"self",
")",
"fig",
",",
"ax",
"=",
"plt",
".",
"subplots",
"(",
"1",
",",
"1",
",",
"figsize",
"=",
"(",
"n",
"*",
"size",
",",
"size",
")",
")",
"ax",
".... | 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 | [
"Plot",
"the",
"values",
"in",
"the",
"color",
"palette",
"as",
"a",
"horizontal",
"array",
".",
"See",
"Seaborn",
"s",
"palplot",
"function",
"for",
"inspiration",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/palettes.py#L432-L451 | train | Plot the values in the color palette as a horizontal array. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | docs/api/features/manifold.py | SCurveExample._make_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 | python | 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",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"os",
".",
"mkdirs",
"(",
"path",
")",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"path",
")",
":",
"... | Makes directories as needed | [
"Makes",
"directories",
"as",
"needed"
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/docs/api/features/manifold.py#L127-L137 | train | Make a path to the log file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | docs/api/features/manifold.py | SCurveExample.plot_manifold_embedding | 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=... | python | 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\"",
")",
":",
"_",
",",
"ax",
"=",
"plt",
".",
"subplots",
"(",
"figsize",
"=",
"(",
"9",
",",
"6",
")",
")",
"path",
"=",
"self",
".",
"_m... | Draw the manifold embedding for the specified algorithm | [
"Draw",
"the",
"manifold",
"embedding",
"for",
"the",
"specified",
"algorithm"
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/docs/api/features/manifold.py#L145-L158 | train | Draw the manifold embedding for the specified algorithm | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/datasets/download.py | download_data | 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... | python | 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",
")",
":",
"data_home",
"=",
"get_data_home",
"(",
"data_home",
")",
"# Get the name of the file from the URL",
"basena... | 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
... | [
"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... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/datasets/download.py#L38-L106 | train | Downloads the zipped data set at the given URL and saves it to the data directory specified by get_data_home. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/rcmod.py | set_aesthetic | 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
-----... | python | 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_context",
"(",
"font_scale",
")",
"set_style",
"(",
"r... | 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... | [
"Set",
"aesthetic",
"parameters",
"in",
"one",
"step",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/rcmod.py#L117-L144 | train | Set the parameters of the aesthetic for this base class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/rcmod.py | _axes_style | 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... | python | 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",
")",
":",
"if",
"isinstance",
"(",
"style",
",",
"dict",
")",
":",
"style_dict",
"=",
"style",
"else",
":",
"# Define colors here",
"dark_gray",
"=",
"\".15\"",
"light_gray",
"=",
"... | 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... | [
"Return",
"a",
"parameter",
"dict",
"for",
"the",
"aesthetic",
"style",
"of",
"the",
"plots",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/rcmod.py#L165-L236 | train | Returns a parameter dictionary for the aesthetic style of the aesthetic. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/rcmod.py | set_style | 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}
... | python | 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",
")",
":",
"style_object",
"=",
"_axes_style",
"(",
"style",
",",
"rc",
")",
"mpl",
".",
"rcParams",
".",
"update",
"(",
"style_object",
")"
] | 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 ... | [
"Set",
"the",
"aesthetic",
"style",
"of",
"the",
"plots",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/rcmod.py#L239-L256 | train | Set the aesthetic style of the plots. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/rcmod.py | _set_context | 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... | python | 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",
")",
":",
"context_object",
"=",
"_plotting_context",
"(",
"context",
",",
"font_scale",
",",
"rc",
")",
"mpl",
".",
"rcParams",
".",
"update",
"(",
... | 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... | [
"Set",
"the",
"plotting",
"context",
"parameters",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/rcmod.py#L351-L379 | train | Set the plotting context parameters for a base context. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/style/rcmod.py | set_palette | 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... | python | 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",
")",
":",
"colors",
"=",
"color_palette",
"(",
"palette",
",",
"n_colors",
")",
"if",
"mpl_ge_150",
":",
"from",
"cycler",
"import",
"cycler",
"cyl",
"=",... | 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 ... | [
"Set",
"the",
"matplotlib",
"color",
"cycle",
"using",
"a",
"seaborn",
"palette",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/style/rcmod.py#L415-L441 | train | Set the matplotlib color cycle using a seaborn color palette. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/text/dispersion.py | dispersion | 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 ... | python | 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... | 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 ... | [
"Displays",
"lexical",
"dispersion",
"plot",
"for",
"words",
"in",
"a",
"corpus"
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/dispersion.py#L252-L314 | train | Displays a dispersion plot for words within a corpus. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/text/dispersion.py | DispersionPlot.fit | 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... | python | 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",
")",
":",
"if",
"y",
"is",
"not",
"None",
":",
"self",
".",
"classes_",
"=",
"np",
".",
"unique",
"(",
"y",
")",
"elif",
"y",
"is",
"None",
"and",
"self",
... | 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... | [
"The",
"fit",
"method",
"is",
"the",
"primary",
"drawing",
"input",
"for",
"the",
"dispersion",
"visualization",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/dispersion.py#L123-L176 | train | This method is the primary drawing input for the dispersion
visualization. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/text/dispersion.py | DispersionPlot.draw | 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... | python | 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",
")",
":",
"# Resolve the labels with the classes",
"labels",
"=",
"self",
".",
"labels",
"if",
"self",
".",
"labels",
"is",
"not",
"None",
"else",
"self",
"."... | Called from the fit method, this method creates the canvas and
draws the plot on it.
Parameters
----------
kwargs: generic keyword arguments. | [
"Called",
"from",
"the",
"fit",
"method",
"this",
"method",
"creates",
"the",
"canvas",
"and",
"draws",
"the",
"plot",
"on",
"it",
".",
"Parameters",
"----------",
"kwargs",
":",
"generic",
"keyword",
"arguments",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/dispersion.py#L178-L226 | train | Creates the canvas and draws the plot on it. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/text/dispersion.py | DispersionPlot.finalize | 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... | python | 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",
")",
":",
"self",
".",
"ax",
".",
"set_ylim",
"(",
"-",
"1",
",",
"len",
"(",
"self",
".",
"indexed_words_",
")",
")",
"self",
".",
"ax",
".",
"set_title",
"(",
"\"Lexical Dispersion Plot\"",
"... | The finalize method executes any subclass-specific axes
finalization steps. The user calls poof & poof calls finalize.
Parameters
----------
kwargs: generic keyword arguments. | [
"The",
"finalize",
"method",
"executes",
"any",
"subclass",
"-",
"specific",
"axes",
"finalization",
"steps",
".",
"The",
"user",
"calls",
"poof",
"&",
"poof",
"calls",
"finalize",
".",
"Parameters",
"----------",
"kwargs",
":",
"generic",
"keyword",
"arguments"... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/text/dispersion.py#L228-L246 | train | Finalize the axes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/manifold.py | manifold_embedding | 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... | python | 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... | 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... | [
"Quick",
"method",
"for",
"Manifold",
"visualizer",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L441-L544 | train | Manifold embedding of latent structures in data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/manifold.py | Manifold.manifold | 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(
... | python | 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",
")",
":",
"if",
"not",
"is_estimator",
"(",
"transformer",
")",
":",
"if",
"transformer",
"not",
"in",
"self",
".",
"ALGORITHMS",
":",
"raise",
"YellowbrickValueError",
"(",
"\"could not create manifold for '%s'\... | Creates the manifold estimator if a string value is passed in,
validates other objects passed in. | [
"Creates",
"the",
"manifold",
"estimator",
"if",
"a",
"string",
"value",
"is",
"passed",
"in",
"validates",
"other",
"objects",
"passed",
"in",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L232-L260 | train | Creates the manifold estimator if a string value is passed in validates other objects passed in. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/manifold.py | Manifold.fit_transform | 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... | python | 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",
")",
":",
"# Determine target type",
"self",
".",
"_determine_target_color_type",
"(",
"y",
")",
"# Compute classes and colors if target type is discrete",
"if",
"self",
".",
"_target_color_type",
"... | 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... | [
"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",
"... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L270-L319 | train | Fits the manifold on X and transforms the data to plot it on the axes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/manifold.py | Manifold.transform | 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... | python | 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",
")",
":",
"try",
":",
"return",
"self",
".",
"manifold",
".",
"transform",
"(",
"X",
")",
"except",
"AttributeError",
"as",
"e",
":",
"raise",
"AttributeError",
"(",
"str",
"(",
"e",
")",
"+",
"\" try using fi... | 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... | [
"Returns",
"the",
"transformed",
"data",
"points",
"from",
"the",
"manifold",
"embedding",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L321-L338 | train | Returns the transformed data points from the manifold embedding. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/manifold.py | Manifold.draw | 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... | python | 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",
")",
":",
"scatter_kwargs",
"=",
"{",
"\"alpha\"",
":",
"self",
".",
"alpha",
"}",
"# Determine the colors",
"if",
"self",
".",
"_target_color_type",
"==",
"SINGLE",
":",
"scatter_kwargs",
"[",
... | 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... | [
"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",
"... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L340-L387 | train | Draws the points described by X and colored by the points in y. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/manifold.py | Manifold.finalize | 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... | python | 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",
")",
":",
"self",
".",
"set_title",
"(",
"'{} Manifold (fit in {:0.2f} seconds)'",
".",
"format",
"(",
"self",
".",
"_name",
",",
"self",
".",
"fit_time_",
".",
"interval",
")",
")",
"self",
".",
"ax",
".",
"set_xticklabels",
... | Add title and modify axes to make the image ready for display. | [
"Add",
"title",
"and",
"modify",
"axes",
"to",
"make",
"the",
"image",
"ready",
"for",
"display",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L389-L407 | train | Finalize the object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/manifold.py | Manifold._determine_target_color_type | 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... | python | 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",
")",
":",
"if",
"y",
"is",
"None",
":",
"self",
".",
"_target_color_type",
"=",
"SINGLE",
"elif",
"self",
".",
"target",
"==",
"\"auto\"",
":",
"# NOTE: See #73 for a generalization to use when implemente... | 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. | [
"Determines",
"the",
"target",
"color",
"type",
"from",
"the",
"vector",
"y",
"as",
"follows",
":"
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/manifold.py#L409-L434 | train | Determines the target color type from the vector y. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/rfecv.py | rfecv | 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... | python | 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",
")",
":",
"# Initialize the visualizer",
"o... | 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
... | [
"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",
... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rfecv.py#L261-L335 | train | This function is used to visualize the RFECV model for one - off analysis. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/rfecv.py | RFECV.fit | 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... | python | 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",
")",
":",
"X",
",",
"y",
"=",
"check_X_y",
"(",
"X",
",",
"y",
",",
"\"csr\"",
")",
"n_features",
"=",
"X",
".",
"shape",
"[",
"1",
"]",
"# This check is kind of unnecessary since RFE will do ... | 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... | [
"Fits",
"the",
"RFECV",
"with",
"the",
"wrapped",
"model",
"to",
"the",
"specified",
"data",
"and",
"draws",
"the",
"rfecv",
"curve",
"with",
"the",
"optimal",
"number",
"of",
"features",
"found",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rfecv.py#L145-L214 | train | Fits the RFECV with the wrapped model to the specified data and draws the RFECV curve with the optimal number of features found. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/features/rfecv.py | RFECV.draw | 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... | python | 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",
")",
":",
"# Compute the curves",
"x",
"=",
"self",
".",
"n_feature_subsets_",
"means",
"=",
"self",
".",
"cv_scores_",
".",
"mean",
"(",
"axis",
"=",
"1",
")",
"sigmas",
"=",
"self",
".",
"cv_scores... | Renders the rfecv curve. | [
"Renders",
"the",
"rfecv",
"curve",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/features/rfecv.py#L216-L240 | train | Renders the rfecv curve. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/contrib/scatter.py | scatterviz | 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... | python | 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... | 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... | [
"Displays",
"a",
"bivariate",
"scatter",
"plot",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/scatter.py#L32-L94 | train | Displays a bivariate scatter plot for one - off analysis. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/contrib/scatter.py | ScatterVisualizer.fit | 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 ... | python | 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",
")",
":",
"_",
",",
"ncols",
"=",
"X",
".",
"shape",
"if",
"ncols",
"==",
"2",
":",
"X_two_cols",
"=",
"X",
"if",
"self",
".",
"features_",
"is",
"None",
":"... | 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... | [
"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... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/scatter.py#L194-L252 | train | Fit the transformer and visualizer to the target or class values of the object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/contrib/scatter.py | ScatterVisualizer.draw | 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])
... | python | 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",
")",
":",
"# Set the axes limits",
"self",
".",
"ax",
".",
"set_xlim",
"(",
"[",
"-",
"1",
",",
"1",
"]",
")",
"self",
".",
"ax",
".",
"set_ylim",
"(",
"[",
"-",
"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 set. | [
"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... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/scatter.py#L254-L300 | train | Called from the fit method creates a scatter plot that draws each instance of the class or target colored point whose location is determined by the feature data set. This method creates a scatter plot that draws each instance of the class or target colored point whose location is determined by the feature data set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/contrib/scatter.py | ScatterVisualizer.finalize | 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... | python | 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",
")",
":",
"# Divide out the two features",
"feature_one",
",",
"feature_two",
"=",
"self",
".",
"features_",
"# Set the title",
"self",
".",
"set_title",
"(",
"'Scatter Plot: {0} vs {1}'",
".",
"format",
"("... | Finalize executes any subclass-specific axes finalization steps.
The user calls poof and poof calls finalize.
Parameters
----------
kwargs: generic keyword arguments. | [
"Finalize",
"executes",
"any",
"subclass",
"-",
"specific",
"axes",
"finalization",
"steps",
".",
"The",
"user",
"calls",
"poof",
"and",
"poof",
"calls",
"finalize",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/contrib/scatter.py#L302-L321 | train | Executes any subclass - specific axes finalization steps. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/gridsearch/pcolor.py | gridsearch_color_plot | 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... | python | 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",
")",
":",
"# Instantiate the visualizer",
"visualizer",
"=",
"GridSearchColorPlot",
... | 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... | [
"Quick",
"method",
":",
"Create",
"a",
"color",
"plot",
"showing",
"the",
"best",
"grid",
"search",
"scores",
"across",
"two",
"parameters",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/gridsearch/pcolor.py#L21-L76 | train | Create a color plot showing the best grid search scores across two parameters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/utils/nan_warnings.py | filter_missing | 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.... | python | 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",
")",
":",
"if",
"y",
"is",
"not",
"None",
":",
"return",
"filter_missing_X_and_y",
"(",
"X",
",",
"y",
")",
"else",
":",
"return",
"X",
"[",
"~",
"np",
".",
"isnan",
"(",
"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 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... | [
"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",
... | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/nan_warnings.py#L10-L44 | train | This function filters out any missing values in data and returns a tuple of the nans in the order they appear in X. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/utils/nan_warnings.py | filter_missing_X_and_y | 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] | python | 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",
")",
":",
"y_nans",
"=",
"np",
".",
"isnan",
"(",
"y",
")",
"x_nans",
"=",
"np",
".",
"isnan",
"(",
"X",
")",
".",
"any",
"(",
"axis",
"=",
"1",
")",
"unioned_nans",
"=",
"np",
".",
"logical_or... | Remove rows from X and y where either contains nans. | [
"Remove",
"rows",
"from",
"X",
"and",
"y",
"where",
"either",
"contains",
"nans",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/nan_warnings.py#L47-L53 | train | Remove rows from X and y where either contains nans. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/utils/nan_warnings.py | warn_if_nans_exist | 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... | python | 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",
")",
":",
"null_count",
"=",
"count_rows_with_nans",
"(",
"X",
")",
"total",
"=",
"len",
"(",
"X",
")",
"percent",
"=",
"100",
"*",
"null_count",
"/",
"total",
"if",
"null_count",
">",
"0",
":",
"warning_message",
"... | Warn if nans exist in a numpy array. | [
"Warn",
"if",
"nans",
"exist",
"in",
"a",
"numpy",
"array",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/nan_warnings.py#L56-L66 | train | Warn if nans exist in a numpy array. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DistrictDataLabs/yellowbrick | yellowbrick/utils/nan_warnings.py | count_rows_with_nans | 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() | python | 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",
")",
":",
"if",
"X",
".",
"ndim",
"==",
"2",
":",
"return",
"np",
".",
"where",
"(",
"np",
".",
"isnan",
"(",
"X",
")",
".",
"sum",
"(",
"axis",
"=",
"1",
")",
"!=",
"0",
",",
"1",
",",
"0",
")",
"."... | Count the number of rows in 2D arrays that contain any nan values. | [
"Count",
"the",
"number",
"of",
"rows",
"in",
"2D",
"arrays",
"that",
"contain",
"any",
"nan",
"values",
"."
] | 59b67236a3862c73363e8edad7cd86da5b69e3b2 | https://github.com/DistrictDataLabs/yellowbrick/blob/59b67236a3862c73363e8edad7cd86da5b69e3b2/yellowbrick/utils/nan_warnings.py#L69-L72 | train | Count the number of rows in 2D arrays that contain any nan values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.