简体   繁体   English

Sklearn多任务:输入数据不是3维的吗?

[英]Sklearn multi-task: Input data not 3-dimensional?

I have one huge data matrix X, of which subsets of rows correspond to different tasks that are related but also have different idiosyncratic properties. 我有一个巨大的数据矩阵X,其中的行子集对应于相关的不同任务,但又具有不同的特质属性。 Thus I want to train a Multi-Task model with some regularization and chose sklearn's linear_model MultiTaskElasticNet function. 因此,我想训练具有一定正则性的多任务模型,然后选择sklearn的linear_model MultiTaskElasticNet函数。 I am confused with the inputs of fitting the model. 我对拟合模型的输入感到困惑。 It says that both the X and the Y matrix are 2-dimensional. 它说X和Y矩阵都是二维的。 The 2nd dimension in Y corresponds to the number of tasks. Y中的第二维对应于任务数。 That makes sense, but in my understanding the X matrix should be 3-dimensional right? 这是有道理的,但是据我了解,X矩阵应该是3维的,对吗? In that way I have selected which subsets of my data correspond to different tasks as I know that in advance (obviously). 通过这种方式,我提前(很显然)知道了我的数据的哪些子集对应于不同的任务。

Does someone know how to enter my data correctly for this scikit-learn module? 有人知道如何为此scikit-learn模块正确输入我的数据吗? Thank you! 谢谢!

I don't see why you'd want X to vary for each task: the point of multitask learning is that the same feature space is used to represent instances for multiple tasks which can be mutually informative. 我不明白为什么您希望每个任务的X都不同:多任务学习的要点是,相同的特征空间用于表示多个任务的实例,这些实例可以相互提供信息。 I get that you may not have ground truth y for all instances for all tasks, though this is currently assumed in the scikit-learn implementation. 我得到你可能没有地面实况y为所有任务的所有实例,虽然这是目前在scikit学习落实承担。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM