Holmes, AI

A Sherlock Holmes story with machine learning.


  • scikit-learn, a machine learning library
  • Image Analysis
  • Face Recognition
  • Google’s Colaboratory
  • Python Notebook


FDA Run Control Specification(Part 9)

Sometimes the specifications initially set are too restrictive, because not enough runs have been done to capture the variability of the experiment.

In run control specification, we rerun the statistics on all the validation runs to establish more liberal thresholds.


Paddling Outrigger Canoe in Hawaii

Image may contain: one or more people, ocean, outdoor, nature and water
Paddling from Sentosa, Beautiful but no waves
Credit @SingaporePaddleClub Facebook

Singapore waters are warm all-year-round, so even on Christmas day we can paddle. However, Singapore lacks waves (except for those generated by the occasional ferry passing by). I love the rush from surfing waves — you feel like you’re flying.

So a year ago, my partner asked for an OC paddling vacation to surf waves.  There are OC clinics and camps, but they really don’t suit us. We don’t like camps because of our work schedules: we need a few hours each day and wi-fi to keep up. An Internet search led me to someone who rents outrigger canoes: Jim Foti in Hawaii. A few emails back-and-forth with Jim and we were set to paddle around Kailua / Lanikai beach in Honolulu.

Image may contain: one or more people, ocean, mountain, outdoor, water and nature
Jim Foti of http://fotibros.com/
Credit: Facebook, @JoeyJim.FotiOhana

Jim rented us his own personal OC2 that he races in. It’s super-light and the ama likes to float in the air. We’re use to our club OCs where our left butts sit an inch lower than our right –  it was wonderful to be sitting completely neutral. It did take some getting used to – in the beginning we hulie’d a few times in completely flat water! It also had dual steering, which is a great feature!

Our beautiful OC2 rental for a week
Rates and info at www.fotibros.com/

We spent a perfect week paddling around Lanikai Beach in Hawaii. When the swells were coming from the east at 30 knots (according to https://www.windfinder.com), we could ride pretty consistent waves at Flat Rock. We were regularly catching waves — my Garmin clocked our speeds at >20 km / hr.

Jim took us out during one of these rough days, and as we caught a *big* wave, I could hear him calling in a slightly higher-pitched voice “keep the boat straight”. I know he was thinking we could wipe out. A lesson from Jim: if the waves are crashing on you, keep the boat straight and you won’t wipe out.

Another time, I made the mistake of looking back and saw a large 6-foot wave crashing behind us. At first frozen and paralyzed with fear like Lot’s wife, I then quickly turned my head back to the front and paddled like a mad man while my partner screamed “We’re either on it (this wave) or we’re not!” with fear in his voice. I was uselessly paddling air, but thankfully we were on it.

It’s hilarious to hear grown strong men call out in high-pitched voices, but I probably wouldn’t have found it funny if we had wiped out. Thankfully, we never did.

We never wiped out because if the waves were too fast, they’d just go under us. And we learned from Jim to keep the boat perfectly straight so if the wave did break on us, we’d just ride it out.

We also learned to bleed boat speed when we were too fast on the wave by “buttering the bread” where we put our blades down on the right side. It’s useful for also stabilizing the boat (smallcraft and OC6) if the ama pops up. My instinct is to always lean left on the ama, so I’ll still have to work on this.

Pueo by WOO, photo by Pierre Frechou
“Buttering the bread”: Ama up, paddle in the water
Credit: https://www.woo-outrigger.com

The other tip we learned is that when going into the waves, go straight in but to soften the landing you can steer off it to the left and right. That made it a less bumpy ride.

For the super-advanced huge waves, the person at the front of the boat can jump off and hold onto the ama as the boat dives into the waves. (We never did it.)

OC is really part of Hawaiian culture. In Kailua, you see painting of outrigger canoes on the walls of restaurants, and on the mailboxes of residents.  We paddled up one of the channels and saw houses with their quite a number of OCs (and even an OC6!) in their own backyard. We also shopped at Island Paddler, which caters to paddlers, and discovered Excel, a brand Excel specific for paddlers.

Outrigger paddle in a deli

We had a perfect week out in Hawaii. We spent ~2 hours a day paddling, the rest of the day eating, working, and bumming around. Our vacations are usually only 4 days, but we wanted to ensure we would have good weather during our time out there so we spent a full week. This actually turned out to be a good decision because when we first got there, there were large swells coming from the East, but when we left it was calm and hard to find waves. Our long vacation time gave us a good sampling of the weather.


FDA Validation of Companion Diagnostic (PCR test)

I’ve been helping get a companion diagnostic get approved as a FDA test. This blog series will describe the statistics (R) used for the FDA validation of the companion diagnostic.

The companion diagnostic test is a PCR test to check for a fusion / rearrangement on the customer’s DNA. Normally, people have gene A and gene B. If the patient’s DNA shows a fusion between gene A and gene B, then she should be administered a drug that is tailored to the A+B fusion.

The lab did the experiments and I performed the statistical analysis in R. This series of posts will describe the analysis.

Note: This isn’t production-level code, but it’ll do the job.

Experimental Setup

The PCR test measures FAM and Texas Red values. There are 42 PCR cycles, and so if a fluorescent signal is observed, the Ct signal must be below 42.

The FAM is the signal for the rearrangement — if it’s detected, then the Ct value (the PCR cycle that it’s detected in) should be less than 42. If the fusion is not present, then the signal is never detected and the FAM Ct value is NaN.

The Texas Red value is the signal for wild-type or normal gene A. It is the internal control — to make sure that DNA is in the test sample, we expect some normal DNA in every test because the fusion is heterozygous and a cancer sample may not be pure. We will figure out the reportable range for Texas Red in the Reportable Range Section .

The Cy5 channel measures the presence for wild-type or normal gene B. it is another internal control.

The method we used to decide whether the fusion is present is delta Ct = FAM-Texas Red.

(You could also use FAM signal only if you didn’t want an internal control of wild-type DNA, it depends on how your validation plan was written.)

FDA validation is a long process that takes a few hundred experiments to examine:
Part 2. Pre-processing
Part 3. Analytical Specificity
Part 4. Accuracy
Part 5. Run Control Specification
Part 6. Reportable Range
Part 7. Limit of Detection (LoD)
Part 8. Precision (repeatability & reproducibility)
Part 9. Checking Controls


Creating Your Own Personal Silent Retreat

I was seeking silence and solitude so I spent a few days at Bali Silent Retreat. It was an ascetic vegetarian lifestyle (which was a bit much for me). While I had my moments of revelation, I realized I didn’t have to fly to Indonesia for silence. This blog post will describe how to create your own silent retreat.

The Bali Silent Retreat is not actually silent. Teachers instruct yoga and meditation, guides talk on tours, and you are asked to chant during ceremonies.

The silent part is removing the noise in your life. For most of us, this is our electronic devices including Internet, and social media. We spend a lot of time on our email accounts, Whatsapp, Telegram, Facebook, Instagram, and Twitter, etc… Noise can also come from family/roommates if you don’t live alone.

The first thing we did at the Silent Retreat is to lock up our electronic devices. There are no electrical outlets in the rooms and there’s no wi-fi signal anywhere.

That’s it! It’s that simple. The secret sauce to a silent retreat:

1) Locking up your electronic devices
2) Avoid excessive talking and stress
3) Spending time alone with your thoughts

If you can do this for a day or two (or even half a day), you’ve created your own silent retreat.

You might be asking: If I can’t go on the Internet or talk to people, what do I do?
The silent retreat had a lot of optional yoga and meditation classes to fill up the day.

Bali Silent Retreat’s Schedule
6-6:45 am Meditation
7-8:30 am Gentle Yoga
8:30-10 am Breakfast
12-2 pm Lunch
2-3:15 pm Yin yoga
3:30-4:30 pm Meditation
4:30 pm-6 pm Dinner

But these classes were optional. You don’t have to meditate or practice yoga — you can do whatever activities that are enjoying and calming to you. Some activities could be:

  • hiking
  • cooking
  • yoga
  • sewing
  • gardening
  • massage
  • taking a bath
  • reading inspirational books

Fill up the day with activities that are familiar, calming, and personally enjoyable, so you can let your mind meander and wander.

Calm your mind first; stillness and insights will come later.

If you feel antsy, write it down for later (using pen and paper), then let it go. This is your time, for you.

You’ll also eat alone in silence and without distraction (no devices nor reading). This helps maintain the silence.

Here’s the reality.

Silence at home
I admit silence is hard to achieve at home because my instinct is to check the Internet every 10 minutes. However, I have still been able to find a 10-hour period of time of silence. I do this when my roommate is travelling so the house is quiet. I work a half-day in the morning so I can check all my emails and get everything out of the way. Because everyone at work knows I’m taking the afternoon off, they won’t expect me to reply until the following day. When my period of silence starts, I make sure nothing is hanging over my head and shut off all devices. And then I fill the rest of the day with activities that I enjoy (see list above)

Silence when travelling
It’s much easier for me to attain ‘enlightenment’ when I travel alone. When I travel, I only use the hotel’s Internet, so I’m unplugged. Importantly, people don’t expect me to respond when I’m travelling. I’ve attain silence similar to what I had in Bali Silent Retreat in a museum in Washington, D.C., soaking in Calistoga baths, or wandering Central Park in New York.

I hope this helps you find your inner self.


Fantasy and Genetics – Do They Go Together Like Science and Fiction?

This could be a disaster. I’m launching a new website that does genetic analyses for fun. It combines make-believe and science.

There are a lot of direct-to-consumer genetics products out there, yet genetics is not very predictive at the individual level. The science behind these difficulties is abtruse, so why not have some fun while helping people understand their DNA better?

In between my various consulting jobs, I caught up on TV, movies and books. Specifically, I got hooked on Game of Thrones.

Game of Thrones has a lot of drama, but it also has genetics! It’s an important plot point – one of the heroes Ned Stark ends up dying because he understands genetics!

Ned Stark recognizes that the black-haired King Baratheon can not be the father of Queen Cersei’s golden-haired children, which means her children should not inherit the throne.

The seed is strong… All those bastards [from King Robert], all with hair as black as night. … No matter how far back Ned searched in the brittle yellowed pages, always he found the gold yielding before the coal.

Ned confronts Queen Cersei with his genetic discovery; which leads to Ned’s downfall and eventual execution.


After getting over the shock of Ned’s death, I went meta and realized that genetics and fantasy don’t have to be completely separate — they can be mixed.

Our favorite characters have interesting personalities and traits, and a lot of these characteristics have been researched. Based on this research we can create a genetic sketch of what our favorite heroes might look like at the DNA level.

My app then takes your DNA (from direct-to-consumer DNA companies like 23andMe), and predicts which traits you might have (like loyalty, brave, strength endurance). Finally, the app shows what traits you could have in common with your favorite fictional characters.

For example, the T allele in rs6265 in the BDNF gene is associated with resilience. So if your DNA has the genotype TT for rs6265 , we’d predict you were also resilient, and would likely share that trait with Ned Stark.

I admit this is one of my stranger ideas, but there is a long tradition of combining science with fiction; why not add genetics to the mix? Since I don’t have a full-time job, I figured it was a perfect time to try new things and a perfect time to fail.  I realize this may not be for everybody — but if you want to see what you have in common with your favorite fictional characters, please try out my DNA Fiction website.


Obsessions in Alzheimer’s

This video shows a woman with Alzheimer’s who is obsessed with finding and helping a non-existent cat. The obsession happens over a two-month period and you can tell she’s very distressed. She is always looking for a cat — wandering the streets and even breaking windows to go out and find this cat. Her daughter (Mulligrubs1) is very patient and reassures often that the five cats they own are safe.

OK, I’ll throw this out there —  I wonder if Mulligrubs1’s mother was using a cat as a metaphor for her mind. Why? Because it resembles what Martin Slevin, another Alzheimer’s carer, described in his own  book. His mother talked to and obsessed over an imaginary girl in the radiator. Towards the end of the book, he realizes that his mother is the little girl in the radiator, trapped, alone, and scared. Once he makes this connection and talks to his mother’s obsession goes away.


In the video, Mulligrubs1’s mother describes a cat:

  • The cat is often lost and outside. Maybe she feels her mind is lost and wandering?
  • The cat is described as wet. Cats don’t like being wet, so this means the cat is unhappy and uncomfortable.
  • Mulligrubs1′ mother always wants to lock the cat in her room. By bringing the cat/her mind in her room, maybe she would feel safer, and her mind wouldn’t wander.

In their conversations, Mulligrubs1 is constantly reassuring the mother about the 5 real cats, but Mulligrubs1’s mother constantly refers to a cat that isn’t there. Maybe some Alzheimer’s patients create a metaphor for how they feel and if we can enter their reality, we can relate to how they feel. And maybe, just maybe, knowing that someone else understands can help our loved ones?

I imagine a possible conversation between Mulligrubs1 and her mother:

Mulligrubs1: Please sit down. Tell me about the cat. I would like to help you.

Mulligrubs1’s mother: <Describes the cat as small, lost, outside, and wanting to come back in.>

Mulligrubs1: That sounds scary. The cat must be very scared. <hugs her mother> Do you feel like that cat?

I wonder what would have been her mother’s response. If it would have helped her to know that someone understood how she felt. Would she remember this or forget and return to her cat obsession? (For Martin, once he made the connection and told his mother he understood, his mother’s obsession went away.)

Of course, it’s easy to make this suggestion from my armchair. Mulligrubs1’s patience and love is admirable (watch the video to see I mean); I hope I can do the same.

Disclaimer: These are just my ponderings…


Can’t lose weight with Belviq?

With the holidays nearly over, I have to admit I’m feeling sick overeating with the holiday parties and goodies given as gifts.

We’ll be examining the gender differences in the weight loss drug Belviq (generic name lorcaserin).

Based on online ratings, Belviq works better in males than in females (men gave 1.18 more points for effectiveness than women (p=0.000064) and 1.17 more for satisfaction (p=0.000086)).

In 43% of the reviews written by men, they said Belviq (Lorcaserin) was “reducing cravings”. In contrast, only 9% of the reviews written by women said Lorcaserin “reduced cravings”. In 34% of women in their reviews said they experienced “headaches” while taking the drug, whereas only 3% of men said they experienced “headaches”. Meanwhile, 87% of men in their reviews said the Belviq assist for “weight lost” as compared to 61.3% of women. So, we can conclude from the reviews that Belviq (Lorcaserin) works better in men than in women.

Here is a comparison of the words found in reviews from men and women:

Phrase Female* Male** p-value
“reduced cravings” 9% (4/44) 43% (13/38) 0.0006
“weight lost” 61% (27/44) 87% (26/30) 0.02
“headache” 34% (15/44) 3% (1/30) 0.002

* % of female reviewers that use the phrase
** % of male reviewers that use the phrase

So, if you’re a woman not seeing great results with Belviq — you’re not the only one! Based on experiences of WebMD reviews, Belviq isn’t as effective for women.


Treating depression: Wellbutrin is more effective for females than males.

Millions suffer from depression, so it’s important to know which treatments work.

Women are underrepresented in clinical trials. Thus, it is possible that they react differently to drugs. To study this, we downloaded online drug reviews to see if women responded to drugs differently than men.

Surprisingly, women rated Wellbutrin XL higher than males. Wellbutrin is typically prescribed for depression. Women gave a +1.16 higher score for effectiveness (p=0.004) and +0.83 higher for satisfaction (p=0.045) compared to men.

In the reviews, women write that Wellbutrin XL is “effective”. Over half of the reviews written by women described Wellbutrin as “effective.” In contrast, only 1 out of 5 men described Wellbutrin as “effective.” Meanwhile, 44% of men in their reviews said Wellbutrin was “not effective.” So we can conclude from the reviews that Wellbutrin works better in women than in men.

Here is a detailed comparison of the word frequencies “effective” and “not effective” in men and women:

Phrase Female* Male** p-value
“effective” 54% (13/24) 19% (3/16) 0.025
“not effective” 17% (4/24) 44% (7/16) 0.06

* % of female reviewers that use the phrase
** % of male reviewers that use the phrase

Thus, we can conclude that Wellbutrin is more effective in females than in males.

— Herty Liany and Pauline Ng


Lighting a Path Forward

About 2 years ago, I accidentally wrote a children’s book. (Accidentally is a strange word: rather, I never intended to write a children’s book, but when an idea sticks with me, the only way to get it out of my head is to do it.)

My significant other is part of a company that makes circuit stickers. Sometimes after dinner, I would beta test his products. I would do this in my spare time, one hand fumbling with a sticky circuit, the other hand clicking for cat clips on the computer. Once the work was done, I’d tuck away the circuit stickers along with the knowledge of how to build these circuits.

And then one night I dreamt of a dark world, and a poem about bringing light to a world full of darkness. The poem stuck in my head. I wrote it down, and from there an idea grew…

And now, 2 years later, *drumroll* I present my STEAM electronics kit: “When Thea LED the Way”.

This is an interactive craftbook that comes with electrical components. The heroine’s name is Thea Prom, a take on Prometheus, the Greek Titan who brought fire to mankind. Likewise, the reader helps Thea bring light to her darkened world.

In the craftbook “When Thea LED the Way”, the reader enters Thea’s world and becomes part of her journey. The reader must help Thea bring light to her world by building circuits. As Thea grows and gains confidence in her knowledge of circuits, the reader does as well.

Of course, the kit comes with everything you need to help Thea with her journey (circuit stickers, copper tape, etc). It’s like the movie “The NeverEnding Story”, where a boy reading a fantasy book has to actively participate in in order to save the fantasy world.

I’m thrilled to see the book in print and the kit being manufactured. In the process of getting to this point, I had to oversee the design many different parts, from the electronic components, to the package design, to the book itself.

When I wrote the SIFT algorithm, my short-sighted goal was to get a publication so I could receive my PhD. Thankfully, my PhD advisors convinced me to make a website so that the research and medical community could actually use SIFT. At the time, I didn’t see the importance of deploying the algorithm. Only later when I saw the utility the SIFT website had in other people’s research, did I realize the impact of deploying an idea.

So while I am excited that a factory is ready to manufacture this kit, I realize that without a website to get the word out, the project would have little impact. Thus, I’m doing a crowdfunding campaign for this project. If you can help me spark confidence in children who might normally not consider engineering, then this craftbook would have achieved the impact I’m hoping for.



Older posts «