{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np\nimport pandas as pd","metadata":{"execution":{"iopub.status.busy":"2023-08-30T03:13:26.403199Z","iopub.execute_input":"2023-08-30T03:13:26.403678Z","iopub.status.idle":"2023-08-30T03:13:26.410070Z","shell.execute_reply.started":"2023-08-30T03:13:26.403642Z","shell.execute_reply":"2023-08-30T03:13:26.408667Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Checking of  sample_submission.csv","metadata":{}},{"cell_type":"markdown","source":"### Display dataframe and basic statistics","metadata":{}},{"cell_type":"code","source":"# Load the sample_submission.csv file\nsample_submission_path = '/kaggle/input/predict-ai-model-runtime/sample_submission.csv'\nsample_submission_df = pd.read_csv(sample_submission_path)","metadata":{"execution":{"iopub.status.busy":"2023-08-30T03:13:26.412777Z","iopub.execute_input":"2023-08-30T03:13:26.413518Z","iopub.status.idle":"2023-08-30T03:13:26.435845Z","shell.execute_reply.started":"2023-08-30T03:13:26.413475Z","shell.execute_reply":"2023-08-30T03:13:26.434591Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Display dataframe\nsample_submission_df","metadata":{"execution":{"iopub.status.busy":"2023-08-30T03:13:26.438000Z","iopub.execute_input":"2023-08-30T03:13:26.438399Z","iopub.status.idle":"2023-08-30T03:13:26.452603Z","shell.execute_reply.started":"2023-08-30T03:13:26.438353Z","shell.execute_reply":"2023-08-30T03:13:26.451212Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Display basic statistics\nsample_submission_df.describe()","metadata":{"execution":{"iopub.status.busy":"2023-08-30T03:13:26.454386Z","iopub.execute_input":"2023-08-30T03:13:26.455175Z","iopub.status.idle":"2023-08-30T03:13:26.478786Z","shell.execute_reply.started":"2023-08-30T03:13:26.455130Z","shell.execute_reply":"2023-08-30T03:13:26.477664Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# The last 50 cases are not \"0;1;2;3;4\"\nsample_submission_df[sample_submission_df[\"TopConfigs\"] != \"0;1;2;3;4\"]","metadata":{"execution":{"iopub.status.busy":"2023-08-30T03:13:26.481485Z","iopub.execute_input":"2023-08-30T03:13:26.482204Z","iopub.status.idle":"2023-08-30T03:13:26.506839Z","shell.execute_reply.started":"2023-08-30T03:13:26.482162Z","shell.execute_reply":"2023-08-30T03:13:26.505396Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Rule-Based Baseline","metadata":{}},{"cell_type":"markdown","source":"The submission file must adhere to specific formatting rules as outlined in the competition guidelines. Here's a summary:\n\n- The file should be a CSV with headers `ID` and `TopConfigs`.\n- The `ID` should be in the format `{collection}:{test_filename_without_extension}`.\n- The `TopConfigs` should list the indices of configurations from fastest to slowest, separated by \";\".\n\nsee [this page](https://www.kaggle.com/competitions/predict-ai-model-runtime/overview/evaluation)!\n","metadata":{}},{"cell_type":"code","source":"def generate_random_config():\n    \"\"\"\n    Generate a random configuration string consisting of 5 unique digits between 0 and 9.\n    \n    Returns:\n        str: A string containing 5 unique digits between 0 and 9, separated by semicolons.\n    \"\"\"\n    return \";\".join(map(str, np.random.choice(range(10), 5, replace=False)))\n\n# Create the baseline submission DataFrame\nbaseline_submission = pd.DataFrame({\n    'ID': sample_submission_df['ID'],\n    'TopConfigs': [generate_random_config() for _ in range(len(sample_submission_df))]\n})\n\n# Save the DataFrame to a CSV file\nbaseline_submission.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2023-08-30T03:13:26.508478Z","iopub.execute_input":"2023-08-30T03:13:26.509463Z","iopub.status.idle":"2023-08-30T03:13:26.575140Z","shell.execute_reply.started":"2023-08-30T03:13:26.509419Z","shell.execute_reply":"2023-08-30T03:13:26.573937Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"baseline_submission","metadata":{"execution":{"iopub.status.busy":"2023-08-30T03:13:26.576619Z","iopub.execute_input":"2023-08-30T03:13:26.577022Z","iopub.status.idle":"2023-08-30T03:13:26.593105Z","shell.execute_reply.started":"2023-08-30T03:13:26.576982Z","shell.execute_reply":"2023-08-30T03:13:26.591263Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}],"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"}}