[{'role': 'system', 'content': "You are an expert in machine learning and your task is to classify code snippets into one of the following categories: ['helper_functions', 'load_data', 'data_exploration', 'data_preprocessing', 'evaluation', 'modelling', 'prediction', 'result_visualization', 'save_results', 'comment_only']."}, {'role': 'user', 'content': 'Identify the single most appropriate category to which the provided code belongs. Provide your response as a single category label without any additional information, commentary, or personal opinions.\\nPython Code:import mplleaflet\nfrom pyproj import Proj\nimport matplotlib.pyplot as plt\nimport scipy\nimport visvalingamwyatt as vw\nimport math\nfrom geopy.distance import vincenty\nimport geojson\nprojstr = \'+proj=lcc +lat_1=40.66666666666666 +lat_2=41.03333333333333 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs\'\npnyc = Proj(projstr,\npreserve_units=True)\n"""\nGiven a pandas DataFrame containing addressal information derived from PLUTO, generates a list of coordinates\nassociated with the given street.\ndf: The PLUTO-derived pandas DataFrame from which the information is being drawn.\nproj: The reusable pyproj projection that is being used to map coordinates from the state grid to global coordinates.\nstreet_name: The name of the street that you want coordinates for. Must be in all-caps and must match the notation\nused in the PLUTO dataset.\nn: The number of points in the final polyline. For best results this parameter should be tuned to match the complexity\nof the street: e.g. since most streets are linear, despite the complexity of the algorithm just n=2 will provide the\nbest results.\n"""\ndef generate(df, proj, street_name, n=20):\ncoords = df[df[\'Street\'].map(lambda a: street_name in str(a))][[\'XCoord\', \'YCoord\', \'Borough\']]\ncoords = coords.dropna()\ncoords = [proj(x, y, inverse=True) for x, y in zip(coords[\'XCoord\'], coords[\'YCoord\'])]\nslope, intercept, r_value, p_value, std_err = scipy.stats.linregress([c[0] for c in coords], [c[1] for c in coords])\nr_slope = -1/slope\nclosest_linear_coords = []\nfor x, y in coords:\nb = y - r_slope*x\nx_int = (intercept - b)/(r_slope - slope)\ny_int = slope*x_int + intercept\nclosest_linear_coords.append((x_int, y_int))\nx_extent = max([c[0] for c in closest_linear_coords]) - min([c[0] for c in closest_linear_coords])\ny_extent = max([c[1] for c in closest_linear_coords]) - min([c[1] for c in closest_linear_coords])\nif x_extent >= y_extent:\narray = np.array([c[0] for c in closest_linear_coords])\nelse:\narray = np.array([c[1] for c in closest_linear_coords])\norder = array.argsort()\nranks = order.argsort()\nsorted_coords = list(zip([c[0] for c in coords], [c[1] for c in coords], ranks))\nsorted_coords.sort(key=lambda x: x[2])\nsorted_coords = [(x, y) for x, y, rank in sorted_coords]\ni = 1\nwhile True:\nif math.sqrt((sorted_coords[i][0] - sorted_coords[i - 1][0])**2 + (sorted_coords[i][1] - sorted_coords[i - 1][1])**2) > 0.01:\ndel sorted_coords[i]\nelse:\ni += 1\nif i > len(sorted_coords) - 1:\nbreak\ncentroid_coords = []\nfor i in range(0, len(sorted_coords) - 4):\nx_c = (sorted_coords[i][0] + sorted_coords[i + 1][0] + sorted_coords[i + 2][0] + sorted_coords[i + 3][0] + sorted_coords[i + 4][0]) / 5\ny_c = (sorted_coords[i][1] + sorted_coords[i + 1][1] + sorted_coords[i + 2][1] + sorted_coords[i + 3][1] + sorted_coords[i + 4][1]) / 5\ncentroid_coords.append((x_c, y_c))\nsimplifier = vw.Simplifier(centroid_coords)\nsimplified_coords = simplifier.simplify(number=n)\nreturn simplified_coords\n"""\nGiven a list of coordinates, plots them using mplleaflet.\n"""\ndef plot_coordinates(coords):\nplt.plot([c[0] for c in coords], [c[1] for c in coords], color=\'black\')\nmplleaflet.show()\n"""\nGiven a sorted list of coordinates, calculates the total distance encoded in it.\n"""\ndef distance(coords):\nd = 0\nfor i in range(0, len(coords) - 1):\nd += vincenty(coords[i][::-1], coords[i + 1][::-1]).miles\nreturn d'}, {'role': 'assistant', 'content': 'modelling'}]