<jupyter_start><jupyter_text>Create Sensor GeoDataFrames<jupyter_code>model_key = job_name + '/output/model.tar.gz'
boto3.resource('s3').Bucket(bucket_name).download_file(model_key, 'model.tar.gz')
os.system('tar -zxvf model.tar.gz')
os.system('unzip model_algo-1')
Kmeans_model_params = mx.ndarray.load('model_algo-1')
sensors = pd.DataFrame(Kmeans_model_params[0].asnumpy())
sensors.columns = ['latitude', 'longitude']
gdf_sensors = geopandas.GeoDataFrame(sensors, geometry=geopandas.points_from_xy(sensors.longitude, sensors.latitude))<jupyter_output><empty_output><jupyter_text>Plot the Sensors and Observations<jupyter_code>ax = world.plot(color='white', edgecolor='black', figsize=(20,10))
gdf.plot(ax=ax, color='red', markersize=1, label='Observations')
gdf_sensors.plot(ax=ax, color='green', markersize=40, label='Sensor Locations')
plt.legend()
plt.show()
file_name = 'sensors.csv'
sensors[['latitude', 'longitude']].to_csv(file_name, index=False)
s3_client = boto3.client('s3')
response = s3_client.upload_file(file_name, bucket_name, file_name)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16036866359447005, 'fraction_numerical': 0.014746543778801843, 'mean_word_length': 10.3125, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '528043', 'license': 'MIT', 'n_tokens_mistral': 428, 'n_tokens_neox': 407, 'n_words': 52, 'path': 'ml-cert-2-ufo.ipynb', 'repo_name': 'daniel-fudge/aws-ml-certification', 'size': '1085'}