Datasets:
Upload 2 files
Browse files
lrs.csv
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
28,2,12.073,-62.428,1.25e-16,2498,2630,1740,1783,4119.1675,4897.299,4163.969,5000.7207,5769.181,6097.5083,5659.4453,6674.6147,7179.827,9152.51,10251.936,10597.772,10204.268,9550.103,9945.965,10132.449,9957.116,9845.937,9239.016,8931.316,9941.469,9545.514,8763.514,8470.204,8738.248,7618.699,7997.9287,8596.588,7813.348,6856.329,6704.273,6220.2944,5853.1646,5685.5127,5600.5127,5170.7686,5048.774,4781.4863,5435.9756,5091.798,5059.641,4531.72,4804.4795,4501.6934,8575.653,8911.356,8195.725,7579.88,6287.374,5500.6753,5336.6006,5152.6235,4210.7637,4029.7117,3308.7466,2899.815,2982.4224,2845.6604,2824.3228,2406.954,2513.885,2680.675,2640.9106,2279.1929,2497.3325,3158.562,2494.8713,2748.682,2627.8225,2669.3901,2561.3833,2584.4604,2059.0562,2267.3674,2365.9924,1779.3666,2316.8135,2471.037,1341.6499,1735.2395,2210.046,1565.0769,1301.9282,1669.9149,2039.3359,1891.6134,1040.1157,1211.5358,1767.6233,1146.9471,1392.4745,1278.9945,1440.482
|
3 |
85,3,12.106,-62.987,2.97e-16,1086,1241,421,674,7660.999,7906.784,7821.8984,7240.5156,6555.786,6364.1265,5450.402,5325.719,4858.7485,4209.9604,3574.5896,3275.3613,2741.708,2536.1704,2475.095,2257.1477,2266.571,2571.1155,3073.6062,3517.288,3414.5022,3119.1765,3287.464,3818.6196,4279.3716,4613.5513,4494.867,4450.2017,4192.484,4013.2407,3905.3386,3813.5017,3805.4858,3897.3374,3955.3274,4125.6665,4278.1904,4716.906,5234.9805,4849.0806,4306.2886,3713.5862,3418.6624,3162.087,3547.0015,3414.1482,3778.1106,4152.1035,4247.2563,4579.738,4736.76,4513.2666,4179.368,4063.1357,3960.402,3925.542,3939.825,4374.115,5169.564,5719.9424,5349.4775,5162.749,5133.8965,5209.4272,5333.1714,5334.848,5459.619,5679.8457,5648.7266,5823.605,6325.7227,6834.1353,7166.9736,6837.47,6553.48,6430.899,6302.1265,6378.4414,6231.0313,6183.5093,6746.712,6653.8022,6648.2983,6879.9707,7056.4053,6817.4297,6682.7944,6988.5977,7084.036,6971.783,7015.5747,6962.22,6263.44
|
4 |
95,3,12.123,-62.554,3.13e-15,481,270,63,451,3196.4287,3013.9722,3003.149,3099.5684,3130.7747,3287.7385,3371.359,3405.3242,3451.8127,3507.8682,3486.153,3553.9514,3469.224,3459.9504,3527.614,3684.8008,3929.2888,3984.2554,4190.9243,4368.691,4275.5186,4174.9146,4142.376,4163.845,4103.8633,4336.97,4417.5737,4448.557,4406.9824,4394.9907,4396.2993,4428.674,4417.3574,4423.784,4483.4863,4592.02,4650.203,4584.017,4384.581,4293.9336,4159.5986,3961.5928,3708.7979,3402.693,4149.154,3988.3118,4156.4233,4365.5293,4432.778,4464.7354,4481.364,4518.1797,4610.691,4656.005,4788.8213,4983.2246,5214.7764,5454.606,5796.704,6074.5273,6095.6157,6193.053,6226.195,6262.394,6354.199,6335.0645,6461.8306,6570.1724,6745.209,6770.8022,6927.477,6893.996,7077.4556,6963.425,6941.2363,6915.406,6777.8687,6899.4478,6722.7876,6550.62,6873.686,6883.7036,6795.325,7048.2163,6998.4155,6669.611,6551.059,6679.7715,6564.263,6309.6396,5954.388,5337.8887,4638.5244
|
|
|
1 |
+
lrs_class,ID-type,right_ascension,declination,scale_factor,blue_base_1,blue_base_2,red_base_1,red_base_2,flux_blue_0,flux_blue_1,flux_blue_2,flux_blue_3,flux_blue_4,flux_blue_5,flux_blue_6,flux_blue_7,flux_blue_8,flux_blue_9,flux_blue_10,flux_blue_11,flux_blue_12,flux_blue_13,flux_blue_14,flux_blue_15,flux_blue_16,flux_blue_17,flux_blue_18,flux_blue_19,flux_blue_20,flux_blue_21,flux_blue_22,flux_blue_23,flux_blue_24,flux_blue_25,flux_blue_26,flux_blue_27,flux_blue_28,flux_blue_29,flux_blue_30,flux_blue_31,flux_blue_32,flux_blue_33,flux_blue_34,flux_blue_35,flux_blue_36,flux_blue_37,flux_blue_38,flux_blue_39,flux_blue_40,flux_blue_41,flux_blue_42,flux_blue_43,flux_red_0,flux_red_1,flux_red_2,flux_red_3,flux_red_4,flux_red_5,flux_red_6,flux_red_7,flux_red_8,flux_red_9,flux_red_10,flux_red_11,flux_red_12,flux_red_13,flux_red_14,flux_red_15,flux_red_16,flux_red_17,flux_red_18,flux_red_19,flux_red_20,flux_red_21,flux_red_22,flux_red_23,flux_red_24,flux_red_25,flux_red_26,flux_red_27,flux_red_28,flux_red_29,flux_red_30,flux_red_31,flux_red_32,flux_red_33,flux_red_34,flux_red_35,flux_red_36,flux_red_37,flux_red_38,flux_red_39,flux_red_40,flux_red_41,flux_red_42,flux_red_43,flux_red_44,flux_red_45,flux_red_46,flux_red_47,flux_red_48
|
2 |
28,2,12.073,-62.428,1.25e-16,2498,2630,1740,1783,4119.1675,4897.299,4163.969,5000.7207,5769.181,6097.5083,5659.4453,6674.6147,7179.827,9152.51,10251.936,10597.772,10204.268,9550.103,9945.965,10132.449,9957.116,9845.937,9239.016,8931.316,9941.469,9545.514,8763.514,8470.204,8738.248,7618.699,7997.9287,8596.588,7813.348,6856.329,6704.273,6220.2944,5853.1646,5685.5127,5600.5127,5170.7686,5048.774,4781.4863,5435.9756,5091.798,5059.641,4531.72,4804.4795,4501.6934,8575.653,8911.356,8195.725,7579.88,6287.374,5500.6753,5336.6006,5152.6235,4210.7637,4029.7117,3308.7466,2899.815,2982.4224,2845.6604,2824.3228,2406.954,2513.885,2680.675,2640.9106,2279.1929,2497.3325,3158.562,2494.8713,2748.682,2627.8225,2669.3901,2561.3833,2584.4604,2059.0562,2267.3674,2365.9924,1779.3666,2316.8135,2471.037,1341.6499,1735.2395,2210.046,1565.0769,1301.9282,1669.9149,2039.3359,1891.6134,1040.1157,1211.5358,1767.6233,1146.9471,1392.4745,1278.9945,1440.482
|
3 |
85,3,12.106,-62.987,2.97e-16,1086,1241,421,674,7660.999,7906.784,7821.8984,7240.5156,6555.786,6364.1265,5450.402,5325.719,4858.7485,4209.9604,3574.5896,3275.3613,2741.708,2536.1704,2475.095,2257.1477,2266.571,2571.1155,3073.6062,3517.288,3414.5022,3119.1765,3287.464,3818.6196,4279.3716,4613.5513,4494.867,4450.2017,4192.484,4013.2407,3905.3386,3813.5017,3805.4858,3897.3374,3955.3274,4125.6665,4278.1904,4716.906,5234.9805,4849.0806,4306.2886,3713.5862,3418.6624,3162.087,3547.0015,3414.1482,3778.1106,4152.1035,4247.2563,4579.738,4736.76,4513.2666,4179.368,4063.1357,3960.402,3925.542,3939.825,4374.115,5169.564,5719.9424,5349.4775,5162.749,5133.8965,5209.4272,5333.1714,5334.848,5459.619,5679.8457,5648.7266,5823.605,6325.7227,6834.1353,7166.9736,6837.47,6553.48,6430.899,6302.1265,6378.4414,6231.0313,6183.5093,6746.712,6653.8022,6648.2983,6879.9707,7056.4053,6817.4297,6682.7944,6988.5977,7084.036,6971.783,7015.5747,6962.22,6263.44
|
4 |
95,3,12.123,-62.554,3.13e-15,481,270,63,451,3196.4287,3013.9722,3003.149,3099.5684,3130.7747,3287.7385,3371.359,3405.3242,3451.8127,3507.8682,3486.153,3553.9514,3469.224,3459.9504,3527.614,3684.8008,3929.2888,3984.2554,4190.9243,4368.691,4275.5186,4174.9146,4142.376,4163.845,4103.8633,4336.97,4417.5737,4448.557,4406.9824,4394.9907,4396.2993,4428.674,4417.3574,4423.784,4483.4863,4592.02,4650.203,4584.017,4384.581,4293.9336,4159.5986,3961.5928,3708.7979,3402.693,4149.154,3988.3118,4156.4233,4365.5293,4432.778,4464.7354,4481.364,4518.1797,4610.691,4656.005,4788.8213,4983.2246,5214.7764,5454.606,5796.704,6074.5273,6095.6157,6193.053,6226.195,6262.394,6354.199,6335.0645,6461.8306,6570.1724,6745.209,6770.8022,6927.477,6893.996,7077.4556,6963.425,6941.2363,6915.406,6777.8687,6899.4478,6722.7876,6550.62,6873.686,6883.7036,6795.325,7048.2163,6998.4155,6669.611,6551.059,6679.7715,6564.263,6309.6396,5954.388,5337.8887,4638.5244
|
lrs.py
CHANGED
@@ -126,7 +126,7 @@ features_types_per_config = {
|
|
126 |
"flux_red_46": datasets.Value("float64"),
|
127 |
"flux_red_47": datasets.Value("float64"),
|
128 |
"flux_red_48": datasets.Value("float64"),
|
129 |
-
"
|
130 |
},
|
131 |
"lrs_0": {
|
132 |
"right_ascension": datasets.Value("float64"),
|
@@ -229,7 +229,7 @@ features_types_per_config = {
|
|
229 |
"flux_red_46": datasets.Value("float64"),
|
230 |
"flux_red_47": datasets.Value("float64"),
|
231 |
"flux_red_48": datasets.Value("float64"),
|
232 |
-
"
|
233 |
},
|
234 |
"lrs_1": {
|
235 |
"right_ascension": datasets.Value("float64"),
|
@@ -332,7 +332,7 @@ features_types_per_config = {
|
|
332 |
"flux_red_46": datasets.Value("float64"),
|
333 |
"flux_red_47": datasets.Value("float64"),
|
334 |
"flux_red_48": datasets.Value("float64"),
|
335 |
-
"
|
336 |
},
|
337 |
"lrs_2": {
|
338 |
"right_ascension": datasets.Value("float64"),
|
@@ -435,7 +435,7 @@ features_types_per_config = {
|
|
435 |
"flux_red_46": datasets.Value("float64"),
|
436 |
"flux_red_47": datasets.Value("float64"),
|
437 |
"flux_red_48": datasets.Value("float64"),
|
438 |
-
"
|
439 |
},
|
440 |
"lrs_3": {
|
441 |
"right_ascension": datasets.Value("float64"),
|
@@ -538,7 +538,7 @@ features_types_per_config = {
|
|
538 |
"flux_red_46": datasets.Value("float64"),
|
539 |
"flux_red_47": datasets.Value("float64"),
|
540 |
"flux_red_48": datasets.Value("float64"),
|
541 |
-
"
|
542 |
},
|
543 |
"lrs_4": {
|
544 |
"right_ascension": datasets.Value("float64"),
|
@@ -641,7 +641,7 @@ features_types_per_config = {
|
|
641 |
"flux_red_46": datasets.Value("float64"),
|
642 |
"flux_red_47": datasets.Value("float64"),
|
643 |
"flux_red_48": datasets.Value("float64"),
|
644 |
-
"
|
645 |
},
|
646 |
"lrs_5": {
|
647 |
"right_ascension": datasets.Value("float64"),
|
@@ -744,7 +744,7 @@ features_types_per_config = {
|
|
744 |
"flux_red_46": datasets.Value("float64"),
|
745 |
"flux_red_47": datasets.Value("float64"),
|
746 |
"flux_red_48": datasets.Value("float64"),
|
747 |
-
"
|
748 |
},
|
749 |
"lrs_6": {
|
750 |
"right_ascension": datasets.Value("float64"),
|
@@ -847,7 +847,7 @@ features_types_per_config = {
|
|
847 |
"flux_red_46": datasets.Value("float64"),
|
848 |
"flux_red_47": datasets.Value("float64"),
|
849 |
"flux_red_48": datasets.Value("float64"),
|
850 |
-
"
|
851 |
},
|
852 |
"lrs_7": {
|
853 |
"right_ascension": datasets.Value("float64"),
|
@@ -950,7 +950,7 @@ features_types_per_config = {
|
|
950 |
"flux_red_46": datasets.Value("float64"),
|
951 |
"flux_red_47": datasets.Value("float64"),
|
952 |
"flux_red_48": datasets.Value("float64"),
|
953 |
-
"
|
954 |
},
|
955 |
"lrs_8": {
|
956 |
"right_ascension": datasets.Value("float64"),
|
@@ -1053,33 +1053,33 @@ features_types_per_config = {
|
|
1053 |
"flux_red_46": datasets.Value("float64"),
|
1054 |
"flux_red_47": datasets.Value("float64"),
|
1055 |
"flux_red_48": datasets.Value("float64"),
|
1056 |
-
"
|
1057 |
},
|
1058 |
|
1059 |
}
|
1060 |
features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
|
1061 |
|
1062 |
|
1063 |
-
|
1064 |
def __init__(self, **kwargs):
|
1065 |
super(LrsConfig, self).__init__(version=VERSION, **kwargs)
|
1066 |
self.features = features_per_config[kwargs["name"]]
|
1067 |
|
1068 |
|
1069 |
-
|
1070 |
# dataset versions
|
1071 |
DEFAULT_CONFIG = "lrs"
|
1072 |
BUILDER_CONFIGS = [
|
1073 |
LrsConfig(name="lrs", description="Lrs dataset."),
|
1074 |
-
LrsConfig(name="lrs_0", description="Binary
|
1075 |
-
LrsConfig(name="lrs_1", description="Binary
|
1076 |
-
LrsConfig(name="lrs_2", description="Binary
|
1077 |
-
LrsConfig(name="lrs_3", description="Binary
|
1078 |
-
LrsConfig(name="lrs_4", description="Binary
|
1079 |
-
LrsConfig(name="lrs_5", description="Binary
|
1080 |
-
LrsConfig(name="lrs_6", description="Binary
|
1081 |
-
LrsConfig(name="lrs_7", description="Binary
|
1082 |
-
LrsConfig(name="lrs_8", description="Binary
|
1083 |
|
1084 |
]
|
1085 |
|
@@ -1109,25 +1109,25 @@ class Lrs(datasets.GeneratorBasedBuilder):
|
|
1109 |
def preprocess(self, data: pandas.DataFrame) -> pandas.DataFrame:
|
1110 |
data.drop("ID-type", axis="columns", inplace=True)
|
1111 |
data = data[list(features_types_per_config["lrs"].keys())]
|
1112 |
-
data["
|
1113 |
|
1114 |
if self.config.name == "lrs_0":
|
1115 |
-
data["
|
1116 |
if self.config.name == "lrs_1":
|
1117 |
-
data["
|
1118 |
if self.config.name == "lrs_2":
|
1119 |
-
data["
|
1120 |
if self.config.name == "lrs_3":
|
1121 |
-
data["
|
1122 |
if self.config.name == "lrs_4":
|
1123 |
-
data["
|
1124 |
if self.config.name == "lrs_5":
|
1125 |
-
data["
|
1126 |
if self.config.name == "lrs_6":
|
1127 |
-
data["
|
1128 |
if self.config.name == "lrs_7":
|
1129 |
-
data["
|
1130 |
if self.config.name == "lrs_8":
|
1131 |
-
data["
|
1132 |
|
1133 |
return data
|
|
|
126 |
"flux_red_46": datasets.Value("float64"),
|
127 |
"flux_red_47": datasets.Value("float64"),
|
128 |
"flux_red_48": datasets.Value("float64"),
|
129 |
+
"lrs_class": datasets.ClassLabel(num_lrs_classes=9)
|
130 |
},
|
131 |
"lrs_0": {
|
132 |
"right_ascension": datasets.Value("float64"),
|
|
|
229 |
"flux_red_46": datasets.Value("float64"),
|
230 |
"flux_red_47": datasets.Value("float64"),
|
231 |
"flux_red_48": datasets.Value("float64"),
|
232 |
+
"lrs_class": datasets.ClassLabel(num_lrs_classes=2, names=("no", "yes"))
|
233 |
},
|
234 |
"lrs_1": {
|
235 |
"right_ascension": datasets.Value("float64"),
|
|
|
332 |
"flux_red_46": datasets.Value("float64"),
|
333 |
"flux_red_47": datasets.Value("float64"),
|
334 |
"flux_red_48": datasets.Value("float64"),
|
335 |
+
"lrs_class": datasets.ClassLabel(num_lrs_classes=2, names=("no", "yes"))
|
336 |
},
|
337 |
"lrs_2": {
|
338 |
"right_ascension": datasets.Value("float64"),
|
|
|
435 |
"flux_red_46": datasets.Value("float64"),
|
436 |
"flux_red_47": datasets.Value("float64"),
|
437 |
"flux_red_48": datasets.Value("float64"),
|
438 |
+
"lrs_class": datasets.ClassLabel(num_lrs_classes=2, names=("no", "yes"))
|
439 |
},
|
440 |
"lrs_3": {
|
441 |
"right_ascension": datasets.Value("float64"),
|
|
|
538 |
"flux_red_46": datasets.Value("float64"),
|
539 |
"flux_red_47": datasets.Value("float64"),
|
540 |
"flux_red_48": datasets.Value("float64"),
|
541 |
+
"lrs_class": datasets.ClassLabel(num_lrs_classes=2, names=("no", "yes"))
|
542 |
},
|
543 |
"lrs_4": {
|
544 |
"right_ascension": datasets.Value("float64"),
|
|
|
641 |
"flux_red_46": datasets.Value("float64"),
|
642 |
"flux_red_47": datasets.Value("float64"),
|
643 |
"flux_red_48": datasets.Value("float64"),
|
644 |
+
"lrs_class": datasets.ClassLabel(num_lrs_classes=2, names=("no", "yes"))
|
645 |
},
|
646 |
"lrs_5": {
|
647 |
"right_ascension": datasets.Value("float64"),
|
|
|
744 |
"flux_red_46": datasets.Value("float64"),
|
745 |
"flux_red_47": datasets.Value("float64"),
|
746 |
"flux_red_48": datasets.Value("float64"),
|
747 |
+
"lrs_class": datasets.ClassLabel(num_lrs_classes=2, names=("no", "yes"))
|
748 |
},
|
749 |
"lrs_6": {
|
750 |
"right_ascension": datasets.Value("float64"),
|
|
|
847 |
"flux_red_46": datasets.Value("float64"),
|
848 |
"flux_red_47": datasets.Value("float64"),
|
849 |
"flux_red_48": datasets.Value("float64"),
|
850 |
+
"lrs_class": datasets.ClassLabel(num_lrs_classes=2, names=("no", "yes"))
|
851 |
},
|
852 |
"lrs_7": {
|
853 |
"right_ascension": datasets.Value("float64"),
|
|
|
950 |
"flux_red_46": datasets.Value("float64"),
|
951 |
"flux_red_47": datasets.Value("float64"),
|
952 |
"flux_red_48": datasets.Value("float64"),
|
953 |
+
"lrs_class": datasets.ClassLabel(num_lrs_classes=2, names=("no", "yes"))
|
954 |
},
|
955 |
"lrs_8": {
|
956 |
"right_ascension": datasets.Value("float64"),
|
|
|
1053 |
"flux_red_46": datasets.Value("float64"),
|
1054 |
"flux_red_47": datasets.Value("float64"),
|
1055 |
"flux_red_48": datasets.Value("float64"),
|
1056 |
+
"lrs_class": datasets.ClassLabel(num_lrs_classes=2, names=("no", "yes"))
|
1057 |
},
|
1058 |
|
1059 |
}
|
1060 |
features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
|
1061 |
|
1062 |
|
1063 |
+
lrs_class LrsConfig(datasets.BuilderConfig):
|
1064 |
def __init__(self, **kwargs):
|
1065 |
super(LrsConfig, self).__init__(version=VERSION, **kwargs)
|
1066 |
self.features = features_per_config[kwargs["name"]]
|
1067 |
|
1068 |
|
1069 |
+
lrs_class Lrs(datasets.GeneratorBasedBuilder):
|
1070 |
# dataset versions
|
1071 |
DEFAULT_CONFIG = "lrs"
|
1072 |
BUILDER_CONFIGS = [
|
1073 |
LrsConfig(name="lrs", description="Lrs dataset."),
|
1074 |
+
LrsConfig(name="lrs_0", description="Binary lrs_classification of lrs_class 0."),
|
1075 |
+
LrsConfig(name="lrs_1", description="Binary lrs_classification of lrs_class 1."),
|
1076 |
+
LrsConfig(name="lrs_2", description="Binary lrs_classification of lrs_class 2."),
|
1077 |
+
LrsConfig(name="lrs_3", description="Binary lrs_classification of lrs_class 3."),
|
1078 |
+
LrsConfig(name="lrs_4", description="Binary lrs_classification of lrs_class 4."),
|
1079 |
+
LrsConfig(name="lrs_5", description="Binary lrs_classification of lrs_class 5."),
|
1080 |
+
LrsConfig(name="lrs_6", description="Binary lrs_classification of lrs_class 6."),
|
1081 |
+
LrsConfig(name="lrs_7", description="Binary lrs_classification of lrs_class 7."),
|
1082 |
+
LrsConfig(name="lrs_8", description="Binary lrs_classification of lrs_class 8.")
|
1083 |
|
1084 |
]
|
1085 |
|
|
|
1109 |
def preprocess(self, data: pandas.DataFrame) -> pandas.DataFrame:
|
1110 |
data.drop("ID-type", axis="columns", inplace=True)
|
1111 |
data = data[list(features_types_per_config["lrs"].keys())]
|
1112 |
+
data["lrs_class"] = data["lrs_class"].apply(lambda x: x if x < 10 else x // 10).unique()
|
1113 |
|
1114 |
if self.config.name == "lrs_0":
|
1115 |
+
data["lrs_class"] = data["lrs_class"].apply(lambda x: 1 if x == 0 else 0)
|
1116 |
if self.config.name == "lrs_1":
|
1117 |
+
data["lrs_class"] = data["lrs_class"].apply(lambda x: 1 if x == 1 else 0)
|
1118 |
if self.config.name == "lrs_2":
|
1119 |
+
data["lrs_class"] = data["lrs_class"].apply(lambda x: 1 if x == 2 else 0)
|
1120 |
if self.config.name == "lrs_3":
|
1121 |
+
data["lrs_class"] = data["lrs_class"].apply(lambda x: 1 if x == 3 else 0)
|
1122 |
if self.config.name == "lrs_4":
|
1123 |
+
data["lrs_class"] = data["lrs_class"].apply(lambda x: 1 if x == 4 else 0)
|
1124 |
if self.config.name == "lrs_5":
|
1125 |
+
data["lrs_class"] = data["lrs_class"].apply(lambda x: 1 if x == 5 else 0)
|
1126 |
if self.config.name == "lrs_6":
|
1127 |
+
data["lrs_class"] = data["lrs_class"].apply(lambda x: 1 if x == 6 else 0)
|
1128 |
if self.config.name == "lrs_7":
|
1129 |
+
data["lrs_class"] = data["lrs_class"].apply(lambda x: 1 if x == 7 else 0)
|
1130 |
if self.config.name == "lrs_8":
|
1131 |
+
data["lrs_class"] = data["lrs_class"].apply(lambda x: 1 if x == 8 else 0)
|
1132 |
|
1133 |
return data
|