Alternative unknown in dictionary

407 views
Skip to first unread message

Kara MacLeod

unread,
Mar 16, 2018, 3:23:24 AM3/16/18
to Biogeme

Hi -


I looked at the documentation but want to confirm what these errors mean...Thanks!


Warning: Error: Alternative 36 unknown in dictionary.

Warning: Error: Alternative 54 unknown in dictionary.

Warning: Error: Alternative 0 unknown in dictionary.

Bierlaire Michel

unread,
Mar 16, 2018, 6:54:23 AM3/16/18
to kara...@gmail.com, Bierlaire Michel, Biogeme
This is out of context.What model did you specify? Please post the p file. 

--
You received this message because you are subscribed to the Google Groups "Biogeme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
To post to this group, send email to bio...@googlegroups.com.
Visit this group at https://groups.google.com/group/biogeme.
For more options, visit https://groups.google.com/d/optout.

Huyen Le

unread,
Mar 17, 2018, 4:13:09 AM3/17/18
to Biogeme
Hi all --

I'm having the same problem with my hybrid choice model (following the original 05latentChoiceFull.py on the website, except that I used a latent regression model for the measurement part). Below is my spec file. Prof. Bierlaire, can you diagnose this file as well? Thank you so much!
LatentChoiceFull.py

Bierlaire Michel

unread,
Mar 19, 2018, 6:52:37 AM3/19/18
to lekhanh...@gmail.com, Bierlaire Michel, Biogeme
Difficult to say. It seems to be a problem with the numbering of the alternative. 
To identify the problem, I would advise to estimate first a choice model only, without latent variable. Second, to estimate the latent variable only, without the choice model. And to merge them only afterward, as described in the online tutorial. 





<LatentChoiceFull.py>

Lizy Spanos

unread,
Dec 23, 2018, 9:43:18 AM12/23/18
to Biogeme
Hello all! I am relatively new to using PythonBiogeme, and i wonder if this particular issue was ever resolved. I'm getting the error message:

Warning:  Error: Alternative 4 unknown in dictionary.

I'm only running a very simple MNL as well, nothing fancy! I attach the code i am using. If anyone can spot an issue in it that i didn't see, i'd appreciate the help! Been stuck on it for a few days now.

Cheers!
Lizy
f6cteffects.py

Michel Bierlaire

unread,
Dec 23, 2018, 9:48:15 AM12/23/18
to lizy....@gmail.com, Michel Bierlaire, Biogeme
It means that one of your ChoiceX variables takes value 4, while there are only 3 alternatives. 



<f6cteffects.py>

manuel barrientos cifuentes

unread,
Dec 24, 2018, 2:41:59 AM12/24/18
to Biogeme
Hi All
I had this trouble a lot of times, if isn't the problem that Professor Bierlaire have noticed, maybe is due the way that you saved the .dat file. I've solved it just triying different ways of generating the .dat file (finally, I'm modifiying my data in STATA, and exporting it to .txt, and after that, saving it in .dat format, probably exist a more efficient way to do it).

Best regards, 
Manuel 

Hlulani

unread,
Jan 29, 2019, 3:10:10 AM1/29/19
to Biogeme
Hi Everyone,

The same error surfaces in my specification, but it runs cuts the number of observations by a large number. My model only has two alternatives (1, 2), but the error ranges between "Alternative 5, 10, 15 is unknown" which are levels for one of the attributes in the model.

I thought it was an "Id" problem, so I fixed the sequence of the "Ids". I then checked the data file, but found nothing unusual (i.e. overlaps in the .dat).

At this point, I am not sure what could cause this. Attached is the _specFile.debug (how does one read this file?)

Thanks
H
__specFile.debug

Tao Xu

unread,
Dec 30, 2019, 3:17:32 AM12/30/19
to Biogeme
Hi everyone, 

I am working on MNL, to analyze the choice of traffic mode. This problem also happens to me. Meanwhile, there are about 441 observations in my data, but there are only 48 observations captured by the model. I have no idea what causes this issue. Attached is my mod file and issue (screen captured). Thank you very much.

Best,
Tao

[23:12:42]patFileNames.cc:48  Portland_20191229B_modechoiceMNL.par does not exist
[23:12:42]patFileNames.cc:52  Trying default.par instead
[23:12:42]patBiogeme.cc:134  Read default.par
 Opening file Portland_20191229B_modeData.dat
Warning:  Error: Alternative 2488107882 is unknown
Warning:  Error: Alternative 224 is unknown
Warning:  Error: Alternative 9 is unknown
Warning:  Error: Alternative 0 is unknown
Warning:  Error: Alternative 8 is unknown
Warning:  Error: Alternative 0 is unknown
Warning:  Error: Alternative 373 is unknown
Warning:  Error: Alternative 7 is unknown
Warning:  Error: Alternative 0 is unknown
Warning:  Error: Alternative 367 is unknown
Warning:  Error: Alternative 1536 is unknown
Warning:  Error: Alternative 515 is unknown
Warning:  Error: Alternative 0 is unknown
Warning:  Error: Alternative 41 is unknown
...............................................................
Portland_20191229B_modechoiceMNL.mod
Issue_unknown alternative.png

Michel Bierlaire

unread,
Dec 30, 2019, 4:15:09 AM12/30/19
to erikss...@tamu.edu, Michel Bierlaire, Biogeme
It seems that your data flle is not read properly. 
I would also advise you to use the new version of Biogeme, that is a module in Python. See the webpage biogeme.epfl.ch
 

-- 
You received this message because you are subscribed to the Google Groups "Biogeme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/biogeme/f0680185-b6a5-4318-bfd4-19ed759e1c66%40googlegroups.com.
<Portland_20191229B_modechoiceMNL.mod><Issue_unknown alternative.png>

Reply all
Reply to author
Forward
0 new messages