{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"Machine Learning Model for Albedo of mercuary  Evaluation test","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19"}},{"cell_type":"markdown","source":"Relying on scientific gains on Kaggle & Google ( machine learning ) and AS a Master's AI Student\nI reached these results related to this project \"Machine Learning Model for the Planetary\nAlbedo\".\nI aimed to predict the albedo based on the relationships between chemical elements composing the surface of the Moon. The challenge consisted of the fact that the existing datasets were incomplete.\n\nThe experiments presented here were done with the use of the following datasets.\nFor the Moon:\n\nalbedo map\nLPFe (iron map)\nLPK (potassium map)\nLPTh (thorium map)\nLPTi (titanium) map.\n\nFor Mercury:\n\nalbedo map\nAl to Si element ratio\nCa to Si element ratio\nFe to Si element ratio\nMg to Si element ratio\nS to Si element ratio.\n","metadata":{}},{"cell_type":"markdown","source":"Task 1. Predicting the Lunar Albedo based on Chemical Composition","metadata":{}},{"cell_type":"markdown","source":"1.Importing Libraries","metadata":{}},{"cell_type":"code","source":"import pandas as pnd #For manipulating numerical tables and time series.\nimport numpy as np #For operations.\nfrom skimage.io import imread, imshow # imshow to display data as an image & imread to used to read an image from a file into an array.\nimport matplotlib.pyplot as plt #collection of functions that make matplotlib work like MATLAB\n%matplotlib inline \n#The resulting plots will be stored in the notebook document.\n","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:29.459476Z","iopub.execute_input":"2022-04-24T18:55:29.460318Z","iopub.status.idle":"2022-04-24T18:55:30.261714Z","shell.execute_reply.started":"2022-04-24T18:55:29.460223Z","shell.execute_reply":"2022-04-24T18:55:30.260952Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Read a CSV file (Maps) with Numpy (Store as Numpy arrays)","metadata":{}},{"cell_type":"code","source":"Albedo_Map=pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Moon/Albedo_Map.csv').to_numpy()\nLPFe_Map = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Moon/LPFe_Map.csv').to_numpy()\nLPK_Map = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Moon/LPK_Map.csv').to_numpy()\nLPTh_Map = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Moon/LPTh_Map.csv').to_numpy()\nLPTi_Map = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Moon/LPTi_Map.csv').to_numpy()\n\n#Lbl: Albedo map\n#Feat:List of maps\nFeat= [LPFe_Map,LPK_Map,LPTh_Map,LPTi_Map]\nLbl= Albedo_Map","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:30.26346Z","iopub.execute_input":"2022-04-24T18:55:30.263755Z","iopub.status.idle":"2022-04-24T18:55:32.232719Z","shell.execute_reply.started":"2022-04-24T18:55:30.263721Z","shell.execute_reply":"2022-04-24T18:55:32.231887Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# using imshow to display the data of Albedo map and LPFe, LPTi, LPK, LPTh maps as image \nimshow(Albedo_Map)\nprint(\"The Albedo_Map\")\nfig, a = plt.subplots(1,2)\na[0].imshow(LPFe_Map)\na[1].imshow(LPTi_Map)\nfig, a1 = plt.subplots(1,2)\na1[0].imshow(LPK_Map)\na1[1].imshow(LPTh_Map)","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:32.234224Z","iopub.execute_input":"2022-04-24T18:55:32.234457Z","iopub.status.idle":"2022-04-24T18:55:33.280818Z","shell.execute_reply.started":"2022-04-24T18:55:32.234429Z","shell.execute_reply":"2022-04-24T18:55:33.280196Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Divise and trainning ","metadata":{}},{"cell_type":"code","source":"# divise the map on 2 and take left half for training data \nprint(imshow(Lbl[:,:360]))\nLbl[:,:360].shape","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:33.282523Z","iopub.execute_input":"2022-04-24T18:55:33.282918Z","iopub.status.idle":"2022-04-24T18:55:33.556952Z","shell.execute_reply.started":"2022-04-24T18:55:33.282882Z","shell.execute_reply":"2022-04-24T18:55:33.556282Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Time to trainning & testing (X_tr x_ts for the 4 feats )(y_tr y_ts for Albedo map)\nFlatten():used to get a copy of an given array collapsed into one dimension.","metadata":{}},{"cell_type":"code","source":"#Flatten():used to get a copy of an given array collapsed into one dimension.\n# numpy.stack(arrays, axis)\n# we need to know the dimensions of the array so we will use shape function\nx_tr=np.stack((LPFe_Map[:,:360].flatten(),LPK_Map[:,:360].flatten(),LPTh_Map[:,:360].flatten(),LPTi_Map[:,:360].flatten())).T\nx_ts=np.stack((LPFe_Map[:,360:].flatten(),LPK_Map[:,360:].flatten(),LPTh_Map[:,360:].flatten(),LPTi_Map[:,360:].flatten())).T\nprint(x_tr.shape,x_ts.shape)\ny_tr=np.array(Lbl[:,:360].flatten()).T\ny_ts=np.array(Lbl[:,360:].flatten()).T\nprint(y_tr.shape,y_ts.shape)","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:33.557921Z","iopub.execute_input":"2022-04-24T18:55:33.558426Z","iopub.status.idle":"2022-04-24T18:55:33.580426Z","shell.execute_reply.started":"2022-04-24T18:55:33.558381Z","shell.execute_reply":"2022-04-24T18:55:33.579535Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"I want to solve my problem with a high level of accuracy, I see that using the Gradient Boosting  to produce a predictive model from an ensemble of weak predictive models will be useful.\n1:Using sklearn.ensemble.GradientBoostingRegressor model for fitting  \n(Fit data on sklearn with fit() )\n2:working with MSE as metric to quantify My Algo performance\n ","metadata":{}},{"cell_type":"code","source":"from sklearn.datasets import make_friedman1\nfrom sklearn.ensemble import GradientBoostingRegressor #model for fitting\nfrom sklearn.metrics import mean_squared_error #to quantify My Algo performance\n\nestim = GradientBoostingRegressor(n_estimators=100, learning_rate=0.1, max_depth=1, random_state=42, loss='squared_error').fit(x_tr, y_tr)\ny_predict=estim.predict(x_ts)\n\nmse=mean_squared_error(y_ts, y_predict)\nprint(\"The mean squared error is :\", mse)\n","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:33.581485Z","iopub.execute_input":"2022-04-24T18:55:33.581754Z","iopub.status.idle":"2022-04-24T18:55:37.612308Z","shell.execute_reply.started":"2022-04-24T18:55:33.581719Z","shell.execute_reply":"2022-04-24T18:55:37.611326Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Residual Plot for Gradient Boosting Regressor Model \n(The residual is the gradient of loss function)\n(A residual plot has the Residual Values on the vertical axis; the horizontal axis displays the independent variable).","metadata":{}},{"cell_type":"markdown","source":"Seeing the entire predicted Albedo map :\n","metadata":{}},{"cell_type":"code","source":"from sklearn.metrics import mean_squared_error\nfrom sklearn.datasets import make_friedman1\nfrom sklearn.ensemble import GradientBoostingRegressor\n\nest = GradientBoostingRegressor(n_estimators=100, learning_rate=0.1, max_depth=1, random_state=42, loss='squared_error').fit(x_tr, y_tr)\ny_pred=est.predict(x_ts)\n\n# printing MSE\nmse=mean_squared_error(y_ts, y_pred)\nprint(\"MSE for GradientBoostingRegressor\", mse)","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:37.61353Z","iopub.execute_input":"2022-04-24T18:55:37.613749Z","iopub.status.idle":"2022-04-24T18:55:40.54162Z","shell.execute_reply.started":"2022-04-24T18:55:37.613723Z","shell.execute_reply":"2022-04-24T18:55:40.540753Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Residual Plot for Gradient Boosting Regressor Model \n(The residual is the gradient of loss function)\n(A residual plot has the Residual Values on the vertical axis; the horizontal axis displays the independent variable).","metadata":{}},{"cell_type":"markdown","source":"The resulting prediction and plot the residuals (difference\nfrom the true image) as a 2-D image and a 1-D histogram.\n","metadata":{}},{"cell_type":"code","source":"from yellowbrick.regressor import ResidualsPlot\nmodel=GradientBoostingRegressor(n_estimators=100, learning_rate=0.1, max_depth=1, random_state=42, loss='squared_error')\nvisualizer = ResidualsPlot(model)\nvisualizer.fit(x_tr, y_tr)  # Fit the training data to the visualizer\nvisualizer.score(x_ts, y_ts)  # Evaluate the model on the test data\n","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:40.543977Z","iopub.execute_input":"2022-04-24T18:55:40.545196Z","iopub.status.idle":"2022-04-24T18:55:45.585388Z","shell.execute_reply.started":"2022-04-24T18:55:40.545151Z","shell.execute_reply":"2022-04-24T18:55:45.584784Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred_plot=y_pred.reshape(359,-1)\nprint(imshow(np.concatenate((Lbl[:,:360],y_pred_plot), axis=1)))\nprint(\"predict albedo\")","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:45.586394Z","iopub.execute_input":"2022-04-24T18:55:45.587002Z","iopub.status.idle":"2022-04-24T18:55:45.851902Z","shell.execute_reply.started":"2022-04-24T18:55:45.586963Z","shell.execute_reply":"2022-04-24T18:55:45.851025Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Comparing with Original Albedo:\n","metadata":{}},{"cell_type":"code","source":"print(imshow(Lbl))\nprint(\"Original albedo\")","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:45.855428Z","iopub.execute_input":"2022-04-24T18:55:45.855754Z","iopub.status.idle":"2022-04-24T18:55:46.221923Z","shell.execute_reply.started":"2022-04-24T18:55:45.855709Z","shell.execute_reply":"2022-04-24T18:55:46.221286Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"As you can observe, the GradientBoostingRegressor of the ensemble methods returned the best results in our case ","metadata":{}},{"cell_type":"markdown","source":"I want to use the SGDRegressor Stochastic Gradient Descent:","metadata":{}},{"cell_type":"code","source":"from sklearn.preprocessing import StandardScaler\nfrom sklearn.linear_model import SGDRegressor\nfrom sklearn.pipeline import make_pipeline\nscaler = StandardScaler()\nscaler.fit(x_tr)  # The test data is \"leaking\" into our training data  - fit only on training data\nx_tr = scaler.transform(x_tr)\nx_ts = scaler.transform(x_ts) \nregres = make_pipeline(StandardScaler(),SGDRegressor(max_iter=1000, tol=1e-3))\nregres.fit(x_tr,y_tr)\ny_predict=regres.predict(x_ts)\nprint(\"MSE using SGDRegressor is:\", mean_squared_error(y_ts,y_predict))\n","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:46.223031Z","iopub.execute_input":"2022-04-24T18:55:46.223351Z","iopub.status.idle":"2022-04-24T18:55:46.353661Z","shell.execute_reply.started":"2022-04-24T18:55:46.223323Z","shell.execute_reply":"2022-04-24T18:55:46.352751Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"  Comparing Albedo prediction to the Albedo map.\n","metadata":{}},{"cell_type":"code","source":"y_predict_plot=y_predict.reshape(359,-1)\ny_test_plot=y_ts.reshape(359,-1)\n\n\nprint(imshow(np.concatenate((Lbl[:,:360],y_predict_plot), axis=1)))\nprint(\"The Predicted Albedo\")","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:46.355376Z","iopub.execute_input":"2022-04-24T18:55:46.355924Z","iopub.status.idle":"2022-04-24T18:55:46.731254Z","shell.execute_reply.started":"2022-04-24T18:55:46.355879Z","shell.execute_reply":"2022-04-24T18:55:46.730285Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Again Compare with the real albedo map","metadata":{}},{"cell_type":"code","source":"print(imshow(Lbl))\nprint(\"the real Albedo Map\")","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:46.732412Z","iopub.execute_input":"2022-04-24T18:55:46.732648Z","iopub.status.idle":"2022-04-24T18:55:47.090879Z","shell.execute_reply.started":"2022-04-24T18:55:46.732619Z","shell.execute_reply":"2022-04-24T18:55:47.089929Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Task2:**Predicting Mercury’s elemental composition from Albedo with\nMESSENGER Data**","metadata":{}},{"cell_type":"markdown","source":"Read a CSV file (Maps) with Numpy (Store as Numpy arrays)","metadata":{}},{"cell_type":"markdown","source":"Features: List of np.arrays of given element ratio maps\nLabels: List of np.arrays of given Albedo Map","metadata":{}},{"cell_type":"code","source":"albedo_top = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Mercury/mercury-albedo-top-half.png.csv').to_numpy()\nalbedo_bottom = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Mercury/mercury-albedo-resized-bottom-half.png.csv').to_numpy()\nalsi = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Mercury/alsimap_smooth_032015.png.csv').to_numpy()\ncasi=pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Mercury/casimap_smooth_032015.png.csv').to_numpy()\nfesi = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Mercury/fesimap_smooth_032015.png.csv').to_numpy()\nmgsi = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Mercury/mgsimap_smooth_032015.png.csv').to_numpy()\nssi = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Mercury/ssimap_smooth_032015.png.csv').to_numpy()\nalbedo_top = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Mercury/mercury-albedo-top-half.png.csv').to_numpy()\nalbedo_bottom = pnd.read_csv('https://raw.githubusercontent.com/ML4SCI/ML4SCI_GSoC/main/Messenger/Mercury/mercury-albedo-resized-bottom-half.png.csv').to_numpy()\n\nFeats= [alsi,casi,fesi,mgsi,ssi]\nLabls= [albedo_top,albedo_bottom]","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:47.092117Z","iopub.execute_input":"2022-04-24T18:55:47.092347Z","iopub.status.idle":"2022-04-24T18:55:54.528365Z","shell.execute_reply.started":"2022-04-24T18:55:47.092317Z","shell.execute_reply":"2022-04-24T18:55:54.527412Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Cloning maps for verification's sake ","metadata":{}},{"cell_type":"code","source":"imshow(albedo_bottom)\nprint(albedo_bottom.shape)","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:54.530828Z","iopub.execute_input":"2022-04-24T18:55:54.531113Z","iopub.status.idle":"2022-04-24T18:55:54.965605Z","shell.execute_reply.started":"2022-04-24T18:55:54.53108Z","shell.execute_reply":"2022-04-24T18:55:54.964612Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\nimport seaborn as sb\nsb.set_theme()\naxe = sb.heatmap(mgsi, cmap='plasma')","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:55:54.967197Z","iopub.execute_input":"2022-04-24T18:55:54.967527Z","iopub.status.idle":"2022-04-24T18:55:57.540171Z","shell.execute_reply.started":"2022-04-24T18:55:54.967482Z","shell.execute_reply":"2022-04-24T18:55:57.53921Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"a = sb.heatmap(alsi, cmap='plasma')","metadata":{"execution":{"iopub.status.busy":"2022-04-24T19:00:28.812585Z","iopub.execute_input":"2022-04-24T19:00:28.812877Z","iopub.status.idle":"2022-04-24T19:00:31.044442Z","shell.execute_reply.started":"2022-04-24T19:00:28.812835Z","shell.execute_reply":"2022-04-24T19:00:31.043322Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"a = sb.heatmap(fesi, cmap='plasma')","metadata":{"execution":{"iopub.status.busy":"2022-04-24T19:00:15.364577Z","iopub.execute_input":"2022-04-24T19:00:15.365117Z","iopub.status.idle":"2022-04-24T19:00:17.564915Z","shell.execute_reply.started":"2022-04-24T19:00:15.365079Z","shell.execute_reply":"2022-04-24T19:00:17.563946Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"a = sb.heatmap(casi, cmap='plasma')","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:59:58.42577Z","iopub.execute_input":"2022-04-24T18:59:58.426092Z","iopub.status.idle":"2022-04-24T19:00:00.598007Z","shell.execute_reply.started":"2022-04-24T18:59:58.426058Z","shell.execute_reply":"2022-04-24T19:00:00.597151Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"a = sb.heatmap(ssi, cmap='plasma')","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:59:45.32886Z","iopub.execute_input":"2022-04-24T18:59:45.329155Z","iopub.status.idle":"2022-04-24T18:59:47.526005Z","shell.execute_reply.started":"2022-04-24T18:59:45.329124Z","shell.execute_reply":"2022-04-24T18:59:47.524975Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Resize to devise Albedo map to use the top half for trainnig and bottom half to testing\n\nuse a model to train your algorith to find relationships between albedo and chemical\ncomposition in the top of the planet. Then, make a prediction about chemical\ncomposition for the bottom half of the planet using the albedo","metadata":{}},{"cell_type":"code","source":"from skimage.transform import resize\n#X for albedo Y for elements \nalbedo_top = resize(albedo_top, (albedo_top.shape[0] // 2, albedo_top.shape[1]), anti_aliasing=True)\nalbedo_bottom = resize(albedo_bottom, (albedo_bottom.shape[0] // 2, albedo_bottom.shape[1]), anti_aliasing=True)\n#trainning & testing X\nx_tr=np.array([albedo_top.flatten()]).T\nx_ts=np.array([albedo_bottom.flatten()]).T\nprint(x_tr.shape,x_ts.shape)\n#trainning & testing  Y\ny_tr_alsi=np.array(alsi[:359,:].flatten()).T\ny_tr_casi=np.array(casi[:359,:].flatten()).T\ny_tr_fesi=np.array(fesi[:359,:].flatten()).T\ny_tr_mgsi=np.array(mgsi[:359,:].flatten()).T\ny_tr_ssi=np.array(ssi[:359,:].flatten()).T\ny_ts_alsi=np.array(alsi[359:-1,:].flatten()).T\ny_ts_casi=np.array(casi[359:-1,:].flatten()).T\ny_ts_fesi=np.array(fesi[359:-1,:].flatten()).T\ny_ts_mgsi=np.array(mgsi[359:-1,:].flatten()).T\ny_ts_ssi=np.array(ssi[359:-1,:].flatten()).T\nprint(y_tr_fesi.shape,y_ts_fesi.shape)","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:56:06.605631Z","iopub.execute_input":"2022-04-24T18:56:06.606055Z","iopub.status.idle":"2022-04-24T18:56:06.845403Z","shell.execute_reply.started":"2022-04-24T18:56:06.606021Z","shell.execute_reply":"2022-04-24T18:56:06.844501Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.metrics import mean_squared_error\nfrom sklearn.datasets import make_friedman1\nfrom sklearn.ensemble import GradientBoostingRegressor\n\ndef Predict(y_tr,y_ts,element):\n  estim = GradientBoostingRegressor(loss='squared_error', learning_rate=0.1,n_estimators=100,max_depth=1, random_state=None).fit(x_tr, y_tr)\n  y_predict=estim.predict(x_ts)\n  mse=mean_squared_error(y_ts, y_predict)\n  print(\"MSE for %s using GradientBoostingRegressor:\"%element, mse)\n  return y_predict\n\ny_pred_alsi=Predict(y_tr_alsi,y_ts_alsi,\"Al-Si\")\ny_pred_fesi=Predict(y_tr_fesi,y_ts_fesi,\"Fe-Si\")\ny_pred_mgsi=Predict(y_tr_mgsi,y_ts_fesi,\"Mg-Si\")\ny_pred_casi=Predict(y_tr_casi,y_ts_fesi,\"Ca-Si\")\ny_pred_ssi=Predict(y_tr_ssi,y_ts_fesi,\"S-Si\")\n","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:56:06.846632Z","iopub.execute_input":"2022-04-24T18:56:06.846881Z","iopub.status.idle":"2022-04-24T18:57:08.48512Z","shell.execute_reply.started":"2022-04-24T18:56:06.846839Z","shell.execute_reply":"2022-04-24T18:57:08.484306Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"\n  Comparing predictions for Al-Si","metadata":{}},{"cell_type":"code","source":"y_pred_plot_al= y_pred_alsi.reshape(359,-1)\ny_ts_plot_al=y_ts_alsi.reshape(359,-1)\n\nprint(sb.heatmap(y_pred_plot_al,cmap='plasma'))","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:59:27.102206Z","iopub.execute_input":"2022-04-24T18:59:27.102635Z","iopub.status.idle":"2022-04-24T18:59:28.608212Z","shell.execute_reply.started":"2022-04-24T18:59:27.102599Z","shell.execute_reply":"2022-04-24T18:59:28.607289Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Real Map\nprint(sb.heatmap(y_ts_plot_al, cmap='plasma'))","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:59:15.087025Z","iopub.execute_input":"2022-04-24T18:59:15.087514Z","iopub.status.idle":"2022-04-24T18:59:16.60145Z","shell.execute_reply.started":"2022-04-24T18:59:15.087462Z","shell.execute_reply":"2022-04-24T18:59:16.600823Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"\n  Comparing predictions for Fe-Si\n","metadata":{}},{"cell_type":"code","source":"y_pred_plot_fe= y_pred_fesi.reshape(359,-1)\ny_ts_plot_fe=y_ts_fesi.reshape(359,-1)\nprint(sb.heatmap(y_pred_plot_fe,cmap='plasma'))","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:58:43.099823Z","iopub.execute_input":"2022-04-24T18:58:43.100995Z","iopub.status.idle":"2022-04-24T18:58:44.713008Z","shell.execute_reply.started":"2022-04-24T18:58:43.10095Z","shell.execute_reply":"2022-04-24T18:58:44.712154Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"\nComprison for Fe-Si","metadata":{}},{"cell_type":"code","source":"y_pred_plot_s= y_pred_ssi.reshape(359,-1)\ny_test_plot_s=y_ts_ssi.reshape(359,-1)\nprint(sb.heatmap(y_pred_plot,cmap='plasma'))\n","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:58:33.22217Z","iopub.execute_input":"2022-04-24T18:58:33.222447Z","iopub.status.idle":"2022-04-24T18:58:34.179859Z","shell.execute_reply.started":"2022-04-24T18:58:33.222416Z","shell.execute_reply":"2022-04-24T18:58:34.179002Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Real map","metadata":{}},{"cell_type":"code","source":"print(sb.heatmap(y_ts_plot_fe, cmap='plasma'))","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:57:25.017456Z","iopub.execute_input":"2022-04-24T18:57:25.017834Z","iopub.status.idle":"2022-04-24T18:57:26.540646Z","shell.execute_reply.started":"2022-04-24T18:57:25.017791Z","shell.execute_reply":"2022-04-24T18:57:26.539618Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"  Comparing predictions for Mg-Si\n","metadata":{}},{"cell_type":"code","source":"y_pred_plot_mg= y_pred_mgsi.reshape(359,-1)\ny_ts_plot_mg=y_ts_mgsi.reshape(359,-1)\nprint(sb.heatmap(y_pred_plot_mg,cmap='plasma'))","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:57:38.64331Z","iopub.execute_input":"2022-04-24T18:57:38.643589Z","iopub.status.idle":"2022-04-24T18:57:40.175588Z","shell.execute_reply.started":"2022-04-24T18:57:38.643561Z","shell.execute_reply":"2022-04-24T18:57:40.174798Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Real map","metadata":{}},{"cell_type":"code","source":"print(sb.heatmap(y_ts_plot_mg, cmap='plasma'))","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:57:51.885757Z","iopub.execute_input":"2022-04-24T18:57:51.886245Z","iopub.status.idle":"2022-04-24T18:57:53.393293Z","shell.execute_reply.started":"2022-04-24T18:57:51.886211Z","shell.execute_reply":"2022-04-24T18:57:53.392564Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"  Comparing predictions for Ca-Si\n","metadata":{}},{"cell_type":"code","source":"y_pred_plot_ca= y_pred_casi.reshape(359,-1)\ny_ts_plot_ca=y_ts_casi.reshape(359,-1)\nprint(sb.heatmap(y_pred_plot_ca,cmap='plasma'))\n","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:57:57.415497Z","iopub.execute_input":"2022-04-24T18:57:57.415906Z","iopub.status.idle":"2022-04-24T18:57:58.948107Z","shell.execute_reply.started":"2022-04-24T18:57:57.415875Z","shell.execute_reply":"2022-04-24T18:57:58.947406Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Real Map ","metadata":{}},{"cell_type":"code","source":"print(sb.heatmap(y_ts_plot_ca, cmap='plasma'))","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:58:03.196875Z","iopub.execute_input":"2022-04-24T18:58:03.197615Z","iopub.status.idle":"2022-04-24T18:58:04.713719Z","shell.execute_reply.started":"2022-04-24T18:58:03.197579Z","shell.execute_reply":"2022-04-24T18:58:04.71288Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"  Comparing predictions for S\n","metadata":{}},{"cell_type":"code","source":"y_pred_plot_s= y_pred_ssi.reshape(359,-1)\ny_ts_plot_s=y_ts_ssi.reshape(359,-1)\nprint(sb.heatmap(y_pred_plot_s,cmap='plasma'))\n","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:58:08.40367Z","iopub.execute_input":"2022-04-24T18:58:08.404529Z","iopub.status.idle":"2022-04-24T18:58:09.942131Z","shell.execute_reply.started":"2022-04-24T18:58:08.404481Z","shell.execute_reply":"2022-04-24T18:58:09.941041Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Real map","metadata":{}},{"cell_type":"code","source":"print(sb.heatmap(y_ts_plot_s, cmap='plasma'))","metadata":{"execution":{"iopub.status.busy":"2022-04-24T18:58:15.520105Z","iopub.execute_input":"2022-04-24T18:58:15.520384Z","iopub.status.idle":"2022-04-24T18:58:17.243651Z","shell.execute_reply.started":"2022-04-24T18:58:15.520357Z","shell.execute_reply":"2022-04-24T18:58:17.242987Z"},"trusted":true},"execution_count":null,"outputs":[]}]}