vastorbit.datasets.gen_meshgrid¶
- vastorbit.datasets.gen_meshgrid(features_ranges: dict) VastFrame¶
Generates a dataset using regular steps.
- Parameters:
features_ranges (dict) –
Dictionary including the features types and ranges.
- For str:
The subdictionary must include two keys: “type” must be set to ‘str’ and ‘value’ must include the feature categories.
- For int:
The subdictionary must include two keys: “type” must be set to ‘int’ and ‘range’ must include two integers that represent the lower and the upper bounds.
- For float:
The subdictionary must include two keys: “type” must be set to ‘float’ and ‘range’ must include two floats that represent the lower and the upper bounds.
- For date:
The subdictionary must include two keys: “type” must be set to ‘date’ and ‘range’ must include the start date and the number of days after.
- For datetime:
The subdictionary must include two keys: “type” must be set to ‘date’ and ‘range’ must include the start date and the number of days after.
Numerical and date-like features must have an extra key in the dictionary named ‘nbins’, which corresponds to the number of bins used to compute the different categories.
- Returns:
Generated dataset.
- Return type:
Examples
import datetime from vastorbit.datasets import gen_meshgrid gen_meshgrid( features_ranges = { "name": {"type": str, "values": ["Badr", "Raghu", "Waqas",]}, "age": {"type": int, "range": [20, 40]}, "distance": {"type": float, "range": [1000, 4000]}, "date": {"type": datetime.date, "range": ["1993-11-03", 365]}, }, )
AbcnameVarchar(5)123ageInteger123distanceDouble📅datetimeTimestamp(3)1 Badr 20 1000.0 1993-11-03 00:00:00 2 Badr 20 1000.0 1993-11-03 00:00:00 3 Badr 20 1000.0 1993-11-03 00:00:00 4 Badr 21 1000.0 1993-11-03 00:00:00 5 Badr 21 1000.0 1993-11-03 00:00:00 6 Badr 21 1000.0 1993-11-03 00:00:00 7 Badr 21 1000.0 1993-11-03 00:00:00 8 Badr 21 1000.0 1993-11-03 00:00:00 9 Badr 22 1000.0 1993-11-03 00:00:00 10 Badr 22 1000.0 1993-11-03 00:00:00 11 Badr 22 1000.0 1993-11-03 00:00:00 12 Badr 22 1000.0 1993-11-03 00:00:00 13 Badr 22 1000.0 1993-11-03 00:00:00 14 Badr 23 1000.0 1993-11-03 00:00:00 15 Badr 23 1000.0 1993-11-03 00:00:00 16 Badr 23 1000.0 1993-11-03 00:00:00 17 Badr 23 1000.0 1993-11-03 00:00:00 18 Badr 23 1000.0 1993-11-03 00:00:00 19 Badr 24 1000.0 1993-11-03 00:00:00 20 Badr 24 1000.0 1993-11-03 00:00:00 21 Badr 24 1000.0 1993-11-03 00:00:00 22 Badr 24 1000.0 1993-11-03 00:00:00 23 Badr 24 1000.0 1993-11-03 00:00:00 24 Badr 25 1000.0 1993-11-03 00:00:00 25 Badr 25 1000.0 1993-11-03 00:00:00 26 Badr 25 1000.0 1993-11-03 00:00:00 27 Badr 25 1000.0 1993-11-03 00:00:00 28 Badr 25 1000.0 1993-11-03 00:00:00 29 Badr 26 1000.0 1993-11-03 00:00:00 30 Badr 26 1000.0 1993-11-03 00:00:00 31 Badr 26 1000.0 1993-11-03 00:00:00 32 Badr 26 1000.0 1993-11-03 00:00:00 33 Badr 26 1000.0 1993-11-03 00:00:00 34 Badr 27 1000.0 1993-11-03 00:00:00 35 Badr 27 1000.0 1993-11-03 00:00:00 36 Badr 27 1000.0 1993-11-03 00:00:00 37 Badr 27 1000.0 1993-11-03 00:00:00 38 Badr 27 1000.0 1993-11-03 00:00:00 39 Badr 28 1000.0 1993-11-03 00:00:00 40 Badr 28 1000.0 1993-11-03 00:00:00 41 Badr 28 1000.0 1993-11-03 00:00:00 42 Badr 28 1000.0 1993-11-03 00:00:00 43 Badr 28 1000.0 1993-11-03 00:00:00 44 Badr 29 1000.0 1993-11-03 00:00:00 45 Badr 29 1000.0 1993-11-03 00:00:00 46 Badr 29 1000.0 1993-11-03 00:00:00 47 Badr 29 1000.0 1993-11-03 00:00:00 48 Badr 29 1000.0 1993-11-03 00:00:00 49 Badr 30 1000.0 1993-11-03 00:00:00 50 Badr 30 1000.0 1993-11-03 00:00:00 51 Badr 30 1000.0 1993-11-03 00:00:00 52 Badr 30 1000.0 1993-11-03 00:00:00 53 Badr 30 1000.0 1993-11-03 00:00:00 54 Badr 31 1000.0 1993-11-03 00:00:00 55 Badr 31 1000.0 1993-11-03 00:00:00 56 Badr 31 1000.0 1993-11-03 00:00:00 57 Badr 31 1000.0 1993-11-03 00:00:00 58 Badr 31 1000.0 1993-11-03 00:00:00 59 Badr 32 1000.0 1993-11-03 00:00:00 60 Badr 32 1000.0 1993-11-03 00:00:00 61 Badr 32 1000.0 1993-11-03 00:00:00 62 Badr 32 1000.0 1993-11-03 00:00:00 63 Badr 32 1000.0 1993-11-03 00:00:00 64 Badr 33 1000.0 1993-11-03 00:00:00 65 Badr 33 1000.0 1993-11-03 00:00:00 66 Badr 33 1000.0 1993-11-03 00:00:00 67 Badr 33 1000.0 1993-11-03 00:00:00 68 Badr 33 1000.0 1993-11-03 00:00:00 69 Badr 34 1000.0 1993-11-03 00:00:00 70 Badr 34 1000.0 1993-11-03 00:00:00 71 Badr 34 1000.0 1993-11-03 00:00:00 72 Badr 34 1000.0 1993-11-03 00:00:00 73 Badr 34 1000.0 1993-11-03 00:00:00 74 Badr 35 1000.0 1993-11-03 00:00:00 75 Badr 35 1000.0 1993-11-03 00:00:00 76 Badr 35 1000.0 1993-11-03 00:00:00 77 Badr 35 1000.0 1993-11-03 00:00:00 78 Badr 35 1000.0 1993-11-03 00:00:00 79 Badr 36 1000.0 1993-11-03 00:00:00 80 Badr 36 1000.0 1993-11-03 00:00:00 81 Badr 36 1000.0 1993-11-03 00:00:00 82 Badr 36 1000.0 1993-11-03 00:00:00 83 Badr 36 1000.0 1993-11-03 00:00:00 84 Badr 37 1000.0 1993-11-03 00:00:00 85 Badr 37 1000.0 1993-11-03 00:00:00 86 Badr 37 1000.0 1993-11-03 00:00:00 87 Badr 37 1000.0 1993-11-03 00:00:00 88 Badr 37 1000.0 1993-11-03 00:00:00 89 Badr 38 1000.0 1993-11-03 00:00:00 90 Badr 38 1000.0 1993-11-03 00:00:00 91 Badr 38 1000.0 1993-11-03 00:00:00 92 Badr 38 1000.0 1993-11-03 00:00:00 93 Badr 38 1000.0 1993-11-03 00:00:00 94 Badr 39 1000.0 1993-11-03 00:00:00 95 Badr 39 1000.0 1993-11-03 00:00:00 96 Badr 39 1000.0 1993-11-03 00:00:00 97 Badr 39 1000.0 1993-11-03 00:00:00 98 Badr 39 1000.0 1993-11-03 00:00:00 99 Badr 40 1000.0 1993-11-03 00:00:00 100 Badr 40 1000.0 1993-11-03 00:00:00 Rows: 1-100 | Columns: 4