Conversation
| columns_to_keep = [5, 6] + list(range(11,26)) + list(range(32, 103)) + [145] | ||
| columns_to_keep = [5, 6] + list(range(11,26)) + list(range(32, 103)) + [145] | ||
| crime = crime.ix[:,columns_to_keep].dropna() | ||
|
|
||
| X_crime = crime.ix[:,range(0,88)] | ||
| X_crime = crime.ix[:, range(88)] |
There was a problem hiding this comment.
Function load_crime_dataset refactored with the following changes:
- Replace range(0, x) with range(x) (
remove-zero-from-range)
| h = [] | ||
| for c in range(0, num_labels): | ||
| h.append(mpatches.Patch(color=color_array[c], label=class_labels[c])) | ||
| h = [ | ||
| mpatches.Patch(color=color_array[c], label=class_labels[c]) | ||
| for c in range(num_labels) | ||
| ] | ||
|
|
There was a problem hiding this comment.
Function plot_labelled_scatter refactored with the following changes:
- Convert for loop into list comprehension (
list-comprehension) - Replace range(0, x) with range(x) (
remove-zero-from-range)
| cmap_light = ListedColormap(color_list_light[0:numClasses]) | ||
| cmap_bold = ListedColormap(color_list_bold[0:numClasses]) | ||
| cmap_light = ListedColormap(color_list_light[:numClasses]) | ||
| cmap_bold = ListedColormap(color_list_bold[:numClasses]) |
There was a problem hiding this comment.
Function plot_class_regions_for_classifier_subplot refactored with the following changes:
- Replace a[0:x] with a[:x] and a[x:len(a)] with a[x:] [×2] (
remove-redundant-slice-index) - Replace range(0, x) with range(x) (
remove-zero-from-range)
| cmap_light = ListedColormap(color_list_light[0:numClasses]) | ||
| cmap_bold = ListedColormap(color_list_bold[0:numClasses]) | ||
| cmap_light = ListedColormap(color_list_light[:numClasses]) | ||
| cmap_bold = ListedColormap(color_list_bold[:numClasses]) |
There was a problem hiding this comment.
Function plot_class_regions_for_classifier refactored with the following changes:
- Replace a[0:x] with a[:x] and a[x:len(a)] with a[x:] [×2] (
remove-redundant-slice-index) - Replace range(0, x) with range(x) (
remove-zero-from-range)
|
|
||
| mesh_step_size = .01 # step size in the mesh | ||
| plot_symbol_size = 50 | ||
|
|
There was a problem hiding this comment.
Found the following improvement in Function plot_fruit_knn:
|
|
||
| mesh_step_size = .01 # step size in the mesh | ||
| plot_symbol_size = 50 | ||
|
|
There was a problem hiding this comment.
Function plot_two_class_knn refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting) - Replace assignment with augmented assignment (
aug-assign)
| dimensions = dimensions = ['Dimension {}'.format(i) for i in range(1,len(pca.components_)+1)] | ||
| dimensions = dimensions = [ | ||
| f'Dimension {i}' for i in range(1, len(pca.components_) + 1) | ||
| ] | ||
|
|
There was a problem hiding this comment.
Function pca_results refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting)
|
|
There was a problem hiding this comment.
Found the following improvement in Function biplot:
Branch
masterrefactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
masterbranch, then run:Help us improve this pull request!