{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":60182,"databundleVersionId":6787572,"sourceType":"competition"}],"dockerImageVersionId":30804,"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":"2024-12-05T13:35:01.530416Z","iopub.execute_input":"2024-12-05T13:35:01.530792Z","iopub.status.idle":"2024-12-05T13:35:02.606529Z","shell.execute_reply.started":"2024-12-05T13:35:01.530760Z","shell.execute_reply":"2024-12-05T13:35:02.605341Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df=pd.read_csv(\"/kaggle/input/earthquake-prediction/train.csv\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-05T13:35:02.608879Z","iopub.execute_input":"2024-12-05T13:35:02.609502Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.head(5)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Eksik değerlerin kontrolü\nprint(df.isnull().sum())","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Temel istatistiksel bilgiler için\nprint(df.describe())\n\n# TTF'nin histogramı\nimport matplotlib.pyplot as plt\n\nplt.hist(df['ttf'], bins=50, alpha=0.7)\nplt.xlabel('Time to Failure (ttf)')\nplt.ylabel('Frequency')\nplt.title('TTF Distribution')\nplt.show()","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(df.columns)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# ttf ve EP_disp'in türevlerini (değişim hızları) hesaplayalım\ndf['EP_disp_derivative'] = df['EP_disp'].diff()  # Yer değiştirme türevi\ndf['ttf_derivative'] = df['ttf'].diff()  # Zaman türevi\n\n# Artış oranlarını hesaplama\ndf['EP_disp_growth_rate'] = df['EP_disp'].pct_change()  # Yüzde değişim oranı\ndf['ttf_growth_rate'] = df['ttf'].pct_change()\n\n# Trendlerin ilk birkaç satırını kontrol edelim\nprint(df[['EP_disp', 'EP_disp_derivative', 'EP_disp_growth_rate', \n          'ttf', 'ttf_derivative', 'ttf_growth_rate']].head())","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import matplotlib.pyplot as plt\n\n# EP_disp ve türevini aynı grafikte çizme\nplt.figure(figsize=(12, 6))\nplt.plot(df.index, df['EP_disp'], label='EP_disp', linewidth=2)\nplt.plot(df.index, df['EP_disp_derivative'], label='EP_disp Derivative', linestyle='--')\nplt.title('EP_disp and its Derivative')\nplt.xlabel('Index')\nplt.ylabel('Value')\nplt.legend()\nplt.grid()\nplt.show()","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# ttf ve türevini aynı grafikte çizme\nplt.figure(figsize=(12, 6))\nplt.plot(df.index, df['ttf'], label='ttf', linewidth=2)\nplt.plot(df.index, df['ttf_derivative'], label='ttf Derivative', linestyle='--')\nplt.title('TTF and its Derivative')\nplt.xlabel('Index')\nplt.ylabel('Value')\nplt.legend()\nplt.grid()\nplt.show()","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(df[['EP_disp', 'ttf']].describe())","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}