0
$\begingroup$

I am working on a set of student data to train some models. I have the gender variable and I can also retrieve data about how many other girls go to this student's class. I would like to take into account in the modelling that if it is a girl, whether there are other girls in her class or not. This variable shouldn't have any interference in the cases where the student is a boy.

Any idea how I should treat this?

$\endgroup$
  • 1
    $\begingroup$ Welcome to the site! Would using only a subset containing girls be useful for you? $\endgroup$ – mapto Sep 10 '18 at 7:45
  • $\begingroup$ Otherwise, is there a type of meaniningful value you could give to that variable for boys? This could be either an existing value (e.g. no girls in the boys class) or a new special null value. Such a choice might be different depending on the algorithms you might to decide to choose. For example, whether you will treat this variable as a categorical true-false(-null) or as numerical 0/1 could be influenced by your algorithm of choice. $\endgroup$ – mapto Sep 10 '18 at 7:49
  • $\begingroup$ Thanks for answering! I don't think there's point in doing it for boys as there's never only one boy at a class group but maybe I could generalize it with a variable that represents whether a student is the only one of its gender as what I pretend to see if a girl who hasn't got any girl colleagues has any downsides $\endgroup$ – raquelhortab Sep 10 '18 at 11:30
0
$\begingroup$

If you are interested to see if there are any other girls, you'll likely need to create a new indicator variable in your modelling data - perhaps something like:

  • other_girls_in_class = 1 if gender = female and there are other girls in the class
  • other_girls_in_class = 0 if gender = female and there are no other girls in the class

You need to treat these kind of approaches with care as it will implicitly contain some information on student gender.

$\endgroup$
  • $\begingroup$ I see, but then it would treat the same a boy and a girl with no other girls (it would not take into account that a girl is the only girl in class). Maybe I should change the perspective and make a variable that takes: 1 - if girl and is the only one 0 - otherwise (boy or a girl who's not alone) $\endgroup$ – raquelhortab Sep 10 '18 at 11:25
  • $\begingroup$ Or you meant that for a boy the variable would take NA ? $\endgroup$ – raquelhortab Sep 10 '18 at 11:26
  • 1
    $\begingroup$ Yes, the value for a boy should be a desired NA value - e.g. could be something like -1, 999, NA. You should choose this value based on how your ML algorithm treats "missing" observations. $\endgroup$ – bradS Sep 10 '18 at 11:34
  • $\begingroup$ considering values for boys as N/A (1-other girls present, 0 - other girls not present, 100-N/A- for boys) could easily creates another category for boys when classification algorithm is used and wont be a problem. $\endgroup$ – CodeMaster GoGo Oct 10 '18 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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