{ "data_id": "44608", "name": "pc4_seed_0_nrows_2000_nclasses_10_ncols_100_stratify_True", "exact_name": "pc4_seed_0_nrows_2000_nclasses_10_ncols_100_stratify_True", "version": 1, "version_label": "2a7779f4-4346-41de-b9db-5f1062f04a83", "description": "Subsampling of the dataset pc4 (1049) with\n\nseed=0\nargs.nrows=2000\nargs.ncols=100\nargs.nclasses=10\nargs.no_stratify=True\nGenerated with the following source code:\n\n\n```python\n def subsample(\n self,\n seed: int,\n nrows_max: int = 2_000,\n ncols_max: int = 100,\n nclasses_max: int = 10,\n stratified: bool = True,\n ) -> Dataset:\n rng = np.random.default_rng(seed)\n\n x = self.x\n y = self.y\n\n # Uniformly sample\n classes = y.unique()\n if len(classes) > nclasses_max:\n vcs = y.value_counts()\n selected_classes = rng.choice(\n classes,\n size=nclasses_max,\n replace=False,\n p=vcs \/ sum(vcs),\n )\n\n # Select the indices where one of these classes is present\n idxs = y.index[y.isin(classes)]\n x = x.iloc[idxs]\n y = y.iloc[idxs]\n\n # Uniformly sample columns if required\n if len(x.columns) > ncols_max:\n columns_idxs = rng.choice(\n list(range(len(x.columns))), size=ncols_max, replace=False\n )\n sorted_column_idxs = sorted(columns_idxs)\n selected_columns = list(x.columns[sorted_column_idxs])\n x = x[selected_columns]\n else:\n sorted_column_idxs = list(range(len(x.columns)))\n\n if len(x) > nrows_max:\n # Stratify accordingly\n target_name = y.name\n data = pd.concat((x, y), axis=\"columns\")\n _, subset = train_test_split(\n data,\n test_size=nrows_max,\n stratify=data[target_name],\n shuffle=True,\n random_state=seed,\n )\n x = subset.drop(target_name, axis=\"columns\")\n y = subset[target_name]\n\n # We need to convert categorical columns to string for openml\n categorical_mask = [self.categorical_mask[i] for i in sorted_column_idxs]\n columns = list(x.columns)\n\n return Dataset(\n # Technically this is not the same but it's where it was derived from\n dataset=self.dataset,\n x=x,\n y=y,\n categorical_mask=categorical_mask,\n columns=columns,\n )\n```", "format": "arff", "uploader": "Eddie Bergman", "uploader_id": 32840, "visibility": "public", "creator": "\"Eddie Bergman\"", "contributor": null, "date": "2022-11-17 18:36:48", "update_comment": null, "last_update": "2022-11-17 18:36:48", "licence": "Public", "status": "active", "error_message": null, "url": "https:\/\/api.openml.org\/data\/download\/22111370\/dataset", "default_target_attribute": "c", "row_id_attribute": null, "ignore_attribute": null, "runs": 0, "suggest": { "input": [ "pc4_seed_0_nrows_2000_nclasses_10_ncols_100_stratify_True", "Subsampling of the dataset pc4 (1049) with seed=0 args.nrows=2000 args.ncols=100 args.nclasses=10 args.no_stratify=True Generated with the following source code: ```python def subsample( self, seed: int, nrows_max: int = 2_000, ncols_max: int = 100, nclasses_max: int = 10, stratified: bool = True, ) -> Dataset: rng = np.random.default_rng(seed) x = self.x y = self.y # Uniformly sample classes = y.unique() if len(classes) > nclasses_max: vcs = y.value_counts() selected_classes = rng.choice( class " ], "weight": 5 }, "qualities": { "NumberOfInstances": 1458, "NumberOfFeatures": 38, "NumberOfClasses": 2, "NumberOfMissingValues": 0, "NumberOfInstancesWithMissingValues": 0, "NumberOfNumericFeatures": 37, "NumberOfSymbolicFeatures": 1, "PercentageOfInstancesWithMissingValues": 0, "AutoCorrelation": 0.7803706245710363, "PercentageOfMissingValues": 0, "Dimensionality": 0.02606310013717421, "PercentageOfNumericFeatures": 97.36842105263158, "MajorityClassPercentage": 87.79149519890261, "PercentageOfSymbolicFeatures": 2.631578947368421, "MajorityClassSize": 1280, "MinorityClassPercentage": 12.208504801097392, "MinorityClassSize": 178, "NumberOfBinaryFeatures": 1, "PercentageOfBinaryFeatures": 2.631578947368421 }, "tags": [ { "uploader": "38960", "tag": "Machine Learning" } ], "features": [ { "name": "c", "index": "37", "type": "nominal", "distinct": "2", "missing": "0", "target": "1", "distr": [ [ "True", "False" ], [ [ "178", "0" ], [ "0", "1280" ] ] ] }, { "name": "LOC_BLANK", "index": "0", "type": "numeric", "distinct": "54", "missing": "0", "min": "0", "max": "90", "mean": "7", "stdev": "10" }, { "name": "BRANCH_COUNT", "index": "1", "type": "numeric", "distinct": "61", "missing": "0", "min": "1", "max": "187", "mean": "8", "stdev": "13" }, { "name": "CALL_PAIRS", "index": "2", "type": "numeric", "distinct": "22", "missing": "0", "min": "0", "max": "24", "mean": "2", "stdev": "3" }, { "name": "LOC_CODE_AND_COMMENT", "index": "3", "type": "numeric", "distinct": "36", "missing": "0", "min": "0", "max": "68", "mean": "2", "stdev": "5" }, { "name": "LOC_COMMENTS", "index": "4", "type": "numeric", "distinct": "57", "missing": "0", "min": "0", "max": "78", "mean": "5", "stdev": "9" }, { "name": "CONDITION_COUNT", "index": "5", "type": "numeric", "distinct": "41", "missing": "0", "min": "0", "max": "372", "mean": "7", "stdev": "16" }, { "name": "CYCLOMATIC_COMPLEXITY", "index": "6", "type": "numeric", "distinct": "43", "missing": "0", "min": "1", "max": "94", "mean": "5", "stdev": "7" }, { "name": "CYCLOMATIC_DENSITY", "index": "7", "type": "numeric", "distinct": "70", "missing": "0", "min": "0", "max": "9", "mean": "0", "stdev": "0" }, { "name": "DECISION_COUNT", "index": "8", "type": "numeric", "distinct": "23", "missing": "0", "min": "0", "max": "186", "mean": "3", "stdev": "8" }, { "name": "DECISION_DENSITY", "index": "9", "type": "numeric", "distinct": "5", "missing": "0", "min": "0", "max": "5", "mean": "1", "stdev": "1" }, { "name": "DESIGN_COMPLEXITY", "index": "10", "type": "numeric", "distinct": "31", "missing": "0", "min": "1", "max": "71", "mean": "3", "stdev": "4" }, { "name": "DESIGN_DENSITY", "index": "11", "type": "numeric", "distinct": "76", "missing": "0", "min": "0", "max": "1", "mean": "1", "stdev": "0" }, { "name": "EDGE_COUNT", "index": "12", "type": "numeric", "distinct": "105", "missing": "0", "min": "1", "max": "357", "mean": "19", "stdev": "28" }, { "name": "ESSENTIAL_COMPLEXITY", "index": "13", "type": "numeric", "distinct": "25", "missing": "0", "min": "1", "max": "70", "mean": "2", "stdev": "4" }, { "name": "ESSENTIAL_DENSITY", "index": "14", "type": "numeric", "distinct": "2", "missing": "0", "min": "0", "max": "1", "mean": "0", "stdev": "0" }, { "name": "LOC_EXECUTABLE", "index": "15", "type": "numeric", "distinct": "107", "missing": "0", "min": "0", "max": "196", "mean": "19", "stdev": "22" }, { "name": "PARAMETER_COUNT", "index": "16", "type": "numeric", "distinct": "8", "missing": "0", "min": "0", "max": "7", "mean": "1", "stdev": "1" }, { "name": "HALSTEAD_CONTENT", "index": "17", "type": "numeric", "distinct": "1021", "missing": "0", "min": "0", "max": "2246", "mean": "26", "stdev": "69" }, { "name": "HALSTEAD_DIFFICULTY", "index": "18", "type": "numeric", "distinct": "708", "missing": "0", "min": "0", "max": "129", "mean": "17", "stdev": "17" }, { "name": "HALSTEAD_EFFORT", "index": "19", "type": "numeric", "distinct": "1165", "missing": "0", "min": "0", "max": "1401719", "mean": "19506", "stdev": "62600" }, { "name": "HALSTEAD_ERROR_EST", "index": "20", "type": "numeric", "distinct": "120", "missing": "0", "min": "0", "max": "9", "mean": "0", "stdev": "0" }, { "name": "HALSTEAD_LENGTH", "index": "21", "type": "numeric", "distinct": "336", "missing": "0", "min": "0", "max": "2867", "mean": "101", "stdev": "171" }, { "name": "HALSTEAD_LEVEL", "index": "22", "type": "numeric", "distinct": "40", "missing": "0", "min": "0", "max": "1", "mean": "0", "stdev": "0" }, { "name": "HALSTEAD_PROG_TIME", "index": "23", "type": "numeric", "distinct": "1159", "missing": "0", "min": "0", "max": "77873", "mean": "1084", "stdev": "3478" }, { "name": "HALSTEAD_VOLUME", "index": "24", "type": "numeric", "distinct": "941", "missing": "0", "min": "0", "max": "26220", "mean": "544", "stdev": "1199" }, { "name": "MAINTENANCE_SEVERITY", "index": "25", "type": "numeric", "distinct": "74", "missing": "0", "min": "0", "max": "1", "mean": "1", "stdev": "0" }, { "name": "MODIFIED_CONDITION_COUNT", "index": "26", "type": "numeric", "distinct": "28", "missing": "0", "min": "0", "max": "93", "mean": "2", "stdev": "4" }, { "name": "MULTIPLE_CONDITION_COUNT", "index": "27", "type": "numeric", "distinct": "40", "missing": "0", "min": "0", "max": "186", "mean": "4", "stdev": "8" }, { "name": "NODE_COUNT", "index": "28", "type": "numeric", "distinct": "89", "missing": "0", "min": "2", "max": "286", "mean": "16", "stdev": "21" }, { "name": "NORMALIZED_CYLOMATIC_COMPLEXITY", "index": "29", "type": "numeric", "distinct": "67", "missing": "0", "min": "0", "max": "2", "mean": "0", "stdev": "0" }, { "name": "NUM_OPERANDS", "index": "30", "type": "numeric", "distinct": "184", "missing": "0", "min": "0", "max": "1403", "mean": "39", "stdev": "71" }, { "name": "NUM_OPERATORS", "index": "31", "type": "numeric", "distinct": "245", "missing": "0", "min": "0", "max": "1687", "mean": "63", "stdev": "104" }, { "name": "NUM_UNIQUE_OPERANDS", "index": "32", "type": "numeric", "distinct": "71", "missing": "0", "min": "0", "max": "601", "mean": "13", "stdev": "21" }, { "name": "NUM_UNIQUE_OPERATORS", "index": "33", "type": "numeric", "distinct": "38", "missing": "0", "min": "0", "max": "38", "mean": "12", "stdev": "7" }, { "name": "NUMBER_OF_LINES", "index": "34", "type": "numeric", "distinct": "171", "missing": "0", "min": "1", "max": "802", "mean": "38", "stdev": "50" }, { "name": "PERCENT_COMMENTS", "index": "35", "type": "numeric", "distinct": "394", "missing": "0", "min": "0", "max": "93", "mean": "17", "stdev": "21" }, { "name": "LOC_TOTAL", "index": "36", "type": "numeric", "distinct": "116", "missing": "0", "min": "0", "max": "210", "mean": "21", "stdev": "25" } ], "nr_of_issues": 0, "nr_of_downvotes": 0, "nr_of_likes": 0, "nr_of_downloads": 0, "total_downloads": 0, "reach": 0, "reuse": 0, "impact_of_reuse": 0, "reach_of_reuse": 0, "impact": 0 }