My MeiCogSci Presentation on the Topic Modeling of Cognitive Science Abstracts

I am a bit behind on my blog posts. I mean, right now writing about my presentation, that I had about a month ago tells me, that I had not written anything for at least a month. I guess it was a busy month. :) Well, last month I had a presentation on the topic modeling of the abstracts, that were published in this very conference in the last decades and some. So that can give us a pretty good indication of what people in our study program find interesting. That was a fun project, that probably took about two months of my life.

I have spend a lot of time playing around with different models. On the end, I used the model with 21 topics. Looking back now, I think I would get a better results with less topics. That is my intuition, because I also played a lot with different number of topic models and I think the ones in the 10-15 topics were a bit clearer and more straight forward. But in the end, I ended up using the best model based on the numerical indications. Also, for most of my time, I was really annoyed, that the three topics were together: constructivism, sense-making and empirical phenomenology. To me, these were separate topics. Or at least more separate topics than reinforcement learning and neural networks, that got divided.

Well, the model was right and I was wrong. The feedback that I got was that these is how it should be. I got the info that the constructivism-phenomenology group should be together. Apparently Varela, who is one of the most prominent empirical phenomenologist, went through both constructivism and sense making. At the presentation, I found out that people have a strong opinion of why neural network and reinforcement learning were supposed to be separate. The first explanation was, that reinforcement learning is just one method of neural networks, but otherwise they are separate. The second has to do with explainability of the model? I don't think I completely understood that explanation.

Well, all this feedback came to late, so I ended up with a model with too many topics. Maybe what I can learn from that is, that if there is something that appear no matter the preprocessing and number of topic selection, it will probably be right, so don't mess up the model to try and correct it.

The visualization of the final model can be found on my page. I also included the simplified model as a web app, so everybody can check the topics of any texts (but if used on text other that cognitive science ones, I can not guarantee any sensible results). Feel free to play with it.

Now, for some interesting results, that I have gotten. Probably a lot more interesting for the people connected to the study program than anybody else. The analysis could be found on my github.

The most popular topics are constructivism, society, learning, decision making, neuroscience, language, perception, modeling, movement, neural networks and reinforcement learning. I put them so many, because of the next difference.

There are difference in which topics are popular in which place. In the study program, there are currently four universities: Ljubljana, Vienna, Bratislava and Budapest. So I also analyzed one of the years (2015) in order to see which topics are popular in which places. There were not enough abstracts from Budapest in that year, so I only used the other three.

For Ljubljana, the most topics of interest were constructivism, learning and neuroscience. In Vienna, the topics were society, decision making, constructivism and perception. And in Bratislava it was reinforcement learning, learning, modeling and language. In the general perception it is, that you go in Ljubljana in you are interesting in first-person research and neuroscience (which is shown), Bratislava if you are interested in computational modeling and maybe language (which is also shown) and in Vienna if you want something else or have no idea what you want to do, since they were supposed to have the most variety.

For the people in Ljubljana, we have to hear a lot about the connection between the first-person and third-person. So it was interesting to see that neuroscience and constructivism have the least amount of collaboration. But what it can also be seen is, that the amount of interdisciplinarity is increasing through the years.

I also checked which topic humanizes the participants and which do not (according to how one of the people in the audience described it). I only checked if the used subject or participant. The topics with most human participants were study of perception, attention, non-typicality, categorization, neuroscience and decision making. The humanizing ones (using participants) were studying of language, decision making and attention. The others (using subjects) were neuroscience, neural networks and the studying of pitch.

I also checked the differences in personality. More agreeable are people studying health, non-typicality and decision making. Less agreeable were people studying reinforcement learning, neural networks and systems. More neurotic were people studying reinforcement learning, systems and tasks. Less neurotic were people studying non-typicality, health and pitch. The most extroverted researchers were the one studying decision making, society and attention. The least extroverted researchers studied neuroscience, TMS and health.

So these are some results, that I ended up finding about this data set. There are still many interesting questions to ask, but I think I will take a bit of a break and maybe return to this topic models later.

Check the license in the Youtube video through API [StackOverflow answer]

This is my answer to the trouble shooting question about getting the license information from the Youtube API: https://stackoverflow.com/questions/56678956/how-to-check-for-creativecommons-videos-by-using-youtube-data-api-i-have-the/56714010#56714010.

@goodvibration answer was correct, as long as you keep into account that the json.load uses the read function, which means that once the data is read, it can not be read again. In this case it would return empty byte string.

This code works by printing True at the end.

response = urllib2.urlopen('https://www.googleapis.com/youtube/v3/videos?id=gwLej8heN5c&part=status&key=MY_KEY') for item in json.load(response)['items']: print(item['status']['license'] == 'creativeCommon')

Also, in your original example and in your example of error you used list(json.load(response)) when saving to data. This would mean, that you don't get the entire json, but just the keys. So in your case, I would suggest to not change the response to list. But since you did not use the data variable later in example, it does not really change the results. But it could be important, if you have more information you want to check/save.

Also, in this case, because the json.load() uses the read function, which can not be used multiple times, you need to save the entire json and then read from it. The code would then be:

response = urllib2.urlopen('https://www.googleapis.com/youtube/v3/videos?id=gwLej8heN5c&part=status&key=MY_KEY') data = json.load(response) for item in data['items']: print(item['status']['license'] == 'creativeCommon')

You can see this if you try and read the response that you get. You can put the following code to test it:

response = urllib2.urlopen('https://www.googleapis.com/youtube/v3/videos?id=gwLej8heN5c&part=status&key=MY_KEY') print(response.read()) print(response.read())

In this case the results would be:

b'{\n "kind": "youtube#videoListResponse",\n "etag": "\"Bdx4f4ps3xCOOo1WZ91nTLkRZ_c/3jdRB-NXSAfUQj7e_FmBbivkK1o\"",\n "pageInfo": {\n "totalResults": 1,\n "resultsPerPage": 1\n },\n "items": [\n {\n "kind": "youtube#video",\n "etag": "\"Bdx4f4ps3xCOOo1WZ91nTLkRZ_c/NUd32t1_moLGAwVuu-ZujlkaiWM\"",\n "id": "gwLej8heN5c",\n "status": {\n "uploadStatus": "processed",\n "privacyStatus": "public",\n "license": "creativeCommon",\n "embeddable": true,\n "publicStatsViewable": true\n }\n }\n ]\n}\n' b''

In the first case, the result is a json in byte-string form, while the second one is an empty byte-string. So when you would try to use multiple json.load() on the same response element, you would get the JSONDecodeError (same as in your comment), since the second time there is no json to parse.

Sortying list of lists based on multiple criteria in Python [StackOverflow answer]

My answer to the following StackOverflow question: https://stackoverflow.com/questions/56556639/sorting-a-list-by-multiple-non-standard-criteria. They wanted to sort based on column 5, and then based on column 8, with entries that have value 0 being listed first.

If you use data.sort(key = lambda x:x[0] == 8), then it will sort every one with 8 on the position 0 to the last place. So what you could do would be the following:

First sort them, so all the 8 at the position 0 are on the end:

data.sort(key = lambda x:x[0] == 8)

Then sort based on the position 5:

data.sort(key = lambda x:x[5])

And then reverse the order:

data.reverse()

Pivot table sorting in Pandas [StackOverflow]

The answer to the question about the sorting based on the difference in the items with the same value in one column: https://stackoverflow.com/questions/56537706/i-want-to-sort-a-dataframe-based-on-the-difference-of-two-rows-of-a-single-colum

First you need to calculate the differences for each item type. One of the ways, how to do this with pandas would be to use pivot_tables. Here you tell it which dataframe (df), based on which columns to calculate (values="TotalCost"), what function to use to calculate it (aggfunc=np.diff) and how to group them (index=["ItemType"]).

diff = pandas.pivot_table(df, values="TotalCost", index=["ItemType"], aggfunc=np.diff)

You case above only have 2 possible months. If you had more than two, then np.diff would give you values in a list. In this case you have two options. Either you filter the data frame, so there are only two months in it. This can be done like this:

df = df[[a or b for a, b in zip(df["Year_Month"] == "Jul-2017", df["Year_Month"] == "Jun-2017")]]

The other option is that you calculate the mean difference in months. This can be done with the following function, which you would then replace np.diff with:

def mean_diff(l): return np.mean(np.diff(l))

Then you can use this to calculate the difference for each element:

df["Diff"] = [float(diff.loc[d]) for d in df["ItemType"]]

After that, you just sort by the difference (and then by item, in case there are multiple items with the same difference)

df.sort_values(by=["Diff", "ItemType", "Year_Month"]).drop(columns = 'Diff')

Why Our Parliament is not the Only Weird One

Sometimes it might seems like, our parliament is a really weird one. You don't believe me?

I remember once watching a parliamentary session, where the person had a couple minutes talk about, how there is the smell of glue. And that maybe there is a lot og glue in the air. So they all might have ended up high. Which, according to that speaker, would explain why people are giving the suggestions they do.

Or a more recent one. There was a meeting. A person admitted on the camera, that they stole a sandwich. Called it a social experiment... well you can imagine what happened in the end.

So, in order to counteract these, I am going to list some of the thing that are weird in the British parliament:

  • They sit 2 sword lengths apart, so that they are unable to cut opponent head off
  • They can't have a debate without a golder mace listening to them
  • They can not address each other directly (I guess they invented passive-aggressiveness?)
  • They are not allowed to say, that something is not true
  • They vote by walking to the room

Topic Modeling of Python Conversations on Tumblr

I had presented a lightning talk on May Python Meetup.

What I did was take all the Python tagged posts from Tumblr. Then I topic analysed them and tried to figure out some interesting things.

Here are the interesting things:

  1. Python is connected to three big topics: nature (the dark night with a dog barking one), startups and coding.

  2. When ignoring the nature one, the trends show that from 2013 to 2016 there was a lot of interest in learning python. But then the interest shifted to startups. (Not sure why. Would be interested in finding out...)

  1. There are people posting python code with comments in Japanese. So, a Japanese python community? (not sure, why it is on Tumblr...)

  2. People really like to create chat apps. (again Why???)

My slides and code are also available.

Sort of MBTI of Problem Solving

This is the idea, that I am toying around with, and I am trying it out from time to time. Not sure, how successful it is practically, but it might help with some people. What it basically does, is to try and see on the problem from different perspectives, in this case, perspectives of different functions.

MBTI was designed based on the Jung's function theory. So Jung's said that we have four functions: Thinking, Feeling, Intuiting and Sensing, and each can be oriented inside or outside. I have to admit, I understand a lot more about inside and outside orientation, since I took first person research. Before, they would sometimes get mixed. For example, I could not understand introverted intuition, but if I think about it like an extroverted intuition oriented in the inside, it makes sense. But it did not make sense, until I started to observe myself.

And each function wants something. The thinking wants order, the sensing wants information, the intuition wants creativity and the feeling wants humanity. And then each one is turned in one side, the thinking wants order, but introverted thinking wants order in the thinking, and the extroverted thinking wants order in the external world. The same with sensing, the extroverted sensing gets the information from the world, and the introverted sensing gets the information from the inside us. The extroverted feeling wants to express humanity toward other people, so that we are more human to each other, the introverted feeling wants to express inner humanity, which is why it is connected to the values a lot of times. And so on and so on.

Penelope Trunk actually summarized what makes each type (not function) makes one happy and refuel them. I copied the information in the table below:

Type Activity
INTJ Needs to create order and structure from theoretical abstraction.
ENTJ Needs to visualize where an organization is headed.
INTP Needs to generate new theories or to prove or disprove existing theories.
ENTP Needs to understand the world they live in.
ISTP Needs to understand the way things work.
ESTP Needs to take action and get the job done.
ISFP Needs to feel immersed in the world of senses.
ESFP Needs to feel excitement and drama.
ISTJ Needs to fulfill their duty.
ESTJ Needs to enforce rules and/or traditions.
ISFJ Needs to create harmony and cooperation.
ESFJ Needs to make people feel good about themselves.
INFJ Needs to see the world of hidden meanings and possibilities.
ENFJ Needs to bring out the best in others.
INFP Needs to make the world a better place.
ENFP Needs to inspire and motivate others.

(As the unrelated note, this can also be used to help type people :) )

So, going from that tangent (but this approach can also work with the needs above), how to use thins to solve problems? Well, when we have a problem, we can think about, how each function would approach this. How can be bring order and use this to solve problems? When can be get more information? Is there something else we did not consider? How do we bring fourth our humanity.

Pydays Vienna 2019

This weekend, I have attended the https://www.pydays.at. This time I am not going to talk about the stuff I learned on it. Even though the Workshop: Analysing 200 Years of Political Debate was both funny and informative.

This time, I went with a friend of mine. And there are some things that I learned just from that.

I prefer buses to the cars. Mostly because I can read and work in peace and because I have more space. Mine friend was great and very understanding, but there is still a social pressure to not just put a laptop out and work on it.

Not to mention, the parking is expensive and it takes a lot of time to find the parking space. It is annoying.

The other point is, that I like travelling with other people. Having the company during breakfast and somebody to share the whole trip was surprisingly refreshing and nice. I am grateful, that I had company.

And that this company was better than the women in my room. They were not bad, but when we went out, they most of the time talked about travelling and men. The first is somehow interesting, the second not at all.

But it does have a negative side as well. Having him there, it gave me the excuse to not socialize with new people. I never noticed this explicitly, but thinking back, that has always been the case. Something to keep in mind.

I don't mind going to the events alone, I have a lot of practice, but it is nice to know, that I need to go somewhere, I don't know anybody, if I want to learn something new.

I also had this weird phase of knowing somebody, where I met them before, I remember them, but I have no idea, how to act around them. Maybe this is why I have problem making regular friends? Something to keep in mind.

Another thing that I noticed is, that recently I have a lot of signs to talk more at the events and to start organizing the events. I noticed both of them. Even more, I noticed that I started to seriously consider this. So this is something, that I need to keep in mind. Which makes me wonder, when will I ever get a normal job and a normal life?

The last thing, that I can remember, is that I finally understand, why I don't like the current feminism. I decided, that instead of attending the lightning talks, I will try to attend the woman-only mentorship meeting. What I realized is, that their complains are small. It is that they don't want to be brushed off (everybody is at one point, and standing for oneself works) and that culture changes, when there is more women (which is probably true, but that does not mean, one is better than another). But they framed everything like a battle.

Which is weird, since gender is not the only interesting difference between people. I wonder what people would say, if there would be groups like that for right-wing people in social sciences or groups like that for old people in the athletic sports or groups like that for sociopaths in teachers in early education.

Plus, I had not draw that many pictures in a day in a log time. You can see them here: https://sarajaksa.eu/2019/gallery/

Otherwise, I got some things to think about, some blog posts to write and some code to correct. So overall, it was a productive weekend.

Lent without Sweets

While I am not religious, the part of my family is. And it is the part of the Christian tradition to observe the Lent during the time from the carnival to the Easter. Well, I think it is called Lent, in my language it is called post, which does translate to Lent, and the descriptions on the internet match? We use the same word for fasting in my country.

I decided that this is a perfect excuse to try and do something that I had wanted to do for a while. Well, I actually wanted to do the no sugar thing, but that seemed a bit too hard. Especially with how little willpower do I have to resist chocolate. And I ate a lot of bread during this time, and I know there is sugar in bread.

I still remember the first day. I think I came to stare at the Milka chocolate. I would be standing there, with the drawer with sweets open, and I would stare at it. The only way that I could survive that, was imagining, that after it is going to be over, I would eat it. It is only these two rituals, that helped me made it through the first couple of days. And I did not cave.

The days afterwards were easier.

I did notice, that it is convenience and more imagined testiness that made me choose sweets. Why do I say imagined testiness? Because none of the sweets are better than raspberries, but I would feel a stronger pool towards sweets. I would feel stronger desire for sweets. (I still do)

But after I figured out the snacking part, it was easier. I always had a thawing raspberries with plain yogurt in the refrigerator. And I ate a lot of oranges. Lots and lots of oranges and other fruit, but the oranges predominated. And drank more strawberry smoothies that I had before in probably more than a year, and that was all toward the end of it. Now, I am not sure how much healthy it was, but it sounds more healthy.

There were three times, that I broke the post and they all show, where do I need to be careful, when I am going to attempt it in a long term.

The first time it was, when I used sour cherries in my yogurt. I still live with my family (I know pathetic :) ), and there were some left over sour cherries. I added them to my yogurt, since I hate food waste. Only days later, did my father told me how much sugar did he pour in (a lot). And this food waste perspective will bring me trouble. I have not been eating meat for almost a decade now, except in the situations, when it was clear, that it will be thrown out. The urge is getting smaller and smaller each year, but it is still there.

Well, the problem will mostly solve itself, once I get my own place. It is the food waste in my home, that is the most hard to deal with. Which is good, because I don't want to spend another decades, going through that again. But on the other hand, I also don't want to wait until I get my own place. Just because I have a limit of about year and a half, does not mean, that it will happen much sooner than that.

Which is why, the two weeks that I spent at the sea side were easier, even though the next two transgressions happened there.

The second time was because of my grandmother. She knew, that I had a no-sugar eating period, and she sends me a apple strudel with my grandfather. And then she pester him, if I am eating right. And she is the type of person, that does not like sweets at all. So I caved in the social pressure. And it was too sweet for my taste buds. But this I know how I will deal with eventually. By going through it. On the long run, once I go do it full time, this is not going to be a problem for long.

But if I am not full time, then my family tries to be helpful by making me to try and break the commitment.

The third one was the first day of menstruation. I think this will be like my cheat day of the month, because there is no way, that I am going through that pain with no chocolate.

Surprisingly, the maturational pain this time around was shorter than usual. And I do wonder if it was because of lack of sugar? Or maybe the chocolate had a bigger effect, because of the lack of it in the days before? I don't know...

Now I am back to my sugar filled days, and I wonder if the sudden lack of productivity compared to that time is the consequence of that? Because I am back on eating a lot of sweets. But I also know, once I came from Austria, I am going to try and make this a more permanent, even if not as strict endeavor. Maybe starting with having the workdays or weekends to be sugar free, with no restriction to the rest of the days? I am still thinking about it.

The Changing Focus in Life

Relatively recently, I was having a lemonade with a friend of mine. I mean, considering I was not in the best mode that day, I hope she did not find it a complete waste of time. :) But there was an interesting comment, that she said in the end. I don't remember the exact words, but she said something like, how she preferred my shorter blog posts about personality, than what I am currently writing.

That got me thinking a bit. I mean, I don't actually expect people to read this blog. It is more a documentation of my thinking process, than a marketing tool. But that also means, that it reflects, what I am currently thinking about it, and I am currently in the phase, where individual differences sort of took a back seat for a while. Programming seems to be in the front for the last couple of months. And I think this is reflected in what I am writing on my blog. A lot more data science/programming posts, less cognitive science/individual differences posts.

But what does this mean for me? There are at least a couple of things, that have to be kept in account. One of them is from decision making. I remember reading in an interview of similar with the Supercasting author Tetlock, that the more people are known for something, the less likely they are to change that part of them. Which means, that even though I don't expect people to read these notes to myself, I might still be putting myself in the mold.

I have recently read a couple of things about changing opinion. From situational factors, to individual factors, to how much message is targeting the right level of personality traits, to the self-concept and how important that identity is to people and so on. And a lot of them work in a way, that they keep the opinion stable. Though, if you have the minority with opinion, that they are not willing to bend on, this can shifts the entire societies (economists have some pretty interesting simulations).

This can be then brought together with the theory, that a classmate of mine from Vienna presented to me last year. The theory says, that we have a huge conformational bias, and that is why conversations exists, so we can come up with the better, ... I don't know if consensus is a good word, but sort of going in this direction (and I probably butchered the theory as well :) ).

But people change. I am reminded of the quote from a series that I watch: "Change happens. Tragedy happens. People make choices and those choices affect everyone else." Well, I have not experienced a lot of tragedy, but the change does happen. Some parts of us are shed away, some are tired on and some of the tried ones are then adopted. Though there are things that I can see are going to come back. As long as I don't understand people enough, to know what to do with them without analysing, that long I am going to keep coming back to individual differences and personality. On the other hand, who needs Toastmasters, when you can have a lightning talk on each Python Meetup? Or find some other, more interested (even if more demanding) audience? (Just a joke, Toastmasters does have a role in helping people get rid of fear of public speaking and give the people the opportunity to socialize).

So on the end, what does thins means? Probably nothing. I don't think I will start writing more likeable material for the audience. At least not yet (nobody knows what the future holds (I am using a lot of parentheses, am I not?)). Even after having more than 500 entries here, I still have no idea, what do I want this blog to be, so for now, I will continue as I did so far. Because I don't think I want to turn this into personality blog (even if I though about it a time or two before).