{"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":"# Image matching challenge 2023 \n\n## Exploratory data analysis of rotation matrices and translation vectors","metadata":{}},{"cell_type":"markdown","source":"This notebook is to perform an EDA of the rotation matrices and translation vectors. I was in the process of training a deep learning model for this challenge. My experiences with the training, made me realize there is still some exploration left to do with the targets, namely rotation matrices and translation vectors. I hope the insights from this notebook will help design a better model.","metadata":{}},{"cell_type":"markdown","source":"## Imports","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nfrom pathlib import Path\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimport statistics","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:58.983850Z","iopub.execute_input":"2023-05-31T13:24:58.984348Z","iopub.status.idle":"2023-05-31T13:24:58.997173Z","shell.execute_reply.started":"2023-05-31T13:24:58.984291Z","shell.execute_reply":"2023-05-31T13:24:58.996381Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Open train_labels.csv file and collect the rotation matrices and translation vectors","metadata":{}},{"cell_type":"code","source":"main_path=Path('/kaggle/input/image-matching-challenge-2023')\ndf_train_path= main_path / 'train'\ntrain_labels_path= df_train_path / 'train_labels.csv'\ndf_train_labels=pd.read_csv(train_labels_path)\ndf_train_labels.head(5)","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:58.998757Z","iopub.execute_input":"2023-05-31T13:24:58.999182Z","iopub.status.idle":"2023-05-31T13:24:59.044109Z","shell.execute_reply.started":"2023-05-31T13:24:58.999144Z","shell.execute_reply":"2023-05-31T13:24:59.042751Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"list_rotation_matrices=df_train_labels['rotation_matrix'].tolist()\nlist_translation_vectors=df_train_labels['translation_vector'].tolist()\nlist_image_paths=df_train_labels['image_path'].tolist()","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.046054Z","iopub.execute_input":"2023-05-31T13:24:59.046746Z","iopub.status.idle":"2023-05-31T13:24:59.052719Z","shell.execute_reply.started":"2023-05-31T13:24:59.046706Z","shell.execute_reply":"2023-05-31T13:24:59.051918Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Linear algebra of the rotation matrices","metadata":{}},{"cell_type":"code","source":"rotmat_dictionary={\"Image_path\" :      [],\n                   \"Rotation_matrix\" : [],\n                   \"Determinant\" :     [],\n                   \"R11\" : [],\n                   \"R12\" : [],\n                   \"R13\" : [],\n                   \"R21\":  [],\n                   \"R22\":  [],\n                   \"R23\":  [],\n                   \"R31\":  [],\n                   \"R32\":  [],\n                   \"R33\":  [],\n                   \"Eigen_vector_1\" : [],\n                   \"Eigen_vector_2\" : [],\n                   \"Eigen_vector_3\" : [],\n                   \"Eigen_value_1\"  : [],\n                   \"Eigen_value_2\"  : [],\n                   \"Eigen_value_3\"  : []\n                   }\n\nfor index in range(len(list_rotation_matrices)):\n    rotation_matrix=np.array(list_rotation_matrices[index].split(';'), dtype=float)\n    rotmat_dictionary[\"R11\"].append(rotation_matrix[0])\n    rotmat_dictionary[\"R12\"].append(rotation_matrix[1])\n    rotmat_dictionary[\"R13\"].append(rotation_matrix[2])\n    rotmat_dictionary[\"R21\"].append(rotation_matrix[3])\n    rotmat_dictionary[\"R22\"].append(rotation_matrix[4])\n    rotmat_dictionary[\"R23\"].append(rotation_matrix[5])\n    rotmat_dictionary[\"R31\"].append(rotation_matrix[6])\n    rotmat_dictionary[\"R32\"].append(rotation_matrix[7])\n    rotmat_dictionary[\"R33\"].append(rotation_matrix[8])  \n    rotation_matrix=rotation_matrix.reshape(3,3)\n    eigen_values,eigen_vectors=np.linalg.eig(rotation_matrix)\n    rotmat_dictionary[\"Eigen_value_1\"].append(eigen_values[0])\n    rotmat_dictionary[\"Eigen_value_2\"].append(eigen_values[1])\n    rotmat_dictionary[\"Eigen_value_3\"].append(eigen_values[2])\n    rotmat_dictionary[\"Eigen_vector_1\"].append(eigen_vectors[0])\n    rotmat_dictionary[\"Eigen_vector_2\"].append(eigen_vectors[1])\n    rotmat_dictionary[\"Eigen_vector_3\"].append(eigen_vectors[2])\n    rotmat_dictionary[\"Determinant\"].append(np.linalg.det(rotation_matrix))\n    rotmat_dictionary[\"Rotation_matrix\"].append(rotation_matrix)\n    rotmat_dictionary[\"Image_path\"].append(list_image_paths[index])\n    ","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.056376Z","iopub.execute_input":"2023-05-31T13:24:59.056948Z","iopub.status.idle":"2023-05-31T13:24:59.093872Z","shell.execute_reply.started":"2023-05-31T13:24:59.056906Z","shell.execute_reply":"2023-05-31T13:24:59.093014Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### 1) Analyze the rotation matrix entries","metadata":{}},{"cell_type":"code","source":"R11=rotmat_dictionary[\"R11\"]\nprint(f\"Minimum R11 value : {min(R11)}\")\nprint(f\"Maximum R11 value : {max(R11)}\")\nprint(f\"Average R11 value : {np.average(R11)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.095383Z","iopub.execute_input":"2023-05-31T13:24:59.095797Z","iopub.status.idle":"2023-05-31T13:24:59.113540Z","shell.execute_reply.started":"2023-05-31T13:24:59.095758Z","shell.execute_reply":"2023-05-31T13:24:59.112381Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"R12=rotmat_dictionary[\"R12\"]\nprint(f\"Minimum R11 value : {min(R12)}\")\nprint(f\"Maximum R11 value : {max(R12)}\")\nprint(f\"Average R11 value : {np.average(R12)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.115270Z","iopub.execute_input":"2023-05-31T13:24:59.115974Z","iopub.status.idle":"2023-05-31T13:24:59.131601Z","shell.execute_reply.started":"2023-05-31T13:24:59.115933Z","shell.execute_reply":"2023-05-31T13:24:59.130433Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"R13=rotmat_dictionary[\"R13\"]\nprint(f\"Minimum R11 value : {min(R13)}\")\nprint(f\"Maximum R11 value : {max(R13)}\")\nprint(f\"Average R11 value : {np.average(R13)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.132998Z","iopub.execute_input":"2023-05-31T13:24:59.133557Z","iopub.status.idle":"2023-05-31T13:24:59.144721Z","shell.execute_reply.started":"2023-05-31T13:24:59.133523Z","shell.execute_reply":"2023-05-31T13:24:59.143630Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"R21=rotmat_dictionary[\"R21\"]\nprint(f\"Minimum R11 value : {min(R21)}\")\nprint(f\"Maximum R11 value : {max(R21)}\")\nprint(f\"Average R11 value : {np.average(R21)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.146240Z","iopub.execute_input":"2023-05-31T13:24:59.147076Z","iopub.status.idle":"2023-05-31T13:24:59.160560Z","shell.execute_reply.started":"2023-05-31T13:24:59.147043Z","shell.execute_reply":"2023-05-31T13:24:59.159514Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"R22=rotmat_dictionary[\"R22\"]\nprint(f\"Minimum R11 value : {min(R22)}\")\nprint(f\"Maximum R11 value : {max(R22)}\")\nprint(f\"Average R11 value : {np.average(R22)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.162093Z","iopub.execute_input":"2023-05-31T13:24:59.162708Z","iopub.status.idle":"2023-05-31T13:24:59.174059Z","shell.execute_reply.started":"2023-05-31T13:24:59.162673Z","shell.execute_reply":"2023-05-31T13:24:59.172905Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"R23=rotmat_dictionary[\"R23\"]\nprint(f\"Minimum R11 value : {min(R23)}\")\nprint(f\"Maximum R11 value : {max(R23)}\")\nprint(f\"Average R11 value : {np.average(R23)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.175575Z","iopub.execute_input":"2023-05-31T13:24:59.176168Z","iopub.status.idle":"2023-05-31T13:24:59.189626Z","shell.execute_reply.started":"2023-05-31T13:24:59.176135Z","shell.execute_reply":"2023-05-31T13:24:59.188642Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"R31=rotmat_dictionary[\"R31\"]\nprint(f\"Minimum R11 value : {min(R31)}\")\nprint(f\"Maximum R11 value : {max(R31)}\")\nprint(f\"Average R11 value : {np.average(R31)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.191047Z","iopub.execute_input":"2023-05-31T13:24:59.191612Z","iopub.status.idle":"2023-05-31T13:24:59.203345Z","shell.execute_reply.started":"2023-05-31T13:24:59.191574Z","shell.execute_reply":"2023-05-31T13:24:59.202374Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"R32=rotmat_dictionary[\"R32\"]\nprint(f\"Minimum R11 value : {min(R32)}\")\nprint(f\"Maximum R11 value : {max(R32)}\")\nprint(f\"Average R11 value : {np.average(R32)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.204636Z","iopub.execute_input":"2023-05-31T13:24:59.205220Z","iopub.status.idle":"2023-05-31T13:24:59.217715Z","shell.execute_reply.started":"2023-05-31T13:24:59.205179Z","shell.execute_reply":"2023-05-31T13:24:59.216452Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"R33=rotmat_dictionary[\"R33\"]\nprint(f\"Minimum R11 value : {min(R33)}\")\nprint(f\"Maximum R11 value : {max(R33)}\")\nprint(f\"Average R11 value : {np.average(R33)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.224378Z","iopub.execute_input":"2023-05-31T13:24:59.224991Z","iopub.status.idle":"2023-05-31T13:24:59.232447Z","shell.execute_reply.started":"2023-05-31T13:24:59.224945Z","shell.execute_reply":"2023-05-31T13:24:59.231163Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig,axs=plt.subplots(3,3)\nfig.set_size_inches((10,10))\n\n\n\naxs[0,0].boxplot(R11, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[0,0].set_title(f\"R11 | median : {round(statistics.median(R11),2)}\")\n\n\naxs[0,1].boxplot(R12, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[0,1].set_title(f\"R12 | median : {round(statistics.median(R12),2)}\")\n\naxs[0,2].boxplot(R13, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[0,2].set_title(f\"R13 | median : {round(statistics.median(R13),2)}\")\n\naxs[1,0].boxplot(R21, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[1,0].set_title('R21')\naxs[1,0].set_title(f\"R21 | median : {round(statistics.median(R21),2)}\")\n\naxs[1,1].boxplot(R22, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[1,1].set_title('R22')\naxs[1,1].set_title(f\"R22 | median : {round(statistics.median(R22),2)}\")\n\naxs[1,2].boxplot(R23, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[1,2].set_title('R23')\naxs[1,2].set_title(f\"R23 | median : {round(statistics.median(R23),2)}\")\n\naxs[2,0].boxplot(R31, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[2,0].set_title('R31')\naxs[2,0].set_title(f\"R31 | median : {round(statistics.median(R31),2)}\")\n\naxs[2,1].boxplot(R32, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[2,1].set_title('R32')\naxs[2,1].set_title(f\"R32 | median : {round(statistics.median(R32),2)}\")\n\naxs[2,2].boxplot(R33, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[2,2].set_title('R33')\naxs[2,2].set_title(f\"R33 | median : {round(statistics.median(R33),2)}\")\n","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:24:59.234022Z","iopub.execute_input":"2023-05-31T13:24:59.234779Z","iopub.status.idle":"2023-05-31T13:25:00.774583Z","shell.execute_reply.started":"2023-05-31T13:24:59.234717Z","shell.execute_reply":"2023-05-31T13:25:00.773455Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"##### Observations \n\n1) All the rotation matrix entries are in the interval (-1,1)\n\n2) The leading diagonal entries of the matrix have median away from 0, while other entries are median zero\n\n     R11, R22, R33 have non zero medians\n     \n     R12, R13, R21, R23, R31, R32 have almost zero medians\n     \n     Means many rotation matrices are just diagonal matrices","metadata":{}},{"cell_type":"markdown","source":"#### 2) Analyze the linear algebraic properties of rotation matrix","metadata":{}},{"cell_type":"markdown","source":"###### a) Determinant of the rotation matrix","metadata":{}},{"cell_type":"code","source":"determinants=rotmat_dictionary[\"Determinant\"]\ndeterminants_rounded=[round(i,2) for i in determinants]\nfig,axs=plt.subplots(1,1)\n\n\n\n\naxs.boxplot(determinants_rounded, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs.set_title(f\"Determinants | median : {round(statistics.median(determinants_rounded),2)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:00.776350Z","iopub.execute_input":"2023-05-31T13:25:00.777053Z","iopub.status.idle":"2023-05-31T13:25:01.017231Z","shell.execute_reply.started":"2023-05-31T13:25:00.777010Z","shell.execute_reply":"2023-05-31T13:25:01.016120Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# See that all the determinant values are equal to 1.0\ntest_determinants=np.ones(len(determinants))\nnp.allclose(test_determinants,determinants)","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:01.019009Z","iopub.execute_input":"2023-05-31T13:25:01.019728Z","iopub.status.idle":"2023-05-31T13:25:01.028051Z","shell.execute_reply.started":"2023-05-31T13:25:01.019689Z","shell.execute_reply":"2023-05-31T13:25:01.026787Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"list_rotation_matrices[0]","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:01.030160Z","iopub.execute_input":"2023-05-31T13:25:01.030806Z","iopub.status.idle":"2023-05-31T13:25:01.044269Z","shell.execute_reply.started":"2023-05-31T13:25:01.030759Z","shell.execute_reply":"2023-05-31T13:25:01.042874Z"},"jupyter":{"source_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"##### b) Check the orthogonality of the rotation matrices","metadata":{}},{"cell_type":"code","source":"# Perform orthogonality check\n#rotation_matrix=np.array(list_rotation_matrices[index].split(';'), dtype=float)\n\nlist_split_rotation_matrices=[np.array(M.split(';'),dtype=float) for M in list_rotation_matrices]\nlist_shaped_rotation_matrices=[M.reshape(3,3) for M in list_split_rotation_matrices]\nlist_mult_matrices=[np.matmul(M,M.T) for M in list_shaped_rotation_matrices]\n\nlist_identity_matrices=[np.identity(3) for i in range(len(list_shaped_rotation_matrices))]\n\nprint(list_mult_matrices[0])\nprint(list_identity_matrices[0])\n","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:01.048718Z","iopub.execute_input":"2023-05-31T13:25:01.049122Z","iopub.status.idle":"2023-05-31T13:25:01.066292Z","shell.execute_reply.started":"2023-05-31T13:25:01.049092Z","shell.execute_reply":"2023-05-31T13:25:01.065124Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"np.allclose(list_mult_matrices, list_identity_matrices)","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:01.067895Z","iopub.execute_input":"2023-05-31T13:25:01.068623Z","iopub.status.idle":"2023-05-31T13:25:01.077742Z","shell.execute_reply.started":"2023-05-31T13:25:01.068580Z","shell.execute_reply":"2023-05-31T13:25:01.076766Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"##### c) Check the eigen values of the rotation matrices","metadata":{}},{"cell_type":"code","source":"eigen_values=rotmat_dictionary[\"Eigen_value_1\"]\neigen_values_rounded=[round(abs(i),2) for i in eigen_values]\nfig,axs=plt.subplots(1,1)\n\n\n\n\naxs.boxplot(eigen_values_rounded, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs.set_title(f\"Eigen values | median : {round(statistics.median(eigen_values_rounded),2)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:01.079388Z","iopub.execute_input":"2023-05-31T13:25:01.080111Z","iopub.status.idle":"2023-05-31T13:25:01.319975Z","shell.execute_reply.started":"2023-05-31T13:25:01.080056Z","shell.execute_reply":"2023-05-31T13:25:01.318433Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"list_eigen_values_ones=np.ones(len(eigen_values))\nnp.allclose(list_eigen_values_ones,eigen_values_rounded)","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:01.321389Z","iopub.execute_input":"2023-05-31T13:25:01.321970Z","iopub.status.idle":"2023-05-31T13:25:01.330880Z","shell.execute_reply.started":"2023-05-31T13:25:01.321935Z","shell.execute_reply":"2023-05-31T13:25:01.329352Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"##### c) Check if the matrices are symmetric","metadata":{}},{"cell_type":"code","source":"list_transposes=[M.T for M in list_shaped_rotation_matrices]\n\nnp.allclose(list_shaped_rotation_matrices,list_transposes)","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:01.332511Z","iopub.execute_input":"2023-05-31T13:25:01.333138Z","iopub.status.idle":"2023-05-31T13:25:01.347735Z","shell.execute_reply.started":"2023-05-31T13:25:01.333102Z","shell.execute_reply":"2023-05-31T13:25:01.346392Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"##### Observations\n\n1) See that the rotation matrices are all having determinants 1. (So, the model we design should output a matrix whose determinant should be 1)\n\n2) See that all the rotation matrices are orthogonal $ M . M^{T} = I $ (So , the model we design should output an orthogonal matrix)\n\n3) See that all the rotation matrices have eigen values $ \\lambda $ such that $ \\lvert \\lambda \\rvert = 1 $ ( This is a consequence of a rotation matrix)\n\n4) See that the rotation matrices are not necessarily symmetric","metadata":{}},{"cell_type":"code","source":"import torch\na=torch.tensor([1,2,3])","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:01.349589Z","iopub.execute_input":"2023-05-31T13:25:01.350113Z","iopub.status.idle":"2023-05-31T13:25:03.222150Z","shell.execute_reply.started":"2023-05-31T13:25:01.350050Z","shell.execute_reply":"2023-05-31T13:25:03.220915Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Analysis of translation vectors","metadata":{}},{"cell_type":"code","source":"transvect_dictionary={\"Image_path\" :      [],\n                   \"Translation_vector\" : [],\n                   \"X_value\" : [],\n                   \"Y_value\" : [],\n                   \"Z_value\" : []\n                   }\n\nfor index in range(len(list_rotation_matrices)):\n    translation_vector=np.array(list_translation_vectors[index].split(';'), dtype=float)\n    transvect_dictionary[\"X_value\"].append(translation_vector[0])\n    transvect_dictionary[\"Y_value\"].append(translation_vector[1])\n    transvect_dictionary[\"Z_value\"].append(translation_vector[2])\n    transvect_dictionary[\"Image_path\"].append(list_image_paths[index])\n    transvect_dictionary[\"Translation_vector\"].append(translation_vector)","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:03.223622Z","iopub.execute_input":"2023-05-31T13:25:03.224236Z","iopub.status.idle":"2023-05-31T13:25:03.234665Z","shell.execute_reply.started":"2023-05-31T13:25:03.224199Z","shell.execute_reply":"2023-05-31T13:25:03.233094Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X=transvect_dictionary[\"X_value\"]\nY=transvect_dictionary[\"Y_value\"]\nZ=transvect_dictionary[\"Z_value\"]","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:03.235823Z","iopub.execute_input":"2023-05-31T13:25:03.236165Z","iopub.status.idle":"2023-05-31T13:25:03.253726Z","shell.execute_reply.started":"2023-05-31T13:25:03.236135Z","shell.execute_reply":"2023-05-31T13:25:03.252816Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig,axs=plt.subplots(1,3)\nfig.set_size_inches((10,3))\n\n\n\naxs[0].boxplot(X, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[0].set_title(f\"X | median : {round(statistics.median(X),2)}\")\n\n\naxs[1].boxplot(Y, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[1].set_title(f\"Y | median : {round(statistics.median(Y),2)}\")\n\naxs[2].boxplot(Z, notch=False, patch_artist=True,boxprops=dict(facecolor=\"yellow\", color=\"red\"))\naxs[2].set_title(f\"Z | median : {round(statistics.median(Z),2)}\")","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:03.255078Z","iopub.execute_input":"2023-05-31T13:25:03.256111Z","iopub.status.idle":"2023-05-31T13:25:03.803496Z","shell.execute_reply.started":"2023-05-31T13:25:03.256068Z","shell.execute_reply":"2023-05-31T13:25:03.802327Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_X=pd.DataFrame(X)\ndf_Y=pd.DataFrame(Y)\ndf_Z=pd.DataFrame(Z)","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:03.804717Z","iopub.execute_input":"2023-05-31T13:25:03.805032Z","iopub.status.idle":"2023-05-31T13:25:03.811794Z","shell.execute_reply.started":"2023-05-31T13:25:03.805007Z","shell.execute_reply":"2023-05-31T13:25:03.810589Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_X.describe()","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:03.813282Z","iopub.execute_input":"2023-05-31T13:25:03.813754Z","iopub.status.idle":"2023-05-31T13:25:03.834380Z","shell.execute_reply.started":"2023-05-31T13:25:03.813713Z","shell.execute_reply":"2023-05-31T13:25:03.833332Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_Y.describe()","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:03.836167Z","iopub.execute_input":"2023-05-31T13:25:03.836552Z","iopub.status.idle":"2023-05-31T13:25:03.855964Z","shell.execute_reply.started":"2023-05-31T13:25:03.836521Z","shell.execute_reply":"2023-05-31T13:25:03.854797Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\ndf_Z.describe()","metadata":{"execution":{"iopub.status.busy":"2023-05-31T13:25:03.857197Z","iopub.execute_input":"2023-05-31T13:25:03.857654Z","iopub.status.idle":"2023-05-31T13:25:03.877894Z","shell.execute_reply.started":"2023-05-31T13:25:03.857611Z","shell.execute_reply":"2023-05-31T13:25:03.876931Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"##### Observations\n\n1) See that the translation vector values are unbounded.","metadata":{}},{"cell_type":"markdown","source":"With that, I am concluding this notebook for now.\nI request my fellow kagglers to give me suggestions / criticisms on improving this notebook and in general for EDA.","metadata":{}}]}