Message Boards Message Boards


Find your Species Name on Darwin's Birthday!

Posted 6 years ago
2 Replies
18 Total Likes

[UPDATE] New Darwin's Day App for 2019 -->

Note: In this post I will show how to create THIS APP

enter image description here

Here what happens when you type a name:

enter image description here

Even Mathematica has its own spiecies! In this case Storena Mathematica is a spider:

enter image description here

Today is the Darwin Day! So, let's celebrate the Origin of the Species by creating a nice application. Do you know if there is any Species with your name? Let's find it out!

First, we need the list of Species with their Scientific Names. Luckily, the Wolfram Language has already built-in this information:

listofEntities = EntityList[EntityClass["Species", "Species"]]
species = Table[StringReplace[listofEntities[[i]][[2]], "Species:" -> ""], {i, Length[listofEntities]}]

enter image description here

Now, we want to split each scientific name in two words. Following the binomial nomenclature the second part identifies the species within the genus and it is the part we are interested in. Before splitting them we will use StringInsert to put a blank between the two parts.

listofSNames = Table[StringInsert[species[[i]], " ", StringPosition[species[[i]], _?UpperCaseQ][[2, 1]]], {i, Length[species]}];

There are couple of Species with a strange format but we will ignore them here and we use the StringSplit function:

listof2ndParts = StringSplit[list = Select[listofSNames, StringQ[#] &]][[All,2]];

So far, so good. Now, we can already apply our key function: Nearest which will find the closest Species Name to our given name:

Nearest[listof2ndParts, "Jofre", 1] 

We can create a specific function for it, let's call it nameToSpecie:

nameToSpecie[name_] := Nearest[listof2ndParts, name, 1]

Finally, we can easily create a FormFunction and Deploy it to the Wolfram Cloud:

CloudDeploy[FormFunction[{"name" -> <|"Interpreter" -> "String", "Input" -> "Darwin"|>}, nameToSpecie[#name] &], "Permissions" ->"Public"]

Happy Darwin Day!

Have fun discovering new Species and let me know what Species do you get.

I got this spider called Cyclosa Jose:

enter image description here

2 Replies

enter image description here - you earned "Featured Contributor" badge, congratulations !

Dear @Jofre Espigule, this is a great post and it has been selected for the curated Staff Picks group. Your profile is now distinguished by a "Featured Contributor" badge and displayed on the "Featured Contributor" board.

Cool! Thanks! The App went viral over the weekend, especially on Tumblr. So, I thought it will be interesting to share some results. I created a Databin in order to store all the entries of the App and track its usage easily. During the last 3 days the App gathered more than 53000 names. In the list there are many "Darwin" entries because it is the default input of the App. We can get rid of them using DeleteCases:

bin = Databin["binID"];
names = DeleteCases[Flatten[TextWords[ToLowerCase[Values[bin]]]], "darwin"];

Now we can visualize the most popular names with the WordCloud function:


enter image description here

It is easy to guess that the female names are more abundant. And we can check this in a quantitative way using Classify with the "NameGender" built-in classifier:

WordCloud[names, ColorFunction -> (If[Classify["NameGender", #2] === "Female", Orange,Purple] &)]

enter image description here

We can also visualize the percentages with a PieChart:

genderProb = Classify["NameGender", names, "TopProbabilities"];

PieChart[100 N[Values[genderCounts]/Total[Values[genderCounts]]], 
     ChartLabels -> {Style["Female names", Bold, FontSize -> 20], 
       Style["Male names", Bold, FontSize -> 20]}]

enter image description here

From the Databin we can also get the "TimeStamps" and easily visualize the usage over time in Entries/Minute units with DateHistogram:

t = Databin["binID"]["Timestamps"];

DateHistogram[t, "Minute", PlotTheme -> "Detailed", TimeZone -> -5,
             PlotRange -> {{{2016, 2, 12}, {2016, 2, 15}}, Automatic}, 
             PlotLabel -> Style["Darwin App Usage (Entries/Minute)", Bold, FontSize -> 26]]

enter image description here

In the near future I will try to analyze the the Species associated with theses person names. In fact, many people were surprised to get mostly insects and spiders. But as a remark, note that mammals only account for 5,416 species out of more than 1 Million.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract