0
$\begingroup$

For example, to use 1 as True and 0 as False:

LogitModelFit[{{300, 0, 0}, {400, 0, 0}, {450, 1, 0}, {460, 1, 1}}, {x, y}, {x, y}]

where y is boolean parameter.

$\endgroup$

1 Answer 1

1
$\begingroup$

You can check the documentation about the option NominalVariables

http://reference.wolfram.com/language/ref/NominalVariables.html

NominalVariables is an option for machine learning functions such as LinearModelFit or Classify that specifies which variables should be treated as having discrete values specified by names.

So

LogitModelFit[{{300, 0, 0}, {400, 0, 0}, {450, 1, 0}, {460, 1, 1}}, {x, y}, {x, y},
  NominalVariables -> y ]

shoud do the job.

You ae not required to use 0 and 1 for your binary variables, you can use more meaningful symbol and strings, like True/False or "Male"/"Female", and so on.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.