Saturday, July 30, 2016

Myanmar-Sar in R - I


Having attempted a mobile-phone data collection application for parallel vote tabulation (Yan Can Cook or More fun with PVT) I was hugely frustrated with the problem of displaying Myanmar characters (Myanglish PVT) on Android mobile phones. So I ranted “As mentioned in my last post Myanglish PVT, I was frustrated, so much frustrated in failing to get a respectable version of PVT data collection application in Myanmar language.” and posted “PVT tawla or lost in font jungle”. Luckily a few months back I received a Nexus-6 by Motorola from my son and I was overjoyed to find it displaying the Myanmar-Sar in my PVT application perfectly. For Myanmar-Sar input I installed the Bagan Keyboard and Myanmar Keyboard by Abbott Cullen and they both worked well.

In an application like PVT, Myanmar-Sar is needed only for assisting the interviewer in the form of question wordings, instruction to the interviewer, and showing the response categories to choose from. In the data file they will be represented by codes (in English) and the only textual data entered in Myanmar-Sar would be the name of the candidate. This is the way most survey data files would be organized, that is, most of the entries would be in precoded categories. However, in certain situations like data collection for civil registry, or for recording birds and animal sightings we may need to enter a lot of data as text in Myanmar-Sar.

How could we work with Myanmar-Sar in situations like the latter, specifically in R? Searching for the answer in Stackoverflow, which I guess is the most likely place, I found out that it wasn't as easy as I first thought. After working through a number of questions and answers on handling non-English characters like Chinese or Russian, I stumbled upon a workable approach and it will be the theme of this post. But first let's look at question 17934847 asked two years ago by dnari which still needs an answer:


It relates specifically to the Mac environment, we were told, but we could still try imitating it in Windows. Since no link was provided for the data “data.csv” I will be using Myanmar Information Management Unit (MIMU) place codes for States/Regions of Myanmar available here. The unzipped file is an Excel file with .xlsx extension. I opened the file in Open Office's Calc spreadsheet and saved its “State_Region” sheet as comma separated values text file “State_Region.csv” in UTF-8 encoding. Opened with notepad, Myanmar-Sa came out of it perfectly:


In the following R script I tried to replicate what dinari has done.


In dinari's question post, cases[[1]] is shown to produce Myanmar-Sar output:


Actually, it is totally different from what is produced in my test of his codes. Also I couldn't find in his code fragment any command that could have produced his text output. I guess dinari would have directed the output to a text file. After all, dinari himself remarked “[the rest is a text file …”. Even then cases[[1]] couldn't produce the text of the corpus as we have seen from running my script. Then you need to type cases[[1]][1] to get it. Also, to write out a text file from a corpus, we need to convert it first into characters as shown in my R script.

Furthermore, cases contains 20 corpora and to write all of them to a text file, we need to convert the corpora to a dataframe. Thanks to Ken Benoit's answer for the stackoverflow question “33193152/unable-to-convert-a-corpus-to-data-frame-in-r” it could be done like this:


Opening the written “caseAll2csv.csv” file with notepad:




Credit: I found the correct way to write unicode Myanmar-Sar to text file from petermeissner's answer to stackoverflow question 10675360/utf-8-file-output-in-r.

Tuesday, June 28, 2016

Suu steam-rolling III: aRxiv for arXiv


I had known a bright young nuclear scientist trained locally who went abroad a long time ago to learn about handling nuclear waste. Coming from a rural family of farmers, he told me that he had quite some trouble using a tea-bag properly for his first breakfast at the hotel. Then I recalled myself watching a gentleman from Sri-Lanka making tea over a conversation. It was some five or six years earlier when I was in the Pacific. There I learned that the secret of good tea is to add one more spoon of creamer—for the cup—to the two spoonfuls I had added for myself! Yet, despite some time I spent outside of Myanmar I wouldn't be able to set the table myself because I don't know the proper places for knives, forks, or spoons and I'm surely ignorant of which brand of tea should go with which occasion. It's my karma and in no way could I have attended a classy high school or have a proper upbringing, if you like. But I won't regret.

For that matter, I never owned a car, or learned to drive one. I'm just happy that I learned to use computers and smart phones a bit. I am happy that I could share things with ordinary folks and that matters.

Then there is one website I would like to share. I've heard that it could replace some technical journals which you won't get free. Welcome open access. Welcome arXiv.


According to ProgrammableWeb -

The Cornell University e-print arXiv, hosted at arXiv.org, is a document submission and retrieval system used by the physics, mathematics and computer science communities. It has become the primary means of communicating manuscripts on current and ongoing research. The arXiv repository is available worldwide. Manuscripts are often submitted to the arXiv before they are published by more traditional means. In some cases they may never be submitted or published elsewhere. The purpose of the arXiv API is to allow programmatic access to the arXiv's e-print content and metadata.

The aRxiv is an R interface to the arXiv API and the arXiv API does not require an API key. You can install aRxiv from any of the cran mirrors.

Below is my R script for finding papers on machine learning published on arXiv from the beginning of 2010, and viewing abstracts on the arXiv website. Once on the abstract page you could download the full paper by using the link provided. On the other hand you could save the search results for the arXiv papers to a text file. Then you could conveniently view them with a spreadsheet.


When you run the script, you will see your commands and outputs, and error messages, if any, displayed one after another on the R console. I assume you know how to save them to a text file for reference. Near the end of the script you'll see the arxiv_open() function. That will open the abstract page shown below and here you can see that you could download the pdf file of the full paper:


After the run, you should also find the ML_aRxSrch.csv file you've saved in your working directory. Part of it is shown below opened with the Open Office Calc spreadsheet. Some rows were hidden for convenience in displaying:



My purpose here and in some earlier posts is to introduce (to myself as well as others) some tools that could take advantage of the web APIs provided by publishers, Q/A sites, social media, and others. For simplicity I've been leaving the contents of their results untouched. However, I couldn't help feeling inspired by an instance of the struggle for ever greater understanding of older vs. newer ideas as I read this abstract:

Neuroimaging research has predominantly drawn conclusions based on classical statistics, including null-hypothesis testing, t-tests, and ANOVA. Throughout recent years, statistical learning methods enjoy increasing popularity, including cross-validation, pattern classification, and sparsity-inducing regression. These two methodological families used for neuroimaging data analysis can be viewed as two extremes of a continuum. Yet, they originated from different historical contexts, build on different theories, rest on different assumptions, evaluate different outcome metrics, and permit different conclusions. This paper portrays commonalities and differences between classical statistics and statistical learning with their relation to neuroimaging research. The conceptual implications are illustrated in three common analysis scenarios. It is thus tried to resolve possible confusion between classical hypothesis testing and data-guided model estimation by discussing their ramifications for the neuroimaging access to neurobiology.

Despite my complete lack of idea on neuroimaging or neurobiology I sensed the promise that such improvements in knowledge would benefit our well-being somehow—collectively or individually. On the side, my feeling is that reading such abstracts could be something more than an idle recreation for the non-specialist. The bottom-line is that it may broaden our knowledge base or simply leave us with an appreciation of good things done (provided of course, that we could make any sense out of a given abstract).


Back to the basics: to play around with aRxiv package, a good start will be to read the vignette “aRxiv tutorial” in the help pages of “Html help” accessible from your R console. You could also download this tutorial here.

Friday, June 24, 2016

Suu steam-rolling II


The stackr package is an R package which you can use to get data from Stack Exchange family of websites. Well, the idea for a big part of my Bayanathi blog has been and will be to stick to “Yan can cook” philosophy. The only difference with Yan is that his demonstrations are based on his famous cooking and years of demos—mine were based on seeing some nice recipes followed by my first attempts to cook them! Currently I am trying out some “Suu” recipes so that my fellow dummies may “Tuu” and (granted that my dishes were too salty, oily, or smelly and somewhat burnt) improve on them to get to “Pyuu” finally.

Stack Exchange is a network of question and answer Web sites on topics in varied fields, each site covering a specific topic, where questions, answers, and users are subject to a reputation award process. The sites are modeled after Stack Overflow, a Q&A site for computer programming questions that was the original site in this network. The reputation system allows the sites to be self-moderating. (Stack Exchange, Wikipedia)

Stack Overflow is a privately held website, the flagship site of the Stack Exchange Network, It features questions and answers on a wide range of topics in computer programming.As of April 2014, Stack Overflow has over 4,000,000 registered users and more than 10,000,000 questions,with 10,000,000 questions celebrated in late August 2015. (Stack Overflow, Wikipedia)

Since by default, stackr search takes your query to the Stack Overflow website, it would be good to read about it now, or later after trying out stackr. In my own dumb way, I went to Stack Overflow, for example, and read about machine learning and related topics as far my as my budget allows for internet access through my cell phone. Mostly skimming over the contents and after getting tired, bored, or frustrated I would look for something that I could do with my own hands like some interesting R script to run related to what I've been reading. Or the process could have been reversed as I would have a minimal reading of an interesting topic, found some analysis I could replicate, tried it, and went on to search and read until I am through with it, or decide to stop. For yourselves, choose your styles of working, or no style at all. But enjoy them all the same.

So there is an introduction to stackr by its creator: Introducing stackr: An R package for querying the Stack Exchange API (David Robinson, Variance Explained, Feb. 4, 2015). He noted:

The package is straightforward to use. Every function starts with stack_: stack_answer to query answers, stack_questions for questions, stack_users, stack_tags, and so on. Each output is a data frame, where each row represents one object (an answer, question, user, etc). The package also provides features for sorting and filtering results in the API: almost all the features available in the API itself. Since the API has an upper limit of returning 100 results at a time, the package also handles pagination so you can get as many results as you need.

He went on to show how to analyze a single user's answering activity including the mean number of accepted answers, how the answering activity changed over time by counting the answers by month and changes in answering activity in the course of day at hourly intervals and made graphs. He also showed how to count the numbers of answers for different tags and make a bar chart as well as a wordcloud out of that.

However, for this post, I've tried getting similar kind of data we've got out of Reddit using the RedditExtractoR package as we've done for our last post. In Reddit you can use search terms and then subreddits to restrict the search to particular grouping(s) of entries organized by areas of interest called subreddits. In Stack Overflow, the item similar to a subreddit is a tag. For example in Reddit you use subreddit = “machinelearning” and in Stack Overflow you use tag = “machine-learning”.

Our Suu exercise plan would be similar to that for Reddit:
  1. You use stack_search() function for a tag, say “machine-learning” and with the word “mining” in the title of the question.
  2. As with Reddit in our last post we will ask for three pages of result, but accepting the default page size; (unlike RedditExtractoR which returns a fixed page size of 25 entries, with stackr you can specify up to 100).
  3. In the Reddit exercise we looked at the most recent posts and chose one: “Google opens a Dedicated Machine Learning Research Center in Europe” which is a news post; here in Stack Exchange an original post could only be a question. And you would like to get the answers for the question with the largest number of views from the three retrieved pages, say. For that, you take the question_id for which the view_count is maximum. Then get the text of the question, answers to it, comments, etc. (However, I couldn't find way to do that in stackr yet, and so I have to do that in my own dumb way—using the browser by calling it from the R session). Here's my script:

After running the script you should see a webpage like this:


You should also find these two files in your working directory: (i) ML_stackrQ.csv, and (ii) ML_stackrQ.RData. Running the script given above to get the results mentioned should give no trouble at all, so also will be for you to try out different search terms and/or tags, or to choose which webpage to open to see the answers and comments, etc.

However, installing stackr may not be trouble-free, because this package is not available on the main cran repository for R packages as it was with RedditExtractoR package. It is available only from GitHub repository here.


Above screenshot shows stackr page on GitHub with “Clone or download” button clicked. I chose to download the ZIP file and then followed the instruction for installing it. You'll find the instruction when you scroll down the page a little.


I chose the second option. If so get yourself a good internet connection and be patient. Be prepared to get devtools and other 20-plus R packages installed on your computer first. They are required for installing stackr!

As I've seen, stackr may not be one to get you the body of posts such as questions, answers, and comments (as yet?). It is perfect for getting the date they were posted, date of last activity, edit date, closed date; qualitative data like if the question was answered, answer accepted or not, if the question has been closed by moderators, reason for that; and quantitative data like view_count, answer_count, score, owner_reputation score, and owner_accept_rate. Since your query return these values and others in an R dataframe, you should have no trouble doing analysis of your choice, including those shown by the stackr package creator Robinson linked earlier in this post.

P.S.
Lesson:
Sly work supervisors start you off with small batches.
So did I for exercises on Reddit and Stack Overflow with “Easier done than said” batches.
Each has been designed to give myself and my fellow dummies an accelerated sense of achievement. I don't know if that could qualify as an application of Nudge theory popular now-a-days with the executive branches of U.S. and Britain. (Bear with me, I'm showing off that I've heard of Nudge).

Risk:
Dropouts.

Sunday, June 19, 2016

Suu steam-rolling


For my previous post “DIY ethics or Ethics express”, I used the text mining software package “tm” to build a wordcloud from Google search results. Text mining is a particular class of data mining which Wikipedia defined as:

the computational process of discovering patterns in large data sets involving methods at the intersection of artificial intelligence, machine learning, statistics, and database systems. ...The overall goal of the data mining process is to extract information from a data set and transform it into an understandable structure for further use.

To be a bit more informed, I looked around on the web and found pieces like these from the Cross Validated and Stack Overflow websites:

I found similar questions/answers on Quora, like the following with 69 answeres:


TIL (Today I Learned …, borrowing from Reddit) one recent post (May 9, 2016) on R-bloggers website, which originally was from Sharp Site Labs, shares an expert's opinion on “What’s the difference between machine learning, statistics, and data mining?” Here Wasserman, a professor in both the Statistics and Machine Learning Departments at Carnegie Mellon, one of the premier universities for stats and ML”, declared that there is no difference. In his own words:

The short answer is: None. They are … concerned with the same question: how do we learn from data?

Further, the blog post gives reasons in support of this primary characterization by Wasserman and the following subtitles in the body of that post provided for me a neat (or actually, lazy) way to summarize.

The core similarities between ML, stats, and data mining
Nearly identical subject-matter and toolkits
The three cultures: why there are three identical subjects with different names

The core differences between ML, stats, and data mining
They emphasize different things
Machine learning is focused on software and systems
The purpose of data mining is finding patterns in databases
They use different words and terminology
ML, stats, and data mining tend to favor different tools
ML and data mining typically work on “bigger” data than statistics

Again: there are far more similarities than differences

Even then, we fellow dummies may benefit from more varied reading in this age of steam-rollers like big data, machine learning, data science and data revolution threatening to flatten a traditional discipline like statistics. Here, I have to confess that however much I tried to follow the discussions, controversies and the links provided from the pages of Stack Overflow, Cross Validated, Quora and others, a lot of them were, with me, TL;DR (Too Long; Didn't Read, again borrowing from the Redditors).

Talking about Reddit, it is “an entertainment, social news networking service, and news website”. It had 542 million monthly visitors (234 million unique users) and ranked 14th most visited web-site in US and 36th in the world in 2015 according to Wikipedia. Reddit has quite extensive posts and comments on Machine Learning in its “MachineLearning” subreddit as well as in related subreddits. Subreddits are different areas of interest into which Reddit entries are organized into. The following shows the screenshot of a part of the first page of of Machine-Learning subreddit showing threads in the “top” category.



Learning Machine-Learning (or for that matter Data Mining, or Statistics, or …) is obviously easier said than done. Yet we may approach any kind of learning through a three-step process: စု- တု- ပြု(suu-tuu-pyuu) or accumulate-imitate-create, as we Myanmars used to say. Turning our conventional wisdom upside down, I would now suggest that at least for the accumulation step, it could be easier done than said! In that context, I've started out with trying to give myself a DIY glimpse of the exciting world of getting data from web services, social networks and others through api (application programming interface). Now I'm sharing this— an api for the masses of some sort.

What we do now is get the posts on machine-learning from the Reddit website using the R package “RedditExatractoR”. We assume that you know how to use the R statistical environment and have the RedditExatractoR package ver. 2.0.2, the latest version, installed together with the two required packages, RJSONIO and igraph. Try running this script as I did:


By the end of the run you should find the following files in your working directory:

ML_getRed.csv
ML_contRed.csv
ML_get_cont.RData



If you have saved or printed the graph produced by the run to a file, you should get the following image of the graph of comments for the thread “Google opens a Dedicated Machine Learning Research Center in Europe” by the OP (original poster, another Reddit term) jay_jay_man posted on June 16, 2016.


You can see that I hadn't made the graph readable and pretty. That would require a bit of tweaking the plotting parameters and the RedditExatractoR help pages says nothing about getting it done. So, like every wise instructor I would just say that it is left as an exercise for the learner!

Anyway, the idea of the graph is great and the retrieval of data is super though we still miss some minor features and options on RedditExatractoR that are only available by visiting the Reddit website directly.


Postscript: We certainly hope to see some public or private or NGO/CSO or multi/bi-lateral agency websites in Myanmar offering data services through web api's sometime soon. My fellow dummies be ready! Not within the first hundred days, though.

Friday, May 20, 2016

DIY ethics or Ethics express


In my last post on selling cold drinks without a shopkeeper, I mentioned “morality” and “ethics” without understanding if they are different or interchangeable. Looking up on the web later, I found out that people used them as if interchangeable when in fact they are different according to some people. Morality—as I was told—relates mostly to norms usually based on religion and culture on how humans must behave concerning the right in contrast to the wrong. Ethics (also known as moral philosophy) is “the branch of philosophy which addresses questions of morality.” So on and on it went and you could stumble over "manner, character, proper behavior", "goodness" or "rightness”, “deontological ethical systems”, “the Golden Rule”, “morality vs. amorality”, “duty, obligation, and principles of conduct”, “descriptive and normative ethics”, “realism and anti-realism”, “tribal and territorial”, “evolution, Neuroscience, Psychology”, “Morality and politics”, “Morality and religion”, … by just skimming over the Morality page of Wikipedia.

Frustrated, you may be tempted to try something like drawing graphs to get insights into a mass of numbers. With text, you could make what is called a word cloud, like the one shown below.

There, different words from a collection of text are counted and those with higher counts are drawn in larger font sizes. The colors of words are added just to make the picture pretty. How did I make it?

I made Google search of “morality” and “ethics” and took the first five pages of each of the results, getting a total of ten pages. Then pure text is extracted from these pages, and unnecessary symbols, numerals, white spaces etc. were stripped. Different words were then counted and the word cloud is drawn. All these steps were done by using the relevant programs of the R Statistical Environment.

Not bad. Hopefully we get something out of that. Well, if you think that's enough for now, it's fine. For me, I still want to know what's really wrong with corruption in civil services and I wouldn't like to be bogged down in the study of the intricacies of morality and ethics. Luckily, I found this web-page on the Ethical Alarms website: Unethical Rationalizations and Misconceptions which could be your express delivery service for insights into people's common excuses for doing bad things.

I felt that giving just a list of all the ethics dodges from that article would go a long way. Quite likely that this list could be good enough to give you a feeling of how people cheat with ethics because you would at once recognize most of these from what you've known or heard before in real life.

Below I've listed all of fifty-eight of them and also extracted a few clarifications or comments to go with them. The selection of clarifications or comments is necessarily subjective and may reflect my poor judgment, but I'm sure it is not an unethical dodge itself. If you find any of them interesting look for details in the full text of the original article here.

1. The Golden Rationalization, or “Everybody does it”
1A. Ethics Surrender, or “We can’t stop it.”
It’s done all the time.”
It’s always been done this way.”
It’s tradition.”
Everybody is used to it.”
Everybody accepts it.”
Nobody’s complained before.”
It’s too late to change now.”
Ethics is hard. Rationalization 1A, Ethics Surrender, or “We can’t stop it,” wrongly concludes that it is impossible.
2. Ethics Estoppel, or “They’re Just as Bad”
This argues that wrongdoing toward a party isn’t really wrong when the aggrieved party has aggrieved the avenger. The victim of the unethical conduct no longer deserves ethical treatment because of the victim’s own misconduct.
But the misconduct of a victim never justifies unethical conduct directed against that victim.
3. Consequentialism, or “It Worked Out for the Best”
Consequentialism is an open invitation to extreme “the ends justify the means” conduct, where even cruel and illegal conduct becomes “ethical” because good consequences happen to arise out of it, even when the good was completely unintended or unpredictable.
4. Marion Barry’s Misdirection, or “If it isn’t illegal, it’s ethical.”
The late D.C. Mayor and lovable rogue Marion Barry earned himself a place in the Ethics Distortion Hall of Fame with his defense of his giving his blatantly unqualified girlfriend a high-paying job with the DC government. Barry declared that since there was no law against using the public payroll as his own private gift service, there was nothing unethical about it.Barry’s statement simply reinforces a misunderstanding of right and wrong.
5. The Compliance Dodge.
Simply put, compliance with rules, including laws, isn’t the same as ethics. Compliance depends on an individual’s desire to avoid punishment. Ethical conduct arises from an individual’s genuine desire to do the right thing. The most unethical person in the world will comply if the punishment is stiff enough. But if he can do something unethical without breaking the rules, watch out!When the inevitable loophole opens up in the rules, when the opportunity to gain at someone else’s expense is there and nobody will ever know, it is the ethical, not the compliant, who will do the right thing.
6. The Biblical Rationalizations
Judge not, lest ye not be judged,” and Let him who is without sin cast the first stone,” have been quoted by scoundrels and their allies and supporters for centuries. Neither quotation means what those guilty of ethical misconduct would have us believe, but the number of people who accept the misreading is substantial. ...
7. The “Tit for Tat” Excuse
This is the principle that bad or unethical behavior justifies, and somehow makes ethical, unethical behavior in response to it. The logical extension of this fallacy is the abandonment of all ethical standards. Through the ages, we have been perplexed at the fact that people who don’t play by the rules have an apparent advantage over those who do, and “If you can’t beat ’em, join ’em!” has been the rallying cry of those who see the abandonment of values as the only way to prosper. ...
The very concept of ethics assumes that winning isn’t the only thing, Vince Lombardi to the contrary, and that we must hold on to ethical standards to preserve the quality of civil existence. Although maxims and aphorisms cause a lot of confusion in ethical arguments, this one is still valid in its simple logic:Two wrongs don’t make a right.”
8. The Trivial Trap (“No harm no foul!”)
Many argue that if no tangible harm arises from a deception or other unethical act, it cannot be “wrong:”“No harm, no foul.” This is truly an insidious fallacy, because it can lead an individual to disregard the unethical nature of an action, and look only to the results of the action. Before too long, one has embraced “the ends justify the means” as an ethical system, otherwise known as “the terrorism standard.”
9. The Reverse Slippery Slope
defenders of unethical conduct like to project legitimate criticism of genuinely harmful conduct into apocalyptic over-reach and ridiculously broad application of the principles at issue.
10. The Unethical Tree in the Forest, or “What they don’t know won’t hurt them.”
The habitually unethical as well as the rarely unethical who don’t want to admit they have strayed are vulnerable to this classic, which posits that as long as the lie, swindle, cheat, or crime is never discovered, it hardly happened at all…in fact, one might as well say it didn’t happen, so you can’t really say anything really was wrong…right? Wrong. 
11. The King’s Pass, The Star Syndrome, or “What Will We Do Without Him?”
One will often hear unethical behavior excused because the person involved is so important, so accomplished, and has done such great things for so many people that we should look the other way, just this once. This is a terribly dangerous mindset, because celebrities and powerful public figures come to depend on it. Their achievements, in their own minds and those of their supporters and fans, have earned them a more lenient ethical standard. ...
11. (a) “I deserve this!” or “Just this once!”
12. The Dissonance Drag
Cognitive dissonance is an innately human process that can muddle the ethical values of an individual without him or her even realizing that it is happening. The most basic of cognitive dissonance scenarios occurs when a person whom an individual regards highly adopts a behavior that the same individual deplores. The gulf between the individual’s admiration of the person (a positive attitude) and the individual’s objection to the behavior (a negative attitude) must be reconciled. The individual can lower his or her estimation of the person, or develop a rationalization for the conflict (the person was acting uncharacteristically due to illness, stress, or confusion), or reduce the disapproval of the behavior.
This is why misbehavior by leaders and other admired role models is potentially very harmful on a large scale: ...
13. The Saint’s Excuse: “It’s for a good cause”
This rationalization has probably caused more death and human suffering than any other. ...
14. Self-validating Virtue
the act is judged by the perceived goodness the person doing it, rather than the other way around. This is applied by the doer, who reasons, “I am a good and ethical person. ...
15. The Futility Illusion: “If I don’t do it, somebody else will.”
It is a famous and time-honored rationalization that sidesteps doing the right thing because the wrong thing is certain to occur anyway. …
16. The Consistency Obsession
It is not only acceptable, it is necessary to use a variety of ethical approaches to solve certain problems. In real life, situations come up that just don’t fit neatly into the existing formulas. …
17. Ethical Vigilantism
addressing a real or imagined injustice by employing remedial cheating, lying, or other unethical means. It has its roots in many of the fallacies above: Tit for Tat, the Golden Rationalization, The Trivial Trap, and The Saint’s License. Its results are personal corruption, harm to innocent parties, and the forfeiture of the moral high ground. Nobody is “owed” the right to lie, cheat, or injure others. ...
18. Hamm’s Excuse: “It wasn’t my fault.”
19. The Perfection Diversion: “Nobody’s Perfect!” or “Everybody makes mistakes!”
19A The Insidious Confession, or “It wasn’t the best choice.”
20. The “Just one mistake!” Fantasy
21. Ethics Accounting (“I’ve earned this”/ “I made up for that”)
22. The Comparative Virtue Excuse: “There are worse things.”
23. Woody’s Excuse: “The heart wants what the heart wants”
#24. Juror 3’s Stand (It’s My Right!”)
24. A. Free Speech Confusion
25. The Coercion Myth: “I have no choice!”
26. “The Favorite Child” Excuse
27. The Victim’s Distortion
28. The Revolutionary’s Excuse: “These are not ordinary times.”
29. The Altruistic Switcheroo: “It’s for his own good”
29 (a). The Gruber Variation, or They are too stupid to know what’s good for them”
30. The Prospective Repeal: “It’s a bad law/stupid rule”
31. The Troublesome Luxury: “Ethics is a luxury we can’t afford right now”
32. The Unethical Role Model: He/She would have done the same thing”
33. The Management Shrug: “Don’t sweat the small stuff!”
34. Success Immunity, or “They must be doing something right!”
35. The Tortoise’s Pass: Better late than never”
36. Victim Blindness, or “They/He/She/ You should have seen it coming.”
#36 A. The Extortionist’s Absolution (You were warned!”)
37. The Maladroit’s Diversion, or “Nobody said it would be easy!”
38. The Miscreant’s Mulligan or “Give him/her/them/me a break!”
39. The Pioneer’s Lament, or “Why should I be the first?”
40. The Desperation Dodge or “I’ll do anything!”
41. The Evasive Tautology, or “It is what it is.”
Rationalization 41 A. Popeye’s Excuse, or “I am what I am.”
42. The Hillary Inoculation, or “If he/she doesn’t care, why should anyone else?”
If Hillary is willing to forgive him, why shouldn’t we?”
43. Vin’s Punchline, or “We’ve never had a problem with it!”
44. The Unethical Precedent, or “It’s Not The First Time”
45. The Abuser’s License: “It’s Complicated”
46. Zola’s Rejection, or “Don’t point fingers!”
47. Contrived Consent, or “The Rapist’s Defense.”
Contrived Consent, or “The Rapist’s Defense,” aims to cleanse unethical conduct by imagining that the victim consented to it, or secretly sought the result of the wrongful act. The most infamous example of this rationalization is, of course, the rapist’s defense that the victim either was inviting a sexual assault by flirtatious conduct or provocative dress, or secretly “wanted it.”
48. Ethics Jiu Jitsu, or “Haters Gonna Hate!”
In truth, those who don’t have the ethical bearings, the courage or the civic responsibility to criticize unethical conduct in the culture are the real problem as we strive for an ethical culture. They can often be identified by their mouthing of the fatuous accusation, “Haters gonna hate!”
49. “Convenient Futility,” or “It wouldn’t have mattered if I had done the right thing.”
The rationalization confounds law and ethics. … “It wouldn’t have mattered because the same thing would have happened even if I was competent” is still an admission of incompetence.
50. The Apathy Defense, or “Nobody Cares.”
The Apathy Defense is at the root of many other rationalizations, like The King’s Pass, The Saint’s excuse, and even “the ends justify the means.”
It is, in fact, one of the most dangerous and corrupting rationalizations of all. Politicians are taking bribes? Who cares? What matters is whether they make the government work. So taking bribes becomes acceptable. Leaders are lying to the public? Nobody cares! What matters is that he’s our guy! It only matters when their guy lies! Now leaders know they can lie with impunity, without consequences or shame.

#50 A, The Underwood Maneuver, or “That’s in the past.”
This rationalization has the honor of being named for a President, though a fictional and sinister one: Frank Underwood, the devious, psychopathic, lying and murdering Chief Executive, played by Kevin Spacey, who leads the den of thieves and blackguards who populate the fictional Washington, D.C. in the Netflix drama, “House of Cards.”
51. The Hippie’s License, or “If it feels good, do it!” (“It’s natural”)
52. Tessio’s Excuse, or “It’s just business”
Near the end of “The Godfather,” longtime Don Corleone loyalist Sal Tessio (played by the immortal Abe Vigoda) is caught attempting to ally with a rival family in an attempt to kill the new Don, Michael Corleone. As he is taken to the car for his final ride, Tessio turns to consiglieri Tom Hagen and says…
Tell Mike it was only business. I always liked him.”
53. The Joke Excuse, or “I was only kidding!”
55, “The Idealist’s Delusion,” or “We’re/ You’re Better Than This.”
56, The Universal Trump, or “Think of the children!”
akin to a human shield, employed to block incoming logic.
57. The Golden Rule Mutation, or “I’m all right with it!”
it translates into…
Do unto others as if the others felt like I do, even though they may not.”
58: The Ironic Rationalization, or “It’s The Right Thing To Do”
Maybe it’s the right thing, and maybe not. Just saying it conduct is right without doing the hard work of ethical analysis is bluffing and deflection. ...
It’s the right thing to do” you say?
Prove it.