Skip to content

Commit

Permalink
Merge branch 'keller-mark-keller-mark/fix-model-predict-for-series'
Browse files Browse the repository at this point in the history
  • Loading branch information
const-ae committed Dec 10, 2024
2 parents 8258a19 + 3cdbdb2 commit 691dada
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pylemur/tl/lemur.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ def predict(

if isinstance(new_condition, pd.DataFrame):
new_design = new_condition.to_numpy()
elif isinstance(new_condition, pd.Series):
new_design = np.expand_dims(new_condition.to_numpy(), axis=0)
elif isinstance(new_condition, np.ndarray):
new_design = new_condition
else:
Expand Down Expand Up @@ -426,8 +428,8 @@ def cond(self, **kwargs):
Returns
-------
`ModelMatrix`
A ModelMatrix instance with one row with the same columns as the design matrix.
`pd.Series`
A contrast vector that aligns to the columns of the design matrix.
Notes
Expand Down

0 comments on commit 691dada

Please sign in to comment.