Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: group_by contains variable(s) ['group'] that could not be found in the entity index. #156

Open
adelavega opened this issue Apr 25, 2022 · 2 comments

Comments

@adelavega
Copy link
Contributor

With pybids 0.15.1, we get the following error:

ValueError: group_by contains variable(s) ['group'] that could not be found in the entity index.

for model:

{
  "Name": "Test medium",
  "Input": {
    "Run": [
      1,
      2
    ],
    "Task": "movie",
    "Subject": [
      "sid000005",
      "sid000007",
      "sid000009"
    ]
  },
  "Description": "",
  "BIDSModelVersion": 1,
  "Nodes": [
    {
      "Level": "run",
      "Model": {
        "X": [
          "speech",
          1
        ]
      },
      "Contrasts": [
        {
          "Name": "speech",
          "Type": "t",
          "Weights": [
            1
          ],
          "ConditionList": [
            "speech"
          ],
          "Test": "t"
        }
      ],
      "Name": "run",
      "GroupBy": [
        "run",
        "subject"
      ],
      "Transformations": {
        "Transformer": "pybids-transforms-v1",
        "Instructions": [
          {
            "Name": "Convolve",
            "Input": [
              "speech"
            ]
          }
        ]
      }
    },
    {
      "Level": "subject",
      "DummyContrasts": {
        "Test": "t"
      },
      "Name": "subject",
      "GroupBy": [
        "subject",
        "contrast"
      ],
      "Model": {
        "X": [
          1
        ],
        "Type": "Meta"
      }
    },
    {
      "Level": "dataset",
      "DummyContrasts": {
        "Test": "t"
      },
      "Name": "dataset",
      "GroupBy": [
        "contrast",
        "group"
      ],
      "Model": {
        "X": [
          1
        ]
      }
    }
  ]
}

Looks like the final groupby should be dataset

@effigies
Copy link
Contributor

Just drop group unless there are groups. I've also considered whether we should introduce an implicit "all" group so that you can use the same model whether or not a group variable is present in the dataset.

@adelavega
Copy link
Contributor Author

Ah, I think I was confused as to whether this was even valid or should be "dataset". Raised an issue in modelzoo but that one did have groups I believe, so can disregard that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants