{"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":"code","source":"import os\nimport pandas as pd \nfrom fastai.tabular.all import *","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-08-09T21:23:22.516692Z","iopub.execute_input":"2022-08-09T21:23:22.517188Z","iopub.status.idle":"2022-08-09T21:23:22.524040Z","shell.execute_reply.started":"2022-08-09T21:23:22.517147Z","shell.execute_reply":"2022-08-09T21:23:22.522746Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path = os.path.join('../input/', 'spaceship-titanic')\npath","metadata":{"execution":{"iopub.status.busy":"2022-08-09T21:23:23.092605Z","iopub.execute_input":"2022-08-09T21:23:23.093800Z","iopub.status.idle":"2022-08-09T21:23:23.100469Z","shell.execute_reply.started":"2022-08-09T21:23:23.093760Z","shell.execute_reply":"2022-08-09T21:23:23.099471Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train = pd.read_csv(\"/kaggle/input/spaceship-titanic/train.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-08-09T21:23:23.494571Z","iopub.execute_input":"2022-08-09T21:23:23.495248Z","iopub.status.idle":"2022-08-09T21:23:23.529735Z","shell.execute_reply.started":"2022-08-09T21:23:23.495210Z","shell.execute_reply":"2022-08-09T21:23:23.528806Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train.head()","metadata":{"execution":{"iopub.status.busy":"2022-08-09T21:23:23.969785Z","iopub.execute_input":"2022-08-09T21:23:23.970673Z","iopub.status.idle":"2022-08-09T21:23:24.001135Z","shell.execute_reply.started":"2022-08-09T21:23:23.970621Z","shell.execute_reply":"2022-08-09T21:23:23.999869Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dls = TabularDataLoaders.from_csv('/kaggle/input/spaceship-titanic/train.csv', path=path, y_names=\"Transported\",\n    cat_names = ['HomePlanet', 'CryoSleep', 'Destination', 'VIP'],\n    cont_names = ['Age'],\n    procs = [Categorify, FillMissing, Normalize])","metadata":{"execution":{"iopub.status.busy":"2022-08-09T21:23:25.046819Z","iopub.execute_input":"2022-08-09T21:23:25.047660Z","iopub.status.idle":"2022-08-09T21:23:25.169704Z","shell.execute_reply.started":"2022-08-09T21:23:25.047607Z","shell.execute_reply":"2022-08-09T21:23:25.168845Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"learn = tabular_learner(dls, metrics=accuracy)","metadata":{"execution":{"iopub.status.busy":"2022-08-09T21:23:25.372318Z","iopub.execute_input":"2022-08-09T21:23:25.373362Z","iopub.status.idle":"2022-08-09T21:23:25.381964Z","shell.execute_reply.started":"2022-08-09T21:23:25.373320Z","shell.execute_reply":"2022-08-09T21:23:25.380901Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"learn.fit_one_cycle(3)","metadata":{"execution":{"iopub.status.busy":"2022-08-09T21:23:25.688134Z","iopub.execute_input":"2022-08-09T21:23:25.689336Z","iopub.status.idle":"2022-08-09T21:23:30.320846Z","shell.execute_reply.started":"2022-08-09T21:23:25.689279Z","shell.execute_reply":"2022-08-09T21:23:30.319521Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"learn.show_results()","metadata":{"execution":{"iopub.status.busy":"2022-08-09T21:23:30.322913Z","iopub.execute_input":"2022-08-09T21:23:30.323292Z","iopub.status.idle":"2022-08-09T21:23:30.375558Z","shell.execute_reply.started":"2022-08-09T21:23:30.323258Z","shell.execute_reply":"2022-08-09T21:23:30.374449Z"},"trusted":true},"execution_count":null,"outputs":[]}]}