{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.11","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":2020493,"sourceType":"datasetVersion","datasetId":1209379},{"sourceId":72929774,"sourceType":"kernelVersion"},{"sourceId":115003,"sourceType":"modelInstanceVersion","isSourceIdPinned":true,"modelInstanceId":96587,"modelId":120770}],"dockerImageVersionId":31012,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n for filename in filenames:\n print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-05-20T14:53:51.929874Z","iopub.execute_input":"2025-05-20T14:53:51.930385Z","iopub.status.idle":"2025-05-20T14:53:51.949747Z","shell.execute_reply.started":"2025-05-20T14:53:51.930349Z","shell.execute_reply":"2025-05-20T14:53:51.948340Z"}},"outputs":[{"name":"stdout","text":"/kaggle/input/skincare-products-clean-dataset/skincare_products_clean.csv\n","output_type":"stream"}],"execution_count":7},{"cell_type":"code","source":"import pandas as pd\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.metrics.pairwise import cosine_similarity","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-20T14:53:51.952143Z","iopub.execute_input":"2025-05-20T14:53:51.952474Z","iopub.status.idle":"2025-05-20T14:53:53.869665Z","shell.execute_reply.started":"2025-05-20T14:53:51.952449Z","shell.execute_reply":"2025-05-20T14:53:53.868593Z"}},"outputs":[],"execution_count":8},{"cell_type":"code","source":"df = pd.read_csv(\"/kaggle/input/skincare-products-clean-dataset/skincare_products_clean.csv\")\ndf","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-20T14:53:53.870648Z","iopub.execute_input":"2025-05-20T14:53:53.871163Z","iopub.status.idle":"2025-05-20T14:53:53.945876Z","shell.execute_reply.started":"2025-05-20T14:53:53.871138Z","shell.execute_reply":"2025-05-20T14:53:53.945061Z"}},"outputs":[{"execution_count":9,"output_type":"execute_result","data":{"text/plain":" product_name \\\n0 The Ordinary Natural Moisturising Factors + HA... \n1 CeraVe Facial Moisturising Lotion SPF 25 52ml \n2 The Ordinary Hyaluronic Acid 2% + B5 Hydration... \n3 AMELIORATE Transforming Body Lotion 200ml \n4 CeraVe Moisturising Cream 454g \n... ... \n1133 Elemis Life Elixirs Embrace Bath and Shower El... \n1134 Love Boo Splendidly Soothing Bath Soak (250ml) \n1135 Elemis Life Elixirs Fortitude Bath and Shower ... \n1136 Connock London Kukui Oil Soothing Bath & Showe... \n1137 Weleda Baby Calendula Cream Bath (200ml) \n\n product_url product_type \\\n0 https://www.lookfantastic.com/the-ordinary-nat... Moisturiser \n1 https://www.lookfantastic.com/cerave-facial-mo... Moisturiser \n2 https://www.lookfantastic.com/the-ordinary-hya... Moisturiser \n3 https://www.lookfantastic.com/ameliorate-trans... Moisturiser \n4 https://www.lookfantastic.com/cerave-moisturis... Moisturiser \n... ... ... \n1133 https://www.lookfantastic.com/elemis-life-elix... Bath Oil \n1134 https://www.lookfantastic.com/love-boo-splendi... Bath Oil \n1135 https://www.lookfantastic.com/elemis-life-elix... Bath Oil \n1136 https://www.lookfantastic.com/connock-london-k... Bath Oil \n1137 https://www.lookfantastic.com/weleda-baby-cale... Bath Oil \n\n clean_ingreds price \n0 ['capric triglyceride', 'cetyl alcohol', 'prop... £5.20 \n1 ['homosalate', 'glycerin', 'octocrylene', 'eth... £13.00 \n2 ['sodium hyaluronate', 'sodium hyaluronate', '... £6.20 \n3 ['ammonium lactate', 'c12-15', 'glycerin', 'pr... £22.50 \n4 ['glycerin', 'cetearyl alcohol', 'capric trigl... £16.00 \n... ... ... \n1133 ['prunus amygdalus dulcis', 'tipa-laureth sulf... £55.00 \n1134 ['sodium lauroyl', 'sodium cocoamphoacetate', ... £10.99 \n1135 ['prunus amygdalus dulcis', 'tipa-laureth sulf... £55.00 \n1136 ['capric triglyceride', 'peg-40 sorbitan perol... £36.00 \n1137 ['prunus amygdalus dulcis', 'sesamium indicum ... £13.95 \n\n[1138 rows x 5 columns]","text/html":"
\n | product_name | \nproduct_url | \nproduct_type | \nclean_ingreds | \nprice | \n
---|---|---|---|---|---|
0 | \nThe Ordinary Natural Moisturising Factors + HA... | \nhttps://www.lookfantastic.com/the-ordinary-nat... | \nMoisturiser | \n['capric triglyceride', 'cetyl alcohol', 'prop... | \n£5.20 | \n
1 | \nCeraVe Facial Moisturising Lotion SPF 25 52ml | \nhttps://www.lookfantastic.com/cerave-facial-mo... | \nMoisturiser | \n['homosalate', 'glycerin', 'octocrylene', 'eth... | \n£13.00 | \n
2 | \nThe Ordinary Hyaluronic Acid 2% + B5 Hydration... | \nhttps://www.lookfantastic.com/the-ordinary-hya... | \nMoisturiser | \n['sodium hyaluronate', 'sodium hyaluronate', '... | \n£6.20 | \n
3 | \nAMELIORATE Transforming Body Lotion 200ml | \nhttps://www.lookfantastic.com/ameliorate-trans... | \nMoisturiser | \n['ammonium lactate', 'c12-15', 'glycerin', 'pr... | \n£22.50 | \n
4 | \nCeraVe Moisturising Cream 454g | \nhttps://www.lookfantastic.com/cerave-moisturis... | \nMoisturiser | \n['glycerin', 'cetearyl alcohol', 'capric trigl... | \n£16.00 | \n
... | \n... | \n... | \n... | \n... | \n... | \n
1133 | \nElemis Life Elixirs Embrace Bath and Shower El... | \nhttps://www.lookfantastic.com/elemis-life-elix... | \nBath Oil | \n['prunus amygdalus dulcis', 'tipa-laureth sulf... | \n£55.00 | \n
1134 | \nLove Boo Splendidly Soothing Bath Soak (250ml) | \nhttps://www.lookfantastic.com/love-boo-splendi... | \nBath Oil | \n['sodium lauroyl', 'sodium cocoamphoacetate', ... | \n£10.99 | \n
1135 | \nElemis Life Elixirs Fortitude Bath and Shower ... | \nhttps://www.lookfantastic.com/elemis-life-elix... | \nBath Oil | \n['prunus amygdalus dulcis', 'tipa-laureth sulf... | \n£55.00 | \n
1136 | \nConnock London Kukui Oil Soothing Bath & Showe... | \nhttps://www.lookfantastic.com/connock-london-k... | \nBath Oil | \n['capric triglyceride', 'peg-40 sorbitan perol... | \n£36.00 | \n
1137 | \nWeleda Baby Calendula Cream Bath (200ml) | \nhttps://www.lookfantastic.com/weleda-baby-cale... | \nBath Oil | \n['prunus amygdalus dulcis', 'sesamium indicum ... | \n£13.95 | \n
1138 rows × 5 columns
\n\n | product_name | \nproduct_url | \nproduct_type | \nclean_ingreds | \nprice | \ncombined_features | \n
---|---|---|---|---|---|---|
0 | \nThe Ordinary Natural Moisturising Factors + HA... | \nhttps://www.lookfantastic.com/the-ordinary-nat... | \nMoisturiser | \n['capric triglyceride', 'cetyl alcohol', 'prop... | \n£5.20 | \nMoisturiser ['capric triglyceride', 'cetyl alc... | \n
1 | \nCeraVe Facial Moisturising Lotion SPF 25 52ml | \nhttps://www.lookfantastic.com/cerave-facial-mo... | \nMoisturiser | \n['homosalate', 'glycerin', 'octocrylene', 'eth... | \n£13.00 | \nMoisturiser ['homosalate', 'glycerin', 'octocr... | \n
2 | \nThe Ordinary Hyaluronic Acid 2% + B5 Hydration... | \nhttps://www.lookfantastic.com/the-ordinary-hya... | \nMoisturiser | \n['sodium hyaluronate', 'sodium hyaluronate', '... | \n£6.20 | \nMoisturiser ['sodium hyaluronate', 'sodium hya... | \n
3 | \nAMELIORATE Transforming Body Lotion 200ml | \nhttps://www.lookfantastic.com/ameliorate-trans... | \nMoisturiser | \n['ammonium lactate', 'c12-15', 'glycerin', 'pr... | \n£22.50 | \nMoisturiser ['ammonium lactate', 'c12-15', 'gl... | \n
4 | \nCeraVe Moisturising Cream 454g | \nhttps://www.lookfantastic.com/cerave-moisturis... | \nMoisturiser | \n['glycerin', 'cetearyl alcohol', 'capric trigl... | \n£16.00 | \nMoisturiser ['glycerin', 'cetearyl alcohol', '... | \n
... | \n... | \n... | \n... | \n... | \n... | \n... | \n
1133 | \nElemis Life Elixirs Embrace Bath and Shower El... | \nhttps://www.lookfantastic.com/elemis-life-elix... | \nBath Oil | \n['prunus amygdalus dulcis', 'tipa-laureth sulf... | \n£55.00 | \nBath Oil ['prunus amygdalus dulcis', 'tipa-lau... | \n
1134 | \nLove Boo Splendidly Soothing Bath Soak (250ml) | \nhttps://www.lookfantastic.com/love-boo-splendi... | \nBath Oil | \n['sodium lauroyl', 'sodium cocoamphoacetate', ... | \n£10.99 | \nBath Oil ['sodium lauroyl', 'sodium cocoamphoa... | \n
1135 | \nElemis Life Elixirs Fortitude Bath and Shower ... | \nhttps://www.lookfantastic.com/elemis-life-elix... | \nBath Oil | \n['prunus amygdalus dulcis', 'tipa-laureth sulf... | \n£55.00 | \nBath Oil ['prunus amygdalus dulcis', 'tipa-lau... | \n
1136 | \nConnock London Kukui Oil Soothing Bath & Showe... | \nhttps://www.lookfantastic.com/connock-london-k... | \nBath Oil | \n['capric triglyceride', 'peg-40 sorbitan perol... | \n£36.00 | \nBath Oil ['capric triglyceride', 'peg-40 sorbi... | \n
1137 | \nWeleda Baby Calendula Cream Bath (200ml) | \nhttps://www.lookfantastic.com/weleda-baby-cale... | \nBath Oil | \n['prunus amygdalus dulcis', 'sesamium indicum ... | \n£13.95 | \nBath Oil ['prunus amygdalus dulcis', 'sesamium... | \n
1138 rows × 6 columns
\n