我有一个数据集,我需要根据属性本身而不是值对这个数据集进行分类。
描述情况的图片:
您可以创建一个元类,它使用类的属性作为它的值,并在此基础上进行分类。
例如,使用你的两个类:
MetaClass
Name | Attributes
-------------------------------------
class 1 | temperature, humidite, vent
class 2 | nom, prenom, age
或者另一种方式:
MetaClass
Name | Temperature | Humidite | Vent | Nom | Prenom | Age
------------------------------------------------------------------
class 1 | True | True | True | False | False | False
class 2 | False | False | False | True | True | True
制作这个元类的细节当然取决于你的实现。