# documents

title: Trump administration’s halt of CDC’s weekly scientific report stalls bird flu studies
scrape_date: 2025-03-14T11:59:58.696346
content_type: markdown
hash: dc173b630322a79fb4a466817fd232356fc509cb72cf4f3aba1dbc3b55a96fbb
url:
https://www.news-medical.net/news/20250130/Trump-administratione28099s-halt-of-CDCe28099s-weekly-scientific-report-stalls-bird-flu-studies.aspx

content:
Skip to content

[ ![News-Medical](https://d2jx2rerrg6sh3.cloudfront.net/themes/Standard/images/nm-logo-4.png) ](/)

Menu

[Medical Home](/medical) [Life Sciences Home](/life-sciences)

[![An AZoNetwork Site](https://d2jx2rerrg6sh3.cloudfront.net/images/an-azonetwork-site.svg)](/suppliers/AZoNetwork-UK-Ltd.aspx)

[Become a Member](/azoprofile/login/)

Search

  * [Medical Home](/medical)
  * [Life Sciences Home](/life-sciences)
  * [About](/medical/about)
  * [COVID-19](/condition/Coronavirus-Disease-COVID-19)
  * [News](/medical/news)
  * [Health A-Z](/medical-a-z.aspx)
  * [Drugs](/drugs-a-z.aspx)
  * [Medical Devices](/Clinical-and-Diagnostics)
  * [Interviews](/medical/interviews)
  * [White Papers](/medical/whitepapers)
  * More...
  * [MediKnowledge](/mediknowledge)
  * [eBooks](/medical/ebooks)
  * [Posters](/medical/posters)
  * [Podcasts](/medical/podcasts)
  * [Newsletters](/medical/newsletters)
  * [Health & Personal Care](/Consumer-Products)
  * [Contact](/medical/contact)
  * [Meet the Team](/medical/team)
  * [Advertise](/medical/advertise)
  * [Search](/medical/search)
  * [Become a Member](/azoprofile/login/)



## Top Health Categories

  * [Coronavirus Disease COVID-19](/condition/Coronavirus-Disease-COVID-19)
  * [Diet & Nutrition](/condition/Diet-Nutrition)
  * [Artificial Intelligence](/condition/Artificial-Intelligence)
  * [Allergies](/condition/Allergies)
  * [Alzheimer's & Dementia](/condition/Alzheimers-Dementia)
  * [Arthritis & Rheumatology](/condition/Arthritis-Rheumatology)
  * [Breast Cancer](/condition/Breast-Cancer)



  * [Cold, Flu & Cough](/condition/Cold-Flu-Cough)
  * [Eating Disorders](/condition/Eating-Disorders)
  * [Eye Health](/condition/Eye-Health)
  * [Gastrointestinal Health](/condition/Gastrointestinal-Health)
  * [Heart Disease](/condition/Heart-Disease)
  * [High Blood Pressure](/condition/High-Blood-Pressure)
  * [Lung Cancer](/condition/Lung-Cancer)



  * [Mental Health](/condition/Mental-Health)
  * [Mpox](/condition/Mpox)
  * [Pregnancy](/condition/Pregnancy)
  * [Type 1 Diabetes](/condition/Type-1-Diabetes)
  * [Type 2 Diabetes](/condition/Type-2-Diabetes)
  * [Sexual Health](/condition/Sexual-Health)
  * [Sleep](/condition/Sleep)
  * [View Health A-Z](/medical-a-z.aspx)



## ×Top Health Categories

  * [Coronavirus Disease COVID-19](/condition/Coronavirus-Disease-COVID-19)
  * [Heart Disease](/condition/Heart-Disease)
  * [Diet & Nutrition](/condition/Diet-Nutrition)
  * [High Blood Pressure](/condition/High-Blood-Pressure)
  * [Artificial Intelligence](/condition/Artificial-Intelligence)
  * [Lung Cancer](/condition/Lung-Cancer)
  * [Allergies](/condition/Allergies)
  * [Mental Health](/condition/Mental-Health)
  * [Alzheimer's & Dementia](/condition/Alzheimers-Dementia)
  * [Mpox](/condition/Mpox)
  * [Arthritis & Rheumatology](/condition/Arthritis-Rheumatology)
  * [Pregnancy](/condition/Pregnancy)
  * [Breast Cancer](/condition/Breast-Cancer)
  * [Type 1 Diabetes](/condition/Type-1-Diabetes)
  * [Cold, Flu & Cough](/condition/Cold-Flu-Cough)
  * [Type 2 Diabetes](/condition/Type-2-Diabetes)
  * [Eating Disorders](/condition/Eating-Disorders)
  * [Sexual Health](/condition/Sexual-Health)
  * [Eye Health](/condition/Eye-Health)
  * [Sleep](/condition/Sleep)
  * [Gastrointestinal Health](/condition/Gastrointestinal-Health)
  *  



[View Health A-Z](/medical-a-z.aspx)

  * [Medical Home](/medical)
  * [Life Sciences Home](/life-sciences)
  * [About](/life-sciences/about)
  * [News](/life-sciences/news)
  * [Life Sciences A-Z](/life-sciences-a-z)
  * [White Papers](/life-sciences/whitepapers)
  * [Lab Equipment](/Life-Science-and-Laboratory)
  * [Interviews](/life-sciences/interviews)
  * [Newsletters](/life-sciences/newsletters)
  * [Webinars](/life-sciences/webinars)
  * More...
  * [eBooks](/life-sciences/ebooks)
  * [Posters](/life-sciences/posters)
  * [Podcasts](/life-sciences/podcasts)
  * [Contact](/life-sciences/contact)
  * [Meet the Team](/life-sciences/team)
  * [Advertise](/life-sciences/advertise)
  * [Search](/medical/search)
  * [Become a Member](/azoprofile/login/)



  * [White Papers](/medical/whitepapers)
  * [MediKnowledge](/mediknowledge)
  * [eBooks](/medical/ebooks)
  * [Posters](/medical/posters)
  * [Podcasts](/medical/podcasts)
  * [Newsletters](/medical/newsletters)
  * [Health & Personal Care](/Consumer-Products)
  * [Contact](/medical/contact)
  * [Meet the Team](/medical/team)
  * [Advertise](/medical/advertise)
  * [Search](/medical/search)
  * [Become a Member](/azoprofile/login/)


  * [Webinars](/life-sciences/webinars)
  * [eBooks](/life-sciences/ebooks)
  * [Posters](/life-sciences/posters)
  * [Podcasts](/life-sciences/podcasts)
  * [Contact](/life-sciences/contact)
  * [Meet the Team](/life-sciences/team)
  * [Advertise](/life-sciences/advertise)
  * [Search](/medical/search)
  * [Become a Member](/azoprofile/login/)



  *   *   * [ ](https://www.linkedin.com/shareArticle?mini=true&url=https%3a%2f%2fwww.news-medical.net%2fnews%2f20250130%2fTrump-administratione28099s-halt-of-CDCe28099s-weekly-scientific-report-stalls-bird-flu-studies.aspx&title= "LinkedIn")
  * [ ](https://www.facebook.com/sharer/sharer.php?u=https%3a%2f%2fwww.news-medical.net%2fnews%2f20250130%2fTrump-administratione28099s-halt-of-CDCe28099s-weekly-scientific-report-stalls-bird-flu-studies.aspx "Facebook")
  * [ ](https://x.com/share?url=https%3a%2f%2fwww.news-medical.net%2fnews%2f20250130%2fTrump-administratione28099s-halt-of-CDCe28099s-weekly-scientific-report-stalls-bird-flu-studies.aspx&text= "X")
  * [ ](https://www.reddit.com/submit?url=https%3a%2f%2fwww.news-medical.net%2fnews%2f20250130%2fTrump-administratione28099s-halt-of-CDCe28099s-weekly-scientific-report-stalls-bird-flu-studies.aspx "Reddit")
  * [ ](http://pinterest.com/pin/create/button/?url=https%3a%2f%2fwww.news-medical.net%2fnews%2f20250130%2fTrump-administratione28099s-halt-of-CDCe28099s-weekly-scientific-report-stalls-bird-flu-studies.aspx "Pinterest")
  * 


# Trump administration’s halt of CDC’s weekly scientific report stalls bird flu studies

  * Download PDF Copy



![Editorial Checklist](https://d2jx2rerrg6sh3.cloudfront.net/images/editorial-checklist.svg) Reviewed

[KFF Health News](https://kffhealthnews.org/)Jan 30 2025

The Trump administration has intervened in the release of important studies on the bird flu, as an outbreak escalates across the United States.

One of the studies would reveal whether veterinarians who treat cattle have been unknowingly infected by the bird flu virus. Another report documents cases in which people carrying the virus might have infected their pet cats.

The studies were slated to appear in the official journal of the Centers for Disease Control and Prevention, the Morbidity and Mortality Weekly Report. The distinguished journal has been published without interruption since 1952.

Its scientific reports have been swept up in an "immediate pause" on communications by federal health agencies ordered by Dorothy Fink, the acting secretary of the Department of Health and Human Services. Fink's memo covers "any document intended for publication," she wrote, "until it has been reviewed and approved by a presidential appointee." It was sent on President Donald Trump's first full day in office.

That's concerning, former CDC officials said, because a firewall has long existed between the agency's scientific reports and political appointees.

"MMWR is the voice of science," said Tom Frieden, a former CDC director and the CEO of the nonprofit organization Resolve to Save Lives.

"This idea that science cannot continue until there's a political lens over it is unprecedented," said Anne Schuchat, a former principal deputy director at the CDC. "I hope it's going to be very short-lived, but if it's not short-lived, it's censorship."

White House officials meddled with scientific studies on covid-19 during the first Trump administration, according to interviews and emails collected in a 2022 report from congressional investigators. Still, the MMWR came out as scheduled.

"What's happening now is quite different than what we experienced in covid, because there wasn't a stop in the MMWR and other scientific manuscripts," Schuchat said.

Neither the White House nor HHS officials responded to requests for comment. CDC spokesperson Melissa Dibble said, "This is a short pause to allow the new team to set up a process for review and prioritization."

News of the interruption hit suddenly last week, just as Fred Gingrich, executive director of the American Association of Bovine Practitioners, a group for veterinarians specializing in cattle medicine, was preparing to hold a webinar with members. He planned to disclose the results of a study he helped lead, slated for publication in the MMWR later that week. Back in September, about 150 members had answered questions and donated blood for the study. Researchers at the CDC analyzed the samples for antibodies against the bird flu virus, to learn whether the veterinarians had been unknowingly infected earlier last year.

Although it would be too late to treat prior cases, the study promised to help scientists understand how the virus spreads from cows to people, what symptoms it causes, and how to prevent infection. "Our members were very excited to hear the results," Gingrich said.

Like farmworkers, livestock veterinarians are at risk of bird flu infections. The study results could help protect them. And having fewer infections would lessen the chance of the H5N1 bird flu virus evolving within a person to spread efficiently between people -- the gateway to a bird flu pandemic.

At least 67 people have tested positive for the bird flu in the U.S., with the majority getting the virus from cows or poultry. But studies and reporting suggest many cases have gone undetected, because testing has been patchy.

### Related Stories

  * [Urgent CDC data and analyses on influenza and bird flu go missing as outbreaks escalate](/news/20250214/Urgent-CDC-data-and-analyses-on-influenza-and-bird-flu-go-missing-as-outbreaks-escalate.aspx)
  * [Study finds certain H5N1 strains in cattle linked to milder human illness; other variants remain a concern](/news/20250113/Study-finds-certain-H5N1-strains-in-cattle-linked-to-milder-human-illness3b-other-variants-remain-a-concern.aspx)
  * [Flu-related neurologic events pose greater risk for children with pre-existing neurologic conditions](/news/20250213/Flu-related-neurologic-events-pose-greater-risk-for-children-with-pre-existing-neurologic-conditions.aspx)



Just before the webinar, Gingrich said, the CDC informed him that because of an HHS order, the agency was unable to publish the report last week or communicate its findings. "We had to cancel," he said.

Another bird flu study slated to be published in the MMWR last week concerns the possibility that people working in Michigan's dairy industry infected their pet cats. These cases were partly revealed last year in emails obtained by KFF Health News. In one email from July 22, an epidemiologist pushed to publish the group's investigation to "inform others about the potential for indirect transmission to companion animals."

Jennifer Morse, medical director at the Mid-Michigan District Health Department and a scientist on the pending study, said she got a note from a colleague last week saying that "there are delays in our publication -- outside of our control."

A person close to the CDC, speaking on the condition of anonymity because of concerns about reprisal, expected the MMWR to be on hold at least until Feb. 6. The journal typically posts on Thursdays, and the HHS memo says the pause will last through Feb. 1.

"It's startling," Frieden said. He added that it would become dangerous if the reports aren't restored. "It would be the equivalent of finding out that your local fire department has been told not to sound any fire alarms," he said.

In addition to publishing studies, the MMWR keeps the country updated on outbreaks, poisonings, and maternal mortality, and provides surveillance data on cancer, heart disease, HIV, and other maladies. Delaying or manipulating the reports could harm Americans by stunting the ability of the U.S. government to detect and curb health threats, Frieden said.

The freeze is also a reminder of how the first Trump administration interfered with the CDC's reports on covid, revealed in emails detailed in 2022 by congressional investigators with the House Select Subcommittee on the Coronavirus Crisis. That investigation found that political appointees at HHS altered or delayed the release of five reports and attempted to control several others in 2020.

In one instance, Paul Alexander, then a scientific adviser to HHS, criticized a July 2020 report on a coronavirus outbreak at a Georgia summer camp in an email to MMWR editors, which was disclosed in the congressional investigation. "It just sends the wrong message as written and actually reads as if to send a message of NOT to re-open," he wrote. Although the report's data remained the same, the CDC removed remarks on the implications of the findings for schools.

Later that year, Alexander sent an email to then-HHS spokesperson Michael Caputo citing this and another example of his sway over the reports: "Small victory but a victory nonetheless and yippee!!!"

Schuchat, who was at the CDC at the time, said she had never experienced such attempts to spin or influence the agency's scientific reports in more than three decades with the agency. She hopes it won't happen again. "The MMWR cannot become a political instrument," she said.

Gingrich remains hopeful that the veterinary study will come out soon. "We're an apolitical organization," he said. "Maintaining open lines of communication and continuing research with our federal partners is critical as we fight this outbreak."

[![Kaiser Health News](https://d2jx2rerrg6sh3.cloudfront.net/images/khn_logo_black.jpg)](https://khn.org/)This article was reprinted from khn.org, a national newsroom that produces in-depth journalism about health issues and is one of the core operating programs at KFF - the independent source for health policy research, polling, and journalism.  
---  
  
Source:

[KFF Health News](https://kffhealthnews.org/)

Posted in: [Disease/Infection News](/category/DiseaseInfection-News.aspx) | [Healthcare News](/category/Healthcare-News.aspx)

Comments (1)

  * Download PDF Copy



## Suggested Reading

[![House cats with bird flu could pose a risk to public health](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250210/House-cats-with-bird-flu-could-pose-a-risk-to-public-health.aspx)

[House cats with bird flu could pose a risk to public health](/news/20250210/House-cats-with-bird-flu-could-pose-a-risk-to-public-health.aspx)

[![Many parents uncertain about bird flu information and risks, poll suggests](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250310/Many-parents-uncertain-about-bird-flu-information-and-risks-poll-suggests.aspx)

[Many parents uncertain about bird flu information and risks, poll suggests](/news/20250310/Many-parents-uncertain-about-bird-flu-information-and-risks-poll-suggests.aspx)

[![On the front lines against bird flu, egg farmers say they’re losing the battle](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250207/On-the-front-lines-against-bird-flu-egg-farmers-say-theye28099re-losing-the-battle.aspx)

[On the front lines against bird flu, egg farmers say they’re losing the battle](/news/20250207/On-the-front-lines-against-bird-flu-egg-farmers-say-theye28099re-losing-the-battle.aspx)

[![New sensor offers rapid detection of airborne bird flu virus](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250307/New-sensor-offers-rapid-detection-of-airborne-bird-flu-virus.aspx)

[New sensor offers rapid detection of airborne bird flu virus](/news/20250307/New-sensor-offers-rapid-detection-of-airborne-bird-flu-virus.aspx)

[![Study reveals dangerous mutations in H5N1 bird flu](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250116/Study-reveals-dangerous-mutations-in-H5N1-bird-flu.aspx)

[Study reveals dangerous mutations in H5N1 bird flu](/news/20250116/Study-reveals-dangerous-mutations-in-H5N1-bird-flu.aspx)

[![Older adults may have stronger immunity to bird flu, Penn study finds](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250313/Older-adults-may-have-stronger-immunity-to-bird-flu-Penn-study-finds.aspx)

[Older adults may have stronger immunity to bird flu, Penn study finds](/news/20250313/Older-adults-may-have-stronger-immunity-to-bird-flu-Penn-study-finds.aspx)

[![H5N1 bird flu spillover to horses, raises fears of new viral strains](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250105/H5N1-bird-flu-spillover-to-horses-raises-fears-of-new-viral-strains.aspx)

[H5N1 bird flu spillover to horses, raises fears of new viral strains](/news/20250105/H5N1-bird-flu-spillover-to-horses-raises-fears-of-new-viral-strains.aspx)

[![How America lost control of the bird flu, setting the stage for another pandemic](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20241220/How-America-lost-control-of-the-bird-flu-setting-the-stage-for-another-pandemic.aspx)

[How America lost control of the bird flu, setting the stage for another pandemic](/news/20241220/How-America-lost-control-of-the-bird-flu-setting-the-stage-for-another-pandemic.aspx)

## Comments

  1. [Dump in trouble](/opinion/5ef7185d-3f3b-4bc6-ba21-367889479cfa.aspx)

![M Grayl1983](https://www.gravatar.com/avatar/f48fcc4b2c142381630957a7d6e6ccd3.jpg?s=32&d=identicon) M Grayl1983 ![United Kingdom](https://d2jx2rerrg6sh3.cloudfront.net/pics/flags/gb.png) says:

[February 14, 2025 at 10:29 AM](/opinion/5ef7185d-3f3b-4bc6-ba21-367889479cfa.aspx)

Yep, President Dump is in complete denial as he'll have yet another pandemic to deal with (another reason why he wants the US to leave the WHO)

0 0

[Reply](javascript:void\(0\);)




The opinions expressed here are the views of the writer and do not necessarily reflect the views and opinions of News Medical. 

[Cancel reply to comment](javascript:void\(0\);)

![](/pics/anonymous_avatar.gif)

Post a new comment

Login    

(Logout)

Quirky Comment Title

Post

  * Trending  
Stories
  * Latest  
Interviews
  * Top Health  
Articles



  * [![Under Trump, Social Security resumes what it once called ‘clawback cruelty](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250311/Under-Trump-Social-Security-resumes-what-it-once-called-e28098clawback-cruelty.aspx)

[Under Trump, Social Security resumes what it once called ‘clawback cruelty](/news/20250311/Under-Trump-Social-Security-resumes-what-it-once-called-e28098clawback-cruelty.aspx)

  * [![Next-generation, inhaled COVID-19 vaccine enters phase-2 clinical trial](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250310/Next-generation-inhaled-COVID-19-vaccine-enters-phase-2-clinical-trial.aspx)

[Next-generation, inhaled COVID-19 vaccine enters phase-2 clinical trial](/news/20250310/Next-generation-inhaled-COVID-19-vaccine-enters-phase-2-clinical-trial.aspx)

  * [![These simple diet tweaks could slash microplastics in your body](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250309/These-simple-diet-tweaks-could-slash-microplastics-in-your-body.aspx)

[These simple diet tweaks could slash microplastics in your body](/news/20250309/These-simple-diet-tweaks-could-slash-microplastics-in-your-body.aspx)

  * [![How to pick healthier gluten-free bread](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250309/How-to-pick-healthier-gluten-free-bread.aspx)

[How to pick healthier gluten-free bread](/news/20250309/How-to-pick-healthier-gluten-free-bread.aspx)

  * [![Study finds no link between Medicaid expansion and opioid misuse](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250311/Study-finds-no-link-between-Medicaid-expansion-and-opioid-misuse.aspx)

[Study finds no link between Medicaid expansion and opioid misuse](/news/20250311/Study-finds-no-link-between-Medicaid-expansion-and-opioid-misuse.aspx)




### [Making Complex Cell Culture Easy and Efficient with AI Angeline Lim Molecular Devices' CellXpress AI streamlines cell culture processes, reducing human error and improving efficiency in drug discovery with advanced automation. ![Making Complex Cell Culture Easy and Efficient with AI](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7) ](/news/20250312/Making-Complex-Cell-Culture-Easy-and-Efficient-with-AI.aspx) ### [This International Women’s Day, Meet the Scientist Changing Women’s Healthcare Professor Inge Herrmann Prof. Dr. Inge Herrmann discusses her innovative work in healthcare, focusing on a reversible hydrogel implant that could transform gynecological treatments. ![This International Women’s Day, Meet the Scientist Changing Women’s Healthcare](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7) ](/news/20250304/This-International-Womene28099s-Day-Meet-the-Scientist-Changing-Womene28099s-Health.aspx) ### [Microphysiological systems in drug discovery Emily Richardson NewsMedical speaks with CN Bio about the translatability between in vitro organ-on-a-chip (OOC) models, microphysiological systems, and their in vivo counterparts. ![Microphysiological systems in drug discovery](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7) ](/news/20250226/Microphysiological-systems-in-drug-discovery.aspx)

  * [![Is The Carnivore Diet Healthy?](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/health/The-Carnivore-Diet-Healthy-Trend-or-Risky-Fad.aspx)

[Is The Carnivore Diet Healthy?](/health/The-Carnivore-Diet-Healthy-Trend-or-Risky-Fad.aspx)

  * [![The Truth About Mushroom Coffee: Benefits vs. Hype](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/health/The-Truth-About-Mushroom-Coffee-Benefits-vs-Hype.aspx)

[The Truth About Mushroom Coffee: Benefits vs. Hype](/health/The-Truth-About-Mushroom-Coffee-Benefits-vs-Hype.aspx)

  * [![What's Next for Semaglutide? Beyond Diabetes and Weight Loss](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/health/Whats-Next-for-Semaglutide-Beyond-Diabetes-and-Weight-Loss.aspx)

[What's Next for Semaglutide? Beyond Diabetes and Weight Loss](/health/Whats-Next-for-Semaglutide-Beyond-Diabetes-and-Weight-Loss.aspx)

  * [![Alpha-GPC: What Science Says About Its Role in Brain Health](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/health/Alpha-GPC-What-Science-Says-About-Its-Role-in-Brain-Health.aspx)

[Alpha-GPC: What Science Says About Its Role in Brain Health](/health/Alpha-GPC-What-Science-Says-About-Its-Role-in-Brain-Health.aspx)

  * [![The Science Behind Long COVID Brain Fog](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/health/The-Science-Behind-Long-COVID-Brain-Fog.aspx)

[The Science Behind Long COVID Brain Fog](/health/The-Science-Behind-Long-COVID-Brain-Fog.aspx)




## Latest News

  * [![UN Commission on Narcotic Drugs places six substances under international control following WHO recommendations](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250314/UN-Commission-on-Narcotic-Drugs-places-six-substances-under-international-control-following-WHO-recommendations.aspx)

[UN Commission on Narcotic Drugs places six substances under international control following WHO recommendations](/news/20250314/UN-Commission-on-Narcotic-Drugs-places-six-substances-under-international-control-following-WHO-recommendations.aspx)

  * [![Progressives seek health privacy protections in California, but Newsom could balk](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250314/Progressives-seek-health-privacy-protections-in-California-but-Newsom-could-balk.aspx)

[Progressives seek health privacy protections in California, but Newsom could balk](/news/20250314/Progressives-seek-health-privacy-protections-in-California-but-Newsom-could-balk.aspx)

  * [![WEHI team makes major strides in the fight against Parkinson's disease](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250314/WEHI-team-makes-major-strides-in-the-fight-against-Parkinsons-disease.aspx)

[WEHI team makes major strides in the fight against Parkinson's disease](/news/20250314/WEHI-team-makes-major-strides-in-the-fight-against-Parkinsons-disease.aspx)

  * [![Study explores impact of severe tricuspid regurgitation in AFMR patients](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250314/Study-explores-impact-of-severe-tricuspid-regurgitation-in-AFMR-patients.aspx)

[Study explores impact of severe tricuspid regurgitation in AFMR patients](/news/20250314/Study-explores-impact-of-severe-tricuspid-regurgitation-in-AFMR-patients.aspx)

  * [![Modified tool helps assess symptoms in cognitively impaired nursing home residents](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)](/news/20250314/Modified-tool-helps-assess-symptoms-in-cognitively-impaired-nursing-home-residents.aspx)

[Modified tool helps assess symptoms in cognitively impaired nursing home residents](/news/20250314/Modified-tool-helps-assess-symptoms-in-cognitively-impaired-nursing-home-residents.aspx)




## Newsletters you may be interested in

  * [![COVID-19](https://www.azonetwork.com/newsletters/icons/COVID-19.png)](https://www.news-medical.net/newsletters/webview/?ppnid=294)

[COVID-19](https://www.news-medical.net/newsletters/webview/?ppnid=294)

([Subscribe or Preview](https://www.news-medical.net/newsletters/webview/?ppnid=294)) 

  * [![HIV/AIDS](https://www.azonetwork.com/newsletters/icons/HIV_AIDS.png)](https://www.news-medical.net/newsletters/webview/?ppnid=116)

[HIV/AIDS](https://www.news-medical.net/newsletters/webview/?ppnid=116)

([Subscribe or Preview](https://www.news-medical.net/newsletters/webview/?ppnid=116)) 

  * [![Infectious Diseases](https://www.azonetwork.com/newsletters/icons/Infectious_Diseases.png)](https://www.news-medical.net/newsletters/webview/?ppnid=217)

[Infectious Diseases](https://www.news-medical.net/newsletters/webview/?ppnid=217)

([Subscribe or Preview](https://www.news-medical.net/newsletters/webview/?ppnid=217)) 




[See all Newsletters »](/medical/newsletters)

[ ![NewsGuard](https://d2jx2rerrg6sh3.cloudfront.net/images/newsguard-logo.svg) ![NewsGuard 100/100 Score](https://d2jx2rerrg6sh3.cloudfront.net/images/newsguard-100.svg) ](/medical/newsguard)

High Credibility: This website adheres to all nine standards of credibility and transparency. 

[![TRUSTe](//privacy-policy.truste.com/privacy-seal/seal?rid=80814776-9892-4bc0-a905-50180d9d0296)](//privacy.truste.com/privacy-seal/validation?rid=80814776-9892-4bc0-a905-50180d9d0296) [![Cyber Essentials Plus](https://d2jx2rerrg6sh3.cloudfront.net/images/cyberessentials_plus_245x90.png)](https://registry.blockmarktech.com/certificates/b5720d0b-7698-4c0d-b58c-92920915c193/)

### Medical Links

  * [Medical Home](/medical)
  * [COVID-19](/condition/Coronavirus-Disease-COVID-19)
  * [News](/medical/news)
  * [Health A-Z](/medical-a-z.aspx)
  * [White Papers](/medical/whitepapers)
  * [Thought Leaders](/medical/thought-leaders)
  * [Insights](/medical/insights-from-industry)
  * [MediKnowledge Series](/mediknowledge)
  * [Health & Personal Care](/Consumer-Products)
  * [Medical Devices](/Clinical-and-Diagnostics)
  * [Drugs](/drugs-a-z.aspx)
  * [eBooks](/medical/ebooks)
  * [Posters](/medical/posters)
  * [Podcasts](/medical/podcasts)



### Life Sciences Links

  * [Life Sciences Home](/life-sciences)
  * [News](/life-sciences/news)
  * [Lab Instruments & Equipment](/Life-Science-and-Laboratory)
  * [Life Sciences A-Z](/life-sciences-a-z)
  * [White Papers](/life-sciences/whitepapers)
  * [Thought Leaders](/life-sciences/thought-leaders)
  * [Insights](/life-sciences/insights-from-industry)
  * [Webinars](/life-sciences/webinars)
  * [eBooks](/life-sciences/ebooks)
  * [Posters](/life-sciences/posters)
  * [Podcasts](/life-sciences/podcasts)



### Other Useful Links

  * [About](/medical/about)
  * [Meet the Team](/medical/team)
  * [Search](/medical/search)
  * [Newsletters](/medical/newsletters)
  * [Sitemap](/sitemap.axd)
  * [Advertise](/medical/advertise)
  * [Contact](/medical/contact)
  * [Terms & Conditions](/medical/terms)
  * [Privacy & Cookie Policy](/medical/privacy)
  * [Content Policy](/medical/content-policy)
  * [Ownership & Funding Information](/medical/about#ownership-funding)



### Other AZoNetwork Sites

  * [AZoM](https://www.azom.com/)
  * [AZoNano](https://www.azonano.com/)
  * [AZoCleantech](https://www.azocleantech.com/)
  * [AZoOptics](https://www.azooptics.com/)
  * [AZoRobotics](https://www.azorobotics.com/)
  * [AZoSensors](https://www.azosensors.com/)
  * [AZoMining](https://www.azomining.com/)
  * [AZoQuantum](https://www.azoquantum.com/)
  * [AZoBuild](https://www.azobuild.com/)
  * [AZoLifeSciences](https://www.azolifesciences.com/)
  * [AZoAi](https://www.azoai.com/)



![News-Medical](https://d2jx2rerrg6sh3.cloudfront.net/themes/Standard/images/nm-logo-4.png)

  * [ Facebook ](https://www.facebook.com/NewsMedical)
  * [ Twitter ](https://twitter.com/NewsMedical)
  * [ LinkedIn ](https://www.linkedin.com/company/news-medical/)



News-Medical.Net provides this medical information service in accordance with these [terms and conditions](/medical/terms). Please note that medical information found on this website is designed to support, not to replace the relationship between patient and physician/doctor and the medical advice they may provide. 

Update Your Privacy Preferences 

Last Updated: Friday 14 Mar 2025

[![AZoNetwork](https://www.azonetwork.com/images/azonetwork_logo_footer_80.png)](https://www.azonetwork.com/)

News-Medical.net - An AZoNetwork Site

Owned and operated by AZoNetwork, (C) 2000-2025

![Azthena chat logo](https://d2jx2rerrg6sh3.cloudfront.net/images/ai-chat-icon.svg)

Azthena logo with the word Azthena

Maximise chat window Hide chat window

Your AI Powered Scientific Assistant 

Hi, I'm Azthena, you can trust me to find commercial scientific answers from News-Medical.net.

To start a conversation, please log into your AZoProfile account first, or create a new account.

Registered members can chat with Azthena, request quotations, download pdf's, brochures and subscribe to our related [newsletter content](/medical/newsletters).

Log in

A few things you need to know before we start. **Please read and _accept_ to continue.**

  * Use of “Azthena” is subject to the terms and conditions of use as set out by [OpenAI](https://openai.com/policies/terms-of-use). 
  * Content provided on any AZoNetwork sites are subject to the site [Terms & Conditions](/medical/terms) and [Privacy Policy](/medical/privacy). 
  * Large Language Models can make mistakes. Consider checking important information. 



I understand, and agree to receive occasional emails about Azthena such as usage tips and new feature announcements.

Please check the box above to proceed.

Start Chat

Great. Ask your question.

Clear Chat Clear Chat  Brief Moderate Detailed

Azthena may occasionally provide inaccurate responses.  
Read the full terms. 

Terms

While we only use edited and approved content for Azthena answers, it may on occasions provide incorrect responses. Please confirm any data provided with the related suppliers or authors. We do not provide medical advice, if you search for medical information you must always consult a medical professional before acting on any information provided. 

Your questions, but not your email details will be shared with OpenAI and retained for 30 days in accordance with their privacy principles. 

Please do not ask questions that use sensitive or confidential information. 

Read the full [Terms & Conditions](/medical/terms).

Provide Feedback

Submit Cancel

You might also like...  ×

[![](https://d2jx2rerrg6sh3.cloudfront.net/images/news/ImageForNews_803213_457129803715509261765-80x70.jpg)Study finds strong evidence that bird flu spreads through the air between farms](/news/20250224/Study-finds-strong-evidence-that-bird-flu-spreads-through-the-air-between-farms.aspx "Study finds strong evidence that bird flu spreads through the air between farms")


url: https://www.cdc.gov/bird-flu/spotlights/h5n1-response-02262025.html
title: CDC A(H5N1) Bird Flu Response Update February 26, 2025 | Bird Flu | CDC
scrape_date: 2025-03-14T11:59:58.695875
content_type: markdown
hash: f15793fe24fefb1e390267076341e3fe775ffeacbc36a82daa692d1e71ad248c
content:
Skip directly to site content Skip directly to search

![U.S. flag](/TemplatePackage/5.0/img/uswds/us_flag_small.png) An official website of the United States government

Here's how you know 

![](/TemplatePackage/5.0/img/uswds/icon-dot-gov.svg)

**Official websites use .gov**

A .gov website belongs to an official government organization in the United States.

![](/TemplatePackage/5.0/img/uswds/icon-https.svg)

**Secure .gov websites use HTTPS**

A **lock** ( __) or**https://** means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.

[ ![Centers for Disease Control and Prevention. CDC twenty four seven. Saving Lives, Protecting People](/TemplatePackage/5.0/img/logo/logo-notext.svg) ](https://www.cdc.gov)

[ Avian Influenza (Bird Flu) ](/bird-flu/index.html)

Explore Topics 

Search

Search

[ For Everyone ](/bird-flu/index.html)

  * [ Current Situation ](/bird-flu/situation-summary/index.html)
  * [ Monitoring Current Situation ](/bird-flu/h5-monitoring/index.html)
  * [ About ](/bird-flu/about/index.html)
  * [ Signs and Symptoms ](/bird-flu/signs-symptoms/index.html)
  * [ Bird Flu in Animals and People ](/bird-flu/virus-transmission/index.html)
  * [ Risk Factors ](/bird-flu/risk-factors/index.html)
  * [ Prevention ](/bird-flu/prevention/index.html)
  * [ Backyard Flock Owners: Protect Yourself from Bird Flu ](/bird-flu/caring/index.html)
  * [ View all ](/bird-flu/site.html#gen)



[ Health Care Providers ](/bird-flu/site.html#hcp)

  * [ Case Definitions for Investigations of Human Infection with Avian Influenza A Viruses in the United States ](/bird-flu/hcp/case-definition/index.html)
  * [ Clinical Overview ](/bird-flu/hcp/clinicians-evaluating-patients/index.html)
  * [ Interim Guidance on the Use of Antiviral Medications for Treatment of Human Infections with Novel Influenza A Viruses Associated with Severe Human Disease ](/bird-flu/hcp/novel-av-treatment-guidance/index.html)
  * [ Interim Guidance on Influenza Antiviral Chemoprophylaxis of Persons Exposed to Birds with Avian Influenza A Viruses Associated with Severe Human Disease or with the Potential to Cause Severe Human Disease ](/bird-flu/hcp/guidance-exposed-persons/index.html)
  * [ Infection Control Guidance ](/bird-flu/hcp/novel-flu-infection-control/index.html)
  * [ Considerations for Veterinarians: Evaluating and Handling of Cats Potentially Exposed to Highly Pathogenic Avian Influenza A(H5N1) Virus in Cats ](/bird-flu/hcp/animals/index.html)
  * [ Conversation Tips: Unpasteurized (Raw Milk) ](/bird-flu/hcp/unpasteurized-raw-milk/index.html)
  * [ Emergency Use Instructions (EUI) for Oseltamivir ](/bird-flu/hcp/emergency-use-oseltamivir/index.html)
  * [ View all ](/bird-flu/site.html#hcp)



[ Public Health ](/bird-flu/site.html#php)

  * [ H5N1 Bird Flu: Current Situation Summary ](/bird-flu/php/avian-flu-summary/index.html)
  * [ Public Health Strategies for Bird Flu ](/bird-flu/php/monitoring-bird-flu/index.html)
  * [ Interim Guidance on Specimen Collection and Testing for Patients with Suspected Infection with Novel Influenza A Viruses Associated with Severe Disease or with the Potential to Cause Severe Disease in Humans ](/bird-flu/php/severe-potential/index.html)
  * [ Interim Guidance for Follow-up of Close Contacts of Persons Infected with Novel Influenza A Viruses and Use of Antiviral Medications for Chemoprophylaxis ](/bird-flu/php/novel-av-chemoprophylaxis-guidance/index.html)
  * [ H5N1 Technical Report ](/bird-flu/php/technical-report/index.html)
  * [ Report: Highly Pathogenic Avian Influenza ](/bird-flu/php/data-research/report-4-26-2024/index.html)
  * [ View all ](/bird-flu/site.html#php)



**Related Topics:**

[ Seasonal Flu ](/flu/) | [ Swine Flu ](/swine-flu/) | [ Flu in Animals ](/flu-in-animals/) | [ Flu Vaccines Work ](/flu-vaccines-work/) | [ Flu Forecasting ](/flu-forecasting/) | [ Flu Burden ](/flu-burden/)

[ View All ](/bird-flu/site.html)

[ ![Centers for Disease Control and Prevention. CDC twenty four seven. Saving Lives, Protecting People](/TemplatePackage/5.0/img/logo/logo-notext.svg) ](https://www.cdc.gov)

_search_ _close search_

__search

[Bird Flu](/bird-flu/index.html) Menu __

__search

For Everyone 

  * [ Current Situation ](/bird-flu/situation-summary/index.html)
  * [ Monitoring Current Situation ](/bird-flu/h5-monitoring/index.html)
  * [ About ](/bird-flu/about/index.html)
  * [ Signs and Symptoms ](/bird-flu/signs-symptoms/index.html)
  * [ Bird Flu in Animals and People ](/bird-flu/virus-transmission/index.html)
  * [ Risk Factors ](/bird-flu/risk-factors/index.html)
  * [ Prevention ](/bird-flu/prevention/index.html)
  * [ Backyard Flock Owners: Protect Yourself from Bird Flu ](/bird-flu/caring/index.html)
  * [ View All ](/bird-flu/site.html#gen) [ Home ](/bird-flu/index.html)



Health Care Providers 

  * [ Case Definitions for Investigations of Human Infection with Avian Influenza A Viruses in the United States ](/bird-flu/hcp/case-definition/index.html)
  * [ Clinical Overview ](/bird-flu/hcp/clinicians-evaluating-patients/index.html)
  * [ Interim Guidance on the Use of Antiviral Medications for Treatment of Human Infections with Novel Influenza A Viruses Associated with Severe Human Disease ](/bird-flu/hcp/novel-av-treatment-guidance/index.html)
  * [ Interim Guidance on Influenza Antiviral Chemoprophylaxis of Persons Exposed to Birds with Avian Influenza A Viruses Associated with Severe Human Disease or with the Potential to Cause Severe Human Disease ](/bird-flu/hcp/guidance-exposed-persons/index.html)
  * [ Infection Control Guidance ](/bird-flu/hcp/novel-flu-infection-control/index.html)
  * [ Considerations for Veterinarians: Evaluating and Handling of Cats Potentially Exposed to Highly Pathogenic Avian Influenza A(H5N1) Virus in Cats ](/bird-flu/hcp/animals/index.html)
  * [ Conversation Tips: Unpasteurized (Raw Milk) ](/bird-flu/hcp/unpasteurized-raw-milk/index.html)
  * [ Emergency Use Instructions (EUI) for Oseltamivir ](/bird-flu/hcp/emergency-use-oseltamivir/index.html)
  * [ View All ](/bird-flu/site.html#hcp)



Public Health 

  * [ H5N1 Bird Flu: Current Situation Summary ](/bird-flu/php/avian-flu-summary/index.html)
  * [ Public Health Strategies for Bird Flu ](/bird-flu/php/monitoring-bird-flu/index.html)
  * [ Interim Guidance on Specimen Collection and Testing for Patients with Suspected Infection with Novel Influenza A Viruses Associated with Severe Disease or with the Potential to Cause Severe Disease in Humans ](/bird-flu/php/severe-potential/index.html)
  * [ Interim Guidance for Follow-up of Close Contacts of Persons Infected with Novel Influenza A Viruses and Use of Antiviral Medications for Chemoprophylaxis ](/bird-flu/php/novel-av-chemoprophylaxis-guidance/index.html)
  * [ H5N1 Technical Report ](/bird-flu/php/technical-report/index.html)
  * [ Report: Highly Pathogenic Avian Influenza ](/bird-flu/php/data-research/report-4-26-2024/index.html)
  * [ View All ](/bird-flu/site.html#php)



Related Topics

  * [ Seasonal Flu ](/flu/)
  * [ Swine Flu ](/swine-flu/)
  * [ Flu in Animals ](/flu-in-animals/)
  * [ Flu Vaccines Work ](/flu-vaccines-work/)
  * [ Flu Forecasting ](/flu-forecasting/)
  * [ Flu Burden ](/flu-burden/)



[ View All  Bird Flu ](/bird-flu/site.html)

 

[ Current Situation ](/bird-flu/situation-summary/index.html) [ Monitoring Current Situation ](/bird-flu/h5-monitoring/index.html) [ About ](/bird-flu/about/index.html) [ Signs and Symptoms ](/bird-flu/signs-symptoms/index.html) [ Bird Flu in Animals and People ](/bird-flu/virus-transmission/index.html) [ Risk Factors ](/bird-flu/risk-factors/index.html) [ Prevention ](/bird-flu/prevention/index.html) [ Backyard Flock Owners: Protect Yourself from Bird Flu ](/bird-flu/caring/index.html) [ View All ](/bird-flu/site.html)

February 26, 2025 

[Español](https://espanol.cdc.gov/enes/bird-flu/spotlights/h5n1-response-02262025.html)

# CDC A(H5N1) Bird Flu Response Update February 26, 2025

## At a glance

CDC provides an update on recent developments in the multistate outbreak of avian influenza A(H5N1) virus, or "H5N1 bird flu," in dairy cows, poultry, and other animals in the United States.

## What to Know

In this spotlight, CDC provides an update on recent human infections associated with the ongoing U.S. H5N1 bird flu outbreak in animals. These updates include information on the specific animal exposures and the genetic sequence analysis of the viruses detected from three recently confirmed cases in Nevada, Ohio, and Wyoming.

## Situation Update

**February 26, 2025** - CDC continues to respond to the public health challenge posed by a multistate outbreak of avian influenza A(H5N1) virus, or "H5N1 bird flu," in dairy cows, poultry, and other animals in the United States. CDC is working in collaboration with the U.S. Department of Agriculture (USDA), the Food and Drug Administration (FDA), Administration for Strategic Preparedness and Response (ASPR), state public health and animal health officials, and other partners using a [One Health approach](https://www.cdc.gov/one-health/about/index.html). 

### Public risk remains low

Since April 2024, working with state public health departments, CDC has confirmed H5 bird flu in 70 people in the United States. To date, person-to-person spread of H5 bird flu has not been identified. CDC believes the immediate risk to the general public from H5 bird flu remains low but this [risk assessment could change](https://www.cdc.gov/bird-flu/spotlights/h5n1-response-01142025.html) as influenza viruses constantly change. CDC is taking actions to be ready in case the current risk for the public changes.

### People with dairy cow or poultry exposures remain at greater risk of infection

People with job- or recreation-related exposures to infected animals are at increased risk of infection. Most (67 of 70) confirmed human infections in the United States have had exposure to infected or presumed to be infected dairy cows or poultry (the source of exposure could not be determined for three cases).

## Epidemiology Updates

As of February 24, CDC has confirmed three human cases of H5 bird flu in people who became ill in 2025: a dairy worker with exposure to infected dairy cows ([Nevada](https://www.centralnevadahd.org/press-release/)), a poultry worker with exposure to infected commercial poultry ([Ohio](https://odh.ohio.gov/media-center/ODH-News-Releases/ohio-reports-first-human-case-of-bird-flu-021225)), and the owner of an infected backyard poultry flock ([Wyoming](https://health.wyo.gov/wyomings-first-human-bird-flu-case-confirmed/)). These are all considered [higher-risk exposures](https://www.cdc.gov/bird-flu/prevention/worker-protection-ppe.html#cdc_generic_section_2-levels-of-exposure). While the dairy worker was not hospitalized, both people with poultry exposures experienced severe illness and were hospitalized. Both hospitalized cases were confirmed positive from lower respiratory specimens, including a bronchoalveolar lavage and sputum. To date, there has been no evidence of onward spread from any of these people to anyone else.

The dairy worker in Nevada had conjunctivitis (eye redness and irritation) and has recovered. Most infections associated with U.S. dairy cows to date have involved mild respiratory symptoms or conjunctivitis. This person was exposed to infected dairy cows and tested positive for avian influenza A(H5N1) virus.

The poultry worker in Ohio had respiratory symptoms and is home and recovering. This person participated in culling activities on a farm with infected poultry. The initial upper respiratory specimens could not be confirmed as positive for avian influenza A(H5) virus at CDC, so CDC initially reported this as a probable case; a subsequent specimen from the person was confirmed positive for avian influenza A(H5) virus at CDC.

The backyard flock owner in Wyoming had respiratory symptoms and is reported to have underlying health conditions that can make people more vulnerable to severe influenza illness. This person has been discharged from the hospital and is recovering. This person had direct contact with poultry infected with avian influenza A(H5) virus that died on their property. Initial upper respiratory specimens were negative for influenza viruses; a lower respiratory specimen collected several days later in the hospital was positive for avian influenza A(H5N1) virus.

## Laboratory Updates

CDC has successfully sequenced the viruses from the Nevada and Wyoming cases. Genetic data have been posted in [GISAID](https://gisaid.org/) (Wyoming: EPI_ISL_19749443, Nevada: EPI_ISL_19726293) and [GenBank](https://www.ncbi.nlm.nih.gov/genbank/). Sequencing data are not yet available for the Ohio case.

CDC's analysis of the genetic sequence of the virus isolated from the patient in Nevada identified the virus as an avian influenza A(H5N1) virus from clade 2.3.4.4.b (genotype D1.1). The nucleotide sequence was nearly identical to that of the viruses that [USDA reported](https://www.aphis.usda.gov/sites/default/files/dairy-cattle-hpai-tech-brief.pdf) from dairy cows in Nevada that the person worked with. The virus had a genetic mutation in its polymerase basic 2 (PB2) protein that has previously been associated with more efficient virus replication in mammalian cells (i.e., change of PB2 D701N). This change was previously identified in a [human case in Chile in 2023](https://www.cdc.gov/bird-flu/spotlights/chile-first-case-h5n1-addendum.html). No other changes associated with mammalian adaption were identified in the sequence data. CDC also did not identify any changes that might impact effectiveness of influenza antiviral medications or existing clade 2.3.4.4b H5 candidate vaccine viruses.

CDC's analysis of the genetic sequence of the virus from the patient in Wyoming identified an avian influenza A(H5N1) virus from clade 2.3.4.4.b (genotype D1.1). The virus had a genetic mutation in its PB2 protein that has previously been associated with more efficient virus replication in people and other mammals (i.e., change of PB2 E627K). This change was previously identified in a [human case in Texas during 2024](https://www.cdc.gov/bird-flu/spotlights/h5n1-response-07192024.html). No other changes associated with mammalian adaption were identified in the sequence data. CDC also did not identify any changes in the sequence data that might impact effectiveness of influenza antiviral medications or existing H5 candidate vaccine viruses. Virus was isolated from the case and will undergo further testing and analysis.

## CDC Recommendations

### Risk for serious illness highlights importance of prevention

Historically, avian influenza A viruses have caused illnesses ranging from mild to deadly. Most human infections with avian influenza A viruses in the United States since 2024 have been mild. However, serious illnesses have occurred, and [one person has died](https://www.cdc.gov/media/releases/2025/m0106-h5-birdflu-death.html). Because these viruses can cause serious illness and death, it is important for people with exposure to infected or potentially infected animals to take care to follow recommended steps to help protect their health.

The best way to prevent H5N1 bird flu is to avoid sources of exposure whenever possible. For people who must have direct or close contact with infected or potentially infected animals, help limit exposure to avian influenza A(H5) viruses using CDC recommendations for

  * [Everyone](https://www.cdc.gov/bird-flu/prevention/index.html)
  * [Workers](https://www.cdc.gov/bird-flu/prevention/farm-workers.html) and [Employers](https://www.cdc.gov/bird-flu/prevention/worker-protection-ppe.html)
  * [Backyard flock owners](https://www.cdc.gov/bird-flu/caring/index.html)



##  On This Page 

  * What to Know
  * Situation Update
  * Epidemiology Updates
  * Laboratory Updates
  * CDC Recommendations



February 26, 2025 

Sources Print Share

[ Facebook ](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.cdc.gov "Share to Facebook") [ LinkedIn ](https://www.linkedin.com/shareArticle?url=https%3A%2F%2Fwww.cdc.gov&title=Living%20with%20High%20Blood%20Pressure "Share to LinkedIn") [ Twitter ](https://twitter.com/share?url=https%3A%2F%2Fwww.cdc.gov&text=Living%20with%20High%20Blood%20Pressure "Share to Twitter") [ Syndicate ](https://tools.cdc.gov/medialibrary/index.aspx#/sharecontent/https://https://www.cdc.gov/bird-flu/spotlights/h5n1-response-02262025.html "Embed this Page")

Content Source:

[National Center for Immunization and Respiratory Diseases (NCIRD)](https://www.cdc.gov/ncird/index.html)

##  [ __ Bird Flu __](/bird-flu/index.html)

Avian influenza or bird flu refers to the disease caused by infection with avian (bird) influenza (flu) Type A viruses.

[ View All ](/bird-flu/site.html)

###  [ For Everyone ](/bird-flu/index.html#gen)

  * [ Current Situation ](/bird-flu/situation-summary/index.html)
  * [ Monitoring Current Situation ](/bird-flu/h5-monitoring/index.html)
  * [ About ](/bird-flu/about/index.html)
  * [ Signs and Symptoms ](/bird-flu/signs-symptoms/index.html)
  * [ Bird Flu in Animals and People ](/bird-flu/virus-transmission/index.html)
  * [ Risk Factors ](/bird-flu/risk-factors/index.html)
  * [ Prevention ](/bird-flu/prevention/index.html)
  * [ Backyard Flock Owners: Protect Yourself from Bird Flu ](/bird-flu/caring/index.html)
  * [ View all  ](/bird-flu/site.html#gen)



###  [ Health Care Providers ](/bird-flu/site.html#hcp)

  * [ Case Definitions for Investigations of Human Infection with Avian Influenza A Viruses in the United States ](/bird-flu/hcp/case-definition/index.html)
  * [ Clinical Overview ](/bird-flu/hcp/clinicians-evaluating-patients/index.html)
  * [ Interim Guidance on the Use of Antiviral Medications for Treatment of Human Infections with Novel Influenza A Viruses Associated with Severe Human Disease ](/bird-flu/hcp/novel-av-treatment-guidance/index.html)
  * [ View All  ](/bird-flu/site.html#hcp)



###  [ Public Health ](/bird-flu/site.html#php)

  * [ H5N1 Bird Flu: Current Situation Summary ](/bird-flu/php/avian-flu-summary/index.html)
  * [ Public Health Strategies for Bird Flu ](/bird-flu/php/monitoring-bird-flu/index.html)
  * [ Interim Guidance on Specimen Collection and Testing for Patients with Suspected Infection with Novel Influenza A Viruses Associated with Severe Disease or with the Potential to Cause Severe Disease in Humans ](/bird-flu/php/severe-potential/index.html)
  * [ View All  ](/bird-flu/site.html#php)



__[Sign up for Email Updates](https://tools.cdc.gov/campaignproxyservice/subscriptions.aspx?topic_id=USCDC_7_3) __

Contact Us 

[Contact Us ](https://www.cdc.gov/cdc-info/index.html)

  * [Call 800-232-4636](tel:800-232-4636)
  * [Contact CDC](https://www.cdc.gov/cdc-info/index.html)



About CDC 

[About CDC ](/about/)

  * [Pressroom](/media/)
  * [Organization](/about/organization/)
  * [Budget & Funding](https://www.cdc.gov/budget/)
  * [Careers & Jobs](https://jobs.cdc.gov/index.html)



Policies 

  * [Accessibility](https://www.cdc.gov/other/accessibility.html)
  * [External Links](https://www.cdc.gov/Other/disclaimer.html#exit-notification)
  * [Privacy](https://www.cdc.gov/other/privacy.html)
  * [Web Policies](https://www.cdc.gov/Other/policies.html)



  * [FOIA](https://www.cdc.gov/foia/)
  * [OIG](https://oig.hhs.gov/)
  * [No Fear Act](https://www.cdc.gov/oeeowe/no-fear-act/)
  * [Nondiscrimination](https://www.cdc.gov/other/nondiscrimination.html)
  * [Vulnerability Disclosure Policy](https://www.hhs.gov/vulnerability-disclosure-policy/index.html)



Languages 

[Languages](https://wwwn.cdc.gov/pubs/other-languages?Sort=Lang%3A%3Aasc)

  * [Español](https://www.cdc.gov/spanish/)



[Language Assistance](https://www.cdc.gov/other/language-assistance.html)

  * [Español](https://www.cdc.gov/other/language-assistance.html#Spanish)
  * [繁體中文](https://www.cdc.gov/other/language-assistance.html#Chinese)
  * [Tiếng Việt](https://www.cdc.gov/other/language-assistance.html#Vietnamese)
  * [한국어](https://www.cdc.gov/other/language-assistance.html#Korean)



  * [Tagalog](https://www.cdc.gov/other/language-assistance.html#Tagalog)
  * [Русский](https://www.cdc.gov/other/language-assistance.html#Russian)
  * [العربية](https://www.cdc.gov/other/language-assistance.html#Arabic)
  * [Kreyòl Ayisyen](https://www.cdc.gov/other/language-assistance.html#Haitian)



  * [Français](https://www.cdc.gov/other/language-assistance.html#French)
  * [Polski](https://www.cdc.gov/other/language-assistance.html#Polish)
  * [Português](https://www.cdc.gov/other/language-assistance.html#Portuguese)
  * [Italiano](https://www.cdc.gov/other/language-assistance.html#Italian)



  * [Deutsch](https://www.cdc.gov/other/language-assistance.html#German)
  * [日本語](https://www.cdc.gov/other/language-assistance.html#Japanese)
  * [فارسی](https://www.cdc.gov/other/language-assistance.html#Farsi)
  * [English](https://www.cdc.gov/other/language-assistance.html#English)



Archive 

  * [CDC Archive](https://archive.cdc.gov/)
  * [Public Health Publications](https://stacks.cdc.gov/)



Contact Us 

[Contact Us](https://www.cdc.gov/cdc-info/index.html)

  * [Call 800-232-4636](tel:800-232-4636)
  * [Contact CDC](https://www.cdc.gov/cdc-info/index.html)



About CDC 

  * [Pressroom](/media/)
  * [Organization](/about/organization/)
  * [Budget & Funding](https://www.cdc.gov/budget/)
  * [Careers & Jobs](https://jobs.cdc.gov/index.html)
  * [About CDC](/about/)



Policies 

  * [Accessibility](https://www.cdc.gov/other/accessibility.html)
  * [External Links](https://www.cdc.gov/Other/disclaimer.html#exit-notification)
  * [Privacy](https://www.cdc.gov/other/privacy.html)
  * [Web Policies](https://www.cdc.gov/Other/policies.html)


  * [FOIA](https://www.cdc.gov/foia/)
  * [OIG](https://oig.hhs.gov/)
  * [No Fear Act](https://www.cdc.gov/oeeowe/no-fear-act/)
  * [Nondiscrimination](https://www.cdc.gov/other/nondiscrimination.html)
  * [Vulnerability Disclosure Policy](https://www.hhs.gov/vulnerability-disclosure-policy/index.html)



Languages 

Languages 

  * [Español](https://www.cdc.gov/spanish/)



Language Assistance 

  * [Español](https://www.cdc.gov/other/language-assistance.html#Spanish)
  * [繁體中文](https://www.cdc.gov/other/language-assistance.html#Chinese)
  * [Tiếng Việt](https://www.cdc.gov/other/language-assistance.html#Vietnamese)
  * [한국어](https://www.cdc.gov/other/language-assistance.html#Korean)
  * [Tagalog](https://www.cdc.gov/other/language-assistance.html#Tagalog)
  * [Русский](https://www.cdc.gov/other/language-assistance.html#Russian)
  * [العربية](https://www.cdc.gov/other/language-assistance.html#Arabic)
  * [Kreyòl Ayisyen](https://www.cdc.gov/other/language-assistance.html#Haitian)
  * [Français](https://www.cdc.gov/other/language-assistance.html#French)
  * [Polski](https://www.cdc.gov/other/language-assistance.html#Polish)
  * [Português](https://www.cdc.gov/other/language-assistance.html#Portuguese)
  * [Italiano](https://www.cdc.gov/other/language-assistance.html#Italian)
  * [Deutsch](https://www.cdc.gov/other/language-assistance.html#German)
  * [日本語](https://www.cdc.gov/other/language-assistance.html#Japanese)
  * [فارسی](https://www.cdc.gov/other/language-assistance.html#Farsi)
  * [English](https://www.cdc.gov/other/language-assistance.html#English)



Archive 

  * [CDC Archive](https://archive.cdc.gov/)
  * [Public Health Publications](https://stacks.cdc.gov/)



[ ![Centers for Disease Control and Prevention](/TemplatePackage/5.0/img/logo/cdc-logo-tag-right.svg) ](/)

[ __](https://www.facebook.com/CDC) [ __](https://twitter.com/CDCgov) [ __](https://www.instagram.com/CDCgov) [ __](https://www.linkedin.com/company/centers-for-disease-control-and-prevention)

[ __](https://www.youtube.com/cdc) [ __](https://www.pinterest.com/cdcgov) [ __](https://www.snapchat.com/add/cdcgov) [ __](https://www.cdc.gov/rss)

[HHS.gov](https://hhs.gov) [USA.gov](https://usa.gov)

__


url: https://hms.harvard.edu/news/are-we-cusp-major-bird-flu-outbreak
title: Are We on the Cusp of a Major Bird Flu Outbreak? | Harvard Medical School
scrape_date: 2025-03-14T11:59:58.696294
content_type: markdown
hash: c48f5aa8283ffa4dccf2ecec0d60fbda3bc71babc1927f12b9155623795f216d
content:
Skip to main content 

## Mobile Main Navigation

  * [Education & Admissions](/education)
    * [Medical Education](https://meded.hms.harvard.edu/ "Medical Education")
    * [MD Admissions](https://meded.hms.harvard.edu/admissions "MD Admissions")
    * [Master's Degree Programs](/education-admissions/masters-degree-programs)
    * [PhD Degree Programs](/education-admissions/phd-degree-programs)
    * [Online Learning (HMX)](https://onlinelearning.hms.harvard.edu/hmx/)
    * [Postgraduate Education](https://postgraduateeducation.hms.harvard.edu/ "Postgraduate Education")
    * [Corporate Learning](https://corporatelearning.hms.harvard.edu/)
    * [Registrar](https://meded.hms.harvard.edu/registrar "Registrar")
    * [Graduation](/education-admissions/graduation)
    * [Health Info](https://www.health.harvard.edu/)
  * [Research](/research)
    * [Research Departments, Centers, Initiatives and more](/research/research-departments-centers-initiatives-more "Research Departments, Centers, Initiatives and more")
    * [Blavatnik Institute](/research/blavatnik-institute)
    * [Postdoctoral Training](https://postdoc.hms.harvard.edu/ "Postdoctoral Training")
    * [HMS Researcher Resources](/research/researcher-resources)
    * [Countway Library of Medicine](https://www.countway.harvard.edu/ "Countway Library of Medicine")
    * [Paper Chase](https://guides.library.harvard.edu/c.php?g=725458&p=7506047 "Paper Chase")
    * [Animal Research](/research/animal-research)
  * [News & Events](/news)
    * [News](/news "News")
    * [Harvard Medicine magazine](https://magazine.hms.harvard.edu)
    * [Multimedia](/news-events/multimedia)
    * [Calendar](/news-events/calendar)
    * [Sign Up for Email Communications](/news-events/sign-email-communications)
    * [For Media](/news-events/media)
    * [Publications Archive](/news-events/publications-archive)
    * [Anatomical Gift Program Resources](/news-events/anatomical-gift-program-resources)
  * [About HMS](/about-hms)
    * [The History of HMS](/about-hms/history-hms)
    * [Campus and Culture](/about-hms/campus-culture)
    * [Diversity and Inclusion](https://hms.harvard.edu/about-hms/campus-culture/diversity-inclusion)
    * [Facts and Figures](/about-hms/facts-figures)
    * [HMS Affiliates](/about-hms/hms-affiliates)
    * [LCME Accreditation](/about-hms/lcme-accreditation)
    * [Leadership](/about-hms/leadership "Leadership")
    * [Contact HMS](/about-hms/contact-harvard-medical-school)
    * [Office of the Dean](/about-hms/office-dean)
    * [People of Harvard Medical School](/about-hms/people-harvard-medical-school)



## Mobile Utility Navigation

  * [Teaching Hospitals & Affiliates](/about-hms/hms-affiliates "Teaching Hospitals & Affiliates")
  * [Departments & Offices](/departments "Departments & Offices")
  * [Dental Medicine](https://hsdm.harvard.edu/ "Dental Medicine")
  * [Harvard University](https://www.harvard.edu/ "Harvard University")
  * [Giving](/departments/development)



__

[ ![](/themes/shared/harvardmedical/logo.svg) ](/ "Home")

__

Menu

## Utility Navigation

  * [Teaching Hospitals & Affiliates](/about-hms/hms-affiliates "Teaching Hospitals & Affiliates")
  * [Departments & Offices](/departments "Departments & Offices")
  * [Dental Medicine](https://hsdm.harvard.edu/ "Dental Medicine")
  * [Harvard University](https://www.harvard.edu/ "Harvard University")
  * [Giving](/departments/development)



__Search

## Main navigation

  * [Education & Admissions](/education)

    * [Medical Education](https://meded.hms.harvard.edu/ "Medical Education")
    * [MD Admissions](https://meded.hms.harvard.edu/admissions "MD Admissions")
    * [Master's Degree Programs](/education-admissions/masters-degree-programs)
    * [PhD Degree Programs](/education-admissions/phd-degree-programs)
    * [Online Learning (HMX)](https://onlinelearning.hms.harvard.edu/hmx/)
    * [Postgraduate Education](https://postgraduateeducation.hms.harvard.edu/ "Postgraduate Education")
    * [Corporate Learning](https://corporatelearning.hms.harvard.edu/)
    * [Registrar](https://meded.hms.harvard.edu/registrar "Registrar")
    * [Graduation](/education-admissions/graduation)
    * [Health Info](https://www.health.harvard.edu/)

  * [Research](/research)

    * [Research Departments, Centers, Initiatives and more](/research/research-departments-centers-initiatives-more "Research Departments, Centers, Initiatives and more")
    * [Blavatnik Institute](/research/blavatnik-institute)
    * [Postdoctoral Training](https://postdoc.hms.harvard.edu/ "Postdoctoral Training")
    * [HMS Researcher Resources](/research/researcher-resources)
    * [Countway Library of Medicine](https://www.countway.harvard.edu/ "Countway Library of Medicine")
    * [Paper Chase](https://guides.library.harvard.edu/c.php?g=725458&p=7506047 "Paper Chase")
    * [Animal Research](/research/animal-research)

  * [News & Events](/news)

    * [News](/news "News")
    * [Harvard Medicine magazine](https://magazine.hms.harvard.edu)
    * [Multimedia](/news-events/multimedia)
    * [Calendar](/news-events/calendar)
    * [Sign Up for Email Communications](/news-events/sign-email-communications)
    * [For Media](/news-events/media)
    * [Publications Archive](/news-events/publications-archive)
    * [Anatomical Gift Program Resources](/news-events/anatomical-gift-program-resources)

  * [About HMS](/about-hms)

    * [The History of HMS](/about-hms/history-hms)
    * [Campus and Culture](/about-hms/campus-culture)
    * [Diversity and Inclusion](https://hms.harvard.edu/about-hms/campus-culture/diversity-inclusion)
    * [Facts and Figures](/about-hms/facts-figures)
    * [HMS Affiliates](/about-hms/hms-affiliates)
    * [LCME Accreditation](/about-hms/lcme-accreditation)
    * [Leadership](/about-hms/leadership "Leadership")
    * [Contact HMS](/about-hms/contact-harvard-medical-school)
    * [Office of the Dean](/about-hms/office-dean)
    * [People of Harvard Medical School](/about-hms/people-harvard-medical-school)




News & Research

## News Topic Menu

  * [News Topics](/news)
    * [Research](/news?f%5B0%5D=news_topic%3A206)
    * [Awards and Achievements](/news?f%5B0%5D=news_topic%3A6)
    * [Care Delivery](/news?f%5B0%5D=news_topic%3A11)
    * [HMS Community](/news?f%5B0%5D=news_topic%3A21)
    * [Education](/news?f%5B0%5D=news_topic%3A16)



Stay Up to Date 

First name

Last name

Email

Which publications would you like to receive?

Harvard Medicine Magazine (monthly)

Harvard Medicine News (weekly)

[RSS](/news/feed.xml)

# Are We on the Cusp of a Major Bird Flu Outbreak?

## Scientists weigh in on the spread of H5N1 and highlight clues that portend what might come next 

By CATHERINE CARUSO  March 7, 2025 [Research](/news/?f%5B0%5D=news_topic%3A206)

8 min read 

![A cluster of elongated and circular teal and purple shapes on a black background.](/sites/default/files/2025-03/850-Bird-Flu-H1N1-53743577158_e581905119_o_credit-CDC-and-NIAID.jpg)

A microscope image of H5N1 avian influenza. Credit: CDC and NIAID 

Bird flu, or H5N1 avian influenza, has been circulating across North America since 2022, infecting birds, livestock, wildlife, pets, and humans. Despite 70 documented human cases, there are no known instances of human-to-human transmission — but some scientists are starting to worry that it’s only a matter of time. 

Experts from the Harvard Medical School-led [Massachusetts Consortium on Pathogen Readiness, or MassCPR](https://masscpr.hms.harvard.edu/), answered questions on March 5 about how H5N1 is spreading and evolving and discussed the state of surveillance efforts, testing, and vaccines. 

[**Get more HMS news**](https://hms.harvard.edu/news-events/sign-email-communications)

“I think we’re all wondering whether this is a minor blip or if we are facing what may turn into an existential threat,” said [Bruce Walker](https://connects.catalyst.harvard.edu/Profiles/display/Person/79342), director of the Ragon Institute of Mass General, MIT, and Harvard and member of the MassCPR executive committee.

Experts included: 

  * [Robert Goldstein](https://www.mass.gov/person/robbie-goldstein-md-phd-commissioner), Massachusetts Department of Public Health Commissioner
  * [Jacob Lemieux](https://urldefense.com/v3/__https:/masscpr.hms.harvard.edu/people/jacob-lemieux-md-phd__;!!PIZeeW5wscynRQ!sZbuNQ1KK1RE-MA6YqqE8Qs-pLzXwLfOFiahREA9LI9cbzDzkW2SILsAy0djAFdlrG5EJW5C-EViZ-Zg1i31jjJw4luZBVPZUJcBdKc$), HMS assistant professor of medicine and infectious disease specialist at Massachusetts General Hospital
  * [Jeremy Luban](https://urldefense.com/v3/__https:/masscpr.hms.harvard.edu/people/jeremy-luban-md__;!!PIZeeW5wscynRQ!sZbuNQ1KK1RE-MA6YqqE8Qs-pLzXwLfOFiahREA9LI9cbzDzkW2SILsAy0djAFdlrG5EJW5C-EViZ-Zg1i31jjJw4luZBVPZvKngXoI$), professor of molecular medicine, biochemistry & molecular biotechnology at UMass Chan Medical School
  * [Jonathan Runstadler](https://vet.tufts.edu/people/faculty/jonathan-runstadler), professor and chair, department of Infectious Disease and Global Health, Cummings School of Veterinary Medicine at Tufts University
  * [Kathryn Stephenson](https://findadoc.bidmc.org/details/2294/kathryn-stephenson-infectious_disease-boston), HMS associate professor of medicine and infectious disease expert at Beth Israel Deaconess Medical Center



 _**Harvard Medicine News:**_**What do we know about the history and evolution of influenza viruses, and specifically H5N1?******

**Luban:** Influenza viruses kill hundreds of thousands of people worldwide each year and have killed tens of millions in pandemics. As influenza spreads from host to host, it gradually accumulates genetic mutations, which is what necessitates an updated flu vaccine each year. Occasionally, an animal is infected with two influenza strains at the same time. When this happens, the viruses swap genes, shuffling their gene segments like a deck of cards to create a new strain. We think this process generates influenza strains like the one that caused the 1918 pandemic. 

[ ![Promotion for Harnessing the Power of the AI Revolution Information Page with listed courses HMS](/sites/default/files/2025-02/oee_harnessingpower_01.png) ](https://bit.ly/3QEnPx8)

A highly pathogenic subtype of H5N1 was first detected in birds in China in 1996, and the first human cases appeared soon afterwards. The virus diversified as it replicated in birds, and migratory bird species spread multiple subtypes around the planet. Avian influenza came to North America in 2014 and caused a severe outbreak in U.S. poultry, but the outbreak was controlled, and luckily the virus disappeared. Up until 2024, there have been almost 1,000 documented human cases of H5N1 in multiple countries, with a fatality rate of about 50 percent. In 2022, a new subtype of H5N1 clade 2.3.4.4b emerged in North America and spread to domestic poultry and many wild mammal species. Over the past year, this subtype of H5N1 has also been spreading in dairy cows. 

Overall, then, H5N1 has a long history of transmission through multiple bird and mammal species worldwide, and the virus has undergone massive diversification into multiple genetic subtypes. The jump into dairy cows is new, and we don’t really know what the implications are yet. We’ve been monitoring the spread to humans, and most cases have been mild so far. There’s been no evidence of human-to-human transmission, but there has been human-to-cat spread, which suggests that humans can transmit the virus. 

_**HMNews:**_**How does H5N1 affect humans?**

**Stephenson:** Historically, subtypes of H5N1 were quite severe, which is why everybody has been worried about the virus. Over the last year in North America, we’ve seen a milder and more self-limited presentation. In more than 90 percent of cases, patients develop conjunctivitis, or pink eye, which is not uncommon in influenza. Since 2022, there have been 70 human cases, and hospitalization has been very rare. Cases have been a mix of the two subtypes also infecting animals. In the last couple months, we have seen three patients with severe or critical illness and one death. 

H5N1 testing is recommended for anyone with influenza-like illness and a high-risk exposure. We’re also doing some testing in the general population. Currently, we recommend that all patients hospitalized with influenza A get further testing for H5N1. The hope is that we will pick up cases we are missing in other ways. 

_**HMNews:**_**What is the status of treatments and vaccines for H5N1?**

**Stephenson:** We recommend giving the antiviral drug oseltamivir, or Tamiflu, to anyone with a suspected or confirmed case or an exposure. Until recently, H5N1 strains did not show resistance to Tamiflu. However, a study from Canada documents the [emergence of a resistant H5N1 strain](https://www.tandfonline.com/doi/full/10.1080/22221751.2025.2469643#abstract) in poultry. This strain has a rare mutation that has not yet been observed in humans. Still, the potential for resistance is why it’s so important to develop antivirals and monoclonal antibodies that could give us new treatments. We also need to continue genomic surveillance of H5N1 to understand the spread of resistance mutations. 

The United States has stockpiled three licensed, pre-pandemic H5N1 vaccines. All three are safe and elicit antibodies against influenza. The problem is that these vaccines do not match the current strains. Research is mixed on how well they neutralize current H5N1 strains. It’s important to have these stockpiled vaccines, but we also need updated vaccines. Traditional vaccine companies are working on new H5N1 vaccines, but it’s going to take time to make them at scale. As a result, we’re looking at new technology, including mRNA, which was so successful for COVID-19 vaccines, and will be faster to update and manufacture. 

> I think we are living next to a volcano, and it may erupt or it may not. But we need to prepare for the possibility of a pandemic. 

Jacob Lemieux 

HMS assistant professor of medicine and infectious disease specialist at Mass General 

Our ability to develop and test vaccines will require continued and long-term investment in our national clinical trial infrastructure. Nearly all of the COVID-19 vaccines were tested in National Institutes of Health-funded clinical trial groups around the country that had been building up for decades. Support for clinical research is not just funding for individual investigators but also funding for all aspects of clinical trials, including institutional review boards and clinical research centers. When we don’t know what our funding is going to be, we can’t prepare for the future — and since we’re working on pandemic preparedness, it paralyzes our work. 

_**HMNews:**_**What is happening in terms of surveillance in the United States?******

**Lemieux:** Most human surveillance is being carried out by the Centers of Disease Control and Prevention, in coordination with state and local public health laboratories. There are two major surveillance programs: U.S. Influenza Surveillance, which tests and characterizes influenza specimens, and targeted surveillance of people after exposure to infected animals. The CDC is also doing some serological testing of dairy workers. 

There are a few factors about H5N1 that point to an increasingly risky and uncertain situation. Increased activity has been sustained for over a year, so the virus does not seem to be going away. The infection is spreading across domestic and wild animals and spilling over into humans. Human cases have escalated since last year, when the first outbreak occurred in cows. Symptoms in humans are relatively mild and common, making H5N1 hard to identify. Fortunately, we haven’t yet seen evidence of human-to-human transmission, but there is a need for urgent, escalated, and coordinated national, state, and municipal surveillance across sectors. 

**Goldstein:** Here in Massachusetts, surveillance is an ongoing collaboration with our agricultural partners. Last summer, the Massachusetts Department of Agriculture Resources and Department of Public Health worked together with MassCPR partners to institute dairy farm testing across the state. We were the first state to do so, and we remain the only state to do it at scale. We are testing all farms in Massachusetts monthly for H5N1, and to date, no dairy farm has tested positive. We need continued collaboration with agriculture, public health, and academia to make sure that our surveillance network is as broad as possible.

_**HMNews:**_**How can we improve surveillance?******

**Lemieux:** In humans, I think we need to look more closely at respiratory syndromes linked to conjunctivitis. We also need to develop better diagnostics for subtyping influenza viruses. Finally, we need resources to support collaborations that enhance surveillance. With pauses in federal funding, there’s a lot of uncertainty right now about whether surveillance efforts can continue, but investment in surveillance is necessary to keep us safe. 

**Runstadler:** On the animal side, we’re experiencing similar uncertainty in surveillance. In the Northeast, we have great partners in the Department of Public Health, MassWildlife, and many other organizations. That’s not the case in other parts of the country or the world, which makes it very difficult to track the virus. One area of concern is infections in marine mammals. In South America, thousands of seals and sea lions perished after being infected by H5N1. In the Northeast, we recorded a seal outbreak in 2022 and a few infections in 2023 and 2024. Spring is when we do most of our seal sampling, but one of our big partners has been hamstrung by federal funding cuts, so our sampling has gone way down this year.

The reality is that we can’t prepare for what we don’t know is there. A critical aspect of surveillance is understanding what is circulating and what is a potential threat for spreading to other species. H5N1 is causing a lot of death in marine mammals, but we don’t understand the basic science well enough to know whether something analogous could happen in humans. We need to study the dynamics of the virus in marine mammals to learn more about it — but we can’t do that if we don’t have funding and support for surveillance.

_**HMNews:**_**On a scale from one to ten, how worried are you about H5N1 becoming a major pandemic?**

**Goldstein:** As infectious disease doctors and public health professionals, we worry all the time, but I think we’re in the four to five range right now. I do think we need to have a healthy worry about H5N1, but the risk to humans at this moment remains low.

**Luban:** I would increase those numbers a little bit. Over the past year I’ve polled influenza experts, and there’s an enormous range of responses. Some said that H5N1 has been circulating since the 1990s, and so they don’t think a pandemic is going to happen. Others are extremely concerned about the fact that the virus has changed a lot and is spreading to new species, which allows it to acquire new properties. 

**Stephenson:** I’m a vaccine person, so that's the lens I use to think about things. I’d put it at a five. We do have stockpiled vaccines that will probably help, but we’re in a very bad funding environment, and I’m not sure we have the infrastructure to actually test vaccines.

**Runstadler:** I’m probably at a six, but I’ve come up from a two or three in a fairly short time period. I’m also at a nine or ten for an influenza virus becoming a pandemic at some point in the future. 

**Lemieux:** I would put it at a six or a seven. In infectious diseases, we have a saying that resistance is a function of time and titer, meaning that the ability for a pathogen to evolve depends on time under pressure and size of the reservoir. The virus has been with us for several years in multiple species, and the reservoir is large. I think we are living next to a volcano, and it may erupt or it may not. But we need to prepare for the possibility of a pandemic. 

_This conversation was edited for length and clarity. The story was updated on Monday, March 10._

## Related News

![A purple circular Nipah virus particle floats in a field of pink surrounded by brown VERO cells.](/sites/default/files/styles/basic_card_thumbnail_530x370/public/2025-01/750%20nipa.jpg?h=b4d99661&itok=dCpRTkMZ)

##  [Scientists Uncover Structure of Critical Component in Deadly Nipah Virus ](/news/scientists-uncover-structure-critical-component-deadly-nipah-virus)

January 20, 2025

Findings could inform the design of treatments to combat infection

![A bright circular virus particle shines in the center of an image against a dark background, with the edge of an infected cell seen in one corner.](/sites/default/files/styles/basic_card_thumbnail_530x370/public/2024-11/759%20hiv.jpg?h=b4d99661&itok=EnmrGy5i)

##  [How HIV Research Has Reshaped Modern Medicine  ](/news/how-hiv-research-has-reshaped-modern-medicine)

November 27, 2024

Decades of scientific work turned the tide on a fatal disease.

![A close up of a mosquito against green backdrop](/sites/default/files/styles/basic_card_thumbnail_530x370/public/2024-08/750%20triple%20e.jpg?h=b4d99661&itok=tjePWkYt)

##  [Deadly Eastern Equine Encephalitis Virus Is a Familiar but Formidable Foe ](/news/deadly-eastern-equine-encephalitis-virus-familiar-formidable-foe)

August 29, 2024

Harvard Medical School expert discusses challenges of diagnosis, treatment, and what lies ahead

## Trending News

![Photorealistic illustration of a wheel with a horse at the center and the word “horse” in different languages along the rim](/sites/default/files/styles/basic_card_thumbnail_530x370/public/2025-02/Uberti%20proto-indo%20wheel%20750.jpg?h=b4d99661&itok=tk7vESCG)

##  [Ancient-DNA Study Identifies Originators of Indo-European Language Family ](/news/ancient-dna-study-identifies-originators-indo-european-language-family)

February 5, 2025

Findings resolve “steppe hypothesis” enigma

![A close-up of inflamed tissue under a microscope](/sites/default/files/styles/basic_card_thumbnail_530x370/public/2025-02/750%20tissue.jpg?h=b4d99661&itok=T6gLfUg1)

##  [Scientists Identify New Driver of Inflammation Implicated in Autoimmune Diseases ](/news/scientists-identify-new-driver-inflammation-implicated-autoimmune-diseases)

February 20, 2025

The protein can turn the body’s defenses against its own tissues to fuel inflammation and damage

![A man in a suit smiles at a lectern in front of a painting of someone in academic robes](/sites/default/files/styles/basic_card_thumbnail_530x370/public/2025-02/750%20poussaint.jpg?h=b4d99661&itok=kptW6fWj)

##  [Alvin Poussaint, Advocate for Black Mental Health and Social Justice, Dies ](/news/alvin-poussaint-advocate-black-mental-health-social-justice-dies)

February 26, 2025

Psychiatrist, civil rights activist worked for more than 50 years at Harvard Medical School

[ ![Harvard Medical School](/themes/shared/harvardmedical/images/footer-logo.svg) ](/)

[Facebook](https://www.facebook.com/HarvardMed/) [twitter](https://twitter.com/harvardmed) [linkedin](https://www.linkedin.com/school/harvard-medical-school/) [instagram](https://www.instagram.com/harvardmed/) [youtube](https://www.youtube.com/harvardmedicalschool)

25 Shattuck Street  
Boston, MA 02115  
617-432-1000

## Footer

  * [Mission and Values](/about-hms/campus-culture/mission-community-values-diversity-statement "Mission and Values")
  * [Privacy Policy](/privacy-policy "Privacy Policy")
  * [Digital Accessibility](https://accessibility.huit.harvard.edu/digital-accessibility-policy)
  * [Accessibility](https://accessibility.harvard.edu/)
  * [Contact HMS](/about-hms/contact-harvard-medical-school)
  * [Jobs](https://hr.hms.harvard.edu/jobs-hms)
  * [Harvard Medicine magazine](https://magazine.hms.harvard.edu "Harvard Medicine magazine")
  * [Alumni](http://alumni.hms.harvard.edu)



(C) 2025 by The President and Fellows of Harvard College


url: https://gch.gmu.edu/news/2025-02/bird-flu-what-you-need-know
title: Bird flu: What you need to know | Department of Global and Community Health
scrape_date: 2025-03-14T11:59:58.729576
content_type: markdown
hash: 0d756424f2db2d0288ec74ec3ca3f5af8d0ab04b82156e0fdf68d6b375293254
content:
Skip to content 

[ ![Home](/sites/g/files/yyqcgq231/files/Web-Logo-Global-Community-Health.png) ](/ "Home")

Search

[MasonGeorge Mason University](https://www.gmu.edu)

[Public Health](https://publichealth.gmu.edu "College of Public Health")

  * [Apply ](/admissions-aid)
  * [Give ](/give)
  * [MyMason ](http://mymason.gmu.edu)
  * [PatriotWeb ](https://patriotweb.gmu.edu/)
  * [Peoplefinder ](http://peoplefinder.gmu.edu/)
  * [Athletics ](http://www.gomason.com/)
  * [News ](/news)
  * [CALENDAR ](/calendar)
  * [Library ](https://library.gmu.edu/)
  * [Graduation ](/graduation)



[ ![Home](/sites/g/files/yyqcgq231/files/Web-Logo-Global-Community-Health.png) ](/ "Home")

  * [__](/)
  * [Academics](/academics)
    * [__](/)
    * [Why Public Health at Mason](/academics/why-public-health-mason)
    * [Public Health Programs at CPH](/academics/public-health-programs-cph)
    * [Graduate Programs](/academics/grad-programs)
      * [__](/)
      * [Public Health, MPH](/program/public-health-mph)
        * [__](/)
        * [MPH Program of Study](/academics/graduate-programs/public-health-mph/mph-program-study)
          * [__](/)
          * [Practicum in Public Health](/master-public-health-practicum)
        * [MPH Foundational Competencies](/academics/graduate-programs/public-health-mph/mph-foundational-competencies)
        * [MPH Concentration Competencies](/academics/graduate-programs/public-health-mph/mph-concentration-competencies)
      * [Accelerated Bachelor/Master of Public Health, MPH](/program/accelerated-bachelormaster-public-health-mph)
        * [__](/)
        * [Accelerated MPH Frequently Asked Questions](/academics/graduate-programs/accelerated-bachelormaster-public-health-mph/accelerated-mph-frequently)
      * [Global Health, MS](/program/global-health-ms)
      * [Public Health, Graduate Certificate](/program/view/19944)
      * [Public Health, PhD](/program/public-health-phd)
    * [Undergraduate Programs](/academics/undergraduate-programs)
      * [__](/)
      * [Community Health, BS](https://publichealth.gmu.edu/program/community-health-bs "Community Health, BS ")
        * [__](/)
        * [Frequently Asked Questions about the BS in Community Health](/academics/undergraduate-programs/community-health-bs/frequently-asked-questions-about-bs-community)
      * [Accelerated Bachelor/Master of Public Health, MPH](/program/accelerated-bachelormaster-public-health-mph)
      * [Global Health, Minor](/program/global-health-minor)
      * [Public Health, Minor](/program/public-health-minor)
      * [Physical Activity in Public Health, Minor](/academics/undergraduate-programs/physical-activity-public-health-minor)
    * [Accreditation](/academics/accreditation)
  * [Admissions](/admissions)
    * [__](/)
    * [PhD Admissions](/admissions/phd-public-health-admissions)
    * [Information Sessions](/admissions/information-sessions)
    * [Graduate Admissions](/admissions/grad-admissions)
    * [Undergraduate Admissions](/admissions/undergrad-admissions)
    * [Non-Degree Admissions](/admissions/non-degree-admissions)
    * [International Students](/admissions/international-students)
    * [Tuition & Fees](/admissions/fees-tuition)
    * [Newly Admitted Students](/admissions/newly-admitted-students)
  * [Research](/research)
    * [__](/)
    * [Research News](/research/research-news)
    * [Faculty Research Interests](/research/faculty-research-interests)
  * [Students](/our-students)
    * [__](/)
    * [Careers in Community and Public Health](/students/careers-community-and-public-health)
    * [Student Spotlight](/students/student-spotlight)
      * [__](/)
      * [PhD Public Health Students](https://chhs.gmu.edu/phd-public-health-student-profiles "PhD Public Health Students")
    * [Students in the Community](/students/students-community)
    * [Career Outcomes](/students/career-outcomes)
    * [Meet Our Alumni](/students/meet-our-alumni)
    * [PhD Students](/students/phd-public-health-students)
    * [Student Organizations](/students/student-organizations)
      * [__](/)
      * [Delta Omega National Honor Society, Gamma Tau Chapter](/students/student-organizations/delta-omega-national-honor-society-gamma-tau-chapter)
      * [Graduate Students for Public Health](/students/student-organizations/graduate-students-public-health)
    * [Student Resources](/students/student-resources)
      * [__](/)
      * [Academic Advising Resources](/students/student-resources/academic-advising-resources)
      * [Graduate Academic Forms](/academics/graduate-programs/graduate-academic-forms)
      * [New Graduate Student Checklist](/students/student-resources/new-graduate-student-checklist)
  * [About](/about)
    * [__](/)
    * [Welcome from the Interim Chair](/about/welcome-chair)
    * [Mission, Goals, and Core Values](/about/mission-goals-and-core-values)
    * [News](/news)
    * [Contact Us](/contact-us)
    * [Events](/calendar)
    * [Make a Gift](/give)
  * [Directory](/directory)
    * [__](/)
    * [Global and Community Health Faculty and Staff](/faculty)
    * [Global and Community Health Adjunct Faculty](/directory/global-and-community-health-adjunct-faculty)
  * [](/st-search)




  * [Apply ](/admissions-aid)
  * [Give ](/give)
  * [MyMason ](http://mymason.gmu.edu)
  * [PatriotWeb ](https://patriotweb.gmu.edu/)
  * [Peoplefinder ](http://peoplefinder.gmu.edu/)
  * [Athletics ](http://www.gomason.com/)
  * [News ](/news)
  * [CALENDAR ](/calendar)
  * [Library ](https://library.gmu.edu/)
  * [Graduation ](/graduation)



  * [__Department of Global and Community Health](/) ____



# Bird flu: What you need to know 

February 7, 2025 / By 

[Taylor Thomas](/taxonomy/term/2926)

Body

February 7, 2025

The first death in a person infected with avian influenza (H5N1), commonly referred to as bird flu, was confirmed on January 6 by the Centers for Disease Control and Prevention (CDC) in Louisiana, following 66 confirmed infections in humans. Health officials have identified cases of bird flu in humans and livestock in multiple states across the United States. 

Nine states have reported cases in both humans and livestock, while an additional eight states have reported outbreaks exclusively in livestock. In total, 17 states have confirmed the presence of bird flu, including poultry farms in Maryland and Virginia. Thus far, there have been no reports of bird flu in Washington, D.C. 

Updated reports in February are warning that a newer strain of avian flu (D1.1), previously only found in humans and birds, has now been detected in dairy cattle in Nevada. This mutation is different from the 2024 outbreak of avian flu (B3.13) that has been circulating across the U.S. Keeping the public informed about bird flu and educating people about ways to reduce the risk of infection is a public health priority.

[Amira Roess](https://publichealth.gmu.edu/profiles/aroess), professor of global health and epidemiology in the College of Public Health, offers updated insight and clarity about the disease. Roess is an epidemiologist who studies emerging zoonotic (animal to human) infectious diseases and their risk factors. She was a leading source of public information during the COVID-19 pandemic. Roess served as the science director of the Pew Policy Commission on Industrial Food Animal Production, an epidemic intelligence service officer at the CDC, and a consultant on preparedness and response to H5N1 bird flu in 2006.

#### Should humans be concerned about contracting bird flu?

The risk to the general public remains low. So far, health officials have not identified or confirmed reports of person-to-person transmission of avian influenza. Those who work in close proximity to animals are at the greatest risk for infection. This includes individuals who care for backyard, noncommercial poultry flocks. 

Fortunately, most human cases have been mild. However, we are worried for those individuals with underlying conditions coming into contact with the virus because their risk of severe illness and death is high. In addition to the increased risk, the virus is more likely to mutate as it lingers in immunocompromised patients. We worry that mutations will arise that make the virus more easily transmissible between humans and more deadly. 

The individual in Louisiana who died was immunocompromised, and the strain identified in that individual appears to have mutated in them. This individual was infected while caring for their domesticated backyard poultry. 

#### Are eggs and chicken safe to eat right now?

Yes, as long as they have been properly prepared for consumption. There has been no evidence in the U.S. of bird flu infections from properly cooked eggs, chicken, beef, or pasteurized milk. Uncooked (raw) and undercooked eggs, poultry, beef and unpasteurized milk can cause illness. Heat from cooking food properly kills bacteria and viruses, including avian flu. The best precaution is to ensure all meat is cooked thoroughly (see the [CDC's safer foods table](https://www.cdc.gov/food-safety/foods/safer-food-choices.html)), stick to milk products that have been pasteurized, and separate raw food items from cooked. 

#### Why is there an egg shortage at my grocery store?

This strain of bird flu is deadly to poultry. When the virus is detected, poultry on that farm are removed from the flock to stop the virus from spreading rapidly between poultry, other animals, and humans. Egg farms across the country are suffering from the loss, which has dwindled the production of eggs. Quite simply, fewer birds mean fewer eggs that can make it into our grocery stores. The demand for eggs cannot be met and so prices rise.

#### How did the disease get from birds and livestock to people? 

There are many ways [diseases spread from animals to people](https://www.cdc.gov/one-health/about/about-zoonotic-diseases.html#:~:text=Direct%20contact:%20Coming%20into%20contact,protect%20themselves%20or%20family%20members.), directly and indirectly. Touching a contaminated animal, including pets and domesticated livestock, or being exposed to bodily fluids or feces where the animal has been, can result in transmission. 

What we’re primarily seeing in this current outbreak is that agriculture workers and those working with poultry are coming into contact with poultry and livestock that have been infected with bird flu. We are also seeing that cats drinking unpasteurized milk from infected cows are becoming infected and dying from H5N1. At the same time, the FDA has asked pet food companies to consider making sure that pet food contains no raw products since they recognize the general risk to pet health from the consumption of raw animal products.

#### What are the symptoms of bird flu in humans?

Symptoms of this outbreak are like those of other seasonal infections. Redness of the eyes, congestion, cough, sore throat, body and headaches, and slight fever are the most common. In some cases, redness of the eyes was the only symptom present. Severe cases, which are rare, may include higher fever, difficulty breathing, and even unconsciousness. 

#### How is bird flu diagnosed? Is there a test for bird flu, like there is for the flu and COVID-19?

Infection is determined by testing a swab of the nose or throat using specific laboratory tests to detect the virus. Because outward signs are so similar to other influenza strains and respiratory illnesses, bird flu can be confused with other illnesses. If you think you have bird flu you should see your health care provider as soon as possible. They can diagnose you and determine the next steps and treatment. 

#### How can we prevent bird flu from further spreading?

We know that those at the greatest risk of infection are agricultural workers and people in close proximity with infected animals. Be vigilant around animals, especially dairy cows and poultry. If you suspect an outbreak among animals, avoid contact with the animals and report it to your local health department immediately. Contact your health care provider or state and local health departments to request a test if you believe you may have already been exposed. Quarantine and be sure to avoid people as much as possible while waiting for results. 

As the virus continues to spread, the risk of people coming into contact with it increases. Those who are immunocompromised, or in close quarters with those who are, should exercise extra caution. Get the flu shot, make sure to eat healthy foods, get adequate sleep and try to reduce your stress levels. All of this will reduce the risk of infection and if you are infected this can help lessen disease severity.

##

**MEDIA INQUIRIES: For reporters who wish to speak to Amira Roess about bird flu or other emerging diseases, please email media contact Michelle Thompson at**[**mthomp7@gmu.edu**](mailto:mthomp7@gmu.edu)**.**

Amira Roess is a professor of global health and epidemiology at George Mason University's College of Public Health, Department of Global and Community Health. She is an epidemiologist with expertise in infectious diseases epidemiology, multidisciplinary and multi-species field research and evaluating interventions to reduce the transmission and impact of infectious diseases. Roess currently oversees several longitudinal studies to understand emergence and transmission of zoonotic infectious diseases globally, including the emergence and transmission of Campylobacter (with support from The Bill and Melinda Gates Foundation), MERS-CoV (with support from the U.S. National Science Foundation), and the development of the microbiome during the first year of life. She studies links between food animal production and emerging infectious and zoonotic diseases emergence globally, and mHealth (especially apps) technology integration and evaluations to reduce the impact of infectious disease outbreaks, promote health care, and help reduce disparities. 

**About George Mason University**

George Mason University is Virginia’s largest public research university. Located near Washington, D.C., Mason enrolls more than 40,000 students from 130 countries and all 50 states. Mason has grown rapidly over the past half-century and is recognized for its innovation and entrepreneurship, remarkable diversity, and commitment to accessibility. In 2023, the university launched Mason Now: Power the Possible, a one-billion-dollar comprehensive campaign to support student success, research, innovation, community, and stewardship. Learn more at [gmu.edu](http://www.gmu.edu/). 

**About College of Public Health at George Mason University**

The College of Public Health at George Mason University is the first College of Public Health in Virginia and a national leader in inclusive, interprofessional, public health research, education, and practice. The college is comprises public health disciplines, health administration and policy, informatics, nursing, nutrition, and social work. The college offers a distinct array of degrees to support research and training of professionals dedicated to ensuring health and well-being for all. The college’s transdisciplinary research seeks to understand the many factors that influence the public’s health and well-being throughout the lifespan. 

The college enrolls more than 1,900 undergraduate and 1,300 graduate students in our nationally recognized programs, including 5 undergraduate degrees, 7 master’s degrees, and 4 doctoral degrees, and 10 certificate programs. Our graduates are uniquely prepared to thrive in an increasingly multicultural, multidisciplinary, community-focused public health landscape.

## In This Story

People Mentioned in This Story

[Amira Roess, PhD, MPH](/profiles/aroess)

## Related Stories

  * [Bird flu: What you need to know ](/news/2025-02/bird-flu-what-you-need-know)

February 7, 2025

  * [Pacific Northwest Ag Network: Picks up comments by Amira Roess addressing concerns about bird flu outbreak in California ](/news/2025-01/pacific-northwest-ag-network-picks-comments-amira-roess-addressing-concerns-about-bird)

December 19, 2024

  * [U.S. News and World Report: Amira Roess discusses likely cause of the outbreak of a previously unidentifiable disease in the Democratic Republic of Congo. ](/news/2025-01/us-news-and-world-report-amira-roess-discusses-likely-cause-outbreak-previously)

December 13, 2024

  * [NBC News: Democratic Republic of Congo's Ministry of Public Health, Hygiene and Social Security warns of deadly unidentified disease. Amira Roess quoted.](/news/2024-12/nbc-news-democratic-republic-congos-ministry-public-health-hygiene-and-social-security)

December 4, 2024

  * [Yahoo!News: Amira Roess answers questions about national avian influenza trends](/news/2024-12/yahoonews-amira-roess-answers-questions-about-national-avian-influenza-trends)

November 28, 2024




## Topics

Topics

[Infectious Disease](/taxonomy/term/396)

[Tip Sheet](/taxonomy/term/666)

[GCH Faculty](/taxonomy/term/2211)

[Research](/taxonomy/term/186)

Icon

__

[Twitter](https://twitter.com/MasonPubHealth)

Icon

__

[Instagram](https://www.instagram.com/masonpublichealth)

Icon

__

[Facebook](https://www.facebook.com/masonpublichealth)

Icon

__

[LinkedIn](https://www.linkedin.com/school/masonpublichealth)

Icon

__

[YouTube](https://www.youtube.com/@masonpublichealth)

![George Mason University](/themes/custom/sf_mason_2024/images/mason-logo.png)

ALL TOGETHER DIFFERENT

College of Public Health  
Department of Global and Community Health  
4400 University Drive, MS: 5B7,  
Fairfax, Virginia 22030  
email: [gch@gmu.edu](mailto: gch@gmu.edu "global and community health general email")

(C) 2025 George Mason University

  * [Sitemap](route:<nolink>)
  * [Sitemap ](/sitemap.xml)
  * [Contact ](https://www.gmu.edu/contact)
  * [Title IX ](https://diversity.gmu.edu/title-ix)
  * [Accessibility ](https://accessibility.gmu.edu/)
  * [Jobs ](https://jobs.gmu.edu/)
  * [Student Consumer Information ](https://oiep.gmu.edu/resources/student-consumer-information/)
  * [Privacy Statement ](https://www.gmu.edu/privacy-statement)
  * [FOIA ](https://www.gmu.edu/about/integrity-and-standards/FOIA)



![George Mason University](/themes/custom/sf_mason_2024/images/mason-logo.png)

ALL TOGETHER DIFFERENT

College of Public Health  
Department of Global and Community Health  
4400 University Drive, MS: 5B7,  
Fairfax, Virginia 22030  
email: [gch@gmu.edu](mailto: gch@gmu.edu "global and community health general email")

(C) 2025 George Mason University

[ ![Home](/sites/g/files/yyqcgq231/files/Web-Logo-Global-Community-Health.png) ](/ "Home")

  * [__](/)
  * [Academics](/academics)
  * [Admissions](/admissions)
  * [Research](/research)
  * [Students](/our-students)
  * [About](/about)
  * [Directory](/directory)
  * [](/st-search)




  * [Apply ](/admissions-aid)
  * [Give ](/give)
  * [MyMason ](http://mymason.gmu.edu)
  * [PatriotWeb ](https://patriotweb.gmu.edu/)
  * [Peoplefinder ](http://peoplefinder.gmu.edu/)
  * [Athletics ](http://www.gomason.com/)
  * [News ](/news)
  * [CALENDAR ](/calendar)
  * [Library ](https://library.gmu.edu/)
  * [Graduation ](/graduation)


scrape_date: 2025-03-14T11:59:58.863571
content_type: markdown
hash: 3f224400217ed7bde22c3067d294cc1d2c9218ef22316ac9ca425c35ef86bf6b
url:
https://www.ama-assn.org/delivering-care/public-health/worst-flu-season-influenza-virus-spread-new-bird-flu-cases-us-plus

title:
Worst flu season: Influenza virus spread, new bird flu cases in the U.S., plus measles outbreak update | AMA Update Video | AMA

content:
Skip to main content 

Explore AMA Products

  * [FREIDA™](https://freida.ama-assn.org/)
  * [CME from AMA Ed Hub™](https://edhub.ama-assn.org/pages/find-cme-keep-current)
  * [AMA Physician Profiles](https://commerce.ama-assn.org/amaprofiles/)
  * [CPT](/practice-management/cpt)
  * [JAMA Network™](https://jamanetwork.com/)
  * [AMA Journal of Ethics®](https://journalofethics.ama-assn.org/home)
  * [Code of Medical Ethics](https://code-medical-ethics.ama-assn.org/)
  * [Store](https://www.ama-assn.org/practice-management/ama-store)
  * [AMA Guides®](https://ama-guides.ama-assn.org/)
  * [GCEP](https://signin.curriculum.ama-assn.org/gcep)



  * [Delivering Care](/delivering-care)
    *       1. Delivering Care
      2. [Coronavirus](/delivering-care/coronavirus)
      3. [AMA Guides®](/delivering-care/ama-guides)
      4. [Health Equity](/delivering-care/health-equity)
      5. [Public Health](/delivering-care/public-health)
      6. [Physician-Patient Relationship](/delivering-care/physician-patient-relationship)
      7. [Overdose Epidemic](/delivering-care/overdose-epidemic)
      8. [Hypertension](/delivering-care/hypertension)
      9. [Diabetes](/delivering-care/diabetes)
      10. [Population Care](/delivering-care/population-care)
      11. [Precision Medicine](/delivering-care/precision-medicine)
      12. [Ethics](/delivering-care/ethics)

![Young child coughing](/sites/ama-assn.org/files/styles/article_stub_800_x_600/public/2025-03/2025-02-10-PERTUSSIS_Index-1170x780.jpg?itok=kIQ3BDEB) ## [ What doctors wish patients knew about pertussis  ](/delivering-care/public-health/what-doctors-wish-patients-knew-about-pertussis)

Also called whooping cough, pertussis is a highly contagious respiratory infection. Alyssa Kuban, MD, of Texas Children’s Pediatrics shares more.

![Person checks blood pressure](/sites/ama-assn.org/files/styles/article_stub_800_x_600/public/2025-03/2025-02-11-OCHSNERPHTI_Index-1170x780.jpg?itok=jnwEws1N) ## [ Ochsner Health’s digital program recognized for BP management  ](/delivering-care/hypertension/ochsner-health-s-digital-program-recognized-bp-management)

A study found Ochsner Health’s digital hypertension platform has clinical benefits, potential long-term savings and improvements to population health. 

  * [Practice Management](/practice-management)
    *       1. Practice Management
      2. [AMA Credentialing Solutions](/practice-management/ama-credentialing-solutions)
      3. [AMA STEPS Forward®](/practice-management/ama-steps-forward)
      4. [AMA Store](/practice-management/ama-store)
      5. [Practice Transformation](https://www.ama-assn.org/practice-management/sustainability/practice-transformation "AMA’s work in practice transformation aims to create the conditions where joy, purpose & meaning are possible for physicians & other health professionals.")
      6. [CPT®](/practice-management/cpt)
      7. [Prior Authorization](/practice-management/prior-authorization)
      8. [Reducing Administrative Burden](/practice-management/reducing-administrative-burden)
      9. [Scope of Practice](/practice-management/scope-practice)
      10. [Sustainability](/practice-management/sustainability)
      11. [Physician Health](/practice-management/physician-health)
      12. [Claims Processing](/practice-management/claims-processing)
      13. [Private Practices](/practice-management/private-practices)
      14. [Payment & Delivery Models](/practice-management/payment-delivery-models)
      15. [Medicare & Medicaid](/practice-management/medicare-medicaid)
      16. [Digital](/practice-management/digital)
      17. [HIPAA](/practice-management/hipaa)
      18. [Career Development](/practice-management/career-development)

![AMA Update for March 14, 2025: Deciding to close your medical practice and the dire consequences of Medicare cuts](/sites/ama-assn.org/files/styles/article_stub_800_x_600/public/2025-03/au-index-031425.jpg?itok=--rcW7BV) ## [ Deciding to close your medical practice and the dire consequences of Medicare cuts  ](/practice-management/private-practices/deciding-close-your-medical-practice-and-dire-consequences)

The AMA Update covers a range of health care topics affecting the lives of physicians and patients. Learn more about the dire consequences of Medicare cuts and private practice.

## [ CPT errata & technical corrections  ](/practice-management/cpt/cpt-errata-technical-corrections)

Download PDFs to see the latest corrections to the published AMA CPT code books.

  * [Education](/education)
    *       1. Education
      2. [AMA PRA Credit System](/education/ama-pra-credit-system)
      3. [Improve GME](/education/improve-gme)
      4. [GME Funding](/education/gme-funding)
      5. [Medical School Diversity](/education/medical-school-diversity)
      6. [ChangeMedEd Initiative](/education/changemeded-initiative)
      7. [International Medical Education](/education/international-medical-education)

![Diverse professional or business people](/sites/ama-assn.org/files/styles/article_stub_800_x_600/public/2022-08/2022-08-05-GCEPDEI-Index_1170x780.jpg?itok=NeaVUrr3) ## [ These courses create health equity champions in your residency program  ](/education/improve-gme/these-courses-create-health-equity-champions-your-residency-program)

Better health equity training is an imperative for better care—and to meet ACGME requirements. Learn about on-demand training options from the AMA.

![AMA Update for March 10, 2025: Precision education and the future of medical education](/sites/ama-assn.org/files/styles/article_stub_800_x_600/public/2025-03/au-index-031025.jpg?itok=pp6Mlb4d) ## [ Precision education and the future of medical education  ](/education/changemeded-initiative/precision-education-and-future-medical-education)

The AMA Update covers a range of health care topics affecting the lives of physicians and patients. Learn more about precision education in medicine.

  * [Medical Students](/medical-students)
    *       1. Medical Students
      2. [Preparing for Medical School](/medical-students/preparing-medical-school)
      3. [USMLE® Step 1 & 2](/medical-students/usmle-step-1-2)
      4. [Medical School Life](/medical-students/medical-school-life)
      5. [Medical Student Health](/medical-students/medical-student-health)
      6. [Medical Student Finance](/medical-students/medical-student-finance)
      7. [Clinical Rotations](/medical-students/clinical-rotations)
      8. [Publishing Research](/medical-students/publishing-research)
      9. [Medical Student Advocacy](/medical-students/medical-student-advocacy)
      10. [Specialty Profiles](/medical-students/specialty-profiles)
      11. [Preparing for Residency](/medical-students/preparing-residency)

![Pregnant woman in doctor's appointment](/sites/ama-assn.org/files/styles/article_stub_800_x_600/public/2025-03/2025-02-12-RESHADOWME_WARNER_Index-1170x780.jpg?itok=IBTT7CyO) ## [ What it’s like in obstetrics and gynecology: Shadowing Dr. Warner  ](/medical-students/specialty-profiles/what-it-s-obstetrics-and-gynecology-shadowing-dr-warner)

AMA member Kimberly D. Warner, MD, says the drawbacks of an unpredictable schedule are offset by the rewards of seeing happy mothers and babies.

![Figure looking at a winding road](/sites/ama-assn.org/files/styles/article_stub_800_x_600/public/2022-03/road-to-residency-series.jpg?itok=OmOAs6iD) ## [ The road to residency  ](/medical-students/preparing-residency/road-residency)

You worked hard to succeed in medical school, now own your next adventure. AMA is your ally on the journey to residency and beyond.

  * [Medical Residents](/medical-residents)
    *       1. Medical Residents
      2. [Residency Life](/medical-residents/residency-life)
      3. [Research During Residency](/medical-residents/research-during-residency)
      4. [Medical Fellowships](/medical-residents/medical-fellowships)
      5. [Medical Resident Wellness](/medical-residents/medical-resident-wellness)
      6. [Medical Resident Advocacy](/medical-residents/medical-resident-advocacy)
      7. [Medical Residency Personal Finance](/medical-residents/medical-residency-personal-finance)
      8. [USMLE® Step 3](/medical-residents/usmle-step-3)
      9. [Transition from Resident to Attending](/medical-residents/transition-resident-attending)

![Two people shaking hands in an office setting](/sites/ama-assn.org/files/styles/article_stub_800_x_600/public/2025-03/2025-03-03-EMPLOYWELL_Index-1170x780.jpg?itok=n4HJPIv4) ## [ Considering physician employment? 4 ways to keep yourself well  ](/medical-residents/transition-resident-attending/considering-physician-employment-4-ways-keep)

Employment presents challenges to a physician’s professional satisfaction. A doctor employed for his entire career advises how to make it work.

![Open sign in a storefront window](/sites/ama-assn.org/files/styles/article_stub_800_x_600/public/2022-02/2022-02-28-AMM_PAYLEARN-Index_1170x780.jpg?itok=zWlHFf1Y) ## [ 3 tips to take the private physician practice route after residency  ](/medical-residents/transition-resident-attending/3-tips-take-private-physician-practice-route-after)

One private practice family physician says becoming a doctor is the hard part. Even when compared with running your own business.

  * [Health Care Advocacy](/health-care-advocacy)
    *       1. Health Care Advocacy
      2. [Advocating for Public Health](/health-care-advocacy/advocating-public-health)
      3. [Access to Care](/health-care-advocacy/access-care)
      4. [Administrative Burdens](/health-care-advocacy/administrative-burdens)
      5. [Payment Reform](/health-care-advocacy/payment-reform)
      6. [Advocacy Update](/health-care-advocacy/advocacy-update)
      7. [Federal Advocacy](/health-care-advocacy/federal-advocacy)
      8. [State Advocacy](/health-care-advocacy/state-advocacy)
      9. [Judicial Advocacy](/health-care-advocacy/judicial-advocacy)

## [ March 7, 2025: Medicare Payment Reform Advocacy Update  ](/health-care-advocacy/advocacy-update/march-7-2025-medicare-payment-reform-advocacy-update)

GOP Doc Caucus endorses H.R. 879, the Medicare Patient Access and Practice Stabilization Act and more in the latest Medicare Payment Reform Advocacy Update.

## [ March 7, 2025: National Advocacy Update  ](/health-care-advocacy/advocacy-update/march-7-2025-national-advocacy-update)

Federal lawmakers introduce bipartisan, bicameral Conrad 30 reauthorization legislation and more in the latest National Advocacy Update.

  * [Member Benefits](/member-benefits)
    *       1. Member Benefits
      2. [Personal Member Benefits & Discounts](/member-benefits/personal-member-benefits-discounts)
      3. [Practice Benefits & Discounts](/member-benefits/practice-benefits-discounts)
      4. [Member Eligibility & Dues](/member-benefits/member-eligibility-dues)
      5. [Events](/member-benefits/events)
      6. [Online CME](/member-benefits/free-cme)

## [ September 2025 Practice Innovation Boot Camp  ](/member-benefits/events/september-2025-practice-innovation-boot-camp)

This two-day boot camp, Sept. 17-18, 2025, will equip attendees with the time-saving tools and strategies to reform their organizations and enhance professional satisfaction.

![ChangeMedEd 2025](/sites/ama-assn.org/files/styles/article_stub_800_x_600/public/2024-11/change-meded.png?itok=qG1j0zqB) ## [ ChangeMedEd® 2025  ](/member-benefits/events/changemeded-2025)

ChangeMedEd® is a national conference that brings together leaders and innovators to accelerate change in medical education across the continuum. Learn more.

  * ###### Organization

  * [Board of Trustees](/about/board-trustees)
  * [House of Delegates](/house-delegates)
    *       1. House of Delegates
      2. [HOD Organization](/house-delegates/hod-organization)
      3. [AMA Policies](/house-delegates/ama-policies)
      4. [Annual Meeting](/house-delegates/annual-meeting)
      5. [Interim Meeting](/house-delegates/interim-meeting)
      6. [AMA Elections](/house-delegates/ama-elections)

## [ Specialty and Service Society  ](/house-delegates/hod-organization/specialty-and-service-society)

The Specialty and Service Society (SSS) is the largest caucus in the AMA House of Delegates.

## [ 2025 Annual Meeting of the HOD: Speakers' updates overview  ](/house-delegates/annual-meeting/2025-annual-meeting-hod-speakers-updates-overview)

Read the House of Delegates (HOD) speakers' updates for the 2025 HOD Annual Meeting.

  * [Councils](/councils)
    *       1. Councils
      2. [Council on Constitution & Bylaws](/councils/council-constitution-bylaws)
      3. [Council on Ethical & Judicial Affairs](/councils/council-ethical-judicial-affairs)
      4. [Council on Legislation](/councils/council-legislation)
      5. [Council on Long Range Planning & Development](/councils/council-long-range-planning-development)
      6. [Council on Medical Education](/councils/council-medical-education)
      7. [Council on Medical Service](/councils/council-medical-service)
      8. [Council on Science & Public Health](/councils/council-science-public-health)

## [ Medical education leadership opportunities  ](/councils/council-medical-education/medical-education-leadership-opportunities)

Apply for a leadership position by submitting the required documentation by the deadline.

## [ About the Council on Constitution & Bylaws (CCB)  ](/councils/council-constitution-bylaws/about-council-constitution-bylaws-ccb)

See how the CCB recommends changes to the AMA Constitution and Bylaws and assists in reviewing the rules, regulations and procedures of AMA sections.

  * [Member Groups (Sections)](/member-groups-sections)
    *       1. Member Groups (Sections)
      2. [Section Meetings](/member-groups-sections/section-meetings)
      3. [Academic Physicians](/member-groups-sections/academic-physicians)
      4. [LGBTQ+ Section](/member-groups-sections/lgbtq-section)
      5. [Integrated Physician Practices](/member-groups-sections/integrated-physician-practices)
      6. [International Medical Graduates](/member-groups-sections/international-medical-graduates)
      7. [Medical Students](/member-groups-sections/medical-students)
      8. [Minority Affairs](/member-groups-sections/minority-affairs)
      9. [Organized Medical Staff](/member-groups-sections/organized-medical-staff)
      10. [Private Practice Physicians](/member-groups-sections/private-practice-physicians)
      11. [Residents & Fellows](/member-groups-sections/residents-fellows)
      12. [Senior Physicians](/member-groups-sections/senior-physicians)
      13. [Women Physicians](/member-groups-sections/women-physicians)
      14. [Young Physicians](/member-groups-sections/young-physicians)

## [ 2025 MAS Annual Meeting agenda & resources  ](/member-groups-sections/minority-affairs/2025-mas-annual-meeting-agenda-resources)

Find the agenda PDF, documents and more for the 2025 MAS Annual Meeting on June 6** ** at the Hyatt Regency in Chicago, Illinois. 

## [ 2025 MSS Annual Meeting agenda & resources  ](/member-groups-sections/medical-students/2025-mss-annual-meeting-agenda-resources)

Find the agenda PDF, documents and more for the 2025 MSS Annual Meeting on June 6 at the Hyatt Regency Chicago. 

  * [About](/about)
    *       1. About
      2. [AMA Center for Health Equity](/about/ama-center-health-equity)
      3. [Board of Trustees](/about/board-trustees)
      4. [Leadership](/about/leadership)
      5. [Foundation](/about/foundation)
      6. [Office of International Relations](/about/office-international-relations)
      7. [CPT® Editorial Panel](/about/cpt-editorial-panel)
      8. [RVS Update Committee (RUC)](/about/rvs-update-committee-ruc)
      9. [United States Adopted Names](/about/united-states-adopted-names)
      10. [Publications & Newsletters](/about/publications-newsletters)
      11. [Research](/about/research)
      12. [AMA History](/about/ama-history)
      13. [Awards](/about/awards)
      14. [AMA Career Opportunities](/about/ama-career-opportunities)
      15. [Physician Professional Data™](/about/physician-professional-data)

## [ Top news stories from AMA Morning Rounds®: Week of March 10, 2025  ](/about/publications-newsletters/top-news-stories-ama-morning-rounds-week-march-10-2025)

In the news: AMA and other physician organizations speak out on Medicare pay cuts, new findings on physicians’ EHR use during paid time off and more.

![Person in glasses works at a computer](/sites/ama-assn.org/files/styles/article_stub_800_x_600/public/2025-03/2025-03-03-GRANTAPPTIPS_Index-1170x780.jpg?itok=l4v10U3S) ## [ 5 tips for physicians on writing a letter of intent  ](/about/awards/5-tips-physicians-writing-letter-intent)

This is often the first step in the process of applying for medical education grants. The AMA’s experts offer great advice on how to do it well.

  * ###### Explore Products

  * [FREIDA™](https://freida.ama-assn.org/)
  * [CME from AMA Ed Hub™](https://edhub.ama-assn.org/pages/find-cme-keep-current)
  * [AMA Physician Profiles](https://commerce.ama-assn.org/amaprofiles/)
  * [CPT](/practice-management/cpt)
  * [JAMA Network™](https://jamanetwork.com/)
  * [AMA Journal of Ethics®](https://journalofethics.ama-assn.org/home)
  * [Code of Medical Ethics](https://code-medical-ethics.ama-assn.org/)
  * [Store](https://www.ama-assn.org/practice-management/ama-store)
  * [AMA Guides®](https://ama-guides.ama-assn.org/)
  * [GCEP](https://signin.curriculum.ama-assn.org/gcep)



[ ![American Medical Association](/themes/custom/ama_one/logo.svg) ](https://www.ama-assn.org/)

[ Join ](https://member.ama-assn.org/join-renew) [ Renew ](https://member.ama-assn.org/join-renew)

[ Join / ](https://member.ama-assn.org/join-renew) [ Renew ](https://member.ama-assn.org/join-renew)

#### Popular Searches

  * [Medicare reform](https://www.ama-assn.org/about/leadership/medicare-physician-payment-reform-has-never-been-more-urgent)
  * [Free CME for members](https://edhub.ama-assn.org/pages/find-cme-keep-current)
  * [Burnout by specialty](https://www.ama-assn.org/practice-management/physician-health/burnout-falls-still-hits-these-6-physician-specialties-most)
  * [DEA training requirement](https://edhub.ama-assn.org/pages/opioid-dea-training-members-certificate)
  * [Joy in Medicine program](https://www.ama-assn.org/practice-management/physician-health/joy-medicine-recognized-organizations-0)



__

[ Member Benefits ](/amaone/ama-member-benefits "Member Benefits")

__[ Sign In ](/saml/login?destination=/delivering-care/public-health/worst-flu-season-influenza-virus-spread-new-bird-flu-cases-us-plus "Sign In") __

Sign In To Enjoy Your AMA Benefits

  * [ Sign In ](/saml/login?destination=/delivering-care/public-health/worst-flu-season-influenza-virus-spread-new-bird-flu-cases-us-plus "Sign In")
  * [ Become a Member ](https://member.ama-assn.org/join-renew "Join/Renew")
  * [ Create Free Account ](https://fsso.ama-assn.org/sign-up?destination=/delivering-care/public-health/worst-flu-season-influenza-virus-spread-new-bird-flu-cases-us-plus&successUrl=https://www.ama-assn.org/delivering-care/public-health/worst-flu-season-influenza-virus-spread-new-bird-flu-cases-us-plus "Create free account")



[ My Subscriptions ](/saml/login?destination=/my-subscriptions) [ My Topics ](/saml/login?destination=/my-topics) [ My Bookmarks ](/saml/login?destination=/my-bookmarks)

[ Public Health ](/delivering-care/public-health)

# Worst flu season: Influenza virus spread, new bird flu cases in the U.S., plus measles outbreak update

Feb 19, 2025 | 10 Min Read

[Member Benefits](https://www.ama-assn.org/member-benefits)

[ Save ](/saml/login?destination=/node/134206%3Fbookmarked%3D1 "Add Bookmark")

Copy

[Print](/print/pdf/node/134206 "Print Page")

Share

[ Share via Email ](https://www.addtoany.com/add_to/email?linkurl=https://www.ama-assn.org%2Fdelivering-care%2Fpublic-health%2Fworst-flu-season-influenza-virus-spread-new-bird-flu-cases-us-plus%3Futm_medium%3DSocial_AMA%26utm_campaign%3Damaone_shared_articles%26utm_source%3Demail&linkname=Worst%20flu%20season%3A%20Influenza%20virus%20spread%2C%20new%20bird%20flu%20cases%20in%20the%20U.S.%2C%20plus%20measles%20outbreak%20update&linknote= "Share via Email") [ Share to Facebook ](https://www.addtoany.com/add_to/facebook?linkurl=https://www.ama-assn.org%2Fdelivering-care%2Fpublic-health%2Fworst-flu-season-influenza-virus-spread-new-bird-flu-cases-us-plus&linkname=Worst%20flu%20season%3A%20Influenza%20virus%20spread%2C%20new%20bird%20flu%20cases%20in%20the%20U.S.%2C%20plus%20measles%20outbreak%20update&linknote=) [ Share to Twitter ](https://www.addtoany.com/add_to/twitter?linkurl=https://www.ama-assn.org%2Fdelivering-care%2Fpublic-health%2Fworst-flu-season-influenza-virus-spread-new-bird-flu-cases-us-plus&linkname=Worst%20flu%20season%3A%20Influenza%20virus%20spread%2C%20new%20bird%20flu%20cases%20in%20the%20U.S.%2C%20plus%20measles%20outbreak%20update&template%5Btext%5D=%24%7Btitle%7D%20%24%7Blink%7D%20\(via%20%40AmerMedicalAssn\)&linknote=) [ Share to LinkedIn ](https://www.addtoany.com/add_to/linkedin?linkurl=https://www.ama-assn.org%2Fdelivering-care%2Fpublic-health%2Fworst-flu-season-influenza-virus-spread-new-bird-flu-cases-us-plus&linkname=Worst%20flu%20season%3A%20Influenza%20virus%20spread%2C%20new%20bird%20flu%20cases%20in%20the%20U.S.%2C%20plus%20measles%20outbreak%20update&linknote=) [ Share to Doximity ](https://www.doximity.com/conversations/new?url=https://www.ama-assn.org%2Fdelivering-care%2Fpublic-health%2Fworst-flu-season-influenza-virus-spread-new-bird-flu-cases-us-plus&subject=Worst%20flu%20season%3A%20Influenza%20virus%20spread%2C%20new%20bird%20flu%20cases%20in%20the%20U.S.%2C%20plus%20measles%20outbreak%20update)

[AMA Update](/series/ama-update)

[Subscribe](/saml/login?destination=/delivering-care/public-health/worst-flu-season-influenza-virus-spread-new-bird-flu-cases-us-plus%3Fsubscribed%3D1)

AMA Update covers a range of health care topics affecting the lives of physicians, residents, medical students and patients. From private practice and health system leaders to scientists and public health officials, hear from the experts in medicine on COVID-19, medical education, advocacy issues, burnout, vaccines and more. 

Featured topic and speakers

## Featured topic and speakers

How bad is the flu right now? Can people get the bird flu? How do you get bird flu? What states have bird flu? Are measles going around? How contagious are measles?

AMA's Vice President of Science, Medicine and Public Health, Andrea Garcia, JD, MPH, discusses the current bird flu outbreak 2025—including cases of avian flu among veterinarians. Also covering how dangerous seasonal flu is this year and the rising measles cases in the U.S. fueled by the Texas measles outbreak. AMA Chief Experience Officer Todd Unger hosts.

  * [Watch AMA Update](https://www.youtube.com/playlist?list=PL7ZHBCvG4qscHA_zJUJoq6lWQLypyZuEe) for health care news for physicians, residents and medical students.
  * For bird flu news visit [AMA H5N1 Resource Center](https://www.ama-assn.org/delivering-care/public-health/bird-flu-h5n1-resource-center) to get clinical information, the latest CDC updates and more AMA resources.
  * [_CDC current avian flu map_](https://www.cdc.gov/bird-flu/situation-summary/data-map-commercial.html).
  * Centers for Disease Control and Prevention [CDC H5N1 Bird Flu Current Situation Summary](https://www.cdc.gov/bird-flu/situation-summary/) (CDC H5N1 technical report).
  * If the CDC issues new health warning, get the latest CDC health alert 2025 via the [_Health Alert Network_](https://emergency.cdc.gov/han/ "\(opens in a new window\)") (HAN CDC website).
  * The AMA is your powerful ally, focused on addressing the issues important to you, so you can focus on what matters most—patients. We will meet this challenge together. [Join us](https://member.ama-assn.org/join-renew/member-search).
  * Learn more about our [AMA advocacy priorities](https://www.ama-assn.org/amaone/fighting-for-physicians), including:
    * Reforming Medicare payment
    * Fighting scope creep
    * Fixing prior authorization
    * Reducing physician burnout
    * Making technology work for physicians



 

### Speaker

  * Andrea Garcia, JD, MPH, vice president, science, medicine & public health, American Medical Association



###  Advancing public health 

AMA membership offers unique access to savings and resources tailored to enrich the personal and professional lives of physicians, residents and medical students.

[ Learn More ](https://www.ama-assn.org/member-benefits "Learn More")

Transcript

## Transcript

> **Garcia:** The CDC's latest MMWR, which did publish last Thursday, detailed three cases of U.S. veterinarians who work with cattle who unknowingly had H5 avian flu. Two of them reported no exposures to infected animals. 

**Unger:** Hello and welcome to the AMA Update video and podcast. Before we dive in today, I just want to take a moment to welcome the 140,000 new subscribers to the AMA YouTube channel. We've been doing the AMA Update for more than five years, so we are glad you've discovered us. 

Today's episode is our weekly look at the public health issues facing physicians and patients across the country with the AMA's Vice President of Science, Medicine and Public Health, Andrea Garcia. I'm Todd Unger, AMA's chief experience officer. Welcome, Andrea.

**Garcia:** Thanks, Todd. Glad to be here. 

**Unger:** And now, Andrea, it's been over a week since we last talked, and there's been some more news on bird flu. Let's get the update. 

**Garcia:** Sure Todd. The big news this week has been more hospitalizations with H5N1 avian flu, two cases to be exact. One of those cases was reported in a woman from Wyoming who had traveled to and is hospitalized in Colorado. The other case was a patient in Ohio. This now brings the number of confirmed human cases of H5 bird flu here in the U.S. up to 70. 

To put this in perspective, up until now, we had only seen two hospitalizations total in the U.S. The majority of people who have had confirmed bird flu here have had mild cases, some with conjunctivitis as their only symptom, and have fully recovered. As we talked about last time, a patient from Louisiana was the first person in the U.S. to die from an H5 infection. That patient was over 65 and had underlying medical condition. 

The other hospitalization we saw here in the U.S. was reported last year in Missouri. That patient recovered and was discharged home. These numbers do not include the Canadian teen we've talked about who also was hospitalized and critically ill with bird flu. That patient was also eventually well enough to be discharged home from the hospital. 

**Unger:** So still a relatively low number of cases but concern about the two new cases that you talked about. Are these folks infected with a new variant that we talked about last week, the one that could be potentially more dangerous to humans? 

**Garcia:** Well, Todd, that's something that we don't know at this point in time. Hopefully, we will know soon. As a reminder, though, most of the human cases we've seen have been the B3.13 genotype, which is thought currently to be less severe for humans, and until recently, it had been the only bird flu genotype that we've seen spreading between dairy herds and then also into some nearby poultry farms. 

The other genotype, which is known as D1.1, has really dominated the spread among wild migratory birds. That genotype has also contributed to the spillovers from wild birds to poultry flock and as we've talked about, have been driving up the egg prices nationwide. It was the D1.1 variant that sickened both the Louisiana patient and the Canadian patient. Last week, we did learn of the first known spillover of D1.1 into dairy cattle, which occurred in Nevada, and then more recently, the virus genotype has been detected in cows in Arizona, representing a separate introduction of the virus into dairy cattle. 

**Unger:** So now what do we know about the case in Wyoming so far? 

**Garcia:** According to a statement from Wyoming's public health department, the Wyoming patient was likely infected by handling sickened birds in a backyard flock. The state's veterinarian says flocks in the county where that patient lived did recently test positive for the B3.13 strain of the virus. We know the patient is an older adult, has other health conditions which may have made them more susceptible to the disease. Of course, to help protect the patient's privacy, their current condition has not been shared. 

**Unger:** And the case in Ohio? 

**Garcia:** We don't know as much about that case. According to a _CBS News_ article, Ohio's health department confirmed this past Saturday that a farmer in the state was discharged from the hospital after being sickened by bird flu. Ohio's health department told _CBS News_ via email that the individual had respiratory symptoms, was previously hospitalized, and has since been released. It is believed that that individual did also have direct contact with sick poultry. 

**Unger:** Well, given everything we've talked about to this moment, where do we stand right now? 

**Garcia:** Well, I think one concern is that in addition to these known cases, the virus may also be spreading undetected. In other words, we may be missing some of these infections. 

The CDC's latest MMWR, which did publish last Thursday, detailed three cases of U.S. veterinarians who work with cattle who unknowingly had H5 avian flu. Two of them reported no exposures to infected animals. One practiced in Georgia and South Carolina, which have had no known cases of the virus in cattle. None of the veterinarians experienced flu-like symptoms. These cases were detected through antibody tests of 150 veterinarians working across 46 states. 

Some health officials have said that there are some reassuring news here as well since only three of the 150 veterinarians tested had signs of prior infections. This suggests that the virus doesn't easily spread from animals to people. The dairy workers who have been infected have likely had more sustained contact with sick cattle and their milk than these veterinarians. 

**Unger:** Andrea, thanks so much for that update. We'll obviously continue to watch. 

Andrea, turning to seasonal flu, has that gotten any better since we checked in last time? 

**Garcia:** Unfortunately, no. Seasonal flu is still high, which is not completely unexpected at this time of year, but it is the first time the CDC has classified it as a high severity season for all age groups since the 2017-2018 flu season. 

We've also now seen seasonal flu outpace COVID hospitalizations and deaths, and this is something that hasn't happened since the COVID pandemic began. According to the latest CDC data, which is from February 8, this has been the worst flu season in 15 years with estimates of at least 29 million cases, the most since the 2009-2010 flu season. 

**Unger:** Wow, those are big numbers. Andrea, is that translating then into more hospitalizations and deaths from flu? 

**Garcia:** Yeah, we're seeing high numbers there, too. According to the CDC, there have been at least 370,000 hospitalizations, 16,000 deaths from flu as of February 8. That's on a pace to surpass the previous high which was recorded during the 2017-2018 flu season. 

Of particular concern this year is the severity of the illness we're seeing in kids. So far, there have been 68 flu deaths in kids. Pediatric flu deaths hit a record high of 200 last year, but this season is on track to be even worse. There have also been some reports of a limited number of pediatric cases with serious neurological complications associated with the flu. 

**Unger:** And we know it's never too late, of course, to get the flu vaccine, which may not prevent the flu, but it can mean less severe illness. Andrea, another disease gaining traction right now is the measles. What can you tell us about that? 

**Garcia:** Well, Todd, this is something we've been tracking as well, and it's been reported on by several news outlets. We've now seen 48 confirmed cases of measles in Texas with a few additional cases in nearby states. And according to recent news coverage, the outbreak shows no signs of slowing down. According to the Texas Department of State Health Services, last Tuesday, the state had 24 reported measles cases, and that number had doubled by Friday. 

A Department of Health spokesperson said that this marks the largest measles outbreak in the state in more than 30 years. All of the cases are in unvaccinated individuals or individuals whose vaccination status is unknown. 13 people have been hospitalized. Gaines County is reportedly the epicenter of the outbreak with 42 cases confirmed among residents. 

**Unger:** Now we're talking about Texas, but you mentioned other nearby states as well. What do we know about that? 

**Garcia:** Well, three cases of measles were also confirmed last week in New Mexico. Those occurred in Lea County, which borders Gaines County. Given the proximity, a connection is suspected but so far remains unconfirmed. According to the CDC, Alaska, Georgia, New York and Rhode Island have also reported measles cases this year. 

Coinciding with these outbreaks are higher than ever vaccine exemption rates among children here in the U.S. This is something that we really need to keep an eye on, given how quickly we know that measles can spread. According to the CDC, measles is one of the most contagious diseases known to humans. Just one infected patient can spread measles up to 9 out of 10 susceptible close contacts. And we do have a highly effective vaccine. We know that two doses of that MMR vaccine in childhood are 97% effective at preventing measles. 

**Unger:** So incredibly contagious and we do have a solution there, the vaccine that you mentioned. So, Andrea, we'll continue to watch that in the weeks ahead as well. 

Well, that wraps up this week's episode. And as always, Andrea, thank you so much for being here keeping us informed. If you found this discussion valuable, you can support more programming like it by becoming an AMA a member at [ama-assn.org/join](https://ama-assn.org/join). You can find all our videos and podcasts at [ama-assn.org/podcasts](https://ama-assn.org/podcasts).

Thanks for joining us today. Please take care.

* * *

**Disclaimer:** The viewpoints expressed in this video are those of the participants and/or do not necessarily reflect the views and policies of the AMA.

### Subscribe to AMA Update

Get videos with expert opinions from the AMA on the most important health care topics affecting physicians, residents, medical students and patients—delivered to your inbox.

[ Subscribe Now ](https://www.ama-assn.org/saml/login?destination=/series/ama-update%3Fsubscribed%3D1 "Subscribe Now")

![AMA Update podcast logo](/sites/ama-assn.org/files/styles/membership_promo_image/public/2022-10/22-738178-Updated-podcast-art-AMA-Update-2_0.png?itok=C1C4MtME)

### Table of Contents

  1. Featured topic and speakers
  2. Transcript



Table of Contents Featured topic and speakers Transcript

 

Upvote

3

  * [Bird Flu ](/topics/bird-flu)
  * [Influenza (Seasonal Flu) ](/topics/influenza-seasonal-flu)
  * [Measles, Mumps and Rubella (MMR) ](/topics/measles-mumps-and-rubella-mmr)
  * [Vaccines, Vaccinations & Immunizations ](/topics/vaccines-vaccinations-immunizations)
  * [Texas ](/topics/texas)
  * [ AMA Update ](/series/ama-update)
  * [Catalog of Topics](/about/topic-catalog)



##  FEATURED STORIES 

[ ![Fix Medicare now](/sites/ama-assn.org/files/styles/related_article_stub_image_1200x800_3_2/public/2023-11/2023-11-05-I23HIGHLIGHTS_Index-1170x780.jpg?itok=YGWetO3K) Spending proposal means devastating 5th year of Medicare pay cuts  Mar 9, 2025  | 4 Min Read  ](/practice-management/medicare-medicaid/spending-proposal-means-devastating-5th-year-medicare-pay "Spending proposal means devastating 5th year of Medicare pay cuts")

[ ![Bustling hospital corridor](/sites/ama-assn.org/files/styles/related_article_stub_image_1200x800_3_2/public/2025-03/2025-03-03-MPAYSTAFF_Index-1170x780.jpg?itok=34xAl0Q9) Medicare pay cuts: How they endanger physician practices  Mar 10, 2025  | 6 Min Read  ](/practice-management/medicare-medicaid/medicare-pay-cuts-how-they-endanger-physician-practices "Medicare pay cuts: How they endanger physician practices")

[ ![One box marked with a check surrounded by many boxes marked with an x](/sites/ama-assn.org/files/styles/related_article_stub_image_1200x800_3_2/public/2025-03/2025-03-03-PASURVEY25_Index-1170x780.jpg?itok=b3Otr5vr) How AI is leading to more prior authorization denials  Mar 10, 2025  | 6 Min Read  ](/practice-management/prior-authorization/how-ai-leading-more-prior-authorization-denials "How AI is leading to more prior authorization denials")

[ ![Health care team ascending a staircase](/sites/ama-assn.org/files/styles/related_article_stub_image_1200x800_3_2/public/2025-03/2025-02-13-WELLCOMMIT_Index-1170x780.jpg?itok=5EnzLGVv) 7 things Sutter Health did to turn the tide on physician burnout  Mar 11, 2025  | 6 Min Read  ](/practice-management/physician-health/7-things-sutter-health-did-turn-tide-physician-burnout "7 things Sutter Health did to turn the tide on physician burnout")

Also of Interest:

  * [Health Information Technology](https://www.ama-assn.org/topics/health-information-technology)
  * [Substance Use Disorders](https://www.ama-assn.org/topics/substance-use-disorders)
  * [Health Care AI](https://www.ama-assn.org/topics/health-care-ai)



[ ![American Medical Association](/themes/custom/ama_one/images/brand/logo-reversed.svg) ](/ "Home")

The AMA promotes the art and science of medicine and the betterment of public health.

  * [](https://www.facebook.com/AmericanMedicalAssociation)
  * [](https://twitter.com/AmerMedicalAssn)
  * [](https://www.linkedin.com/company/american-medical-association)
  * [](https://www.youtube.com/user/AmerMedicalAssn)
  * [](https://www.instagram.com/amermedicalassn/)

[AMA Contact Us](/form/contact-us)  
[Subscribe to free newsletters from the AMA](/newsletters)

  * [AMA Careers](/about-ama/ama-career-opportunities)
  * [Events](/events)
  * [Press Center](/press-center)


  * [AMA Alliance](https://www.amaalliance.org/)
  * [AMPAC](http://www.ampaconline.org/)
  * [AMA Foundation](https://amafoundation.org)



The best in medicine, delivered to your mailbox

Please enter your email address.

I verify that I’m in the U.S. and agree to receive communication from the AMA or third parties on behalf of AMA.

Explore AMA Products

  * [FREIDA™](https://freida.ama-assn.org/)
  * [CME from AMA Ed Hub™](https://edhub.ama-assn.org/pages/find-cme-keep-current)
  * [AMA Physician Profiles](https://commerce.ama-assn.org/amaprofiles/)
  * [CPT](/practice-management/cpt)
  * [JAMA Network™](https://jamanetwork.com/)
  * [AMA Journal of Ethics®](https://journalofethics.ama-assn.org/home)
  * [Code of Medical Ethics](https://code-medical-ethics.ama-assn.org/)
  * [Store](https://www.ama-assn.org/practice-management/ama-store)
  * [AMA Guides®](https://ama-guides.ama-assn.org/)
  * [GCEP](https://signin.curriculum.ama-assn.org/gcep)



  * [Terms of Use](/about/terms-use "Read the Terms of Use for accessing and using any AMA website or online property. If you do not agree to the Terms, please exit the AMA website.")
  * [Privacy Policy](/about/privacy-policy "The American Medical Association \(AMA\) respects your privacy and is committed to protecting it at all times. ")
  * [Code of Conduct](/about/code-conduct "View the AMA Code of Conduct and Anti-harassment policy. ")
  * [Website Accessibility](/about/accessibility-statement "Read about the American Medical Association's commitment to providing a website that is accessible to all users, including those with disabilities. ")



Copyright 1995 - 2025 American Medical Association. All rights reserved. 


url: https://www.geeksforgeeks.org/binary-search/
title: Binary Search Algorithm - Iterative and Recursive Implementation - GeeksforGeeks
scrape_date: 2025-03-14T13:30:57.348531
content_type: markdown
hash: 96ba374e6e298af997386e9795682b99778cd9c1294fb44f121e318ac5548997
content:
Skip to content [ ![geeksforgeeks](https://media.geeksforgeeks.org/gfg-gg-logo.svg) ](https://www.geeksforgeeks.org/)

  * Courses __
    * [DSA to Development](https://www.geeksforgeeks.org/courses/dsa-to-development-coding-guide?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * [Machine Learning & Data Science](https://www.geeksforgeeks.org/courses/data-science-live?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * [Generative AI & ChatGPT](https://www.geeksforgeeks.org/courses/mastering-generative-ai-and-chat-gpt?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * [Become AWS Certified](https://www.geeksforgeeks.org/courses/search?query=AWS&itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * DSA Courses __
      * [Data Structure& Algorithm(C++/JAVA)](https://www.geeksforgeeks.org/courses/dsa-self-paced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [Data Structure & Algorithm(Python)](https://www.geeksforgeeks.org/courses/Data-Structures-With-Python?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [Data Structure & Algorithm(JavaScript)](https://www.geeksforgeeks.org/courses/data-structures-and-algorithms-in-javascript?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * Programming Languages __
      * [CPP](https://www.geeksforgeeks.org/courses/cpp-programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [Java](https://www.geeksforgeeks.org/courses/Java-Programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [Python](https://www.geeksforgeeks.org/courses/Python-Foundation?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [JavaScript](https://www.geeksforgeeks.org/courses/javascript?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [C](https://www.geeksforgeeks.org/courses/c-Programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * [All Courses](https://www.geeksforgeeks.org/courses?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
  * Tutorials __
    * Python __
      * [Python Tutorial](https://www.geeksforgeeks.org/python-programming-language-tutorial/?ref=outind)
      * [Python Programs](https://www.geeksforgeeks.org/python-programming-examples/?ref=outind)
      * [Python Quiz](https://www.geeksforgeeks.org/python-quizzes/?ref=outind)
      * [Python Projects](https://www.geeksforgeeks.org/python-projects-beginner-to-advanced/?ref=outind)
      * [Python Interview Questions](https://www.geeksforgeeks.org/python-interview-questions/?ref=outind)
      * [Python Data Structures](https://www.geeksforgeeks.org/python-data-structures-and-algorithms/?ref=outind)
    * Java __
      * [Java Tutorial](https://www.geeksforgeeks.org/java/?ref=outind)
      * [Java Collections](https://www.geeksforgeeks.org/collections-in-java-2/?ref=outind)
      * [Java 8 Tutorial](https://www.geeksforgeeks.org/java-8-features/?ref=outind)
      * [Java Programs](https://www.geeksforgeeks.org/java-programming-examples/?ref=outind)
      * [Java Quiz](https://www.geeksforgeeks.org/java-multiple-choice-questions/?ref=outind)
      * [Java Projects](https://www.geeksforgeeks.org/java-projects/?ref=outind)
      * [Java Interview Questions](https://www.geeksforgeeks.org/java-interview-questions/?ref=outind)
      * [Advanced Java](https://www.geeksforgeeks.org/advanced-java/?ref=outind)
    * Programming Languages __
      * [JavaScript](https://www.geeksforgeeks.org/javascript/?ref=outind)
      * [C++](https://www.geeksforgeeks.org/c-plus-plus/?ref=outind)
      * [R Tutorial](https://www.geeksforgeeks.org/r-tutorial/?ref=outind)
      * [SQL](https://www.geeksforgeeks.org/sql-tutorial/?ref=outind)
      * [PHP](https://www.geeksforgeeks.org/php-tutorial/?ref=outind)
      * [C#](https://www.geeksforgeeks.org/csharp-programming-language/?ref=outind)
      * [C](https://www.geeksforgeeks.org/c-programming-language/?ref=outind)
      * [Scala](https://www.geeksforgeeks.org/scala-programming-language/?ref=outind)
      * [Perl](https://www.geeksforgeeks.org/perl-programming-language/?ref=outind)
      * [Go Language](https://www.geeksforgeeks.org/golang/?ref=outind)
      * [Kotlin](https://www.geeksforgeeks.org/kotlin-programming-language/?ref=outind)
    * Interview Corner __
      * [System Design Tutorial](https://www.geeksforgeeks.org/system-design-tutorial/?ref=outind)
      * [Company Preparation](https://www.geeksforgeeks.org/company-preparation/?ref=outind)
      * [Top Topics](https://www.geeksforgeeks.org/interview-preparation-for-software-developer/?ref=outind)
      * [Practice Company Questions](https://practice.geeksforgeeks.org/company-tags/?ref=outind)
      * [Interview Experiences](https://www.geeksforgeeks.org/company-interview-corner/?ref=outind)
      * [Experienced Interviews](https://www.geeksforgeeks.org/experienced-interview-experiences-company-wise/?ref=outind)
      * [Internship Interviews](https://www.geeksforgeeks.org/internship-interview-experiences-company-wise/?ref=outind)
      * [Competitive Programming](https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outind)
      * [Multiple Choice Quizzes](https://www.geeksforgeeks.org/quiz-corner-gq/?ref=outind)
      * [Aptitude for Placements](https://www.geeksforgeeks.org/aptitude-questions-and-answers/?ref=outind)
    * Computer Science Subjects __
      * [Operating System](https://www.geeksforgeeks.org/operating-systems/?ref=outind)
      * [DBMS](https://www.geeksforgeeks.org/dbms/?ref=outind)
      * [Computer Networks](https://www.geeksforgeeks.org/computer-network-tutorials/?ref=outind)
      * [Engineering Mathematics](https://www.geeksforgeeks.org/engineering-mathematics-tutorials/?ref=outind)
      * [Computer Organization and Architecture](https://www.geeksforgeeks.org/computer-organization-and-architecture-tutorials/?ref=outind)
      * [Theory of Computation](https://www.geeksforgeeks.org/theory-of-computation-automata-tutorials/?ref=outind)
      * [Compiler Design](https://www.geeksforgeeks.org/compiler-design-tutorials/?ref=outind)
      * [Digital Logic](https://www.geeksforgeeks.org/digital-electronics-logic-design-tutorials/#blg/?ref=outind)
      * [Software Engineering](https://www.geeksforgeeks.org/software-engineering/?ref=outind)
    * DevOps and Linux __
      * [DevOps Tutorial](https://www.geeksforgeeks.org/devops-tutorial/?ref=ghm)
      * [GIT](https://www.geeksforgeeks.org/git-tutorial/?ref=outind)
      * [AWS](https://www.geeksforgeeks.org/aws-tutorial/?ref=outind)
      * [Docker](https://www.geeksforgeeks.org/docker-tutorial/?ref=outind)
      * [Kubernetes](https://www.geeksforgeeks.org/kubernetes-tutorial/?ref=outind)
      * [Microsoft Azure Tutorial](https://www.geeksforgeeks.org/microsoft-azure/?ref=outind)
      * [Google Cloud Platform](https://www.geeksforgeeks.org/google-cloud-platform-tutorial/?ref=outind)
      * [Linux Tutorial](https://www.geeksforgeeks.org/linux-tutorial/?ref=outind)
    * Software Testing __
      * [Software Testing Tutorial](https://www.geeksforgeeks.org/software-testing-tutorial/?ref=outind)
      * [Software Engineering Tutorial](https://www.geeksforgeeks.org/software-engineering/?ref=outind)
      * [Testing Interview Questions](https://www.geeksforgeeks.org/software-testing-interview-questions/?ref=outind)
      * [Jira](https://www.geeksforgeeks.org/jira-tutorial/?ref=outind)
    * Databases __
      * [DBMS Tutorial](https://www.geeksforgeeks.org/dbms/?ref=outind)
      * [SQL Tutorial](https://www.geeksforgeeks.org/sql-tutorial/?ref=outind)
      * [PostgreSQL Tutorial](https://www.geeksforgeeks.org/postgresql-tutorial/?ref=outind)
      * [MongoDB Tutorial](https://www.geeksforgeeks.org/mongodb-tutorial/?ref=outind)
      * [SQL Interview Questions](https://www.geeksforgeeks.org/sql-interview-questions/?ref=outind)
      * [MySQL Interview Questions](https://www.geeksforgeeks.org/mysql-interview-questions/?ref=outind)
      * [PL/SQL Interview Questions](https://www.geeksforgeeks.org/pl-sql-interview-questions/?ref=outind)
    * Android __
      * [Android Tutorial](https://www.geeksforgeeks.org/android-tutorial/?ref=outind)
      * [Android Studio Tutorial](https://www.geeksforgeeks.org/android-studio-tutorial/?ref=outind)
      * [Kotlin For Android](https://www.geeksforgeeks.org/kotlin-android-tutorial/?ref=outind)
      * [Android Projects](https://www.geeksforgeeks.org/android-projects-from-basic-to-advanced-level/?ref=outind)
      * [Android Interview Questions](https://www.geeksforgeeks.org/top-50-android-interview-questions-answers-sde-i-to-sde-iii/?ref=outind)
      * [6 Weeks of Android App Development](https://www.geeksforgeeks.org/6-weeks-of-android-app-development-free-project-based-learning/?ref=outind)
    * Excel __
      * [MS Excel Tutorial](https://www.geeksforgeeks.org/excel-tutorial/?ref=outind)
      * [Introduction to MS Excel](https://www.geeksforgeeks.org/introduction-to-ms-excel/?ref=outind)
      * [Data Analysis in Excel](https://www.geeksforgeeks.org/data-analysis-in-excel/?ref=outind)
      * [Basic Excel Formulas & Functions](https://www.geeksforgeeks.org/basic-excel-formulas-and-functions/?ref=outind)
      * [Data Analysis in Advanced Excel](https://www.geeksforgeeks.org/instant-data-analysis-in-advanced-excel/?ref=outind)
      * [Workbooks](https://www.geeksforgeeks.org/workbooks-in-microsoft-excel/?ref=outind)
      * [Statistical Functions](https://www.geeksforgeeks.org/statistical-functions-in-excel-with-examples/?ref=outind)
      * [Data Visualization in Excel](https://www.geeksforgeeks.org/data-visualization-in-excel/?ref=outind)
      * [Pivot Tables in Excel](https://www.geeksforgeeks.org/pivot-tables-in-excel/?ref=outind)
      * [Excel Spreadsheets in Python](https://www.geeksforgeeks.org/working-with-excel-spreadsheets-in-python/?ref=outind)
      * [Basic Excel Shortcuts](https://www.geeksforgeeks.org/basic-excel-shortcuts/?ref=outind)
    * Mathematics __
      * [Number System](https://www.geeksforgeeks.org/number-theory/?ref=outind)
      * [Algebra](https://www.geeksforgeeks.org/algebra/?ref=outind)
      * [Linear Algebra](https://www.geeksforgeeks.org/linear-algebra/?ref=outind)
      * [Trigonometry](https://www.geeksforgeeks.org/math-trigonometry/?ref=outind)
      * [Set Theory](https://www.geeksforgeeks.org/set-theory/?ref=outind)
      * [Statistics](https://www.geeksforgeeks.org/statistics/?ref=outind)
      * [Probability](https://www.geeksforgeeks.org/probability-in-maths/?ref=outind)
      * [Geometry](https://www.geeksforgeeks.org/geometry/?ref=outind)
      * [Mensuration](https://www.geeksforgeeks.org/mensuration/?ref=outind)
      * [Logarithms](https://www.geeksforgeeks.org/logarithms/?ref=outind)
      * [Calculus](https://www.geeksforgeeks.org/math-calculus/?ref=outind)
  * DSA __
    * [DSA Tutorial](https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/?ref=outind)
    * Practice __
      * [Practice Coding Problems](https://www.geeksforgeeks.org/geeksforgeeks-practice-best-online-coding-platform/?itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header)
      * [Problem of the Day](https://www.geeksforgeeks.org/problem-of-the-day?itm_source=geeksforgeeksitm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header)
      * [GfG SDE Sheet](https://www.geeksforgeeks.org/explore?page=1&curated\[\]=1&sortBy=submissions&curated_names\[\]=SDE Sheet?itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header)
    * [Competitive Programming](https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outind)
    * Company Wise SDE Sheets __
      * [Facebook SDE Sheet](https://www.geeksforgeeks.org/facebookmeta-sde-sheet-interview-questions-and-answers/?ref=outind)
      * [Amazon SDE Sheet](https://www.geeksforgeeks.org/amazon-sde-sheet-interview-questions-and-answers/?ref=outind)
      * [Apple SDE Sheet](https://www.geeksforgeeks.org/apple-sde-sheet-interview-questions-and-answers/?ref=outind)
      * [Netflix SDE Sheet](https://www.geeksforgeeks.org/netflix-sde-sheet-interview-questions-and-answers/?ref=outind)
      * [Google SDE Sheet](https://www.geeksforgeeks.org/google-sde-sheet-interview-questions-and-answers/?ref=outind)
    * [Top Interview Questions](https://www.geeksforgeeks.org/top-100-data-structure-and-algorithms-dsa-interview-questions-topic-wise/?ref=outind)
    * Puzzles __
      * [All Puzzles](https://www.geeksforgeeks.org/puzzles/?ref=outind)
      * [Top 100 Puzzles Asked In Interviews](https://www.geeksforgeeks.org/top-100-puzzles-asked-in-interviews/?ref=outind)
      * [Top 20 Puzzles Commonly Asked During SDE Interviews](https://www.geeksforgeeks.org/top-20-puzzles-commonly-asked-during-sde-interviews/?ref=outind)
  * Data Science __
    * [Python Tutorial](https://www.geeksforgeeks.org/python-programming-language/?ref=outind)
    * [R Tutorial](https://www.geeksforgeeks.org/r-tutorial/?ref=outind)
    * [Machine Learning](https://www.geeksforgeeks.org/machine-learning/?ref=outind)
    * [Data Science using Python](https://www.geeksforgeeks.org/data-science-with-python-tutorial/?ref=outind)
    * [Data Science using R](https://www.geeksforgeeks.org/r-programming-for-data-science/?ref=outind)
    * Data Science Packages __
      * [Pandas Tutorial](https://www.geeksforgeeks.org/pandas-tutorial/?ref=outind)
      * [NumPy Tutorial](https://www.geeksforgeeks.org/numpy-tutorial/?ref=outind)
    * Data Visualization __
      * [Python Data Visualization Tutorial](https://www.geeksforgeeks.org/python-data-visualization-tutorial/?ref=outind)
      * [Data Visualization with R](https://www.geeksforgeeks.org/data-visualization-in-r/?ref=outind)
    * Data Analysis __
      * [Data Analysis with Python](https://www.geeksforgeeks.org/data-analysis-with-python/?ref=outind)
      * [Data Analysis with R](https://www.geeksforgeeks.org/data-analysis-using-r/?ref=outind)
    * [Deep Learning](https://www.geeksforgeeks.org/deep-learning-tutorial/?ref=outind)
    * [NLP Tutorial](https://www.geeksforgeeks.org/natural-language-processing-nlp-tutorial/?ref=outind)
  * Web Tech __
    * [HTML Tutorial](https://www.geeksforgeeks.org/html-tutorial/?ref=outind)
    * [CSS Tutorial](https://www.geeksforgeeks.org/css-tutorial/?ref=outind)
    * [JavaScript Tutorial](https://www.geeksforgeeks.org/javascript/?ref=outind)
    * [PHP Tutorial](https://www.geeksforgeeks.org/php-tutorial/?ref=outind)
    * [ReactJS Tutorial](https://www.geeksforgeeks.org/react-tutorial/?ref=outind)
    * [NodeJS Tutorial](https://www.geeksforgeeks.org/nodejs/?ref=outind)
    * [Bootstrap Tutorial](https://www.geeksforgeeks.org/bootstrap/?ref=outind)
    * [Typescript](https://www.geeksforgeeks.org/typescript/?ref=outind)
    * Web Development Using Python __
      * [Django Tutorial](https://www.geeksforgeeks.org/django-tutorial/?ref=outind)
      * [Flask Tutorial](https://www.geeksforgeeks.org/flask-tutorial/?ref=outind)
      * [Postman](https://www.geeksforgeeks.org/postman-tutorial/?ref=outind)
      * [Github](https://www.geeksforgeeks.org/introduction-to-github/?ref=outind)
    * Cheat Sheets __
      * [HTML Cheat Sheet](https://www.geeksforgeeks.org/html-cheat-sheet-a-basic-guide-to-html/?ref=outind)
      * [CSS Cheat Sheet](https://www.geeksforgeeks.org/css-cheat-sheet-a-basic-guide-to-css/?ref=outind)
      * [JavaScript Cheat Sheet](https://www.geeksforgeeks.org/javascript-cheat-sheet-a-basic-guide-to-javascript/?ref=outind)
      * [React Cheat Sheet](https://www.geeksforgeeks.org/react-cheat-sheet/?ref=outind)
      * [Angular Cheat Sheet](https://www.geeksforgeeks.org/angular-cheat-sheet-a-basic-guide-to-angular/?ref=outind)
      * [jQuery Cheat Sheet](https://www.geeksforgeeks.org/jquery-cheat-sheet-a-basic-guide-to-jquery/?ref=outind)
      * [Bootstrap Cheat Sheet](https://www.geeksforgeeks.org/bootstrap-cheatsheet-a-basic-guide-to-bootstrap/?ref=outind)
    * [Learn Complete Web Development](https://www.geeksforgeeks.org/web-development/?ref=outind)


  * __ __ __

  * __

  * __
  * 


__

  * [DSA](https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/?ref=shm)
  * [Practice Divide and Conquer](https://www.geeksforgeeks.org/explore?page=1&category=Divide%20and%20Conquer&sortBy=submissions&ref=shm)
  * [MCQs on Divide and Conquer](https://www.geeksforgeeks.org/quizzes/top-mcqs-on-divide-and-conquer-algrithm-with-answers/?ref=shm)
  * [Tutorial on Divide & Conquer](https://www.geeksforgeeks.org/introduction-to-divide-and-conquer-algorithm/?ref=shm)
  * [Binary Search](https://www.geeksforgeeks.org/binary-search/?ref=shm)
  * [Merge Sort](https://www.geeksforgeeks.org/merge-sort/?ref=shm)
  * [Quick Sort](https://www.geeksforgeeks.org/quick-sort-algorithm/?ref=shm)
  * [Calculate Power](https://www.geeksforgeeks.org/write-a-c-program-to-calculate-powxn/?ref=shm)
  * [Strassen's Matrix Multiplication](https://www.geeksforgeeks.org/strassens-matrix-multiplication/?ref=shm)
  * [Karatsuba Algorithm](https://www.geeksforgeeks.org/karatsuba-algorithm-for-fast-multiplication-using-divide-and-conquer-algorithm/?ref=shm)
  * [Divide and Conquer Optimization](https://www.geeksforgeeks.org/divide-and-conquer-optimization-in-dynamic-programming/?ref=shm)
  * [Closest Pair of Points](https://www.geeksforgeeks.org/closest-pair-of-points-using-divide-and-conquer-algorithm/?ref=shm)

__

▲

[ Open In App ](https://geeksforgeeksapp.page.link/?link=https://www.geeksforgeeks.org/binary-search/?type%3Darticle%26id%3D142311&apn=free.programming.programming&isi=1641848816&ibi=org.geeksforgeeks.GeeksforGeeksDev&efr=1)

[ Next Article: Sentinel Linear Search ![Next article icon](https://media.geeksforgeeks.org/auth-dashboard-uploads/ep_right.svg) ](https://www.geeksforgeeks.org/sentinel-linear-search/?ref=next_article_top)

# Binary Search Algorithm - Iterative and Recursive Implementation

Last Updated :  19 Feb, 2025

Summarize

__

Comments

__

Improve

__

  *   *   * 


__ Suggest changes

Like Article

__ Like

__ Share

__ Report

[ ![News](https://media.geeksforgeeks.org/auth-dashboard-uploads/Google-news.svg) Follow ](https://news.google.com/publications/CAAqBwgKMLTrzwsw44bnAw?hl=en-IN&gl=IN&ceid=IN%3Aen)

[ Try it on GfG Practice ![redirect icon](https://media.geeksforgeeks.org/auth-dashboard-uploads/Group-arrow.svg) ](https://www.geeksforgeeks.org/problems/binary-search-1587115620/1?itm_source=geeksforgeeks&itm_medium=article&itm_campaign=practice_card)

****Binary Search**** ****Algorithm**** is a [searching algorithm](https://www.geeksforgeeks.org/searching-algorithms/) used in a sorted array by ****repeatedly dividing the search interval in half****. The idea of binary search is to use the information that the array is sorted and reduce the time complexity to O(log N). 

![binnary-search-](https://media.geeksforgeeks.org/wp-content/uploads/20240506155201/binnary-search-.webp)

Binary Search Algorithm

Table of Content

  * What is Binary Search Algorithm?
  * Conditions to apply Binary Search Algorithm in a Data Structure
  * Binary Search Algorithm
  * How does Binary Search Algorithm work?
  * How to Implement Binary Search Algorithm?
    * Iterative Binary Search Algorithm:
    * Recursive Binary Search Algorithm:
  * Complexity Analysis of Binary Search Algorithm
  * Applications of Binary Search Algorithm
  * Advantages of Binary Search
  * Disadvantages of Binary Search
  * Frequently Asked Questions(FAQs) on Binary Search



## What is Binary Search Algorithm?

****Binary search**** is a search algorithm used to find the position of a target value within a ****sorted**** array. It works by repeatedly dividing the search interval in half until the target value is found or the interval is empty. The search interval is halved by comparing the target element with the middle value of the search space.

## Conditions to apply Binary Search Algorithm in a Data Structure

To apply Binary Search algorithm:

  * The data structure must be sorted.
  * Access to any element of the data structure should take constant time.



## Binary Search Algorithm

Below is the step-by-step algorithm for Binary Search:

  * Divide the search space into two halves by [****finding the middle index "mid"****](https://www.geeksforgeeks.org/problem-binary-search-implementations/). 
  * Compare the middle element of the search space with the ****key****. 
  * If the ****key**** is found at middle element, the process is terminated.
  * If the ****key**** is not found at middle element, choose which half will be used as the next search space.
    * If the ****key**** is smaller than the middle element, then the ****left**** side is used for next search.
    * If the ****key**** is larger than the middle element, then the ****right**** side is used for next search.
  * This process is continued until the ****key**** is found or the total search space is exhausted.



## Binary Search Visualizer

## How does Binary Search Algorithm work?

To understand the working of binary search, consider the following illustration:

Consider an array ****arr[] = {2, 5, 8, 12, 16, 23, 38, 56, 72, 91}**** , and the ****target = 23****.  


  


## How to Implement Binary Search Algorithm?

The ****Binary Search Algorithm**** can be implemented in the following two ways

  * Iterative Binary Search Algorithm
  * Recursive Binary Search Algorithm



Given below are the pseudocodes for the approaches.

### ****Iterative Binary Search Algorithm:****

> Here we use a while loop to continue the process of comparing the key and splitting the search space in two halves.

C++ `
    
    
    // C++ program to implement iterative Binary Search
    #include <bits/stdc++.h>
    using namespace std;
    
    // An iterative binary search function.
    int binarySearch(int arr[], int low, int high, int x)
    {
        while (low <= high) {
            int mid = low + (high - low) / 2;
    
            // Check if x is present at mid
            if (arr[mid] == x)
                return mid;
    
            // If x greater, ignore left half
            if (arr[mid] < x)
                low = mid + 1;
    
            // If x is smaller, ignore right half
            else
                high = mid - 1;
        }
    
        // If we reach here, then element was not present
        return -1;
    }
    
    // Driver code
    int main(void)
    {
        int arr[] = { 2, 3, 4, 10, 40 };
        int x = 10;
        int n = sizeof(arr) / sizeof(arr[0]);
        int result = binarySearch(arr, 0, n - 1, x);
        if(result == -1) cout << "Element is not present in array";
        else cout << "Element is present at index " << result;
        return 0;
    }
    

` C `
    
    
    // C program to implement iterative Binary Search
    #include <stdio.h>
    
    // An iterative binary search function.
    int binarySearch(int arr[], int low, int high, int x)
    {
        while (low <= high) {
            int mid = low + (high - low) / 2;
    
            // Check if x is present at mid
            if (arr[mid] == x)
                return mid;
    
            // If x greater, ignore left half
            if (arr[mid] < x)
                low = mid + 1;
    
            // If x is smaller, ignore right half
            else
                high = mid - 1;
        }
    
        // If we reach here, then element was not present
        return -1;
    }
    
    // Driver code
    int main(void)
    {
        int arr[] = { 2, 3, 4, 10, 40 };
        int n = sizeof(arr) / sizeof(arr[0]);
        int x = 10;
        int result = binarySearch(arr, 0, n - 1, x);
       if(result == -1) printf("Element is not present in array");
       else printf("Element is present at index %d",result);
    
    }
    

` Java `
    
    
    // Java implementation of iterative Binary Search
    
    import java.io.*;
    
    class BinarySearch {
      
        // Returns index of x if it is present in arr[].
        int binarySearch(int arr[], int x)
        {
            int low = 0, high = arr.length - 1;
            while (low <= high) {
                int mid = low + (high - low) / 2;
    
                // Check if x is present at mid
                if (arr[mid] == x)
                    return mid;
    
                // If x greater, ignore left half
                if (arr[mid] < x)
                    low = mid + 1;
    
                // If x is smaller, ignore right half
                else
                    high = mid - 1;
            }
    
            // If we reach here, then element was
            // not present
            return -1;
        }
    
        // Driver code
        public static void main(String args[])
        {
            BinarySearch ob = new BinarySearch();
            int arr[] = { 2, 3, 4, 10, 40 };
            int n = arr.length;
            int x = 10;
            int result = ob.binarySearch(arr, x);
            if (result == -1)
                System.out.println(
                    "Element is not present in array");
            else
                System.out.println("Element is present at "
                                   + "index " + result);
        }
    }
    

` Python `
    
    
    # Python3 code to implement iterative Binary
    # Search.
    
    
    # It returns location of x in given array arr
    def binarySearch(arr, low, high, x):
    
        while low <= high:
    
            mid = low + (high - low) // 2
    
            # Check if x is present at mid
            if arr[mid] == x:
                return mid
    
            # If x is greater, ignore left half
            elif arr[mid] < x:
                low = mid + 1
    
            # If x is smaller, ignore right half
            else:
                high = mid - 1
    
        # If we reach here, then the element
        # was not present
        return -1
    
    
    # Driver Code
    if __name__ == '__main__':
        arr = [2, 3, 4, 10, 40]
        x = 10
    
        # Function call
        result = binarySearch(arr, 0, len(arr)-1, x)
        if result != -1:
            print("Element is present at index", result)
        else:
            print("Element is not present in array")
    

` C# `
    
    
    // C# implementation of iterative Binary Search
    using System;
    
    class GFG {
        
        // Returns index of x if it is present in arr[]
        static int binarySearch(int[] arr, int x)
        {
            int low = 0, high = arr.Length - 1;
            while (low <= high) {
                int mid = low + (high - low) / 2;
    
                // Check if x is present at mid
                if (arr[mid] == x)
                    return mid;
    
                // If x greater, ignore left half
                if (arr[mid] < x)
                    low = mid + 1;
    
                // If x is smaller, ignore right half
                else
                    high = mid - 1;
            }
    
            // If we reach here, then element was
            // not present
            return -1;
        }
    
        // Driver code
        public static void Main()
        {
            int[] arr = { 2, 3, 4, 10, 40 };
            int n = arr.Length;
            int x = 10;
            int result = binarySearch(arr, x);
            if (result == -1)
                Console.WriteLine(
                    "Element is not present in array");
            else
                Console.WriteLine("Element is present at "
                                  + "index " + result);
        }
    }
    

` JavaScript `
    
    
    // Program to implement iterative Binary Search
    
    // A iterative binary search function. It returns
    // location of x in given array arr[l..r] is present,
    // otherwise -1
    
    function binarySearch(arr, x)
    {
        let low = 0;
        let high = arr.length - 1;
        let mid;
        while (high >= low) {
            mid = low + Math.floor((high - low) / 2);
    
            // If the element is present at the middle
            // itself
            if (arr[mid] == x)
                return mid;
    
            // If element is smaller than mid, then
            // it can only be present in left subarray
            if (arr[mid] > x)
                high = mid - 1;
    
            // Else the element can only be present
            // in right subarray
            else
                low = mid + 1;
        }
    
        // We reach here when element is not
        // present in array
        return -1;
    }
    
    arr = new Array(2, 3, 4, 10, 40);
    x = 10;
    n = arr.length;
    result = binarySearch(arr, x);
    if (result == -1)
        console.log("Element is not present in array")
        else
        {
            console.log("Element is present at index "
                        + result);
        }
    

` PHP `
    
    
    <?php
    // PHP program to implement
    // iterative Binary Search
    
    // An iterative binary search 
    // function
    function binarySearch($arr, $low, 
                          $high, $x)
    {
        while ($low <= $high)
        {
            $mid = $low + ($high - $low) / 2;
    
            // Check if x is present at mid
            if ($arr[$mid] == $x)
                return floor($mid);
    
            // If x greater, ignore
            // left half
            if ($arr[$mid] < $x)
                $low = $mid + 1;
    
            // If x is smaller, 
            // ignore right half
            else
                $high = $mid - 1;
        }
    
        // If we reach here, then 
        // element was not present
        return -1;
    }
    
    // Driver Code
    $arr = array(2, 3, 4, 10, 40);
    $n = count($arr);
    $x = 10;
    $result = binarySearch($arr, 0, 
                           $n - 1, $x);
    if(($result == -1))
    echo "Element is not present in array";
    else
    echo "Element is present at index ", 
                                $result;
    
    ?>
    

`

  
**Output**
    
    
    Element is present at index 3

****Time Complexity:**** O(log N)  
****Auxiliary Space:**** O(1)

### ****Recursive Binary Search Algorithm:****

> Create a recursive function and compare the mid of the search space with the key. And based on the result either return the index where the key is found or call the recursive function for the next search space.

C++ `
    
    
    #include <bits/stdc++.h>
    using namespace std;
    
    // A recursive binary search function. It returns
    // location of x in given array arr[low..high] is present,
    // otherwise -1
    int binarySearch(int arr[], int low, int high, int x)
    {
        if (high >= low) {
            int mid = low + (high - low) / 2;
    
            // If the element is present at the middle
            // itself
            if (arr[mid] == x)
                return mid;
    
            // If element is smaller than mid, then
            // it can only be present in left subarray
            if (arr[mid] > x)
                return binarySearch(arr, low, mid - 1, x);
    
            // Else the element can only be present
            // in right subarray
            return binarySearch(arr, mid + 1, high, x);
        }
      return -1;
    }
    
    // Driver code
    int main()
    {
        int arr[] = { 2, 3, 4, 10, 40 };
        int query = 90;
        int n = sizeof(arr) / sizeof(arr[0]);
        int result = binarySearch(arr, 0, n - 1, query);
        if (result == -1) cout << "Element is not present in array";
        else cout << "Element is present at index " << result;
        return 0;
    }
    

` C `
    
    
    // C program to implement recursive Binary Search
    #include <stdio.h>
    
    // A recursive binary search function. It returns
    // location of x in given array arr[low..high] is present,
    // otherwise -1
    int binarySearch(int arr[], int low, int high, int x)
    {
        if (high >= low) {
            int mid = low + (high - low) / 2;
    
            // If the element is present at the middle
            // itself
            if (arr[mid] == x)
                return mid;
    
            // If element is smaller than mid, then
            // it can only be present in left subarray
            if (arr[mid] > x)
                return binarySearch(arr, low, mid - 1, x);
    
            // Else the element can only be present
            // in right subarray
            return binarySearch(arr, mid + 1, high, x);
        }
    
        // We reach here when element is not
        // present in array
        return -1;
    }
    
    // Driver code
    int main()
    {
        int arr[] = { 2, 3, 4, 10, 40 };
        int n = sizeof(arr) / sizeof(arr[0]);
        int x = 10;
        int result = binarySearch(arr, 0, n - 1, x);
        if (result == -1) printf("Element is not present in array");
        else printf("Element is present at index %d", result);
        return 0;
    }
    

` Java `
    
    
    // Java implementation of recursive Binary Search
    class BinarySearch {
    
        // Returns index of x if it is present in arr[low..
        // high], else return -1
        int binarySearch(int arr[], int low, int high, int x)
        {
            if (high >= low) {
                int mid = low + (high - low) / 2;
    
                // If the element is present at the
                // middle itself
                if (arr[mid] == x)
                    return mid;
    
                // If element is smaller than mid, then
                // it can only be present in left subarray
                if (arr[mid] > x)
                    return binarySearch(arr, low, mid - 1, x);
    
                // Else the element can only be present
                // in right subarray
                return binarySearch(arr, mid + 1, high, x);
            }
    
            // We reach here when element is not present
            // in array
            return -1;
        }
    
        // Driver code
        public static void main(String args[])
        {
            BinarySearch ob = new BinarySearch();
            int arr[] = { 2, 3, 4, 10, 40 };
            int n = arr.length;
            int x = 10;
            int result = ob.binarySearch(arr, 0, n - 1, x);
            if (result == -1)
                System.out.println(
                    "Element is not present in array");
            else
                System.out.println(
                    "Element is present at index " + result);
        }
    }
    

` Python `
    
    
    # Python3 Program for recursive binary search.
    
    
    # Returns index of x in arr if present, else -1
    def binarySearch(arr, low, high, x):
    
        # Check base case
        if high >= low:
    
            mid = low + (high - low) // 2
    
            # If element is present at the middle itself
            if arr[mid] == x:
                return mid
    
            # If element is smaller than mid, then it
            # can only be present in left subarray
            elif arr[mid] > x:
                return binarySearch(arr, low, mid-1, x)
    
            # Else the element can only be present
            # in right subarray
            else:
                return binarySearch(arr, mid + 1, high, x)
    
        # Element is not present in the array
        else:
            return -1
    
    
    # Driver Code
    if __name__ == '__main__':
        arr = [2, 3, 4, 10, 40]
        x = 10
        
        # Function call
        result = binarySearch(arr, 0, len(arr)-1, x)
        
        if result != -1:
            print("Element is present at index", result)
        else:
            print("Element is not present in array")
    

` C# `
    
    
    // C# implementation of recursive Binary Search
    using System;
    
    class GFG {
    
        // Returns index of x if it is present in
        // arr[low..high], else return -1
        static int binarySearch(int[] arr, int low, int high, int x)
        {
            if (high >= low) {
                int mid = low + (high - low) / 2;
    
                // If the element is present at the
                // middle itself
                if (arr[mid] == x)
                    return mid;
    
                // If element is smaller than mid, then
                // it can only be present in left subarray
                if (arr[mid] > x)
                    return binarySearch(arr, low, mid - 1, x);
    
                // Else the element can only be present
                // in right subarray
                return binarySearch(arr, mid + 1, high, x);
            }
    
            // We reach here when element is not present
            // in array
            return -1;
        }
    
        // Driver code
        public static void Main()
        {
    
            int[] arr = { 2, 3, 4, 10, 40 };
            int n = arr.Length;
            int x = 10;
    
            int result = binarySearch(arr, 0, n - 1, x);
    
            if (result == -1)
                Console.WriteLine(
                    "Element is not present in arrau");
            else
                Console.WriteLine("Element is present at index "
                                  + result);
        }
    }
    

` JavaScript `
    
    
    // JavaScript program to implement recursive Binary Search
    
    // A recursive binary search function. It returns
    // location of x in given array arr[low..high] is present,
    // otherwise -1
    function binarySearch(arr, low, high, x)
    {
        if (high >= low) {
            let mid = low + Math.floor((high - low) / 2);
    
            // If the element is present at the middle
            // itself
            if (arr[mid] == x)
                return mid;
    
            // If element is smaller than mid, then
            // it can only be present in left subarray
            if (arr[mid] > x)
                return binarySearch(arr, low, mid - 1, x);
    
            // Else the element can only be present
            // in right subarray
            return binarySearch(arr, mid + 1, high, x);
        }
    
        // We reach here when element is not
        // present in array
        return -1;
    }
    
    let arr = [ 2, 3, 4, 10, 40 ];
    let x = 10;
    let n = arr.length
    let result = binarySearch(arr, 0, n - 1, x);
    if (result == -1)
        console.log("Element is not present in array");
    else
        console.log("Element is present at index " + result);
    

` PHP `
    
    
    <?php
    // PHP program to implement
    // recursive Binary Search
    
    // A recursive binary search
    // function. It returns location
    // of x in given array arr[low..high] 
    // is present, otherwise -1
    function binarySearch($arr, $low, $high, $x)
    {
    if ($high >= $low)
    {
            $mid = ceil($low + ($high - $low) / 2);
    
            // If the element is present 
            // at the middle itself
            if ($arr[$mid] == $x) 
                return floor($mid);
    
            // If element is smaller than 
            // mid, then it can only be 
            // present in left subarray
            if ($arr[$mid] > $x) 
                return binarySearch($arr, $low, 
                                    $mid - 1, $x);
    
            // Else the element can only 
            // be present in right subarray
            return binarySearch($arr, $mid + 1, 
                                $high, $x);
    }
    
    // We reach here when element 
    // is not present in array
    return -1;
    }
    
    // Driver Code
    $arr = array(2, 3, 4, 10, 40);
    $n = count($arr);
    $x = 10;
    $result = binarySearch($arr, 0, $n - 1, $x);
    if(($result == -1))
    echo "Element is not present in array";
    else
    echo "Element is present at index ",
                                $result;
                              
    ?>
    

`

  
**Output**
    
    
    Element is present at index 3

## [Complexity Analysis of Binary Search Algorithm](https://www.geeksforgeeks.org/complexity-analysis-of-binary-search/)

  * ****Time Complexity:****  
    * Best Case: O(1)
    * Average Case: O(log N)
    * Worst Case: O(log N)
  * ****Auxiliary Space:**** O(1), If the recursive call stack is considered then the auxiliary space will be O(logN).



## [****Applications of Binary Search Algorithm****](https://www.geeksforgeeks.org/applications-advantages-and-disadvantages-of-binary-search/)

  * Binary search can be used as a building block for more complex algorithms used in machine learning, such as algorithms for training neural networks or finding the optimal hyperparameters for a model.
  * It can be used for searching in computer graphics such as algorithms for ray tracing or texture mapping.
  * It can be used for searching a database.



## ****Advantages of Binary Search****

  * Binary search is faster than linear search, especially for large arrays.
  * More efficient than other searching algorithms with a similar time complexity, such as interpolation search or exponential search.
  * Binary search is well-suited for searching large datasets that are stored in external memory, such as on a hard drive or in the cloud.



## ****Disadvantages of Binary Search****

  * The array should be sorted.
  * Binary search requires that the data structure being searched be stored in contiguous memory locations. 
  * Binary search requires that the elements of the array be comparable, meaning that they must be able to be ordered.



## Frequently Asked Questions(FAQs) on Binary Search

### 1\. What is Binary Search?

> Binary search is an efficient algorithm for finding a target value within a sorted array. It works by repeatedly dividing the search interval in half.

### 2\. How does Binary Search work?

> Binary Search compares the target value to the middle element of the array. If they are equal, the search is successful. If the target is less than the middle element, the search continues in the lower half of the array. If the target is greater, the search continues in the upper half. This process repeats until the target is found or the search interval is empty.

### 3\. What is the time complexity of Binary Search?

> The time complexity of binary search is O(log2n), where n is the number of elements in the array. This is because the size of the search interval is halved in each step.

### 4\. What are the prerequisites for Binary Search?

> Binary search requires that the array is sorted in ascending or descending order. If the array is not sorted, we cannot use Binary Search to search an element in the array.

### 5\. What happens if the array is not sorted for binary search?

> If the array is not sorted, binary search may return incorrect results. It relies on the sorted nature of the array to make decisions about which half of the array to search.

### 6\. Can binary search be applied to non-numeric data?

> Yes, binary search can be applied to non-numeric data as long as there is a defined order for the elements. For example, it can be used to search for strings in alphabetical order.

### 7\. What are some common disadvantages of Binary Search?

> The disadvantage of Binary Search is that the input array needs to be sorted to decide which in which half the target element can lie. Therefore for unsorted arrays, we need to sort the array before applying Binary Search.

### 8\. When should Binary Search be used?

> Binary search should be used when searching for a target value in a sorted array, especially when the size of the array is large. It is particularly efficient for large datasets compared to linear search algorithms.

### 9\. Can binary search be implemented recursively?

> Yes, binary search can be implemented both iteratively and recursively. The recursive implementation often leads to more concise code but may have slightly higher overhead due to recursive stack space or function calls.

### 10\. Is Binary Search always the best choice for searching in a sorted array?

> While binary search is very efficient for searching in sorted arrays, there may be specific cases where other search algorithms are more appropriate, such as when dealing with small datasets or when the array is frequently modified.

****Related Articles:****

  * [Binary Search on Answer Tutorial with Problems](https://www.geeksforgeeks.org/binary-search-on-answer-tutorial-with-problems/)
  * [Linear Search vs Binary Search](https://www.geeksforgeeks.org/linear-search-vs-binary-search/)
  * [How to Identify & Solve Binary Search Problems?](https://www.geeksforgeeks.org/binary-search-identify-solve-and-interview-questions/)

  


  


__ Comment 

More info

[Advertise with us](https://www.geeksforgeeks.org/about/contact-us/?listicles)

[ Next Article ](https://www.geeksforgeeks.org/sentinel-linear-search/?ref=next_article)

[Sentinel Linear Search](https://www.geeksforgeeks.org/sentinel-linear-search/?ref=next_article)

[![author](https://media.geeksforgeeks.org/auth/profile/sb7ciorr5k5t22woqkes) __ ](https://www.geeksforgeeks.org/user/kartik/contributions/?itm_source=geeksforgeeks&itm_medium=article_author&itm_campaign=auth_user)

[kartik](https://www.geeksforgeeks.org/user/kartik/contributions/?itm_source=geeksforgeeks&itm_medium=article_author&itm_campaign=auth_user)

Follow

[ ![News](https://media.geeksforgeeks.org/auth-dashboard-uploads/Google-news.svg) ](https://news.google.com/publications/CAAqBwgKMLTrzwsw44bnAw?hl=en-IN&gl=IN&ceid=IN%3Aen)

__

Improve __

Article Tags : 

  * [Divide and Conquer](https://www.geeksforgeeks.org/category/dsa/algorithm/divide-and-conquer/?ref=article_category)
  * [DSA](https://www.geeksforgeeks.org/category/dsa/?ref=article_category)
  * [Searching](https://www.geeksforgeeks.org/category/dsa/algorithm/searching/?ref=article_category)
  * [Accenture](https://www.geeksforgeeks.org/tag/accenture/?ref=article_tag)
  * [Binary Search](https://www.geeksforgeeks.org/tag/binary-search/?ref=article_tag)
  * [DSA Tutorials](https://www.geeksforgeeks.org/tag/dsa-tutorials/?ref=article_tag)
  * [Infosys](https://www.geeksforgeeks.org/tag/infosys/?ref=article_tag)
  * [Oracle](https://www.geeksforgeeks.org/tag/oracle/?ref=article_tag)
  * [Qualcomm](https://www.geeksforgeeks.org/tag/qualcomm/?ref=article_tag)
  * [SAP Labs](https://www.geeksforgeeks.org/tag/sap-labs/?ref=article_tag)
  * [TCS](https://www.geeksforgeeks.org/tag/tcs/?ref=article_tag)
  * [Wipro](https://www.geeksforgeeks.org/tag/wipro/?ref=article_tag)

+8 More

Practice Tags : 

  * [Accenture](https://www.geeksforgeeks.org/explore?company=Accenture&ref=article_practice_tag)
  * [Infosys](https://www.geeksforgeeks.org/explore?company=Infosys&ref=article_practice_tag)
  * [Oracle](https://www.geeksforgeeks.org/explore?company=Oracle&ref=article_practice_tag)
  * [Qualcomm](https://www.geeksforgeeks.org/explore?company=Qualcomm&ref=article_practice_tag)
  * [SAP Labs](https://www.geeksforgeeks.org/explore?company=SAP Labs&ref=article_practice_tag)
  * [TCS](https://www.geeksforgeeks.org/explore?company=TCS&ref=article_practice_tag)
  * [Wipro](https://www.geeksforgeeks.org/explore?company=Wipro&ref=article_practice_tag)
  * [Binary Search](https://www.geeksforgeeks.org/explore?category=Binary Search&ref=article_practice_tag)
  * [Divide and Conquer](https://www.geeksforgeeks.org/explore?category=Divide and Conquer&ref=article_practice_tag)
  * [Searching](https://www.geeksforgeeks.org/explore?category=Searching&ref=article_practice_tag)

+6 More

### Similar Reads

  * [ Searching Algorithms  Searching algorithms are essential tools in computer science used to locate specific items within a collection of data. These algorithms are designed to efficiently navigate through data structures to find the desired information, making them fundamental in various applications such as databases, we __ 2 min read ](https://www.geeksforgeeks.org/searching-algorithms/?ref=lbp)

## Most Common Searching Algorithms

    * [ Linear Search Algorithm  Given an array, arr of n integers, and an integer element x, find whether element x is present in the array. Return the index of the first occurrence of x in the array, or -1 if it doesn't exist. Input: arr[] = [1, 2, 3, 4], x = 3Output: 2Explanation: There is one test case with array as [1, 2, 3 4] __ 9 min read ](https://www.geeksforgeeks.org/linear-search/?ref=lbp)

* * *

    * [ Binary Search Algorithm - Iterative and Recursive Implementation  Binary Search Algorithm is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half. The idea of binary search is to use the information that the array is sorted and reduce the time complexity to O(log N). Table of Content What is Binary Search Algorithm?Condit __ 15+ min read ](https://www.geeksforgeeks.org/binary-search/?ref=lbp)

* * *

## Other Searching Algorithms

    * [ Sentinel Linear Search  Sentinel Linear Search as the name suggests is a type of Linear Search where the number of comparisons is reduced as compared to a traditional linear search. In a traditional linear search, only N comparisons are made, and in a Sentinel Linear Search, the sentinel value is used to avoid any out-of-b __ 7 min read ](https://www.geeksforgeeks.org/sentinel-linear-search/?ref=lbp)

* * *

    * [ Meta Binary Search | One-Sided Binary Search  Meta binary search (also called one-sided binary search by Steven Skiena in The Algorithm Design Manual on page 134) is a modified form of binary search that incrementally constructs the index of the target value in the array. Like normal binary search, meta binary search takes O(log n) time. Meta B __ 9 min read ](https://www.geeksforgeeks.org/meta-binary-search-one-sided-binary-search/?ref=lbp)

* * *

    * [ Ternary Search  Computer systems use different methods to find specific data. There are various search algorithms, each better suited for certain situations. For instance, a binary search divides information into two parts, while a ternary search does the same but into three equal parts. It's worth noting that tern __ 15+ min read ](https://www.geeksforgeeks.org/ternary-search/?ref=lbp)

* * *

    * [ Jump Search  Like Binary Search, Jump Search is a searching algorithm for sorted arrays. The basic idea is to check fewer elements (than linear search) by jumping ahead by fixed steps or skipping some elements in place of searching all elements.For example, suppose we have an array arr[] of size n and a block (t __ 11 min read ](https://www.geeksforgeeks.org/jump-search/?ref=lbp)

* * *

    * [ Interpolation Search  Given a sorted array of n uniformly distributed values arr[], write a function to search for a particular element x in the array. Linear Search finds the element in O(n) time, Jump Search takes O(n) time and Binary Search takes O(log n) time. The Interpolation Search is an improvement over Binary Se __ 15+ min read ](https://www.geeksforgeeks.org/interpolation-search/?ref=lbp)

* * *

    * [ Exponential Search  The name of this searching algorithm may be misleading as it works in O(Log n) time. The name comes from the way it searches an element. Given a sorted array, and an element x to be searched, find position of x in the array. Input: arr[] = {10, 20, 40, 45, 55} x = 45Output: Element found at index 3I __ 15+ min read ](https://www.geeksforgeeks.org/exponential-search/?ref=lbp)

* * *

    * [ Fibonacci Search  Given a sorted array arr[] of size n and an element x to be searched in it. Return index of x if it is present in array else return -1.Â Examples:Â  Input: Â arr[] = {2, 3, 4, 10, 40}, x = 10Output:Â  3Element x is present at index 3. Input:Â  arr[] = {2, 3, 4, 10, 40}, x = 11Output: Â -1Element x is not __ 15+ min read ](https://www.geeksforgeeks.org/fibonacci-search/?ref=lbp)

* * *

    * [ The Ubiquitous Binary Search | Set 1  We are aware of the binary search algorithm. Binary search isÂ the easiest algorithm to get right. I present some interesting problems that I collected on binary search. There were some requests on binary search. I request you to honor the code, "I sincerely attempt to solve the problem and ensure th __ 15+ min read ](https://www.geeksforgeeks.org/the-ubiquitous-binary-search-set-1/?ref=lbp)

* * *

## Comparisons between Searching Algorithms

    * [ Linear Search vs Binary Search  Prerequisite: Linear SearchBinary SearchLINEAR SEARCH Assume that item is in an array in random order and we have to find an item. Then the only way to search for a target item is, to begin with, the first position and compare it to the target. If the item is at the same, we will return the position __ 11 min read ](https://www.geeksforgeeks.org/linear-search-vs-binary-search/?ref=lbp)

* * *

    * [ Interpolation search vs Binary search  Interpolation search works better than Binary Search for a Sorted and Uniformly Distributed array. Binary Search goes to the middle element to check irrespective of search-key. On the other hand, Interpolation Search may go to different locations according to search-key. If the value of the search-k __ 7 min read ](https://www.geeksforgeeks.org/g-fact-84/?ref=lbp)

* * *

    * [ Why is Binary Search preferred over Ternary Search?  The following is a simple recursive Binary Search function in C++ taken from here. C/C++ Code // CPP program for the above approach #include <bits/stdc++.h> using namespace std; // A recursive binary search function. It returns location of x in // given array arr[l..r] is present, otherwise -1 __ 11 min read ](https://www.geeksforgeeks.org/binary-search-preferred-ternary-search/?ref=lbp)

* * *

    * [ Is Sentinel Linear Search better than normal Linear Search?  Sentinel Linear search is a type of linear search where the element to be searched is placed in the last position and then all the indices are checked for the presence of the element without checking for the index out of bound case. The number of comparisons is reduced in this search as compared to __ 8 min read ](https://www.geeksforgeeks.org/is-sentinel-linear-search-better-than-normal-linear-search/?ref=lbp)

* * *

## Library implementations of Searching algorithms

    * [ Binary Search functions in C++ STL (binary_search, lower_bound and upper_bound)  In C++, STL provide various functions like std::binary_search(), std::lower_bound(), and std::upper_bound() which uses the the binary search algorithm for different purposes. These function will only work on the sorted data. There are the 3 binary search function in C++ STL: Table of Content binary_ __ 3 min read ](https://www.geeksforgeeks.org/binary-search-functions-in-c-stl-binary_search-lower_bound-and-upper_bound/?ref=lbp)

* * *

    * [ Arrays.binarySearch() in Java with Examples | Set 1  In Java, the Arrays.binarySearch() method searches the specified array of the given data type for the specified value using the binary search algorithm. The array must be sorted by the Arrays.sort() method before making this call. If it is not sorted, the results are undefined. Example: Below is a s __ 3 min read ](https://www.geeksforgeeks.org/arrays-binarysearch-java-examples-set-1/?ref=lbp)

* * *

    * [ Arrays.binarySearch() in Java with examples | Set 2 (Search in subarray)  Arrays.binarySearch()| Set 1 Covers how to find an element in a sorted array in Java. This set will cover "How to Search a key in an array within a given range including only start index". Syntax : public static int binarySearch(data_type[] arr, int fromIndex, int toIndex, data_type key) Parameters __ 5 min read ](https://www.geeksforgeeks.org/arrays-binarysearch-in-java-with-examples-set-2-search-in-subarray/?ref=lbp)

* * *

    * [ Collections.binarySearch() in Java with Examples  java.util.Collections.binarySearch() method is a java.util.Collections class method that returns the position of an object in a sorted list. // Returns index of key in a sorted list sorted in// ascending orderpublic static int binarySearch(List slist, T key)// Returns index of key in a sorted list s __ 4 min read ](https://www.geeksforgeeks.org/collections-binarysearch-java-examples/?ref=lbp)

* * *

## Easy problems on Searching algorithms

    * [ Find the Missing Number  Given an array arr[] of size n-1 with distinct integers in the range of [1, n]. This array represents a permutation of the integers from 1 to n with one element missing. Find the missing element in the array. Examples: Input: arr[] = [1, 2, 4, 6, 3, 7, 8] Output: 5Explanation: Here the size of the a __ 13 min read ](https://www.geeksforgeeks.org/find-the-missing-number/?ref=lbp)

* * *

    * [ Find the first repeating element in an array of integers  Given an array of integers arr[], The task is to find the index of first repeating element in it i.e. the element that occurs more than once and whose index of the first occurrence is the smallest. Examples: Input: arr[] = {10, 5, 3, 4, 3, 5, 6}Output: 5 Explanation: 5 is the first element that repe __ 8 min read ](https://www.geeksforgeeks.org/find-first-repeating-element-array-integers/?ref=lbp)

* * *

    * [ Missing and Repeating in an Array  Given an unsorted array of size n. Array elements are in the range of 1 to n. One number from set {1, 2, ...n} is missing and one number occurs twice in the array. The task is to find these two numbers. Examples: Input: arr[] = {3, 1, 3}Output: 3, 2Explanation: In the array, 2 is missing and 3 occur __ 15+ min read ](https://www.geeksforgeeks.org/find-a-repeating-and-a-missing-number/?ref=lbp)

* * *

    * [ Count 1's in a sorted binary array  Given a binary array arr[] of size n, which is sorted in non-increasing order, count the number of 1's in it. Examples: Input: arr[] = [1, 1, 0, 0, 0, 0, 0]Output: 2Explanation: Count of the 1's in the given array is 2. Input: arr[] = [1, 1, 1, 1, 1, 1, 1]Output: 7 Input: arr[] = [0, 0, 0, 0, 0, 0, __ 8 min read ](https://www.geeksforgeeks.org/count-1s-sorted-binary-array/?ref=lbp)

* * *

    * [ Two Sum - Pair Closest to 0  Given an integer array of N elements. You need to find the maximum sum of two elements such that sum is closest to zero. This problem is a variation of standard 2 Sum problems. Note: In Case if we have two of more ways to form sum of two elements closest to zero return the maximum sum.Example: Input __ 15 min read ](https://www.geeksforgeeks.org/two-elements-whose-sum-is-closest-to-zero/?ref=lbp)

* * *

    * [ Find a pair with the given difference  Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Examples: Input: arr[] = {5, 20, 3, 2, 50, 80}, n = 78Output: Pair Found: (2, 80) Input: arr[] = {90, 70, 20, 80, 50}, n = 45Output: No Such Pair Method 1: The simplest method is to ru __ 15+ min read ](https://www.geeksforgeeks.org/find-a-pair-with-the-given-difference/?ref=lbp)

* * *

    * [ Kth smallest element in a row-wise and column-wise sorted 2D array  Given an n x n matrix, every row and column is sorted in non-decreasing order. Given a number K where K lies in the range [1, n*n], find the Kth smallest element in the given 2D matrix. Example: Input: mat ={{10, 20, 30, 40}, {15, 25, 35, 45}, {24, 29, 37, 48}, {32, 33, 39, 50 }}K = 3Output: 20Expla __ 15+ min read ](https://www.geeksforgeeks.org/kth-smallest-element-in-a-row-wise-and-column-wise-sorted-2d-array/?ref=lbp)

* * *

    * [ Find common elements in three sorted arrays  Given three sorted arrays in non-decreasing order, print all common elements in these arrays. Note: In case of duplicate common elements, print only once. Examples: Input: A[] = {1, 5, 10, 20, 30} , B[] = {5, 13, 15, 20}, C[] = {5, 20} Output: 5 20Explanation: 5 and 20 are common in all the arrays. __ 15+ min read ](https://www.geeksforgeeks.org/find-common-elements-three-sorted-arrays/?ref=lbp)

* * *

    * [ Ceiling in a sorted array  Given a sorted array and a value x, find index of the ceiling of x. The ceiling of x is the smallest element in an array greater than or equal to x. Note: In case of multiple occurrences of ceiling of x, return the index of the first occurrence. Examples : Input: arr[] = [1, 2, 8, 10, 10, 12, 19], x __ 13 min read ](https://www.geeksforgeeks.org/ceiling-in-a-sorted-array/?ref=lbp)

* * *

    * [ Floor in a Sorted Array  Given a sorted array and a value x, find the element of the floor of x. The floor of x is the largest element in the array smaller than or equal to x. Examples: Input: arr[] = [1, 2, 8, 10, 10, 12, 19], x = 5Output: 1Explanation: Largest number less than or equal to 5 is 2, whose index is 1 Input: a __ 9 min read ](https://www.geeksforgeeks.org/floor-in-a-sorted-array/?ref=lbp)

* * *

    * [ Bitonic Point - Maximum in Increasing Decreasing Array  Given an array arr[] of integers which is initially strictly increasing and then strictly decreasing, the task is to find the bitonic point, that is the maximum value in the array. Bitonic Point is a point in bitonic sequence before which elements are strictly increasing and after which elements are __ 11 min read ](https://www.geeksforgeeks.org/find-the-maximum-element-in-an-array-which-is-first-increasing-and-then-decreasing/?ref=lbp)

* * *

    * [ Given Array of size n and a number k, find all elements that appear more than n/k times  Given an array of size n and an integer k, find all elements in the array that appear more than n/k times. Examples: Input: arr[] = {3, 1, 2, 2, 1, 2, 3, 3}, k = 4Output: {2, 3}Explanation: Here n/k is 8/4 = 2, therefore 2 appears 3 times in the array that is greater than 2 and 3 appears 3 times in __ 15+ min read ](https://www.geeksforgeeks.org/given-an-array-of-of-size-n-finds-all-the-elements-that-appear-more-than-nk-times/?ref=lbp)

* * *

## Medium problems on Searching algorithms

    * [ 3 Sum - Find All Triplets with Zero Sum  Given an array arr[], the task is to find all possible indices {i, j, k} of triplet {arr[i], arr[j], arr[k]} such that their sum is equal to zero and all indices in a triplet should be distinct (i != j, j != k, k != i). We need to return indices of a triplet in sorted order, i.e., i < j < k. E __ 11 min read ](https://www.geeksforgeeks.org/find-triplets-array-whose-sum-equal-zero/?ref=lbp)

* * *

    * [ Find the element before which all the elements are smaller than it, and after which all are greater  Given an array, find an element before which all elements are equal or smaller than it, and after which all the elements are equal or greater. Note: Print -1, if no such element exists. Examples: Input: arr[] = [5, 1, 4, 3, 6, 8, 10, 7, 9]Output: 6 Explanation: 6 is present at index 4. All elements __ 14 min read ](https://www.geeksforgeeks.org/find-the-element-before-which-all-the-elements-are-smaller-than-it-and-after-which-all-are-greater-than-it/?ref=lbp)

* * *

    * [ Largest pair sum in an array  Given an unsorted of distinct integers, find the largest pair sum in it. For example, the largest pair sum is 74. If there are less than 2 elements, then we need to return -1. Input : arr[] = {12, 34, 10, 6, 40}, Output : 74 Input : arr[] = {10, 10, 10}, Output : 20 Input arr[] = {10}, Output : -1 [ __ 10 min read ](https://www.geeksforgeeks.org/find-the-largest-pair-sum-in-an-unsorted-array/?ref=lbp)

* * *

    * [ Kath Smallest Element in Unsorted Array  Given an array arr[] of N distinct elements and a number K, where K is smaller than the size of the array. Find the K'th smallest element in the given array. Examples: Input: arr[] = {7, 10, 4, 3, 20, 15}, K = 3 Output: 7 Input: arr[] = {7, 10, 4, 3, 20, 15}, K = 4 Output: 10 Table of Content [Naive __ 15+ min read ](https://www.geeksforgeeks.org/kth-smallest-largest-element-in-unsorted-array/?ref=lbp)

* * *

    * [ Search in a Sorted and Rotated Array  Given a sorted and rotated array arr[] of n distinct elements, the task is to find the index of given key in the array. If the key is not present in the array, return -1. Examples: Input: arr[] = [5, 6, 7, 8, 9, 10, 1, 2, 3], key = 3Output: 8Explanation: 3 is present at index 8 in arr[]. Input: arr[ __ 15+ min read ](https://www.geeksforgeeks.org/search-an-element-in-a-sorted-and-pivoted-array/?ref=lbp)

* * *

    * [ Minimum in a Sorted and Rotated Array  Given a sorted array of distinct elements arr[] of size n that is rotated at some unknown point, the task is to find the minimum element in it. Examples: Input: arr[] = [5, 6, 1, 2, 3, 4]Output: 1Explanation: 1 is the minimum element present in the array. Input: arr[] = [3, 1, 2]Output: 1Explanation __ 9 min read ](https://www.geeksforgeeks.org/find-minimum-element-in-a-sorted-and-rotated-array/?ref=lbp)

* * *

    * [ Find a Fixed Point (Value equal to index) in a given array  Given an array of n distinct integers sorted in ascending order, the task is to find the First Fixed Point in the array. Fixed Point in an array is an index i such that arr[i] equals i. Note that integers in the array can be negative. Note: If no Fixed Point is present in the array, print -1. Exampl __ 7 min read ](https://www.geeksforgeeks.org/find-a-fixed-point-in-a-given-array/?ref=lbp)

* * *

    * [ Find the k most frequent words from a file  Given a book of words. Assume you have enough main memory to accommodate all words. design a data structure to find top K maximum occurring words. The data structure should be dynamic so that new words can be added. A simple solution is to use Hashing. Hash all words one by one in a hash table. If a __ 15+ min read ](https://www.geeksforgeeks.org/find-the-k-most-frequent-words-from-a-file/?ref=lbp)

* * *

    * [ Find k closest elements to a given value  Given a sorted array arr[] and a value x, find the k closest elements to x in arr[]. Note that if the element is present in array, then it should not be in output, only the other closest elements are required. Examples: Input: k = 4, x = 35, arr[] = {12, 16, 22, 30, 35, 39, 42, 45, 48, 50, 53, 55, 5 __ 15+ min read ](https://www.geeksforgeeks.org/find-k-closest-elements-given-value/?ref=lbp)

* * *

    * [ 2 Sum - Pair Sum Closest to Target using Binary Search  Given an array arr[] of n integers and an integer target, the task is to find a pair in arr[] such that itas sum is closest to target. Note: Return the pair in sorted order and if there are multiple such pairs return the pair with maximum absolute difference. If no such pair exists return an empty a __ 10 min read ](https://www.geeksforgeeks.org/2-sum-pair-sum-closest-to-target-using-binary-search/?ref=lbp)

* * *

    * [ Find the closest pair from two sorted arrays  Given two arrays arr1[0...m-1] and arr2[0..n-1], and a number x, the task is to find the pair arr1[i] + arr2[j] such that absolute value of (arr1[i] + arr2[j] - x) is minimum. Example: Input: arr1[] = {1, 4, 5, 7}; arr2[] = {10, 20, 30, 40}; x = 32Output: 1 and 30Input: arr1[] = {1, 4, 5, 7}; arr2[] __ 15+ min read ](https://www.geeksforgeeks.org/given-two-sorted-arrays-number-x-find-pair-whose-sum-closest-x/?ref=lbp)

* * *

    * [ Find three closest elements from given three sorted arrays  Given three sorted arrays A[], B[] and C[], find 3 elements i, j and k from A, B and C respectively such that max(abs(A[i] - B[j]), abs(B[j] - C[k]), abs(C[k] - A[i])) is minimized. Here abs() indicates absolute value. Example : Input : A[] = {1, 4, 10} B[] = {2, 15, 20} C[] = {10, 12} Output: 10 15 __ 15+ min read ](https://www.geeksforgeeks.org/find-three-closest-elements-from-given-three-sorted-arrays/?ref=lbp)

* * *

    * [ Binary Search for Rational Numbers without using floating point arithmetic  A rational is represented as p/qb, for example 2/3. Given a sorted array of rational numbers, how to search an element using Binary Search. Use of floating-point arithmetic is not allowed. Example: Input: arr[] = {1/5, 2/3, 3/2, 13/2} x = 3/2 Output: Found at index 2 We strongly recommend you to min __ 9 min read ](https://www.geeksforgeeks.org/binary-search-for-rational-numbers-without-using-floating-point-arithmetic/?ref=lbp)

* * *

## Hard problems on Searching algorithms

    * [ Median of two sorted arrays of same size  Given 2 sorted arrays a[] and b[], each of size n, the task is to find the median of the array obtained after merging a[] and b[]. Note: Since the size of the merged array will always be even, the median will be the average of the middle two numbers. Input: a[] = [1, 12, 15, 26, 38], b[] = [2, 13, 1 __ 15+ min read ](https://www.geeksforgeeks.org/median-of-two-sorted-arrays/?ref=lbp)

* * *

    * [ Search in an almost sorted array  Given a sorted array arr[] of size n, some elements of array are moved to either of the adjacent positions, i.e., arr[i] may be present at arr[i+1] or arr[i-1] i.e. arr[i] can only be swapped with either arr[i+1] or arr[i-1]. The task is to search for an element in this array. Examples : Input: arr[ __ 10 min read ](https://www.geeksforgeeks.org/search-almost-sorted-array/?ref=lbp)

* * *

    * [ Find position of an element in a sorted array of infinite numbers  Given a sorted array arr[] of infinite numbers. The task is to search for an element k in the array. Examples: Input: arr[] = [3, 5, 7, 9, 10, 90, 100, 130, 140, 160, 170], k = 10Output: 4Explanation: 10 is at index 4 in array. Input: arr[] = [2, 5, 7, 9], k = 3Output: -1Explanation: 3 is not presen __ 15+ min read ](https://www.geeksforgeeks.org/find-position-element-sorted-array-infinite-numbers/?ref=lbp)

* * *

    * [ Pair Sum in a Sorted and Rotated Array  Given an array arr[] of size n, which is sorted and then rotated around an unknown pivot, the task is to check whether there exists a pair of elements in the array whose sum is equal to a given target value. Examples : Input: arr[] = [11, 15, 6, 8, 9, 10], target = 16Output: trueExplanation: There i __ 10 min read ](https://www.geeksforgeeks.org/given-a-sorted-and-rotated-array-find-if-there-is-a-pair-with-a-given-sum/?ref=lbp)

* * *

    * [ Kath Smallest/Largest Element in Unsorted Array | Worst case Linear Time  Given an array and a number k where k is smaller than the size of the array, we need to find the kath smallest element in the given array. It is given that all array elements are distinct.Examples: Input: arr[] = {7, 10, 4, 3, 20, 15} k = 3Output: 7Input: arr[] = {7, 10, 4, 3, 20, 15} k = 4Output: 1 __ 15+ min read ](https://www.geeksforgeeks.org/kth-smallest-largest-element-in-unsorted-array-worst-case-linear-time/?ref=lbp)

* * *

    * [ K'th largest element in a stream  Given an infinite stream of integers, find the Kth largest element at any point of time. Note: Here we have a stream instead of a whole array and we are allowed to store only K elements. Examples: Input: stream[] = {10, 20, 11, 70, 50, 40, 100, 5, . . .}, K = 3Output: {_, _, 10, 11, 20, 40, 50, 50, __ 14 min read ](https://www.geeksforgeeks.org/kth-largest-element-in-a-stream/?ref=lbp)

* * *

    * [ Best First Search (Informed Search)  In BFS and DFS, when we are at a node, we can consider any of the adjacent as the next node. So both BFS and DFS blindly explore paths without considering any cost function.Â  The idea of Best First Search is to use an evaluation function to decide which adjacent is most promising and then explore. B __ 9 min read ](https://www.geeksforgeeks.org/best-first-search-informed-search/?ref=lbp)

* * *




__ Like

__

[![three90RightbarBannerImg](https://media.geeksforgeeks.org/auth-dashboard-uploads/premium_oin_rbar_min.png)](https://www.geeksforgeeks.org/geeksforgeeks-premium-subscription?itm_source=geeksforgeeks&itm_medium=rightbar_oin&itm_campaign=premium)

[ ![geeksforgeeks-footer-logo](https://media.geeksforgeeks.org/auth-dashboard-uploads/gfgFooterLogo.png) ](https://www.geeksforgeeks.org/)

__

Corporate & Communications Address:

A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305) 

__

Registered Address:

K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305 

[ ](https://www.facebook.com/geeksforgeeks.org/) [ ](https://www.instagram.com/geeks_for_geeks/) [ ](https://in.linkedin.com/company/geeksforgeeks) [ ](https://twitter.com/geeksforgeeks) [ ](https://www.youtube.com/geeksforgeeksvideos)

[![GFG App on Play Store](https://media.geeksforgeeks.org/auth-dashboard-uploads/googleplay.png)](https://geeksforgeeksapp.page.link/gfg-app) [![GFG App on App Store](https://media.geeksforgeeks.org/auth-dashboard-uploads/appstore.png)](https://geeksforgeeksapp.page.link/gfg-app)

[Advertise with us](https://www.geeksforgeeks.org/advertise-with-us/?ref=footer)

  * Company
  * [About Us](https://www.geeksforgeeks.org/about/?ref=outindfooter)
  * [Legal](https://www.geeksforgeeks.org/legal/?ref=outindfooter)
  * [Privacy Policy](https://www.geeksforgeeks.org/legal/privacy-policy/?ref=outindfooter)
  * [In Media](https://www.geeksforgeeks.org/press-release/?ref=outindfooter)
  * [Contact Us](https://www.geeksforgeeks.org/about/contact-us/?ref=outindfooter)
  * [Advertise with us](https://www.geeksforgeeks.org/advertise-with-us/?ref=outindfooter)
  * [GFG Corporate Solution](https://www.geeksforgeeks.org/gfg-corporate-solution/?ref=outindfooter)
  * [Placement Training Program](https://www.geeksforgeeks.org/campus-training-program/?ref=outindfooter)
  * [GeeksforGeeks Community](https://www.geeksforgeeks.org/community/?ref=outindfooter)


  * [Languages](https://www.geeksforgeeks.org/introduction-to-programming-languages/?ref=outindfooter)
  * [Python](https://www.geeksforgeeks.org/python-programming-language/?ref=outindfooter)
  * [Java](https://www.geeksforgeeks.org/java/?ref=outindfooter)
  * [C++](https://www.geeksforgeeks.org/c-plus-plus/?ref=outindfooter)
  * [PHP](https://www.geeksforgeeks.org/php-tutorials/?ref=outindfooter)
  * [GoLang](https://www.geeksforgeeks.org/golang/?ref=outindfooter)
  * [SQL](https://www.geeksforgeeks.org/sql-tutorial/?ref=outindfooter)
  * [R Language](https://www.geeksforgeeks.org/r-tutorial/?ref=outindfooter)
  * [Android Tutorial](https://www.geeksforgeeks.org/android-tutorial/?ref=outindfooter)
  * [Tutorials Archive](https://www.geeksforgeeks.org/geeksforgeeks-online-tutorials-free/?ref=outindfooter)


  * [DSA](https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/?ref=outindfooter)
  * [Data Structures](https://www.geeksforgeeks.org/data-structures/?ref=outindfooter)
  * [Algorithms](https://www.geeksforgeeks.org/fundamentals-of-algorithms/?ref=outindfooter)
  * [DSA for Beginners](https://www.geeksforgeeks.org/complete-guide-to-dsa-for-beginners/?ref=outindfooter)
  * [Basic DSA Problems](https://www.geeksforgeeks.org/basic-coding-problems-in-dsa-for-beginners/?ref=outindfooter)
  * [DSA Roadmap](https://www.geeksforgeeks.org/complete-roadmap-to-learn-dsa-from-scratch/?ref=outindfooter)
  * [Top 100 DSA Interview Problems](https://www.geeksforgeeks.org/top-100-data-structure-and-algorithms-dsa-interview-questions-topic-wise/?ref=outindfooter)
  * [DSA Roadmap by Sandeep Jain](https://www.geeksforgeeks.org/dsa-roadmap-for-beginner-to-advanced-by-sandeep-jain/?ref=outindfooter)
  * [All Cheat Sheets](https://www.geeksforgeeks.org/geeksforgeeks-master-sheet-list-of-all-cheat-sheets/?ref=outindfooter)


  * [Data Science & ML](https://www.geeksforgeeks.org/ai-ml-ds/?ref=outindfooter)
  * [Data Science With Python](https://www.geeksforgeeks.org/data-science-tutorial/?ref=outindfooter)
  * [Data Science For Beginner](https://www.geeksforgeeks.org/data-science-for-beginners/?ref=outindfooter)
  * [Machine Learning](https://www.geeksforgeeks.org/machine-learning/?ref=outindfooter)
  * [ML Maths](https://www.geeksforgeeks.org/machine-learning-mathematics/?ref=outindfooter)
  * [Data Visualisation](https://www.geeksforgeeks.org/python-data-visualization-tutorial/?ref=outindfooter)
  * [Pandas](https://www.geeksforgeeks.org/pandas-tutorial/?ref=outindfooter)
  * [NumPy](https://www.geeksforgeeks.org/numpy-tutorial/?ref=outindfooter)
  * [NLP](https://www.geeksforgeeks.org/natural-language-processing-nlp-tutorial/?ref=outindfooter)
  * [Deep Learning](https://www.geeksforgeeks.org/deep-learning-tutorial/?ref=outindfooter)


  * [Web Technologies](https://www.geeksforgeeks.org/web-technology/?ref=outindfooter)
  * [HTML](https://www.geeksforgeeks.org/html/?ref=outindfooter)
  * [CSS](https://www.geeksforgeeks.org/css/?ref=outindfooter)
  * [JavaScript](https://www.geeksforgeeks.org/javascript/?ref=outindfooter)
  * [TypeScript](https://www.geeksforgeeks.org/typescript/?ref=outindfooter)
  * [ReactJS](https://www.geeksforgeeks.org/learn-reactjs/?ref=outindfooter)
  * [NextJS](https://www.geeksforgeeks.org/nextjs/?ref=outindfooter)
  * [Bootstrap](https://www.geeksforgeeks.org/bootstrap/?ref=outindfooter)
  * [Web Design](https://www.geeksforgeeks.org/web-design/?ref=outindfooter)


  * [Python Tutorial](https://www.geeksforgeeks.org/python-programming-language/?ref=outindfooter)
  * [Python Programming Examples](https://www.geeksforgeeks.org/python-programming-examples/?ref=outindfooter)
  * [Python Projects](https://www.geeksforgeeks.org/python-projects-beginner-to-advanced/?ref=outindfooter)
  * [Python Tkinter](https://www.geeksforgeeks.org/python-tkinter-tutorial/?ref=outindfooter)
  * [Web Scraping](https://www.geeksforgeeks.org/python-web-scraping-tutorial/?ref=outindfooter)
  * [OpenCV Tutorial](https://www.geeksforgeeks.org/opencv-python-tutorial/?ref=outindfooter)
  * [Python Interview Question](https://www.geeksforgeeks.org/python-interview-questions/?ref=outindfooter)
  * [Django](https://www.geeksforgeeks.org/django-tutorial/?ref=outindfooter)



  * Computer Science
  * [Operating Systems](https://www.geeksforgeeks.org/operating-systems/?ref=outindfooter)
  * [Computer Network](https://www.geeksforgeeks.org/computer-network-tutorials/?ref=outindfooter)
  * [Database Management System](https://www.geeksforgeeks.org/dbms/?ref=outindfooter)
  * [Software Engineering](https://www.geeksforgeeks.org/software-engineering/?ref=outindfooter)
  * [Digital Logic Design](https://www.geeksforgeeks.org/digital-electronics-logic-design-tutorials/?ref=outindfooter)
  * [Engineering Maths](https://www.geeksforgeeks.org/engineering-mathematics-tutorials/?ref=outindfooter)
  * [Software Development](https://www.geeksforgeeks.org/software-development/?ref=outindfooter)
  * [Software Testing](https://www.geeksforgeeks.org/software-testing-tutorial/?ref=outindfooter)


  * [DevOps](https://www.geeksforgeeks.org/devops-tutorial/?ref=outindfooter)
  * [Git](https://www.geeksforgeeks.org/git-tutorial/?ref=outindfooter)
  * [Linux](https://www.geeksforgeeks.org/linux-tutorial/?ref=outindfooter)
  * [AWS](https://www.geeksforgeeks.org/aws-tutorial/?ref=outindfooter)
  * [Docker](https://www.geeksforgeeks.org/docker-tutorial/?ref=outindfooter)
  * [Kubernetes](https://www.geeksforgeeks.org/kubernetes-tutorial/?ref=outindfooter)
  * [Azure](https://www.geeksforgeeks.org/microsoft-azure/?ref=outindfooter)
  * [GCP](https://www.geeksforgeeks.org/google-cloud-platform-tutorial/?ref=outindfooter)
  * [DevOps Roadmap](https://www.geeksforgeeks.org/devops-roadmap/?ref=outindfooter)


  * [System Design](https://www.geeksforgeeks.org/system-design-tutorial/?ref=outindfooter)
  * [High Level Design](https://www.geeksforgeeks.org/what-is-high-level-design-learn-system-design/?ref=outindfooter)
  * [Low Level Design](https://www.geeksforgeeks.org/what-is-low-level-design-or-lld-learn-system-design/?ref=outindfooter)
  * [UML Diagrams](https://www.geeksforgeeks.org/unified-modeling-language-uml-introduction/?ref=outindfooter)
  * [Interview Guide](https://www.geeksforgeeks.org/system-design-interview-guide/?ref=outindfooter)
  * [Design Patterns](https://www.geeksforgeeks.org/software-design-patterns/?ref=outindfooter)
  * [OOAD](https://www.geeksforgeeks.org/object-oriented-analysis-and-design/?ref=outindfooter)
  * [System Design Bootcamp](https://www.geeksforgeeks.org/system-design-interview-bootcamp-guide/?ref=outindfooter)
  * [Interview Questions](https://www.geeksforgeeks.org/most-commonly-asked-system-design-interview-problems-questions/?ref=outindfooter)


  * [Inteview Preparation](https://www.geeksforgeeks.org/technical-interview-preparation/?ref=outindfooter)
  * [Competitive Programming](https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outindfooter)
  * [Top DS or Algo for CP](https://www.geeksforgeeks.org/top-algorithms-and-data-structures-for-competitive-programming/?ref=outindfooter)
  * [Company-Wise Recruitment Process](https://www.geeksforgeeks.org/company-wise-recruitment-process/?ref=outindfooter)
  * [Company-Wise Preparation](https://www.geeksforgeeks.org/company-preparation/?ref=outindfooter)
  * [Aptitude Preparation](https://www.geeksforgeeks.org/aptitude-questions-and-answers/?ref=outindfooter)
  * [Puzzles](https://www.geeksforgeeks.org/puzzles/?ref=outindfooter)


  * School Subjects
  * [Mathematics](https://www.geeksforgeeks.org/maths/?ref=outindfooter)
  * [Physics](https://www.geeksforgeeks.org/physics/?ref=outindfooter)
  * [Chemistry](https://www.geeksforgeeks.org/chemistry/?ref=outindfooter)
  * [Biology](https://www.geeksforgeeks.org/biology/?ref=outindfooter)
  * [Social Science](https://www.geeksforgeeks.org/social-science/?ref=outindfooter)
  * [English Grammar](https://www.geeksforgeeks.org/english-grammar/?ref=outindfooter)
  * [Commerce](https://www.geeksforgeeks.org/commerce/?ref=outindfooter)
  * [World GK](https://www.geeksforgeeks.org/tag/world-general-knowledge/?ref=outindfooter)


  * [GeeksforGeeks Videos](https://www.geeksforgeeks.org/videos/?ref=outindfooter)
  * [DSA](https://www.geeksforgeeks.org/videos/category/sde-sheet/?ref=outindfooter)
  * [Python](https://www.geeksforgeeks.org/videos/category/python/?ref=outindfooter)
  * [Java](https://www.geeksforgeeks.org/videos/category/java-w6y5f4/?ref=outindfooter)
  * [C++](https://www.geeksforgeeks.org/videos/category/c/?ref=outindfooter)
  * [Web Development](https://www.geeksforgeeks.org/videos/category/web-development/?ref=outindfooter)
  * [Data Science](https://www.geeksforgeeks.org/videos/category/data-science/?ref=outindfooter)
  * [CS Subjects](https://www.geeksforgeeks.org/videos/category/cs-subjects/?ref=outindfooter)



[@GeeksforGeeks, Sanchhaya Education Private Limited](https://www.geeksforgeeks.org/), [All rights reserved](https://www.geeksforgeeks.org/copyright-information/)

We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our [_Cookie Policy_](https://www.geeksforgeeks.org/cookie-policy/) & [_Privacy Policy_](https://www.geeksforgeeks.org/privacy-policy/) Got It ! 

![Lightbox]()

Improvement

__

Suggest changes

Suggest Changes

Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.

![geeksforgeeks-suggest-icon](https://media.geeksforgeeks.org/auth-dashboard-uploads/suggestChangeIcon.png)

Create Improvement

Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.

![geeksforgeeks-improvement-icon](https://media.geeksforgeeks.org/auth-dashboard-uploads/createImprovementIcon.png)

__

Suggest Changes

__

min 4 words, max Words Limit:1000

## Thank You!

Your suggestions are valuable to us.

## What kind of Experience do you want to share?

[ Interview Experiences ](https://write.geeksforgeeks.org/posts-new?cid=e8fc46fe-75e7-4a4b-be3c-0c862d655ed0) [ Admission Experiences ](https://write.geeksforgeeks.org/posts-new?cid=82536bdb-84e6-4661-87c3-e77c3ac04ede) [ Career Journeys ](https://write.geeksforgeeks.org/posts-new?cid=5219b0b2-7671-40a0-9bda-503e28a61c31) [ Work Experiences ](https://write.geeksforgeeks.org/posts-new?cid=22ae3354-15b6-4dd4-a5b4-5c7a105b8a8f) [ Campus Experiences ](https://write.geeksforgeeks.org/posts-new?cid=c5e1ac90-9490-440a-a5fa-6180c87ab8ae) [ Competitive Exam Experiences ](https://write.geeksforgeeks.org/posts-new?cid=5ebb8fe9-b980-4891-af07-f2d62a9735f2)


url: http://arxiv.org/abs/2402.19107v1
title: [2402.19107v1] Rahmani Sort: A Novel Variant of Insertion Sort Algorithm with O(nlogn) Complexity
scrape_date: 2025-03-14T13:30:57.348637
content_type: markdown
hash: a35a5ebd23f5f948abfe8109cb15307003ea66730ec4d98327ee8af5d4a29a70
content:
Skip to main content

[![Cornell University](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg)](https://www.cornell.edu/)

We gratefully acknowledge support from the Simons Foundation, [member institutions](https://info.arxiv.org/about/ourmembers.html), and all contributors. [Donate](https://info.arxiv.org/about/donate.html)

[](/IgnoreMe)

[![arxiv logo](/static/browse/0.3.4/images/arxiv-logo-one-color-white.svg)](/) > [cs](/list/cs/recent) > arXiv:2402.19107v1 

[Help](https://info.arxiv.org/help) | [Advanced Search](https://arxiv.org/search/advanced)

All fields Title Author Abstract Comments Journal reference ACM classification MSC classification Report number arXiv identifier DOI ORCID arXiv author ID Help pages Full text

Search

[![arXiv logo](/static/browse/0.3.4/images/arxiv-logomark-small-white.svg)](https://arxiv.org/)

[ ![Cornell University Logo](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg) ](https://www.cornell.edu/)

open search

GO

open navigation menu

## quick links

  * [Login](https://arxiv.org/login)
  * [Help Pages](https://info.arxiv.org/help)
  * [About](https://info.arxiv.org/about)



# Computer Science > Cryptography and Security

**arXiv:2402.19107v1** (cs) 

[Submitted on 29 Feb 2024]

# Title:Rahmani Sort: A Novel Variant of Insertion Sort Algorithm with O(nlogn) Complexity

Authors:[Mohammad Khalid Imam Rahmani](https://arxiv.org/search/cs?searchtype=author&query=Rahmani,+M+K+I)

View a PDF of the paper titled Rahmani Sort: A Novel Variant of Insertion Sort Algorithm with O(nlogn) Complexity, by Mohammad Khalid Imam Rahmani

[View PDF](/pdf/2402.19107v1)

> Abstract:Various decision support systems are available that implement Data Mining and Data Warehousing techniques for diving into the sea of data for getting useful patterns of knowledge (pearls). Classification, regression, clustering, and many other algorithms are used to enhance the precision and accuracy of the decision process. So, there is scope for increasing the response time of the decision process, especially in mission-critical operations. If data are ordered with suitable and efficient sorting operation, the response time of the decision process can be minimized. Insertion sort is much more suitable for such applications due to its simple and straight logic along with its dynamic nature suitable for list implementation. But it is slower than merge sort and quick sort. The main reasons this is slow: firstly, a sequential search is used to find the actual position of the next key element into the sorted left subarray and secondly, shifting of elements is required by one position towards the right for accommodating the newly inserted element. Therefore, I propose a new algorithm by using a novel technique of binary search mechanism for finding the sorted location of the next key item into the previously sorted left subarray much quicker than the conventional insertion sort algorithm. Performance measurement in terms of the actual running time of the new algorithm has been compared with those of other conventional sorting algorithms apart from the insertion sort. The results obtained on various sample data show that the new algorithm is better in performance than the conventional insertion sort and merge sort algorithms. 

Comments: | None  
---|---  
Subjects: |  Cryptography and Security (cs.CR); Data Structures and Algorithms (cs.DS)  
MSC classes: | 14J26 (Secondary)  
ACM classes: | E.1  
Cite as: | [arXiv:2402.19107](https://arxiv.org/abs/2402.19107) [cs.CR]  
  | (or  [arXiv:2402.19107v1](https://arxiv.org/abs/2402.19107v1) [cs.CR] for this version)   
  |  <https://doi.org/10.48550/arXiv.2402.19107> Focus to learn more arXiv-issued DOI via DataCite  
  
## Submission history

From: Mohammad Khalid Imam Rahmani [[view email](/show-email/035f4b1d/2402.19107)]   
**[v1]** Thu, 29 Feb 2024 12:38:57 UTC (343 KB)  


Full-text links:

## Access Paper:

View a PDF of the paper titled Rahmani Sort: A Novel Variant of Insertion Sort Algorithm with O(nlogn) Complexity, by Mohammad Khalid Imam Rahmani

  * [View PDF](/pdf/2402.19107v1)
  * [Other Formats](/format/2402.19107v1)



[ ![license icon](https://arxiv.org/icons/licenses/by-4.0.png) view license ](http://creativecommons.org/licenses/by/4.0/ "Rights to this article")

Current browse context: 

cs.CR

[< prev](/prevnext?id=2402.19107&function=prev&context=cs.CR "previous in cs.CR \(accesskey p\)")   |   [next >](/prevnext?id=2402.19107&function=next&context=cs.CR "next in cs.CR \(accesskey n\)")   


[new](/list/cs.CR/new) |  [recent](/list/cs.CR/recent) | [2024-02](/list/cs.CR/2024-02)

Change to browse by: 

[cs](/abs/2402.19107?context=cs)  
[cs.DS](/abs/2402.19107?context=cs.DS)  


### References & Citations

  * [NASA ADS](https://ui.adsabs.harvard.edu/abs/arXiv:2402.19107)
  * [Google Scholar](https://scholar.google.com/scholar_lookup?arxiv_id=2402.19107)
  * [Semantic Scholar](https://api.semanticscholar.org/arXiv:2402.19107)



[a](/static/browse/0.3.4/css/cite.css) export BibTeX citation Loading...

## BibTeX formatted citation

×

loading...

Data provided by: 

### Bookmark

[ ![BibSonomy logo](/static/browse/0.3.4/images/icons/social/bibsonomy.png) ](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2402.19107&description=Rahmani Sort: A Novel Variant of Insertion Sort Algorithm with O\(nlogn\) Complexity "Bookmark on BibSonomy") [ ![Reddit logo](/static/browse/0.3.4/images/icons/social/reddit.png) ](https://reddit.com/submit?url=https://arxiv.org/abs/2402.19107&title=Rahmani Sort: A Novel Variant of Insertion Sort Algorithm with O\(nlogn\) Complexity "Bookmark on Reddit")

Bibliographic Tools

# Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer _([What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))_

Connected Papers Toggle

Connected Papers _([What is Connected Papers?](https://www.connectedpapers.com/about))_

Litmaps Toggle

Litmaps _([What is Litmaps?](https://www.litmaps.co/))_

scite.ai Toggle

scite Smart Citations _([What are Smart Citations?](https://www.scite.ai/))_

Code, Data, Media

# Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv _([What is alphaXiv?](https://alphaxiv.org/))_

Links to Code Toggle

CatalyzeX Code Finder for Papers _([What is CatalyzeX?](https://www.catalyzex.com))_

DagsHub Toggle

DagsHub _([What is DagsHub?](https://dagshub.com/))_

GotitPub Toggle

Gotit.pub _([What is GotitPub?](http://gotit.pub/faq))_

Huggingface Toggle

Hugging Face _([What is Huggingface?](https://huggingface.co/huggingface))_

Links to Code Toggle

Papers with Code _([What is Papers with Code?](https://paperswithcode.com/))_

ScienceCast Toggle

ScienceCast _([What is ScienceCast?](https://sciencecast.org/welcome))_

Demos

# Demos

Replicate Toggle

Replicate _([What is Replicate?](https://replicate.com/docs/arxiv/about))_

Spaces Toggle

Hugging Face Spaces _([What is Spaces?](https://huggingface.co/docs/hub/spaces))_

Spaces Toggle

TXYZ.AI _([What is TXYZ.AI?](https://txyz.ai))_

Related Papers

# Recommenders and Search Tools

Link to Influence Flower

Influence Flower _([What are Influence Flowers?](https://influencemap.cmlab.dev/))_

Core recommender toggle

CORE Recommender _([What is CORE?](https://core.ac.uk/services/recommender))_

  * Author
  * Venue
  * Institution
  * Topic



About arXivLabs 

# arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).

[Which authors of this paper are endorsers?](/auth/show-endorsers/2402.19107) | [Disable MathJax](javascript:setMathjaxCookie\(\)) ([What is MathJax?](https://info.arxiv.org/help/mathjax.html)) 

  * [About](https://info.arxiv.org/about)
  * [Help](https://info.arxiv.org/help)



  * contact arXivClick here to contact arXiv [ Contact](https://info.arxiv.org/help/contact.html)
  * subscribe to arXiv mailingsClick here to subscribe [ Subscribe](https://info.arxiv.org/help/subscribe)



  * [Copyright](https://info.arxiv.org/help/license/index.html)
  * [Privacy Policy](https://info.arxiv.org/help/policies/privacy_policy.html)



  * [Web Accessibility Assistance](https://info.arxiv.org/help/web_accessibility.html)
  * [arXiv Operational Status ](https://status.arxiv.org)  
Get status notifications via [email](https://subscribe.sorryapp.com/24846f03/email/new) or [slack](https://subscribe.sorryapp.com/24846f03/slack/new)



  *[MSC]: Mathematical Subject Classification
  *[ACM]: Association of Computing Machinery Classification


url: https://www.geeksforgeeks.org/linear-search-vs-binary-search/
title: Linear Search vs Binary Search - GeeksforGeeks
scrape_date: 2025-03-14T13:30:57.348597
content_type: markdown
hash: af3008b4e86b0b059156b1ea31efd2a484828970f06141927321e0e1129fda03
content:
Skip to content [ ![geeksforgeeks](https://media.geeksforgeeks.org/gfg-gg-logo.svg) ](https://www.geeksforgeeks.org/)

  * Courses __
    * [DSA to Development](https://www.geeksforgeeks.org/courses/dsa-to-development-coding-guide?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * [Machine Learning & Data Science](https://www.geeksforgeeks.org/courses/data-science-live?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * [Generative AI & ChatGPT](https://www.geeksforgeeks.org/courses/mastering-generative-ai-and-chat-gpt?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * [Become AWS Certified](https://www.geeksforgeeks.org/courses/search?query=AWS&itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * DSA Courses __
      * [Data Structure& Algorithm(C++/JAVA)](https://www.geeksforgeeks.org/courses/dsa-self-paced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [Data Structure & Algorithm(Python)](https://www.geeksforgeeks.org/courses/Data-Structures-With-Python?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [Data Structure & Algorithm(JavaScript)](https://www.geeksforgeeks.org/courses/data-structures-and-algorithms-in-javascript?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * Programming Languages __
      * [CPP](https://www.geeksforgeeks.org/courses/cpp-programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [Java](https://www.geeksforgeeks.org/courses/Java-Programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [Python](https://www.geeksforgeeks.org/courses/Python-Foundation?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [JavaScript](https://www.geeksforgeeks.org/courses/javascript?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
      * [C](https://www.geeksforgeeks.org/courses/c-Programming-basic-to-advanced?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
    * [All Courses](https://www.geeksforgeeks.org/courses?itm_source=geeksforgeeks&itm_medium=main_header&itm_campaign=courses)
  * Tutorials __
    * Python __
      * [Python Tutorial](https://www.geeksforgeeks.org/python-programming-language-tutorial/?ref=outind)
      * [Python Programs](https://www.geeksforgeeks.org/python-programming-examples/?ref=outind)
      * [Python Quiz](https://www.geeksforgeeks.org/python-quizzes/?ref=outind)
      * [Python Projects](https://www.geeksforgeeks.org/python-projects-beginner-to-advanced/?ref=outind)
      * [Python Interview Questions](https://www.geeksforgeeks.org/python-interview-questions/?ref=outind)
      * [Python Data Structures](https://www.geeksforgeeks.org/python-data-structures-and-algorithms/?ref=outind)
    * Java __
      * [Java Tutorial](https://www.geeksforgeeks.org/java/?ref=outind)
      * [Java Collections](https://www.geeksforgeeks.org/collections-in-java-2/?ref=outind)
      * [Java 8 Tutorial](https://www.geeksforgeeks.org/java-8-features/?ref=outind)
      * [Java Programs](https://www.geeksforgeeks.org/java-programming-examples/?ref=outind)
      * [Java Quiz](https://www.geeksforgeeks.org/java-multiple-choice-questions/?ref=outind)
      * [Java Projects](https://www.geeksforgeeks.org/java-projects/?ref=outind)
      * [Java Interview Questions](https://www.geeksforgeeks.org/java-interview-questions/?ref=outind)
      * [Advanced Java](https://www.geeksforgeeks.org/advanced-java/?ref=outind)
    * Programming Languages __
      * [JavaScript](https://www.geeksforgeeks.org/javascript/?ref=outind)
      * [C++](https://www.geeksforgeeks.org/c-plus-plus/?ref=outind)
      * [R Tutorial](https://www.geeksforgeeks.org/r-tutorial/?ref=outind)
      * [SQL](https://www.geeksforgeeks.org/sql-tutorial/?ref=outind)
      * [PHP](https://www.geeksforgeeks.org/php-tutorial/?ref=outind)
      * [C#](https://www.geeksforgeeks.org/csharp-programming-language/?ref=outind)
      * [C](https://www.geeksforgeeks.org/c-programming-language/?ref=outind)
      * [Scala](https://www.geeksforgeeks.org/scala-programming-language/?ref=outind)
      * [Perl](https://www.geeksforgeeks.org/perl-programming-language/?ref=outind)
      * [Go Language](https://www.geeksforgeeks.org/golang/?ref=outind)
      * [Kotlin](https://www.geeksforgeeks.org/kotlin-programming-language/?ref=outind)
    * Interview Corner __
      * [System Design Tutorial](https://www.geeksforgeeks.org/system-design-tutorial/?ref=outind)
      * [Company Preparation](https://www.geeksforgeeks.org/company-preparation/?ref=outind)
      * [Top Topics](https://www.geeksforgeeks.org/interview-preparation-for-software-developer/?ref=outind)
      * [Practice Company Questions](https://practice.geeksforgeeks.org/company-tags/?ref=outind)
      * [Interview Experiences](https://www.geeksforgeeks.org/company-interview-corner/?ref=outind)
      * [Experienced Interviews](https://www.geeksforgeeks.org/experienced-interview-experiences-company-wise/?ref=outind)
      * [Internship Interviews](https://www.geeksforgeeks.org/internship-interview-experiences-company-wise/?ref=outind)
      * [Competitive Programming](https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outind)
      * [Multiple Choice Quizzes](https://www.geeksforgeeks.org/quiz-corner-gq/?ref=outind)
      * [Aptitude for Placements](https://www.geeksforgeeks.org/aptitude-questions-and-answers/?ref=outind)
    * Computer Science Subjects __
      * [Operating System](https://www.geeksforgeeks.org/operating-systems/?ref=outind)
      * [DBMS](https://www.geeksforgeeks.org/dbms/?ref=outind)
      * [Computer Networks](https://www.geeksforgeeks.org/computer-network-tutorials/?ref=outind)
      * [Engineering Mathematics](https://www.geeksforgeeks.org/engineering-mathematics-tutorials/?ref=outind)
      * [Computer Organization and Architecture](https://www.geeksforgeeks.org/computer-organization-and-architecture-tutorials/?ref=outind)
      * [Theory of Computation](https://www.geeksforgeeks.org/theory-of-computation-automata-tutorials/?ref=outind)
      * [Compiler Design](https://www.geeksforgeeks.org/compiler-design-tutorials/?ref=outind)
      * [Digital Logic](https://www.geeksforgeeks.org/digital-electronics-logic-design-tutorials/#blg/?ref=outind)
      * [Software Engineering](https://www.geeksforgeeks.org/software-engineering/?ref=outind)
    * DevOps and Linux __
      * [DevOps Tutorial](https://www.geeksforgeeks.org/devops-tutorial/?ref=ghm)
      * [GIT](https://www.geeksforgeeks.org/git-tutorial/?ref=outind)
      * [AWS](https://www.geeksforgeeks.org/aws-tutorial/?ref=outind)
      * [Docker](https://www.geeksforgeeks.org/docker-tutorial/?ref=outind)
      * [Kubernetes](https://www.geeksforgeeks.org/kubernetes-tutorial/?ref=outind)
      * [Microsoft Azure Tutorial](https://www.geeksforgeeks.org/microsoft-azure/?ref=outind)
      * [Google Cloud Platform](https://www.geeksforgeeks.org/google-cloud-platform-tutorial/?ref=outind)
      * [Linux Tutorial](https://www.geeksforgeeks.org/linux-tutorial/?ref=outind)
    * Software Testing __
      * [Software Testing Tutorial](https://www.geeksforgeeks.org/software-testing-tutorial/?ref=outind)
      * [Software Engineering Tutorial](https://www.geeksforgeeks.org/software-engineering/?ref=outind)
      * [Testing Interview Questions](https://www.geeksforgeeks.org/software-testing-interview-questions/?ref=outind)
      * [Jira](https://www.geeksforgeeks.org/jira-tutorial/?ref=outind)
    * Databases __
      * [DBMS Tutorial](https://www.geeksforgeeks.org/dbms/?ref=outind)
      * [SQL Tutorial](https://www.geeksforgeeks.org/sql-tutorial/?ref=outind)
      * [PostgreSQL Tutorial](https://www.geeksforgeeks.org/postgresql-tutorial/?ref=outind)
      * [MongoDB Tutorial](https://www.geeksforgeeks.org/mongodb-tutorial/?ref=outind)
      * [SQL Interview Questions](https://www.geeksforgeeks.org/sql-interview-questions/?ref=outind)
      * [MySQL Interview Questions](https://www.geeksforgeeks.org/mysql-interview-questions/?ref=outind)
      * [PL/SQL Interview Questions](https://www.geeksforgeeks.org/pl-sql-interview-questions/?ref=outind)
    * Android __
      * [Android Tutorial](https://www.geeksforgeeks.org/android-tutorial/?ref=outind)
      * [Android Studio Tutorial](https://www.geeksforgeeks.org/android-studio-tutorial/?ref=outind)
      * [Kotlin For Android](https://www.geeksforgeeks.org/kotlin-android-tutorial/?ref=outind)
      * [Android Projects](https://www.geeksforgeeks.org/android-projects-from-basic-to-advanced-level/?ref=outind)
      * [Android Interview Questions](https://www.geeksforgeeks.org/top-50-android-interview-questions-answers-sde-i-to-sde-iii/?ref=outind)
      * [6 Weeks of Android App Development](https://www.geeksforgeeks.org/6-weeks-of-android-app-development-free-project-based-learning/?ref=outind)
    * Excel __
      * [MS Excel Tutorial](https://www.geeksforgeeks.org/excel-tutorial/?ref=outind)
      * [Introduction to MS Excel](https://www.geeksforgeeks.org/introduction-to-ms-excel/?ref=outind)
      * [Data Analysis in Excel](https://www.geeksforgeeks.org/data-analysis-in-excel/?ref=outind)
      * [Basic Excel Formulas & Functions](https://www.geeksforgeeks.org/basic-excel-formulas-and-functions/?ref=outind)
      * [Data Analysis in Advanced Excel](https://www.geeksforgeeks.org/instant-data-analysis-in-advanced-excel/?ref=outind)
      * [Workbooks](https://www.geeksforgeeks.org/workbooks-in-microsoft-excel/?ref=outind)
      * [Statistical Functions](https://www.geeksforgeeks.org/statistical-functions-in-excel-with-examples/?ref=outind)
      * [Data Visualization in Excel](https://www.geeksforgeeks.org/data-visualization-in-excel/?ref=outind)
      * [Pivot Tables in Excel](https://www.geeksforgeeks.org/pivot-tables-in-excel/?ref=outind)
      * [Excel Spreadsheets in Python](https://www.geeksforgeeks.org/working-with-excel-spreadsheets-in-python/?ref=outind)
      * [Basic Excel Shortcuts](https://www.geeksforgeeks.org/basic-excel-shortcuts/?ref=outind)
    * Mathematics __
      * [Number System](https://www.geeksforgeeks.org/number-theory/?ref=outind)
      * [Algebra](https://www.geeksforgeeks.org/algebra/?ref=outind)
      * [Linear Algebra](https://www.geeksforgeeks.org/linear-algebra/?ref=outind)
      * [Trigonometry](https://www.geeksforgeeks.org/math-trigonometry/?ref=outind)
      * [Set Theory](https://www.geeksforgeeks.org/set-theory/?ref=outind)
      * [Statistics](https://www.geeksforgeeks.org/statistics/?ref=outind)
      * [Probability](https://www.geeksforgeeks.org/probability-in-maths/?ref=outind)
      * [Geometry](https://www.geeksforgeeks.org/geometry/?ref=outind)
      * [Mensuration](https://www.geeksforgeeks.org/mensuration/?ref=outind)
      * [Logarithms](https://www.geeksforgeeks.org/logarithms/?ref=outind)
      * [Calculus](https://www.geeksforgeeks.org/math-calculus/?ref=outind)
  * DSA __
    * [DSA Tutorial](https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/?ref=outind)
    * Practice __
      * [Practice Coding Problems](https://www.geeksforgeeks.org/geeksforgeeks-practice-best-online-coding-platform/?itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header)
      * [Problem of the Day](https://www.geeksforgeeks.org/problem-of-the-day?itm_source=geeksforgeeksitm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header)
      * [GfG SDE Sheet](https://www.geeksforgeeks.org/explore?page=1&curated\[\]=1&sortBy=submissions&curated_names\[\]=SDE Sheet?itm_source=geeksforgeeks&itm_medium=main_header_outIndia&itm_campaign=DSA_Header)
    * [Competitive Programming](https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outind)
    * Company Wise SDE Sheets __
      * [Facebook SDE Sheet](https://www.geeksforgeeks.org/facebookmeta-sde-sheet-interview-questions-and-answers/?ref=outind)
      * [Amazon SDE Sheet](https://www.geeksforgeeks.org/amazon-sde-sheet-interview-questions-and-answers/?ref=outind)
      * [Apple SDE Sheet](https://www.geeksforgeeks.org/apple-sde-sheet-interview-questions-and-answers/?ref=outind)
      * [Netflix SDE Sheet](https://www.geeksforgeeks.org/netflix-sde-sheet-interview-questions-and-answers/?ref=outind)
      * [Google SDE Sheet](https://www.geeksforgeeks.org/google-sde-sheet-interview-questions-and-answers/?ref=outind)
    * [Top Interview Questions](https://www.geeksforgeeks.org/top-100-data-structure-and-algorithms-dsa-interview-questions-topic-wise/?ref=outind)
    * Puzzles __
      * [All Puzzles](https://www.geeksforgeeks.org/puzzles/?ref=outind)
      * [Top 100 Puzzles Asked In Interviews](https://www.geeksforgeeks.org/top-100-puzzles-asked-in-interviews/?ref=outind)
      * [Top 20 Puzzles Commonly Asked During SDE Interviews](https://www.geeksforgeeks.org/top-20-puzzles-commonly-asked-during-sde-interviews/?ref=outind)
  * Data Science __
    * [Python Tutorial](https://www.geeksforgeeks.org/python-programming-language/?ref=outind)
    * [R Tutorial](https://www.geeksforgeeks.org/r-tutorial/?ref=outind)
    * [Machine Learning](https://www.geeksforgeeks.org/machine-learning/?ref=outind)
    * [Data Science using Python](https://www.geeksforgeeks.org/data-science-with-python-tutorial/?ref=outind)
    * [Data Science using R](https://www.geeksforgeeks.org/r-programming-for-data-science/?ref=outind)
    * Data Science Packages __
      * [Pandas Tutorial](https://www.geeksforgeeks.org/pandas-tutorial/?ref=outind)
      * [NumPy Tutorial](https://www.geeksforgeeks.org/numpy-tutorial/?ref=outind)
    * Data Visualization __
      * [Python Data Visualization Tutorial](https://www.geeksforgeeks.org/python-data-visualization-tutorial/?ref=outind)
      * [Data Visualization with R](https://www.geeksforgeeks.org/data-visualization-in-r/?ref=outind)
    * Data Analysis __
      * [Data Analysis with Python](https://www.geeksforgeeks.org/data-analysis-with-python/?ref=outind)
      * [Data Analysis with R](https://www.geeksforgeeks.org/data-analysis-using-r/?ref=outind)
    * [Deep Learning](https://www.geeksforgeeks.org/deep-learning-tutorial/?ref=outind)
    * [NLP Tutorial](https://www.geeksforgeeks.org/natural-language-processing-nlp-tutorial/?ref=outind)
  * Web Tech __
    * [HTML Tutorial](https://www.geeksforgeeks.org/html-tutorial/?ref=outind)
    * [CSS Tutorial](https://www.geeksforgeeks.org/css-tutorial/?ref=outind)
    * [JavaScript Tutorial](https://www.geeksforgeeks.org/javascript/?ref=outind)
    * [PHP Tutorial](https://www.geeksforgeeks.org/php-tutorial/?ref=outind)
    * [ReactJS Tutorial](https://www.geeksforgeeks.org/react-tutorial/?ref=outind)
    * [NodeJS Tutorial](https://www.geeksforgeeks.org/nodejs/?ref=outind)
    * [Bootstrap Tutorial](https://www.geeksforgeeks.org/bootstrap/?ref=outind)
    * [Typescript](https://www.geeksforgeeks.org/typescript/?ref=outind)
    * Web Development Using Python __
      * [Django Tutorial](https://www.geeksforgeeks.org/django-tutorial/?ref=outind)
      * [Flask Tutorial](https://www.geeksforgeeks.org/flask-tutorial/?ref=outind)
      * [Postman](https://www.geeksforgeeks.org/postman-tutorial/?ref=outind)
      * [Github](https://www.geeksforgeeks.org/introduction-to-github/?ref=outind)
    * Cheat Sheets __
      * [HTML Cheat Sheet](https://www.geeksforgeeks.org/html-cheat-sheet-a-basic-guide-to-html/?ref=outind)
      * [CSS Cheat Sheet](https://www.geeksforgeeks.org/css-cheat-sheet-a-basic-guide-to-css/?ref=outind)
      * [JavaScript Cheat Sheet](https://www.geeksforgeeks.org/javascript-cheat-sheet-a-basic-guide-to-javascript/?ref=outind)
      * [React Cheat Sheet](https://www.geeksforgeeks.org/react-cheat-sheet/?ref=outind)
      * [Angular Cheat Sheet](https://www.geeksforgeeks.org/angular-cheat-sheet-a-basic-guide-to-angular/?ref=outind)
      * [jQuery Cheat Sheet](https://www.geeksforgeeks.org/jquery-cheat-sheet-a-basic-guide-to-jquery/?ref=outind)
      * [Bootstrap Cheat Sheet](https://www.geeksforgeeks.org/bootstrap-cheatsheet-a-basic-guide-to-bootstrap/?ref=outind)
    * [Learn Complete Web Development](https://www.geeksforgeeks.org/web-development/?ref=outind)


  * __ __ __

  * __

  * __
  * 


__

  * [DSA](https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/?ref=shm)
  * [Practice Searching Algorithms](https://www.geeksforgeeks.org/explore?page=1&category=Searching&sortBy=submissions&ref=shm)
  * [MCQs on Searching Algorithms](https://www.geeksforgeeks.org/algorithms-gq/top-mcqs-on-searching-algorithm-with-answers/?ref=shm)
  * [Tutorial on Searching Algorithms](https://www.geeksforgeeks.org/introduction-to-searching-data-structure-and-algorithm-tutorial/?ref=shm)
  * [Linear Search](https://www.geeksforgeeks.org/linear-search/?ref=shm)
  * [Binary Search](https://www.geeksforgeeks.org/binary-search/?ref=shm)
  * [Ternary Search](https://www.geeksforgeeks.org/ternary-search/?ref=shm)
  * [Jump Search](https://www.geeksforgeeks.org/jump-search/?ref=shm)
  * [Sentinel Linear Search](https://www.geeksforgeeks.org/sentinel-linear-search/?ref=shm)
  * [Interpolation Search](https://www.geeksforgeeks.org/interpolation-search/?ref=shm)
  * [Exponential Search](https://www.geeksforgeeks.org/exponential-search/?ref=shm)
  * [Fibonacci Search](https://www.geeksforgeeks.org/fibonacci-search/?ref=shm)
  * [Ubiquitous Binary Search](https://www.geeksforgeeks.org/the-ubiquitous-binary-search-set-1/?ref=shm)
  * [Linear Search Vs Binary Search](https://www.geeksforgeeks.org/linear-search-vs-binary-search/?ref=shm)
  * [Interpolation Search Vs Binary Search](https://www.geeksforgeeks.org/g-fact-84/?ref=shm)
  * [Binary Search Vs Ternary Search](https://www.geeksforgeeks.org/binary-search-preferred-ternary-search/?ref=shm)
  * [Sentinel Linear Search Vs Linear Search](https://www.geeksforgeeks.org/is-sentinel-linear-search-better-than-normal-linear-search/?ref=shm)

__

▲

[ Open In App ](https://geeksforgeeksapp.page.link/?link=https://www.geeksforgeeks.org/linear-search-vs-binary-search/?type%3Darticle%26id%3D142323&apn=free.programming.programming&isi=1641848816&ibi=org.geeksforgeeks.GeeksforGeeksDev&efr=1)

[ Next Article: Interpolation search vs Binary search ![Next article icon](https://media.geeksforgeeks.org/auth-dashboard-uploads/ep_right.svg) ](https://www.geeksforgeeks.org/g-fact-84/?ref=next_article_top)

# Linear Search vs Binary Search

Last Updated :  19 Dec, 2023

Summarize

__

Comments

__

Improve

__

  *   *   * 


__ Suggest changes

Like Article

__ Like

__ Share

__ Report

[ ![News](https://media.geeksforgeeks.org/auth-dashboard-uploads/Google-news.svg) Follow ](https://news.google.com/publications/CAAqBwgKMLTrzwsw44bnAw?hl=en-IN&gl=IN&ceid=IN%3Aen)

Prerequisite:

  * [Linear Search](https://www.geeksforgeeks.org/linear-search/)
  * [Binary Search](https://www.geeksforgeeks.org/binary-search/)



****LINEAR SEARCH****

Assume that item is in an array in random order and we have to find an item. Then the only way to search for a target item is, to begin with, the first position and compare it to the target. If the item is at the same, we will return the position of the current item. Otherwise, we will move to the next position. If we arrive at the last position of an array and still can not find the target, we return -1. This is called the Linear search or Sequential search.

Below is the code syntax for the linear search.

## C++

__

__  
__

__

__  
__  
__

`// Linear Search in C++`   `#include <iostream>` `using` `namespace` `std;`   `int` `search(``int` `array[], ``int` `n, ``int` `x)` `{`   `    ``// Going through array sequencially` `    ``for` `(``int` `i = 0; i < n; i++)` `        ``if` `(array[i] == x)` `            ``return` `i;` `    ``return` `-1;` `}`  
---  
  
__


__


## C

__

__  
__

__

__  
__  
__

`// Linear Search in C`   `#include <stdio.h>`   `int` `search(``int` `array[], ``int` `n, ``int` `x)` `{`   `    ``// Going through array sequencially` `    ``for` `(``int` `i = 0; i < n; i++)` `        ``if` `(array[i] == x)` `            ``return` `i;` `    ``return` `-1;` `}`  
---  
  
__


__


## Java

__

__  
__

__

__  
__  
__

`/*package whatever //do not write package name here */`   `import` `java.io.*;`   `class` `Main {` `    ``public` `static` `int` `liner(``int` `arr[], ``int` `x)` `    ``{` `        ``for` `(``int` `i = ``0``; i < arr.length; i++) {` `            ``if` `(arr[i] == x)` `                ``return` `i;` `        ``}` `        ``return` `-``1``;` `    ``}` `}`  
---  
  
__


__


## Python

__

__  
__

__

__  
__  
__

`# Linear Search in Python`     `def` `linearSearch(array, n, x):`   `    ``for` `i ``in` `range``(``0``, n):` `        ``if` `(array[i] ``=``=` `x):` `            ``return` `i` `    ``return` `-``1`  
---  
  
__


__


## C#

__

__  
__

__

__  
__  
__

`// Linear Search in c#` `using` `System;` `using` `System.Collections.Generic;` ` `  `class` `GFG` `{` `  ``public` `static` `int` `search(``int``[] array, ``int` `n, ``int` `x)` `  ``{` `    ``// Going through array sequencially` `    ``for` `(``int` `i = 0; i < n; i++)` `        ``if` `(array[i] == x)` `            ``return` `i;` `    ``return` `-1;` `  ``}` `}` ` `  `// This code is contributed by adityapatil12.`  
---  
  
__


__


## Javascript

__

__  
__

__

__  
__  
__

`<script>`   `// Linear Search in C++`   `function` `search(array, n, x)` `{`   `    ``// Going through array sequencially` `    ``for` `(let i = 0; i < n; i++){` `        ``if` `(array[i] == x){` `            ``return` `i;` `        ``}       ` `    ``}      ` `    ``return` `-1;` `}`   `// The coee is contributed by Gautam goel. ` `</script>`  
---  
  
__


__


****BINARY SEARCH****

In a binary search, however, cut down your search to half as soon as you find the middle of a sorted list. The middle element is looked at to check if it is greater than or less than the value to be searched. Accordingly, a search is done to either half of the given list

Below is the code syntax for the binary search.

## C++

__

__  
__

__

__  
__  
__

`#include <iostream>` `using` `namespace` `std;`   `int` `binarySearch(``int` `array[], ``int` `x, ``int` `low, ``int` `high)` `{`   `    ``// Repeat until the pointers low and high meet each` `    ``// other` `    ``while` `(low <= high) {` `        ``int` `mid = low + (high - low) / 2;`   `        ``if` `(array[mid] == x)` `            ``return` `mid;`   `        ``if` `(array[mid] < x)` `            ``low = mid + 1;`   `        ``else` `            ``high = mid - 1;` `    ``}`   `    ``return` `-1;` `}`  
---  
  
__


__


## C

__

__  
__

__

__  
__  
__

`#include <stdio.h>`   `int` `binarySearch(``int` `array[], ``int` `x, ``int` `low, ``int` `high)` `{` `    ``// Repeat until the pointers low and high meet each` `    ``// other` `    ``while` `(low <= high) {` `        ``int` `mid = low + (high - low) / 2;`   `        ``if` `(array[mid] == x)` `            ``return` `mid;`   `        ``if` `(array[mid] < x)` `            ``low = mid + 1;`   `        ``else` `            ``high = mid - 1;` `    ``}`   `    ``return` `-1;` `}`  
---  
  
__


__


## Java

__

__  
__

__

__  
__  
__

`/*package whatever //do not write package name here */`   `class` `GFG {` `    ``public` `static` `int` `binary(``int``[] arr, ``int` `x)` `    ``{` `        ``int` `start = ``0``;` `        ``int` `end = arr.length - ``1``;` `        ``while` `(start <= end) {` `            ``int` `mid = (start + end) / ``2``;` `            ``if` `(x == arr[mid]) {` `                ``return` `mid;` `            ``}` `            ``else` `if` `(x > arr[mid]) {` `                ``start = mid + ``1``;` `            ``}` `            ``else` `{` `                ``end = mid - ``1``;` `            ``}` `        ``}` `        ``return` `-``1``;` `    ``}` `}`  
---  
  
__


__


## Python

__

__  
__

__

__  
__  
__

`def` `binarySearch(array, x, low, high):`   `    ``# Repeat until the pointers low and high meet each other` `    ``while` `low <``=` `high:`   `        ``mid ``=` `low ``+` `(high ``-` `low)``/``/``2`   `        ``if` `array[mid] ``=``=` `x:` `            ``return` `mid`   `        ``elif` `array[mid] < x:` `            ``low ``=` `mid ``+` `1`   `        ``else``:` `            ``high ``=` `mid ``-` `1`   `    ``return` `-``1`  
---  
  
__


__


## C#

__

__  
__

__

__  
__  
__

`// Linear Search in c#` `using` `System;` `using` `System.Collections.Generic;` ` `  `class` `GFG` `{` `  ``public` `static` `int` `binary(``int``[] arr, ``int` `x)` `  ``{` `    ``int` `start = 0;` `    ``int` `end = arr.Length - 1;` `    ``while` `(start <= end) {` `        ``int` `mid = (start + end) / 2;` `        ``if` `(x == arr[mid]) {` `            ``return` `mid;` `        ``}` `        ``else` `if` `(x > arr[mid]) {` `            ``start = mid + 1;` `        ``}` `        ``else` `{` `            ``end = mid - 1;` `        ``}` `    ``}` `    ``return` `-1;` `  ``}` `}` ` `  `// This code is contributed by aditya942003patil`  
---  
  
__


__


## Javascript

__

__  
__

__

__  
__  
__

`<script>`   `function` `binarySearch(array, x, low, high)` `{`   `    ``// Repeat until the pointers low and high meet each` `    ``// other` `    ``while` `(low <= high) {` `        ``int mid = low + (high - low) / 2;`   `        ``if` `(array[mid] == x){` `            ``return` `mid;` `        ``}` `            `  `        ``if` `(array[mid] < x){` `            ``low = mid + 1;` `        ``}` `        ``else``{` `            ``high = mid - 1;` `        ``}` `            `  `    ``}`   `    ``return` `-1;` `}`   `// The code is contributed by gautam goel. `   `</script>`  
---  
  
__


__


****Important Differences****

****Linear Search**** |  ****Binary Search****  
---|---  
In linear search input data need not to be in sorted. | In binary search input data need to be in sorted order.  
It is also called sequential search. | It is also called half-interval search.  
The time complexity of linear search ****O(n)****.  | The time complexity of binary search****O(log n)****.  
Multidimensional array can be used. | Only single dimensional array is used.  
Linear search performs equality comparisons | Binary search performs ordering comparisons  
It is less complex. | It is more complex.  
It is very slow process. | It is very fast process.  
  
Let us look at an example to compare the two:

****Linear Search to find the element "J" in a given sorted list from A-X****

![linear-search](https://media.geeksforgeeks.org/wp-content/uploads/Linear.png)

****Binary Search to find the element "J" in a given sorted list from A-X****

![binary-search](https://media.geeksforgeeks.org/wp-content/uploads/binary-3.png)

****LINEAR SEARCHING EXAMPLE:****

## C++

__

__  
__

__

__  
__  
__

`#include <iostream>` `using` `namespace` `std;`   `int` `search(``int` `array[], ``int` `n, ``int` `x)` `{`   `    ``// Going through array sequencially` `    ``for` `(``int` `i = 0; i < n; i++)` `        ``if` `(array[i] == x)` `            ``return` `i;` `    ``return` `-1;` `}`   `int` `main()` `{` `    ``int` `array[] = { 12, 114, 0, 4, 9 };` `    ``int` `x = 4;` `    ``int` `n = ``sizeof``(array) / ``sizeof``(array[0]);`   `    ``int` `result = search(array, n, x);`   `    ``(result == -1)` `        ``? cout << ``"Element not found"` `        ``: cout << ``"Element found at index: "` `<< result;` `}`  
---  
  
__


__


## C

__

__  
__

__

__  
__  
__

`#include <stdio.h>`   `int` `search(``int` `array[], ``int` `n, ``int` `x)` `{`   `    ``// Going through array sequencially` `    ``for` `(``int` `i = 0; i < n; i++)` `        ``if` `(array[i] == x)` `            ``return` `i;` `    ``return` `-1;` `}`   `int` `main()` `{` `    ``int` `array[] = { 12, 114, 0, 4, 9 };` `    ``int` `x = 4;` `    ``int` `n = ``sizeof``(array) / ``sizeof``(array[0]);`   `    ``int` `result = search(array, n, x);`   `    ``(result == -1)` `        ``? ``printf``(``"Element not found"``)` `        ``: ``printf``(``"Element found at index: %d"``, result);` `}`  
---  
  
__


__


## Java

__

__  
__

__

__  
__  
__

`/*package whatever //do not write package name here */` `import` `java.io.*;`   `class` `GFG {` `    ``public` `static` `int` `liner(``int` `arr[], ``int` `x)` `    ``{` `        ``for` `(``int` `i = ``0``; i < arr.length; i++) {` `            ``if` `(arr[i] == x)` `                ``return` `i;` `        ``}` `        ``return` `-``1``;` `    ``}` `    ``public` `static` `void` `main(String[] args)` `    ``{` `          ``int` `arr[] = { ``12``, ``114``, ``0``, ``4``, ``9` `};` `  `  `        ``int` `search = liner(` `            ``arr,` `            ``4``); ``// Here we are searching for 10 element in` `                 ``// the array which is not present in the` `                 ``// array so, it will print -1` `        ``System.out.println(search);` `    ``}` `}`  
---  
  
__


__


## Python

__

__  
__

__

__  
__  
__

`def` `linearSearch(array, n, x):`   `    ``for` `i ``in` `range``(``0``, n):` `        ``if` `(array[i] ``=``=` `x):` `            ``return` `i` `    ``return` `-``1`     `array ``=` `[``24``, ``41``, ``31``, ``11``, ``9``]` `x ``=` `11` `n ``=` `len``(array)` `result ``=` `linearSearch(array, n, x)` `if``(result ``=``=` `-``1``):` `    ``print``(``"Element not found"``)` `else``:` `    ``print``(``"Element is Present at Index: "``, result)`  
---  
  
__


__


## C#

__

__  
__

__

__  
__  
__

`// C# program to implement above approach` `using` `System;` `using` `System.Collections.Generic;` ` `  `class` `GFG` `{` `  ``public` `static` `int` `liner(``int``[] arr, ``int` `x)` `  ``{` `    ``for` `(``int` `i = 0; i < arr.Length; i++) {` `        ``if` `(arr[i] == x)` `            ``return` `i;` `    ``}` `    ``return` `-1;` `  ``}` ` `  `  ``// Driver Code` `  ``public` `static` `void` `Main(``string``[] args){` `  `  `    ``int``[] arr = { 12, 114, 0, 4, 9 };` `    ``int` `search = liner(arr, 4); ``// Here we are searching for 10 element in` `                                 ``// the array which is not present in the` `                                 ``// array so, it will print -1` `    ``Console.Write(search);` `  ``}` `}` `//this code is contributed by aditya942003patil`  
---  
  
__


__


## Javascript

__

__  
__

__

__  
__  
__

`function` `search(array, n, x)` `{`   `    ``// Going through array sequencially` `    ``for` `(let i = 0; i < n; i++)` `        ``if` `(array[i] == x)` `            ``return` `i;` `    ``return` `-1;` `}`     `array = [12, 114, 0, 4, 9 ];` `x = 4;` `n = array.length;` `result = search(array, n, x);`     `if``(result == -1){` `    ``console.log(``"Element not found"``);` `}` `else``{` `    ``console.log(``"Elementn found at index: "``, result);` `}`   `// The code is contributed by Nidhi goel`  
---  
  
__


__


**Output**
    
    
    Element found at index: 3
    
    
    

****Time Complexity:**** O(n), where n is the size of the input array. The worst-case scenario is when the target element is not present in the array, and the function has to go through the entire array to figure that out.  
****Auxiliary Space:**** O(1), the function uses only a constant amount of extra space to store variables. The amount of extra space used does not depend on the size of the input array.

****BINARY SEARCHING EXAMPLE:****

## C++

__

__  
__

__

__  
__  
__

`#include<bits/stdc++.h>` `using` `namespace` `std;`   `int` `binarySearch(vector<``int``> arr,``int` `x,``int` `low,``int` `high){`   `    ``while``(low <= high){`   `        ``int` `mid = low + (high - low)/2;`   `        ``if` `(arr[mid] == x)` `            ``return` `mid;`   `        ``else` `if` `(arr[mid] < x)` `            ``low = mid + 1;` `        ``else` `            ``high = mid - 1;` `    ``}`   `    ``return` `-1;` `}`   `int` `main(){` `    ``vector<``int``> arr = {2, 4, 5, 7, 14, 17, 19, 22};` `    ``int` `x = 22;`   `    ``int` `result = binarySearch(arr, x, 0, arr.size()-1);`   `    ``if` `(result != -1)` `        ``cout << result << endl;` `    ``else` `        ``cout << ``"Not found"` `<< endl;` `    ``return` `0;` `}`     `// The code is constributed by Nidhi goel`  
---  
  
__


__


## C

__

__  
__

__

__  
__  
__

`#include <stdio.h>`   `int` `binarySearch(``int` `array[], ``int` `x, ``int` `low, ``int` `high)` `{` `    ``// Repeat until the pointers low and high meet each` `    ``// other` `    ``while` `(low <= high) {` `        ``int` `mid = low + (high - low) / 2;`   `        ``if` `(array[mid] == x)` `            ``return` `mid;`   `        ``if` `(array[mid] < x)` `            ``low = mid + 1;`   `        ``else` `            ``high = mid - 1;` `    ``}`   `    ``return` `-1;` `}`   `int` `main( )` `{` `    ``int` `array[] = { 2, 4, 5, 7, 14, 17, 19, 22 };` `    ``int` `n = ``sizeof``(array) / ``sizeof``(array[0]);` `    ``int` `x = 22;` `    ``int` `result = binarySearch(array, x, 0, n - 1);` `    ``if` `(result == -1)` `        ``printf``(``"Not found"``);` `    ``else` `        ``printf``(``" %d"``, result);` `    ``return` `0;` `}`  
---  
  
__


__


## Java

__

__  
__

__

__  
__  
__

`/*package whatever //do not write package name here */`   `public` `class` `GFG {` `    ``public` `static` `int` `binary(``int` `arr[], ``int` `x)` `    ``{` `        ``int` `start = ``0``;` `        ``int` `end = arr.length - ``1``;` `        ``while` `(start <= end) {` `            ``int` `mid = (start + end) / ``2``;` `            ``if` `(x == arr[mid]) {` `                ``return` `mid;` `            ``}` `            ``else` `if` `(x > arr[mid]) {` `                ``start = mid + ``1``;` `            ``}` `            ``else` `{` `                ``end = mid - ``1``;` `            ``}` `        ``}` `        ``return` `-``1``;` `    ``}` `    ``public` `static` `void` `main(String[] args)` `    ``{` `        ``int` `arr[] = { ``2``, ``4``, ``5``, ``7``, ``14``, ``17``, ``19``, ``22``};` `        ``int` `search = binary(arr, ``22``);` `        ``System.out.println(search);` `    ``}` `}`  
---  
  
__


__


## Python

__

__  
__

__

__  
__  
__

`def` `binarySearch(array, x, low, high):`   `    ``while` `low <``=` `high:`   `        ``mid ``=` `low ``+` `(high ``-` `low)``/``/``2`   `        ``if` `array[mid] ``=``=` `x:` `            ``return` `mid`   `        ``elif` `array[mid] < x:` `            ``low ``=` `mid ``+` `1`   `        ``else``:` `            ``high ``=` `mid ``-` `1`   `    ``return` `-``1`     `array ``=` `[``2``, ``4``, ``5``, ``7``, ``14``, ``17``, ``19``, ``22``]` `x ``=` `22`   `result ``=` `binarySearch(array, x, ``0``, ``len``(array)``-``1``)`   `if` `result !``=` `-``1``:` `    ``print``(``str``(result))` `else``:` `    ``print``(``"Not found"``)`  
---  
  
__


__


## C#

__

__  
__

__

__  
__  
__

`using` `System;` `using` `System.Collections.Generic;` ` `  `class` `GFG` `{` `  ``public` `static` `int` `binary(``int``[] arr, ``int` `x)` `  ``{` `    ``int` `start = 0;` `    ``int` `end = arr.Length - 1;` `    ``while` `(start <= end) {` `        ``int` `mid = (start + end) / 2;` `        ``if` `(x == arr[mid]) {` `            ``return` `mid;` `        ``}` `        ``else` `if` `(x > arr[mid]) {` `            ``start = mid + 1;` `        ``}` `        ``else` `{` `            ``end = mid - 1;` `        ``}` `    ``}` `    ``return` `-1;` `  ``}` ` `  `  ``// Driver Code` `  ``public` `static` `void` `Main(``string``[] args){` ` `  `    ``int``[] arr = { 2, 4, 5, 7, 14, 17, 19, 22 };` `    ``int` `search = binary(arr, 22);` `    ``Console.Write(search);` `  ``}` `}` `// This code is contributed by aditya942003patil`  
---  
  
__


__


## Javascript

__

__  
__

__

__  
__  
__

`<script> `   `function` `binarySearch(array, x, low, high){`   `    ``while``(low <= high){`   `        ``let mid = low + Math.floor((high - low)/2);`   `        ``if` `(array[mid] == x)` `            ``return` `mid;`   `        ``else` `if` `(array[mid] < x)` `            ``low = mid + 1;` `        ``else` `            ``high = mid - 1;` `    ``}`   `    ``return` `-1;` `}`   `let array = [2, 4, 5, 7, 14, 17, 19, 22];` `let x = 22;`   `let result = binarySearch(array, x, 0, array.length-1);` `if` `(result != -1)` `    ``console.log(result);` `else` `    ``console.log(``"Not found"``);`   `// The code is constributed by Nidhi goel ` `</script>`  
---  
  
__


__


**Output**
    
    
     7
    
    
    

****Time Complexity:**** O(log n) - Binary search algorithm divides the input array in half at every step, reducing the search space by half, and hence has a time complexity of logarithmic order.  
****Auxiliary Space:**** O(1) - Binary search algorithm requires only constant space for storing the low, high, and mid indices, and does not require any additional data structures, so its auxiliary space complexity is O(1).

  


  


__ Comment 

More info

[Advertise with us](https://www.geeksforgeeks.org/about/contact-us/?listicles)

[ Next Article ](https://www.geeksforgeeks.org/g-fact-84/?ref=next_article)

[Interpolation search vs Binary search](https://www.geeksforgeeks.org/g-fact-84/?ref=next_article)

[![author](https://media.geeksforgeeks.org/auth/profile/sb7ciorr5k5t22woqkes) __ ](https://www.geeksforgeeks.org/user/kartik/contributions/?itm_source=geeksforgeeks&itm_medium=article_author&itm_campaign=auth_user)

[kartik](https://www.geeksforgeeks.org/user/kartik/contributions/?itm_source=geeksforgeeks&itm_medium=article_author&itm_campaign=auth_user)

Follow

[ ![News](https://media.geeksforgeeks.org/auth-dashboard-uploads/Google-news.svg) ](https://news.google.com/publications/CAAqBwgKMLTrzwsw44bnAw?hl=en-IN&gl=IN&ceid=IN%3Aen)

__

Improve __

Article Tags : 

  * [DSA](https://www.geeksforgeeks.org/category/dsa/?ref=article_category)
  * [Searching](https://www.geeksforgeeks.org/category/dsa/algorithm/searching/?ref=article_category)
  * [Binary Search](https://www.geeksforgeeks.org/tag/binary-search/?ref=article_tag)



Practice Tags : 

  * [Binary Search](https://www.geeksforgeeks.org/explore?category=Binary Search&ref=article_practice_tag)
  * [Searching](https://www.geeksforgeeks.org/explore?category=Searching&ref=article_practice_tag)



### Similar Reads

  * [ Searching Algorithms  Searching algorithms are essential tools in computer science used to locate specific items within a collection of data. These algorithms are designed to efficiently navigate through data structures to find the desired information, making them fundamental in various applications such as databases, we __ 2 min read ](https://www.geeksforgeeks.org/searching-algorithms/?ref=lbp)

## Most Common Searching Algorithms

    * [ Linear Search Algorithm  Given an array, arr of n integers, and an integer element x, find whether element x is present in the array. Return the index of the first occurrence of x in the array, or -1 if it doesn't exist. Input: arr[] = [1, 2, 3, 4], x = 3Output: 2Explanation: There is one test case with array as [1, 2, 3 4] __ 9 min read ](https://www.geeksforgeeks.org/linear-search/?ref=lbp)

* * *

    * [ Binary Search Algorithm - Iterative and Recursive Implementation  Binary Search Algorithm is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half. The idea of binary search is to use the information that the array is sorted and reduce the time complexity to O(log N). Table of Content What is Binary Search Algorithm?Condit __ 15+ min read ](https://www.geeksforgeeks.org/binary-search/?ref=lbp)

* * *

## Other Searching Algorithms

    * [ Sentinel Linear Search  Sentinel Linear Search as the name suggests is a type of Linear Search where the number of comparisons is reduced as compared to a traditional linear search. In a traditional linear search, only N comparisons are made, and in a Sentinel Linear Search, the sentinel value is used to avoid any out-of-b __ 7 min read ](https://www.geeksforgeeks.org/sentinel-linear-search/?ref=lbp)

* * *

    * [ Meta Binary Search | One-Sided Binary Search  Meta binary search (also called one-sided binary search by Steven Skiena in The Algorithm Design Manual on page 134) is a modified form of binary search that incrementally constructs the index of the target value in the array. Like normal binary search, meta binary search takes O(log n) time. Meta B __ 9 min read ](https://www.geeksforgeeks.org/meta-binary-search-one-sided-binary-search/?ref=lbp)

* * *

    * [ Ternary Search  Computer systems use different methods to find specific data. There are various search algorithms, each better suited for certain situations. For instance, a binary search divides information into two parts, while a ternary search does the same but into three equal parts. It's worth noting that tern __ 15+ min read ](https://www.geeksforgeeks.org/ternary-search/?ref=lbp)

* * *

    * [ Jump Search  Like Binary Search, Jump Search is a searching algorithm for sorted arrays. The basic idea is to check fewer elements (than linear search) by jumping ahead by fixed steps or skipping some elements in place of searching all elements.For example, suppose we have an array arr[] of size n and a block (t __ 11 min read ](https://www.geeksforgeeks.org/jump-search/?ref=lbp)

* * *

    * [ Interpolation Search  Given a sorted array of n uniformly distributed values arr[], write a function to search for a particular element x in the array. Linear Search finds the element in O(n) time, Jump Search takes O(n) time and Binary Search takes O(log n) time. The Interpolation Search is an improvement over Binary Se __ 15+ min read ](https://www.geeksforgeeks.org/interpolation-search/?ref=lbp)

* * *

    * [ Exponential Search  The name of this searching algorithm may be misleading as it works in O(Log n) time. The name comes from the way it searches an element. Given a sorted array, and an element x to be searched, find position of x in the array. Input: arr[] = {10, 20, 40, 45, 55} x = 45Output: Element found at index 3I __ 15+ min read ](https://www.geeksforgeeks.org/exponential-search/?ref=lbp)

* * *

    * [ Fibonacci Search  Given a sorted array arr[] of size n and an element x to be searched in it. Return index of x if it is present in array else return -1.Â Examples:Â  Input: Â arr[] = {2, 3, 4, 10, 40}, x = 10Output:Â  3Element x is present at index 3. Input:Â  arr[] = {2, 3, 4, 10, 40}, x = 11Output: Â -1Element x is not __ 15+ min read ](https://www.geeksforgeeks.org/fibonacci-search/?ref=lbp)

* * *

    * [ The Ubiquitous Binary Search | Set 1  We are aware of the binary search algorithm. Binary search isÂ the easiest algorithm to get right. I present some interesting problems that I collected on binary search. There were some requests on binary search. I request you to honor the code, "I sincerely attempt to solve the problem and ensure th __ 15+ min read ](https://www.geeksforgeeks.org/the-ubiquitous-binary-search-set-1/?ref=lbp)

* * *

## Comparisons between Searching Algorithms

    * [ Linear Search vs Binary Search  Prerequisite: Linear SearchBinary SearchLINEAR SEARCH Assume that item is in an array in random order and we have to find an item. Then the only way to search for a target item is, to begin with, the first position and compare it to the target. If the item is at the same, we will return the position __ 11 min read ](https://www.geeksforgeeks.org/linear-search-vs-binary-search/?ref=lbp)

* * *

    * [ Interpolation search vs Binary search  Interpolation search works better than Binary Search for a Sorted and Uniformly Distributed array. Binary Search goes to the middle element to check irrespective of search-key. On the other hand, Interpolation Search may go to different locations according to search-key. If the value of the search-k __ 7 min read ](https://www.geeksforgeeks.org/g-fact-84/?ref=lbp)

* * *

    * [ Why is Binary Search preferred over Ternary Search?  The following is a simple recursive Binary Search function in C++ taken from here. C/C++ Code // CPP program for the above approach #include <bits/stdc++.h> using namespace std; // A recursive binary search function. It returns location of x in // given array arr[l..r] is present, otherwise -1 __ 11 min read ](https://www.geeksforgeeks.org/binary-search-preferred-ternary-search/?ref=lbp)

* * *

    * [ Is Sentinel Linear Search better than normal Linear Search?  Sentinel Linear search is a type of linear search where the element to be searched is placed in the last position and then all the indices are checked for the presence of the element without checking for the index out of bound case. The number of comparisons is reduced in this search as compared to __ 8 min read ](https://www.geeksforgeeks.org/is-sentinel-linear-search-better-than-normal-linear-search/?ref=lbp)

* * *

## Library implementations of Searching algorithms

    * [ Binary Search functions in C++ STL (binary_search, lower_bound and upper_bound)  In C++, STL provide various functions like std::binary_search(), std::lower_bound(), and std::upper_bound() which uses the the binary search algorithm for different purposes. These function will only work on the sorted data. There are the 3 binary search function in C++ STL: Table of Content binary_ __ 3 min read ](https://www.geeksforgeeks.org/binary-search-functions-in-c-stl-binary_search-lower_bound-and-upper_bound/?ref=lbp)

* * *

    * [ Arrays.binarySearch() in Java with Examples | Set 1  In Java, the Arrays.binarySearch() method searches the specified array of the given data type for the specified value using the binary search algorithm. The array must be sorted by the Arrays.sort() method before making this call. If it is not sorted, the results are undefined. Example: Below is a s __ 3 min read ](https://www.geeksforgeeks.org/arrays-binarysearch-java-examples-set-1/?ref=lbp)

* * *

    * [ Arrays.binarySearch() in Java with examples | Set 2 (Search in subarray)  Arrays.binarySearch()| Set 1 Covers how to find an element in a sorted array in Java. This set will cover "How to Search a key in an array within a given range including only start index". Syntax : public static int binarySearch(data_type[] arr, int fromIndex, int toIndex, data_type key) Parameters __ 5 min read ](https://www.geeksforgeeks.org/arrays-binarysearch-in-java-with-examples-set-2-search-in-subarray/?ref=lbp)

* * *

    * [ Collections.binarySearch() in Java with Examples  java.util.Collections.binarySearch() method is a java.util.Collections class method that returns the position of an object in a sorted list. // Returns index of key in a sorted list sorted in// ascending orderpublic static int binarySearch(List slist, T key)// Returns index of key in a sorted list s __ 4 min read ](https://www.geeksforgeeks.org/collections-binarysearch-java-examples/?ref=lbp)

* * *

## Easy problems on Searching algorithms

    * [ Find the Missing Number  Given an array arr[] of size n-1 with distinct integers in the range of [1, n]. This array represents a permutation of the integers from 1 to n with one element missing. Find the missing element in the array. Examples: Input: arr[] = [1, 2, 4, 6, 3, 7, 8] Output: 5Explanation: Here the size of the a __ 13 min read ](https://www.geeksforgeeks.org/find-the-missing-number/?ref=lbp)

* * *

    * [ Find the first repeating element in an array of integers  Given an array of integers arr[], The task is to find the index of first repeating element in it i.e. the element that occurs more than once and whose index of the first occurrence is the smallest. Examples: Input: arr[] = {10, 5, 3, 4, 3, 5, 6}Output: 5 Explanation: 5 is the first element that repe __ 8 min read ](https://www.geeksforgeeks.org/find-first-repeating-element-array-integers/?ref=lbp)

* * *

    * [ Missing and Repeating in an Array  Given an unsorted array of size n. Array elements are in the range of 1 to n. One number from set {1, 2, ...n} is missing and one number occurs twice in the array. The task is to find these two numbers. Examples: Input: arr[] = {3, 1, 3}Output: 3, 2Explanation: In the array, 2 is missing and 3 occur __ 15+ min read ](https://www.geeksforgeeks.org/find-a-repeating-and-a-missing-number/?ref=lbp)

* * *

    * [ Count 1's in a sorted binary array  Given a binary array arr[] of size n, which is sorted in non-increasing order, count the number of 1's in it. Examples: Input: arr[] = [1, 1, 0, 0, 0, 0, 0]Output: 2Explanation: Count of the 1's in the given array is 2. Input: arr[] = [1, 1, 1, 1, 1, 1, 1]Output: 7 Input: arr[] = [0, 0, 0, 0, 0, 0, __ 8 min read ](https://www.geeksforgeeks.org/count-1s-sorted-binary-array/?ref=lbp)

* * *

    * [ Two Sum - Pair Closest to 0  Given an integer array of N elements. You need to find the maximum sum of two elements such that sum is closest to zero. This problem is a variation of standard 2 Sum problems. Note: In Case if we have two of more ways to form sum of two elements closest to zero return the maximum sum.Example: Input __ 15 min read ](https://www.geeksforgeeks.org/two-elements-whose-sum-is-closest-to-zero/?ref=lbp)

* * *

    * [ Find a pair with the given difference  Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Examples: Input: arr[] = {5, 20, 3, 2, 50, 80}, n = 78Output: Pair Found: (2, 80) Input: arr[] = {90, 70, 20, 80, 50}, n = 45Output: No Such Pair Method 1: The simplest method is to ru __ 15+ min read ](https://www.geeksforgeeks.org/find-a-pair-with-the-given-difference/?ref=lbp)

* * *

    * [ Kth smallest element in a row-wise and column-wise sorted 2D array  Given an n x n matrix, every row and column is sorted in non-decreasing order. Given a number K where K lies in the range [1, n*n], find the Kth smallest element in the given 2D matrix. Example: Input: mat ={{10, 20, 30, 40}, {15, 25, 35, 45}, {24, 29, 37, 48}, {32, 33, 39, 50 }}K = 3Output: 20Expla __ 15+ min read ](https://www.geeksforgeeks.org/kth-smallest-element-in-a-row-wise-and-column-wise-sorted-2d-array/?ref=lbp)

* * *

    * [ Find common elements in three sorted arrays  Given three sorted arrays in non-decreasing order, print all common elements in these arrays. Note: In case of duplicate common elements, print only once. Examples: Input: A[] = {1, 5, 10, 20, 30} , B[] = {5, 13, 15, 20}, C[] = {5, 20} Output: 5 20Explanation: 5 and 20 are common in all the arrays. __ 15+ min read ](https://www.geeksforgeeks.org/find-common-elements-three-sorted-arrays/?ref=lbp)

* * *

    * [ Ceiling in a sorted array  Given a sorted array and a value x, find index of the ceiling of x. The ceiling of x is the smallest element in an array greater than or equal to x. Note: In case of multiple occurrences of ceiling of x, return the index of the first occurrence. Examples : Input: arr[] = [1, 2, 8, 10, 10, 12, 19], x __ 13 min read ](https://www.geeksforgeeks.org/ceiling-in-a-sorted-array/?ref=lbp)

* * *

    * [ Floor in a Sorted Array  Given a sorted array and a value x, find the element of the floor of x. The floor of x is the largest element in the array smaller than or equal to x. Examples: Input: arr[] = [1, 2, 8, 10, 10, 12, 19], x = 5Output: 1Explanation: Largest number less than or equal to 5 is 2, whose index is 1 Input: a __ 9 min read ](https://www.geeksforgeeks.org/floor-in-a-sorted-array/?ref=lbp)

* * *

    * [ Bitonic Point - Maximum in Increasing Decreasing Array  Given an array arr[] of integers which is initially strictly increasing and then strictly decreasing, the task is to find the bitonic point, that is the maximum value in the array. Bitonic Point is a point in bitonic sequence before which elements are strictly increasing and after which elements are __ 11 min read ](https://www.geeksforgeeks.org/find-the-maximum-element-in-an-array-which-is-first-increasing-and-then-decreasing/?ref=lbp)

* * *

    * [ Given Array of size n and a number k, find all elements that appear more than n/k times  Given an array of size n and an integer k, find all elements in the array that appear more than n/k times. Examples: Input: arr[] = {3, 1, 2, 2, 1, 2, 3, 3}, k = 4Output: {2, 3}Explanation: Here n/k is 8/4 = 2, therefore 2 appears 3 times in the array that is greater than 2 and 3 appears 3 times in __ 15+ min read ](https://www.geeksforgeeks.org/given-an-array-of-of-size-n-finds-all-the-elements-that-appear-more-than-nk-times/?ref=lbp)

* * *

## Medium problems on Searching algorithms

    * [ 3 Sum - Find All Triplets with Zero Sum  Given an array arr[], the task is to find all possible indices {i, j, k} of triplet {arr[i], arr[j], arr[k]} such that their sum is equal to zero and all indices in a triplet should be distinct (i != j, j != k, k != i). We need to return indices of a triplet in sorted order, i.e., i < j < k. E __ 11 min read ](https://www.geeksforgeeks.org/find-triplets-array-whose-sum-equal-zero/?ref=lbp)

* * *

    * [ Find the element before which all the elements are smaller than it, and after which all are greater  Given an array, find an element before which all elements are equal or smaller than it, and after which all the elements are equal or greater. Note: Print -1, if no such element exists. Examples: Input: arr[] = [5, 1, 4, 3, 6, 8, 10, 7, 9]Output: 6 Explanation: 6 is present at index 4. All elements __ 14 min read ](https://www.geeksforgeeks.org/find-the-element-before-which-all-the-elements-are-smaller-than-it-and-after-which-all-are-greater-than-it/?ref=lbp)

* * *

    * [ Largest pair sum in an array  Given an unsorted of distinct integers, find the largest pair sum in it. For example, the largest pair sum is 74. If there are less than 2 elements, then we need to return -1. Input : arr[] = {12, 34, 10, 6, 40}, Output : 74 Input : arr[] = {10, 10, 10}, Output : 20 Input arr[] = {10}, Output : -1 [ __ 10 min read ](https://www.geeksforgeeks.org/find-the-largest-pair-sum-in-an-unsorted-array/?ref=lbp)

* * *

    * [ Kath Smallest Element in Unsorted Array  Given an array arr[] of N distinct elements and a number K, where K is smaller than the size of the array. Find the K'th smallest element in the given array. Examples: Input: arr[] = {7, 10, 4, 3, 20, 15}, K = 3 Output: 7 Input: arr[] = {7, 10, 4, 3, 20, 15}, K = 4 Output: 10 Table of Content [Naive __ 15+ min read ](https://www.geeksforgeeks.org/kth-smallest-largest-element-in-unsorted-array/?ref=lbp)

* * *

    * [ Search in a Sorted and Rotated Array  Given a sorted and rotated array arr[] of n distinct elements, the task is to find the index of given key in the array. If the key is not present in the array, return -1. Examples: Input: arr[] = [5, 6, 7, 8, 9, 10, 1, 2, 3], key = 3Output: 8Explanation: 3 is present at index 8 in arr[]. Input: arr[ __ 15+ min read ](https://www.geeksforgeeks.org/search-an-element-in-a-sorted-and-pivoted-array/?ref=lbp)

* * *

    * [ Minimum in a Sorted and Rotated Array  Given a sorted array of distinct elements arr[] of size n that is rotated at some unknown point, the task is to find the minimum element in it. Examples: Input: arr[] = [5, 6, 1, 2, 3, 4]Output: 1Explanation: 1 is the minimum element present in the array. Input: arr[] = [3, 1, 2]Output: 1Explanation __ 9 min read ](https://www.geeksforgeeks.org/find-minimum-element-in-a-sorted-and-rotated-array/?ref=lbp)

* * *

    * [ Find a Fixed Point (Value equal to index) in a given array  Given an array of n distinct integers sorted in ascending order, the task is to find the First Fixed Point in the array. Fixed Point in an array is an index i such that arr[i] equals i. Note that integers in the array can be negative. Note: If no Fixed Point is present in the array, print -1. Exampl __ 7 min read ](https://www.geeksforgeeks.org/find-a-fixed-point-in-a-given-array/?ref=lbp)

* * *

    * [ Find the k most frequent words from a file  Given a book of words. Assume you have enough main memory to accommodate all words. design a data structure to find top K maximum occurring words. The data structure should be dynamic so that new words can be added. A simple solution is to use Hashing. Hash all words one by one in a hash table. If a __ 15+ min read ](https://www.geeksforgeeks.org/find-the-k-most-frequent-words-from-a-file/?ref=lbp)

* * *

    * [ Find k closest elements to a given value  Given a sorted array arr[] and a value x, find the k closest elements to x in arr[]. Note that if the element is present in array, then it should not be in output, only the other closest elements are required. Examples: Input: k = 4, x = 35, arr[] = {12, 16, 22, 30, 35, 39, 42, 45, 48, 50, 53, 55, 5 __ 15+ min read ](https://www.geeksforgeeks.org/find-k-closest-elements-given-value/?ref=lbp)

* * *

    * [ 2 Sum - Pair Sum Closest to Target using Binary Search  Given an array arr[] of n integers and an integer target, the task is to find a pair in arr[] such that itas sum is closest to target. Note: Return the pair in sorted order and if there are multiple such pairs return the pair with maximum absolute difference. If no such pair exists return an empty a __ 10 min read ](https://www.geeksforgeeks.org/2-sum-pair-sum-closest-to-target-using-binary-search/?ref=lbp)

* * *

    * [ Find the closest pair from two sorted arrays  Given two arrays arr1[0...m-1] and arr2[0..n-1], and a number x, the task is to find the pair arr1[i] + arr2[j] such that absolute value of (arr1[i] + arr2[j] - x) is minimum. Example: Input: arr1[] = {1, 4, 5, 7}; arr2[] = {10, 20, 30, 40}; x = 32Output: 1 and 30Input: arr1[] = {1, 4, 5, 7}; arr2[] __ 15+ min read ](https://www.geeksforgeeks.org/given-two-sorted-arrays-number-x-find-pair-whose-sum-closest-x/?ref=lbp)

* * *

    * [ Find three closest elements from given three sorted arrays  Given three sorted arrays A[], B[] and C[], find 3 elements i, j and k from A, B and C respectively such that max(abs(A[i] - B[j]), abs(B[j] - C[k]), abs(C[k] - A[i])) is minimized. Here abs() indicates absolute value. Example : Input : A[] = {1, 4, 10} B[] = {2, 15, 20} C[] = {10, 12} Output: 10 15 __ 15+ min read ](https://www.geeksforgeeks.org/find-three-closest-elements-from-given-three-sorted-arrays/?ref=lbp)

* * *

    * [ Search in an Array of Rational Numbers without floating point arithmetic  Given a sorted array of rational numbers, where each rational number is represented in the form p/q (where p is the numerator and q is the denominator), the task is to find the index of a given rational number x in the array. If the number does not exist in the array, return -1. Examples: Input: arr __ 9 min read ](https://www.geeksforgeeks.org/binary-search-for-rational-numbers-without-using-floating-point-arithmetic/?ref=lbp)

* * *

## Hard problems on Searching algorithms

    * [ Median of two sorted arrays of same size  Given 2 sorted arrays a[] and b[], each of size n, the task is to find the median of the array obtained after merging a[] and b[]. Note: Since the size of the merged array will always be even, the median will be the average of the middle two numbers. Input: a[] = [1, 12, 15, 26, 38], b[] = [2, 13, 1 __ 15+ min read ](https://www.geeksforgeeks.org/median-of-two-sorted-arrays/?ref=lbp)

* * *

    * [ Search in an almost sorted array  Given a sorted array arr[] of size n, some elements of array are moved to either of the adjacent positions, i.e., arr[i] may be present at arr[i+1] or arr[i-1] i.e. arr[i] can only be swapped with either arr[i+1] or arr[i-1]. The task is to search for an element in this array. Examples : Input: arr[ __ 10 min read ](https://www.geeksforgeeks.org/search-almost-sorted-array/?ref=lbp)

* * *

    * [ Find position of an element in a sorted array of infinite numbers  Given a sorted array arr[] of infinite numbers. The task is to search for an element k in the array. Examples: Input: arr[] = [3, 5, 7, 9, 10, 90, 100, 130, 140, 160, 170], k = 10Output: 4Explanation: 10 is at index 4 in array. Input: arr[] = [2, 5, 7, 9], k = 3Output: -1Explanation: 3 is not presen __ 15+ min read ](https://www.geeksforgeeks.org/find-position-element-sorted-array-infinite-numbers/?ref=lbp)

* * *

    * [ Pair Sum in a Sorted and Rotated Array  Given an array arr[] of size n, which is sorted and then rotated around an unknown pivot, the task is to check whether there exists a pair of elements in the array whose sum is equal to a given target value. Examples : Input: arr[] = [11, 15, 6, 8, 9, 10], target = 16Output: trueExplanation: There i __ 10 min read ](https://www.geeksforgeeks.org/given-a-sorted-and-rotated-array-find-if-there-is-a-pair-with-a-given-sum/?ref=lbp)

* * *

    * [ Kath Smallest/Largest Element in Unsorted Array | Worst case Linear Time  Given an array and a number k where k is smaller than the size of the array, we need to find the kath smallest element in the given array. It is given that all array elements are distinct.Examples: Input: arr[] = {7, 10, 4, 3, 20, 15} k = 3Output: 7Input: arr[] = {7, 10, 4, 3, 20, 15} k = 4Output: 1 __ 15+ min read ](https://www.geeksforgeeks.org/kth-smallest-largest-element-in-unsorted-array-worst-case-linear-time/?ref=lbp)

* * *

    * [ K'th largest element in a stream  Given an infinite stream of integers, find the Kth largest element at any point of time. Note: Here we have a stream instead of a whole array and we are allowed to store only K elements. Examples: Input: stream[] = {10, 20, 11, 70, 50, 40, 100, 5, . . .}, K = 3Output: {_, _, 10, 11, 20, 40, 50, 50, __ 14 min read ](https://www.geeksforgeeks.org/kth-largest-element-in-a-stream/?ref=lbp)

* * *

    * [ Best First Search (Informed Search)  In BFS and DFS, when we are at a node, we can consider any of the adjacent as the next node. So both BFS and DFS blindly explore paths without considering any cost function.Â  The idea of Best First Search is to use an evaluation function to decide which adjacent is most promising and then explore. B __ 9 min read ](https://www.geeksforgeeks.org/best-first-search-informed-search/?ref=lbp)

* * *




__ Like

__

[![three90RightbarBannerImg](https://media.geeksforgeeks.org/auth-dashboard-uploads/premium_oin_rbar_min.png)](https://www.geeksforgeeks.org/geeksforgeeks-premium-subscription?itm_source=geeksforgeeks&itm_medium=rightbar_oin&itm_campaign=premium)

[ ![geeksforgeeks-footer-logo](https://media.geeksforgeeks.org/auth-dashboard-uploads/gfgFooterLogo.png) ](https://www.geeksforgeeks.org/)

__

Corporate & Communications Address:

A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305) 

__

Registered Address:

K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305 

[ ](https://www.facebook.com/geeksforgeeks.org/) [ ](https://www.instagram.com/geeks_for_geeks/) [ ](https://in.linkedin.com/company/geeksforgeeks) [ ](https://twitter.com/geeksforgeeks) [ ](https://www.youtube.com/geeksforgeeksvideos)

[![GFG App on Play Store](https://media.geeksforgeeks.org/auth-dashboard-uploads/googleplay.png)](https://geeksforgeeksapp.page.link/gfg-app) [![GFG App on App Store](https://media.geeksforgeeks.org/auth-dashboard-uploads/appstore.png)](https://geeksforgeeksapp.page.link/gfg-app)

[Advertise with us](https://www.geeksforgeeks.org/advertise-with-us/?ref=footer)

  * Company
  * [About Us](https://www.geeksforgeeks.org/about/?ref=outindfooter)
  * [Legal](https://www.geeksforgeeks.org/legal/?ref=outindfooter)
  * [Privacy Policy](https://www.geeksforgeeks.org/legal/privacy-policy/?ref=outindfooter)
  * [In Media](https://www.geeksforgeeks.org/press-release/?ref=outindfooter)
  * [Contact Us](https://www.geeksforgeeks.org/about/contact-us/?ref=outindfooter)
  * [Advertise with us](https://www.geeksforgeeks.org/advertise-with-us/?ref=outindfooter)
  * [GFG Corporate Solution](https://www.geeksforgeeks.org/gfg-corporate-solution/?ref=outindfooter)
  * [Placement Training Program](https://www.geeksforgeeks.org/campus-training-program/?ref=outindfooter)
  * [GeeksforGeeks Community](https://www.geeksforgeeks.org/community/?ref=outindfooter)


  * [Languages](https://www.geeksforgeeks.org/introduction-to-programming-languages/?ref=outindfooter)
  * [Python](https://www.geeksforgeeks.org/python-programming-language/?ref=outindfooter)
  * [Java](https://www.geeksforgeeks.org/java/?ref=outindfooter)
  * [C++](https://www.geeksforgeeks.org/c-plus-plus/?ref=outindfooter)
  * [PHP](https://www.geeksforgeeks.org/php-tutorials/?ref=outindfooter)
  * [GoLang](https://www.geeksforgeeks.org/golang/?ref=outindfooter)
  * [SQL](https://www.geeksforgeeks.org/sql-tutorial/?ref=outindfooter)
  * [R Language](https://www.geeksforgeeks.org/r-tutorial/?ref=outindfooter)
  * [Android Tutorial](https://www.geeksforgeeks.org/android-tutorial/?ref=outindfooter)
  * [Tutorials Archive](https://www.geeksforgeeks.org/geeksforgeeks-online-tutorials-free/?ref=outindfooter)


  * [DSA](https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/?ref=outindfooter)
  * [Data Structures](https://www.geeksforgeeks.org/data-structures/?ref=outindfooter)
  * [Algorithms](https://www.geeksforgeeks.org/fundamentals-of-algorithms/?ref=outindfooter)
  * [DSA for Beginners](https://www.geeksforgeeks.org/complete-guide-to-dsa-for-beginners/?ref=outindfooter)
  * [Basic DSA Problems](https://www.geeksforgeeks.org/basic-coding-problems-in-dsa-for-beginners/?ref=outindfooter)
  * [DSA Roadmap](https://www.geeksforgeeks.org/complete-roadmap-to-learn-dsa-from-scratch/?ref=outindfooter)
  * [Top 100 DSA Interview Problems](https://www.geeksforgeeks.org/top-100-data-structure-and-algorithms-dsa-interview-questions-topic-wise/?ref=outindfooter)
  * [DSA Roadmap by Sandeep Jain](https://www.geeksforgeeks.org/dsa-roadmap-for-beginner-to-advanced-by-sandeep-jain/?ref=outindfooter)
  * [All Cheat Sheets](https://www.geeksforgeeks.org/geeksforgeeks-master-sheet-list-of-all-cheat-sheets/?ref=outindfooter)


  * [Data Science & ML](https://www.geeksforgeeks.org/ai-ml-ds/?ref=outindfooter)
  * [Data Science With Python](https://www.geeksforgeeks.org/data-science-tutorial/?ref=outindfooter)
  * [Data Science For Beginner](https://www.geeksforgeeks.org/data-science-for-beginners/?ref=outindfooter)
  * [Machine Learning](https://www.geeksforgeeks.org/machine-learning/?ref=outindfooter)
  * [ML Maths](https://www.geeksforgeeks.org/machine-learning-mathematics/?ref=outindfooter)
  * [Data Visualisation](https://www.geeksforgeeks.org/python-data-visualization-tutorial/?ref=outindfooter)
  * [Pandas](https://www.geeksforgeeks.org/pandas-tutorial/?ref=outindfooter)
  * [NumPy](https://www.geeksforgeeks.org/numpy-tutorial/?ref=outindfooter)
  * [NLP](https://www.geeksforgeeks.org/natural-language-processing-nlp-tutorial/?ref=outindfooter)
  * [Deep Learning](https://www.geeksforgeeks.org/deep-learning-tutorial/?ref=outindfooter)


  * [Web Technologies](https://www.geeksforgeeks.org/web-technology/?ref=outindfooter)
  * [HTML](https://www.geeksforgeeks.org/html/?ref=outindfooter)
  * [CSS](https://www.geeksforgeeks.org/css/?ref=outindfooter)
  * [JavaScript](https://www.geeksforgeeks.org/javascript/?ref=outindfooter)
  * [TypeScript](https://www.geeksforgeeks.org/typescript/?ref=outindfooter)
  * [ReactJS](https://www.geeksforgeeks.org/learn-reactjs/?ref=outindfooter)
  * [NextJS](https://www.geeksforgeeks.org/nextjs/?ref=outindfooter)
  * [Bootstrap](https://www.geeksforgeeks.org/bootstrap/?ref=outindfooter)
  * [Web Design](https://www.geeksforgeeks.org/web-design/?ref=outindfooter)


  * [Python Tutorial](https://www.geeksforgeeks.org/python-programming-language/?ref=outindfooter)
  * [Python Programming Examples](https://www.geeksforgeeks.org/python-programming-examples/?ref=outindfooter)
  * [Python Projects](https://www.geeksforgeeks.org/python-projects-beginner-to-advanced/?ref=outindfooter)
  * [Python Tkinter](https://www.geeksforgeeks.org/python-tkinter-tutorial/?ref=outindfooter)
  * [Web Scraping](https://www.geeksforgeeks.org/python-web-scraping-tutorial/?ref=outindfooter)
  * [OpenCV Tutorial](https://www.geeksforgeeks.org/opencv-python-tutorial/?ref=outindfooter)
  * [Python Interview Question](https://www.geeksforgeeks.org/python-interview-questions/?ref=outindfooter)
  * [Django](https://www.geeksforgeeks.org/django-tutorial/?ref=outindfooter)



  * Computer Science
  * [Operating Systems](https://www.geeksforgeeks.org/operating-systems/?ref=outindfooter)
  * [Computer Network](https://www.geeksforgeeks.org/computer-network-tutorials/?ref=outindfooter)
  * [Database Management System](https://www.geeksforgeeks.org/dbms/?ref=outindfooter)
  * [Software Engineering](https://www.geeksforgeeks.org/software-engineering/?ref=outindfooter)
  * [Digital Logic Design](https://www.geeksforgeeks.org/digital-electronics-logic-design-tutorials/?ref=outindfooter)
  * [Engineering Maths](https://www.geeksforgeeks.org/engineering-mathematics-tutorials/?ref=outindfooter)
  * [Software Development](https://www.geeksforgeeks.org/software-development/?ref=outindfooter)
  * [Software Testing](https://www.geeksforgeeks.org/software-testing-tutorial/?ref=outindfooter)


  * [DevOps](https://www.geeksforgeeks.org/devops-tutorial/?ref=outindfooter)
  * [Git](https://www.geeksforgeeks.org/git-tutorial/?ref=outindfooter)
  * [Linux](https://www.geeksforgeeks.org/linux-tutorial/?ref=outindfooter)
  * [AWS](https://www.geeksforgeeks.org/aws-tutorial/?ref=outindfooter)
  * [Docker](https://www.geeksforgeeks.org/docker-tutorial/?ref=outindfooter)
  * [Kubernetes](https://www.geeksforgeeks.org/kubernetes-tutorial/?ref=outindfooter)
  * [Azure](https://www.geeksforgeeks.org/microsoft-azure/?ref=outindfooter)
  * [GCP](https://www.geeksforgeeks.org/google-cloud-platform-tutorial/?ref=outindfooter)
  * [DevOps Roadmap](https://www.geeksforgeeks.org/devops-roadmap/?ref=outindfooter)


  * [System Design](https://www.geeksforgeeks.org/system-design-tutorial/?ref=outindfooter)
  * [High Level Design](https://www.geeksforgeeks.org/what-is-high-level-design-learn-system-design/?ref=outindfooter)
  * [Low Level Design](https://www.geeksforgeeks.org/what-is-low-level-design-or-lld-learn-system-design/?ref=outindfooter)
  * [UML Diagrams](https://www.geeksforgeeks.org/unified-modeling-language-uml-introduction/?ref=outindfooter)
  * [Interview Guide](https://www.geeksforgeeks.org/system-design-interview-guide/?ref=outindfooter)
  * [Design Patterns](https://www.geeksforgeeks.org/software-design-patterns/?ref=outindfooter)
  * [OOAD](https://www.geeksforgeeks.org/object-oriented-analysis-and-design/?ref=outindfooter)
  * [System Design Bootcamp](https://www.geeksforgeeks.org/system-design-interview-bootcamp-guide/?ref=outindfooter)
  * [Interview Questions](https://www.geeksforgeeks.org/most-commonly-asked-system-design-interview-problems-questions/?ref=outindfooter)


  * [Inteview Preparation](https://www.geeksforgeeks.org/technical-interview-preparation/?ref=outindfooter)
  * [Competitive Programming](https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/?ref=outindfooter)
  * [Top DS or Algo for CP](https://www.geeksforgeeks.org/top-algorithms-and-data-structures-for-competitive-programming/?ref=outindfooter)
  * [Company-Wise Recruitment Process](https://www.geeksforgeeks.org/company-wise-recruitment-process/?ref=outindfooter)
  * [Company-Wise Preparation](https://www.geeksforgeeks.org/company-preparation/?ref=outindfooter)
  * [Aptitude Preparation](https://www.geeksforgeeks.org/aptitude-questions-and-answers/?ref=outindfooter)
  * [Puzzles](https://www.geeksforgeeks.org/puzzles/?ref=outindfooter)


  * School Subjects
  * [Mathematics](https://www.geeksforgeeks.org/maths/?ref=outindfooter)
  * [Physics](https://www.geeksforgeeks.org/physics/?ref=outindfooter)
  * [Chemistry](https://www.geeksforgeeks.org/chemistry/?ref=outindfooter)
  * [Biology](https://www.geeksforgeeks.org/biology/?ref=outindfooter)
  * [Social Science](https://www.geeksforgeeks.org/social-science/?ref=outindfooter)
  * [English Grammar](https://www.geeksforgeeks.org/english-grammar/?ref=outindfooter)
  * [Commerce](https://www.geeksforgeeks.org/commerce/?ref=outindfooter)
  * [World GK](https://www.geeksforgeeks.org/tag/world-general-knowledge/?ref=outindfooter)


  * [GeeksforGeeks Videos](https://www.geeksforgeeks.org/videos/?ref=outindfooter)
  * [DSA](https://www.geeksforgeeks.org/videos/category/sde-sheet/?ref=outindfooter)
  * [Python](https://www.geeksforgeeks.org/videos/category/python/?ref=outindfooter)
  * [Java](https://www.geeksforgeeks.org/videos/category/java-w6y5f4/?ref=outindfooter)
  * [C++](https://www.geeksforgeeks.org/videos/category/c/?ref=outindfooter)
  * [Web Development](https://www.geeksforgeeks.org/videos/category/web-development/?ref=outindfooter)
  * [Data Science](https://www.geeksforgeeks.org/videos/category/data-science/?ref=outindfooter)
  * [CS Subjects](https://www.geeksforgeeks.org/videos/category/cs-subjects/?ref=outindfooter)



[@GeeksforGeeks, Sanchhaya Education Private Limited](https://www.geeksforgeeks.org/), [All rights reserved](https://www.geeksforgeeks.org/copyright-information/)

We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our [_Cookie Policy_](https://www.geeksforgeeks.org/cookie-policy/) & [_Privacy Policy_](https://www.geeksforgeeks.org/privacy-policy/) Got It ! 

![Lightbox]()

Improvement

__

Suggest changes

Suggest Changes

Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.

![geeksforgeeks-suggest-icon](https://media.geeksforgeeks.org/auth-dashboard-uploads/suggestChangeIcon.png)

Create Improvement

Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.

![geeksforgeeks-improvement-icon](https://media.geeksforgeeks.org/auth-dashboard-uploads/createImprovementIcon.png)

__

Suggest Changes

__

min 4 words, max Words Limit:1000

## Thank You!

Your suggestions are valuable to us.

## What kind of Experience do you want to share?

[ Interview Experiences ](https://write.geeksforgeeks.org/posts-new?cid=e8fc46fe-75e7-4a4b-be3c-0c862d655ed0) [ Admission Experiences ](https://write.geeksforgeeks.org/posts-new?cid=82536bdb-84e6-4661-87c3-e77c3ac04ede) [ Career Journeys ](https://write.geeksforgeeks.org/posts-new?cid=5219b0b2-7671-40a0-9bda-503e28a61c31) [ Work Experiences ](https://write.geeksforgeeks.org/posts-new?cid=22ae3354-15b6-4dd4-a5b4-5c7a105b8a8f) [ Campus Experiences ](https://write.geeksforgeeks.org/posts-new?cid=c5e1ac90-9490-440a-a5fa-6180c87ab8ae) [ Competitive Exam Experiences ](https://write.geeksforgeeks.org/posts-new?cid=5ebb8fe9-b980-4891-af07-f2d62a9735f2)


title: Python Data Structures and Algorithms - Benjamin Baka - Google Books
scrape_date: 2025-03-14T13:30:57.369573
content_type: markdown
hash: 0a0e1157233ed57c06c2ee5473ca9babe06371caf2079513d4c3cb6d587b4d1e
url:
https://books.google.com/books?hl=en&lr=&id=oHc5DwAAQBAJ&oi=fnd&pg=PP1&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&ots=TvhCHe2hhG&sig=m0_A0HoWJPqa228Uf9IqwKhL5Ts

content:
  1. [Search](https://www.google.com/search?tab=pw)
  2. [Images](https://www.google.com/imghp?hl=en&tab=pi)
  3. [Maps](https://maps.google.com/maps?hl=en&tab=pl)
  4. [Play](https://play.google.com/?hl=en&tab=p8)
  5. [YouTube](https://www.youtube.com/?tab=p1)
  6. [News](https://news.google.com/?tab=pn)
  7. [Gmail](https://mail.google.com/mail/?tab=pm)
  8. [Drive](https://drive.google.com/?tab=po)
  9. [More](https://www.google.com/intl/en/about/products?tab=ph)

    1. [Calendar](https://calendar.google.com/calendar?tab=pc)
    2. [Translate](https://translate.google.com/?hl=en&tab=pT)
    3. [Mobile](http://www.google.com/mobile/?hl=en&tab=pD)
    4. [Books](https://books.google.com/?hl=en&tab=pp)
    5. [Shopping](https://www.google.com/shopping?hl=en&source=og&tab=pf)
    6. [Blogger](https://www.blogger.com/?tab=pj)
    7. [Finance](https://www.google.com/finance?tab=pe)
    8. [Photos](https://photos.google.com/?tab=pq&pageId=none)
    9. [Docs](https://docs.google.com/document/?usp=docs_alc)
    10.     11. [Even more »](https://www.google.com/intl/en/about/products?tab=ph)




## Account Options

  1. [Sign in](https://www.google.com/accounts/Login?service=print&continue=https://books.google.com/books%3Fhl%3Den%26lr%3D%26id%3DoHc5DwAAQBAJ%26oi%3Dfnd%26pg%3DPP1%26dq%3DWhat%2Bis%2Bthe%2Bmost%2Befficient%2BPython%2Bimplementation%2Bof%2Bbinary%2Bsearch%2Bfor%2Blarge%2Bdatasets,%2Bincluding%2Bexamples%2Bof%2Bhow%2Bto%2Buse%2Bit%2Bto%2Bfind%2Belements%2Bin%2Bsorted%2Blists%2Band%2Barrays,%2Bwhile%2Balso%2Bexplaining%2Bits%2Btime%2Bcomplexity%2Band%2Badvantages%2Bover%2Blinear%2Bsearch.%26ots%3DTvhCHe2hhG%26sig%3Dm0_A0HoWJPqa228Uf9IqwKhL5Ts&hl=en&ec=GAZACg)
  2.   3. [](http://www.google.com/preferences?hl=en "Options")




[![Screen reader users: click this link for accessible mode. Accessible mode has the same essential features but works better with your reader.](//www.google.com/images/cleardot.gif)](https://books.google.com/books?hl=en&lr=&id=oHc5DwAAQBAJ&oi=fnd&pg=PP1&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&ots=TvhCHe2hhG&sig=m0_A0HoWJPqa228Uf9IqwKhL5Ts&output=html_text "Screen reader users: click this link for accessible mode. Accessible mode has the same essential features but works better with your reader.")

## [Books](/books)

[](https://books.google.com/books?id=oHc5DwAAQBAJ&printsec=frontcover&source=gbs_vpt_read)[](https://play.google.com/books/reader?id=oHc5DwAAQBAJ&lr=&source=gbs_vpt_read)[]()[]()[]()[]()

Try the new Google Books

Check out the new look and enjoy easier access to your favorite features

[Try it now](https://www.google.com/books/edition/_/oHc5DwAAQBAJ?hl=en&newbks=1&gbpv=1&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&pg=PP1&printsec=frontcover)

[No thanks](javascript:)

![](/googlebooks/images/material/ogen_bookshelf.png)

[![](/googlebooks/images/material/book_icon_color.png)Try the new Google Books![](/googlebooks/images/material/arrow_right_black_24dp.png)](https://www.google.com/books/edition/_/oHc5DwAAQBAJ?hl=en&newbks=1&gbpv=1&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&pg=PP1&printsec=frontcover)

  1. [Try the new Google Books](https://www.google.com/books/edition/Python_Data_Structures_and_Algorithms/oHc5DwAAQBAJ?hl=en&newbks=1&gbpv=1&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&pg=PP1&printsec=frontcover)
  2. [My library](https://www.google.com/accounts/Login?service=print&continue=https://books.google.com/books%3Fop%3Dlibrary&hl=en)
  3. [Help](http://books.google.com/support/topic/4359341?hl=en)
  4. [Advanced Book Search](https://books.google.com/advanced_book_search?q=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&lr=)



[Buy eBook - $31.19](https://play.google.com/store/books/details?id=oHc5DwAAQBAJ&rdid=book-oHc5DwAAQBAJ&rdot=1&source=gbs_vpt_read&pcampaignid=books_booksearch_viewport)

Get this book in print

### 

  * [Amazon.com](http://www.amazon.com/gp/search?index=books&linkCode=qs&keywords=9781786465337)
  * [Barnes&Noble.com;](https://www.barnesandnoble.com/w/_/_?ean=9781786465337)
  * [Books-A-Million](http://www.booksamillion.com/product/9781786465337)
  * [IndieBound](http://www.indiebound.org/book/9781786465337)
  * * * *

  * [Find in a library](https://books.google.com/url?id=oHc5DwAAQBAJ&pg=PP1&q=http://worldcat.org/oclc/1019491829&clientid=librarylink&usg=AOvVaw2ue6jiMRu0loQaZdAWt-x2&source=gbs_buy_r)
  * [All sellers »](https://books.google.com/books?id=oHc5DwAAQBAJ&sitesec=buy&source=gbs_buy_r)



[![Front Cover](https://books.google.com/books/publisher/content?id=oHc5DwAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&imgtk=AFLRE72H4nAjfEUlFV8tIA0FZ2yMtr5wBvS0CbY8iPgZmvyPHpigXeQO5AXiXmlAc8ArYTHljfrhpyHc6XLR2ZLGvqVTxV2HDwl219tVDBhsKEoYO_nI3wVHIGmVVvITo2n8bfRP47n5)](https://books.google.com/books?id=oHc5DwAAQBAJ&printsec=frontcover)|   
---|---  
  
# Python Data Structures and Algorithms

By Benjamin Baka

|  |   
---|---|---  
  
[About this book](https://books.google.com/books?id=oHc5DwAAQBAJ&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&lr=&source=gbs_navlinks_s)

[Terms of Service](/intl/en/googlebooks/tos.html)

### 

[![Packt Publishing Ltd](https://pagead2.googlesyndication.com/pagead/imgad?id=CLSgwOL1m8j4dxBaGDIyCDDh5GK-DOSe)](https://books.google.com/url?id=oHc5DwAAQBAJ&pg=PP1&q=http://www.packtpub.com&linkid=1&usg=AOvVaw3MI-toXUfJchHlrvcwA8_b&source=gbs_pub_info_r)| Pages displayed by permission of [Packt Publishing Ltd](https://books.google.com/url?id=oHc5DwAAQBAJ&pg=PP1&q=http://www.packtpub.com&linkid=1&usg=AOvVaw3MI-toXUfJchHlrvcwA8_b&source=gbs_pub_info_r). [Copyright](https://books.google.com/books?id=oHc5DwAAQBAJ&printsec=copyright&source=gbs_pub_info_r). | | | Front Cover| [](https://books.google.com/books?id=oHc5DwAAQBAJ&pg=PA288&lpg=PP1&ots=TvhCHe2hhG&focus=viewport&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&lr=)| [](https://books.google.com/books?id=oHc5DwAAQBAJ&pg=PP2&lpg=PP1&ots=TvhCHe2hhG&focus=viewport&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&lr=)  
---|---|---  
  | |   
  
|   
---|---  
  
[![Next Page](//www.google.com/images/cleardot.gif)](https://books.google.com/books?id=oHc5DwAAQBAJ&pg=PP2&lpg=PP1&ots=TvhCHe2hhG&focus=viewport&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&lr=)  
---


url: http://arxiv.org/abs/2406.16729v1
title: [2406.16729v1] Optimizing Search Strategies: A Study of Two-Pointer Linear Search Implementation
scrape_date: 2025-03-14T13:30:57.348644
content_type: markdown
hash: a7187131acb85e0785f6b2528d4382fc76c0c60185ebfcf67dfd61f884f21f89
content:
Skip to main content

[![Cornell University](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg)](https://www.cornell.edu/)

We gratefully acknowledge support from the Simons Foundation, [member institutions](https://info.arxiv.org/about/ourmembers.html), and all contributors. [Donate](https://info.arxiv.org/about/donate.html)

[](/IgnoreMe)

[![arxiv logo](/static/browse/0.3.4/images/arxiv-logo-one-color-white.svg)](/) > [cs](/list/cs/recent) > arXiv:2406.16729v1 

[Help](https://info.arxiv.org/help) | [Advanced Search](https://arxiv.org/search/advanced)

All fields Title Author Abstract Comments Journal reference ACM classification MSC classification Report number arXiv identifier DOI ORCID arXiv author ID Help pages Full text

Search

[![arXiv logo](/static/browse/0.3.4/images/arxiv-logomark-small-white.svg)](https://arxiv.org/)

[ ![Cornell University Logo](/static/browse/0.3.4/images/icons/cu/cornell-reduced-white-SMALL.svg) ](https://www.cornell.edu/)

open search

GO

open navigation menu

## quick links

  * [Login](https://arxiv.org/login)
  * [Help Pages](https://info.arxiv.org/help)
  * [About](https://info.arxiv.org/about)



# Computer Science > Data Structures and Algorithms

**arXiv:2406.16729v1** (cs) 

[Submitted on 24 Jun 2024]

# Title:Optimizing Search Strategies: A Study of Two-Pointer Linear Search Implementation

Authors:[Nazma Akter Zinnia](https://arxiv.org/search/cs?searchtype=author&query=Zinnia,+N+A), [Eisuke Hanada](https://arxiv.org/search/cs?searchtype=author&query=Hanada,+E)

View a PDF of the paper titled Optimizing Search Strategies: A Study of Two-Pointer Linear Search Implementation, by Nazma Akter Zinnia and Eisuke Hanada

[View PDF](/pdf/2406.16729v1)

> Abstract:This report investigates three fundamental search algorithms: Linear Search, Binary Search, and Two Pointer Search. Linear Search checks each element sequentially, Binary Search divides the search space in half, and Two Pointer Search uses two pointers to scan from both ends of a sorted list. We compare these algorithms in terms of time complexity, space complexity, and practical performance. Our findings demonstrate that while Linear Search is straightforward, it is inefficient for large datasets. Binary Search is efficient for sorted data but requires an initial sorting step. The Two Pointer Search, combining elements of both methods, offers a practical balance of simplicity and efficiency. We propose a novel implementation of the Two Pointer Search algorithm and validate its performance through comprehensive testing on various hardware configurations. The results indicate that our proposed algorithm significantly improves search efficiency, making it suitable for both sorted and unsorted datasets. Future work will extend this algorithm to more complex data structures and real-world applications. 

Comments: | 5 pages, 1 figures, 4 Tables  
---|---  
Subjects: |  Data Structures and Algorithms (cs.DS)  
Cite as: | [arXiv:2406.16729](https://arxiv.org/abs/2406.16729) [cs.DS]  
  | (or  [arXiv:2406.16729v1](https://arxiv.org/abs/2406.16729v1) [cs.DS] for this version)   
  |  <https://doi.org/10.48550/arXiv.2406.16729> Focus to learn more arXiv-issued DOI via DataCite  
  
## Submission history

From: Nazma Akter Zinnia Ms [[view email](/show-email/21930587/2406.16729)]   
**[v1]** Mon, 24 Jun 2024 15:34:25 UTC (408 KB)  


Full-text links:

## Access Paper:

View a PDF of the paper titled Optimizing Search Strategies: A Study of Two-Pointer Linear Search Implementation, by Nazma Akter Zinnia and Eisuke Hanada

  * [View PDF](/pdf/2406.16729v1)
  * [Other Formats](/format/2406.16729v1)



[ ![license icon](https://arxiv.org/icons/licenses/by-4.0.png) view license ](http://creativecommons.org/licenses/by/4.0/ "Rights to this article")

Current browse context: 

cs.DS

[< prev](/prevnext?id=2406.16729&function=prev&context=cs.DS "previous in cs.DS \(accesskey p\)")   |   [next >](/prevnext?id=2406.16729&function=next&context=cs.DS "next in cs.DS \(accesskey n\)")   


[new](/list/cs.DS/new) |  [recent](/list/cs.DS/recent) | [2024-06](/list/cs.DS/2024-06)

Change to browse by: 

[cs](/abs/2406.16729?context=cs)  


### References & Citations

  * [NASA ADS](https://ui.adsabs.harvard.edu/abs/arXiv:2406.16729)
  * [Google Scholar](https://scholar.google.com/scholar_lookup?arxiv_id=2406.16729)
  * [Semantic Scholar](https://api.semanticscholar.org/arXiv:2406.16729)



[a](/static/browse/0.3.4/css/cite.css) export BibTeX citation Loading...

## BibTeX formatted citation

×

loading...

Data provided by: 

### Bookmark

[ ![BibSonomy logo](/static/browse/0.3.4/images/icons/social/bibsonomy.png) ](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2406.16729&description=Optimizing Search Strategies: A Study of Two-Pointer Linear Search Implementation "Bookmark on BibSonomy") [ ![Reddit logo](/static/browse/0.3.4/images/icons/social/reddit.png) ](https://reddit.com/submit?url=https://arxiv.org/abs/2406.16729&title=Optimizing Search Strategies: A Study of Two-Pointer Linear Search Implementation "Bookmark on Reddit")

Bibliographic Tools

# Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer _([What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))_

Connected Papers Toggle

Connected Papers _([What is Connected Papers?](https://www.connectedpapers.com/about))_

Litmaps Toggle

Litmaps _([What is Litmaps?](https://www.litmaps.co/))_

scite.ai Toggle

scite Smart Citations _([What are Smart Citations?](https://www.scite.ai/))_

Code, Data, Media

# Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv _([What is alphaXiv?](https://alphaxiv.org/))_

Links to Code Toggle

CatalyzeX Code Finder for Papers _([What is CatalyzeX?](https://www.catalyzex.com))_

DagsHub Toggle

DagsHub _([What is DagsHub?](https://dagshub.com/))_

GotitPub Toggle

Gotit.pub _([What is GotitPub?](http://gotit.pub/faq))_

Huggingface Toggle

Hugging Face _([What is Huggingface?](https://huggingface.co/huggingface))_

Links to Code Toggle

Papers with Code _([What is Papers with Code?](https://paperswithcode.com/))_

ScienceCast Toggle

ScienceCast _([What is ScienceCast?](https://sciencecast.org/welcome))_

Demos

# Demos

Replicate Toggle

Replicate _([What is Replicate?](https://replicate.com/docs/arxiv/about))_

Spaces Toggle

Hugging Face Spaces _([What is Spaces?](https://huggingface.co/docs/hub/spaces))_

Spaces Toggle

TXYZ.AI _([What is TXYZ.AI?](https://txyz.ai))_

Related Papers

# Recommenders and Search Tools

Link to Influence Flower

Influence Flower _([What are Influence Flowers?](https://influencemap.cmlab.dev/))_

Core recommender toggle

CORE Recommender _([What is CORE?](https://core.ac.uk/services/recommender))_

  * Author
  * Venue
  * Institution
  * Topic



About arXivLabs 

# arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).

[Which authors of this paper are endorsers?](/auth/show-endorsers/2406.16729) | [Disable MathJax](javascript:setMathjaxCookie\(\)) ([What is MathJax?](https://info.arxiv.org/help/mathjax.html)) 

  * [About](https://info.arxiv.org/about)
  * [Help](https://info.arxiv.org/help)



  * contact arXivClick here to contact arXiv [ Contact](https://info.arxiv.org/help/contact.html)
  * subscribe to arXiv mailingsClick here to subscribe [ Subscribe](https://info.arxiv.org/help/subscribe)



  * [Copyright](https://info.arxiv.org/help/license/index.html)
  * [Privacy Policy](https://info.arxiv.org/help/policies/privacy_policy.html)



  * [Web Accessibility Assistance](https://info.arxiv.org/help/web_accessibility.html)
  * [arXiv Operational Status ](https://status.arxiv.org)  
Get status notifications via [email](https://subscribe.sorryapp.com/24846f03/email/new) or [slack](https://subscribe.sorryapp.com/24846f03/slack/new)


scrape_date: 2025-03-14T13:30:57.430389
content_type: markdown
hash: 98231ed28237f28e95e0fe393a76ec77e82bb603885526f66d6da823a55ad097
url:
https://books.google.com/books?hl=en&lr=&id=4IzrDwAAQBAJ&oi=fnd&pg=PP1&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&ots=I6dYC8j4UK&sig=j7roJ2s8pdhaEzsiIcep9wwkZuc

title:
40 Algorithms Every Programmer Should Know: Hone your problem-solving skills ... - Imran Ahmad - Google Books

content:
  1. [Search](https://www.google.com/search?tab=pw)
  2. [Images](https://www.google.com/imghp?hl=en&tab=pi)
  3. [Maps](https://maps.google.com/maps?hl=en&tab=pl)
  4. [Play](https://play.google.com/?hl=en&tab=p8)
  5. [YouTube](https://www.youtube.com/?tab=p1)
  6. [News](https://news.google.com/?tab=pn)
  7. [Gmail](https://mail.google.com/mail/?tab=pm)
  8. [Drive](https://drive.google.com/?tab=po)
  9. [More](https://www.google.com/intl/en/about/products?tab=ph)

    1. [Calendar](https://calendar.google.com/calendar?tab=pc)
    2. [Translate](https://translate.google.com/?hl=en&tab=pT)
    3. [Mobile](http://www.google.com/mobile/?hl=en&tab=pD)
    4. [Books](https://books.google.com/?hl=en&tab=pp)
    5. [Shopping](https://www.google.com/shopping?hl=en&source=og&tab=pf)
    6. [Blogger](https://www.blogger.com/?tab=pj)
    7. [Finance](https://www.google.com/finance?tab=pe)
    8. [Photos](https://photos.google.com/?tab=pq&pageId=none)
    9. [Docs](https://docs.google.com/document/?usp=docs_alc)
    10.     11. [Even more »](https://www.google.com/intl/en/about/products?tab=ph)




## Account Options

  1. [Sign in](https://www.google.com/accounts/Login?service=print&continue=https://books.google.com/books%3Fhl%3Den%26lr%3D%26id%3D4IzrDwAAQBAJ%26oi%3Dfnd%26pg%3DPP1%26dq%3DWhat%2Bis%2Bthe%2Bmost%2Befficient%2BPython%2Bimplementation%2Bof%2Bbinary%2Bsearch%2Bfor%2Blarge%2Bdatasets,%2Bincluding%2Bexamples%2Bof%2Bhow%2Bto%2Buse%2Bit%2Bto%2Bfind%2Belements%2Bin%2Bsorted%2Blists%2Band%2Barrays,%2Bwhile%2Balso%2Bexplaining%2Bits%2Btime%2Bcomplexity%2Band%2Badvantages%2Bover%2Blinear%2Bsearch.%26ots%3DI6dYC8j4UK%26sig%3Dj7roJ2s8pdhaEzsiIcep9wwkZuc&hl=en&ec=GAZACg)
  2.   3. [](http://www.google.com/preferences?hl=en "Options")




[![Screen reader users: click this link for accessible mode. Accessible mode has the same essential features but works better with your reader.](//www.google.com/images/cleardot.gif)](https://books.google.com/books?hl=en&lr=&id=4IzrDwAAQBAJ&oi=fnd&pg=PP1&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&ots=I6dYC8j4UK&sig=j7roJ2s8pdhaEzsiIcep9wwkZuc&output=html_text "Screen reader users: click this link for accessible mode. Accessible mode has the same essential features but works better with your reader.")

## [Books](/books)

[](https://books.google.com/books?id=4IzrDwAAQBAJ&printsec=frontcover&source=gbs_vpt_read)[](https://play.google.com/books/reader?id=4IzrDwAAQBAJ&lr=&source=gbs_vpt_read)[]()[]()[]()[]()

Try the new Google Books

Check out the new look and enjoy easier access to your favorite features

[Try it now](https://www.google.com/books/edition/_/4IzrDwAAQBAJ?hl=en&newbks=1&gbpv=1&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&pg=PP1&printsec=frontcover)

[No thanks](javascript:)

![](/googlebooks/images/material/ogen_bookshelf.png)

[![](/googlebooks/images/material/book_icon_color.png)Try the new Google Books![](/googlebooks/images/material/arrow_right_black_24dp.png)](https://www.google.com/books/edition/_/4IzrDwAAQBAJ?hl=en&newbks=1&gbpv=1&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&pg=PP1&printsec=frontcover)

  1. [Try the new Google Books](https://www.google.com/books/edition/40_Algorithms_Every_Programmer_Should_Kn/4IzrDwAAQBAJ?hl=en&newbks=1&gbpv=1&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&pg=PP1&printsec=frontcover)
  2. [My library](https://www.google.com/accounts/Login?service=print&continue=https://books.google.com/books%3Fop%3Dlibrary&hl=en)
  3. [Help](http://books.google.com/support/topic/4359341?hl=en)
  4. [Advanced Book Search](https://books.google.com/advanced_book_search?q=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&lr=)



[Buy eBook - $31.19](https://play.google.com/store/books/details?id=4IzrDwAAQBAJ&rdid=book-4IzrDwAAQBAJ&rdot=1&source=gbs_vpt_read&pcampaignid=books_booksearch_viewport)

Get this book in print

### 

  * [Amazon.com](http://www.amazon.com/gp/search?index=books&linkCode=qs&keywords=9781789809862)
  * [Barnes&Noble.com;](https://www.barnesandnoble.com/w/_/_?ean=9781789809862)
  * [Books-A-Million](http://www.booksamillion.com/product/9781789809862)
  * [IndieBound](http://www.indiebound.org/book/9781789809862)
  * * * *

  * [Find in a library](https://books.google.com/url?id=4IzrDwAAQBAJ&pg=PP1&q=http://worldcat.org/oclc/1158746283&clientid=librarylink&usg=AOvVaw3syBnmPscq8VX1M-U3cMNB&source=gbs_buy_r)
  * [All sellers »](https://books.google.com/books?id=4IzrDwAAQBAJ&sitesec=buy&source=gbs_buy_r)



[![Front Cover](https://books.google.com/books/publisher/content?id=4IzrDwAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&imgtk=AFLRE72f-SVLfj-re-mIDtzmVWSj5A6TCDoIWxlir_-88ZnCLUuQa-zxf9DZeixynTio7yvRlKUo5BqCqMacAY9g_5FPQgrJJzEoZkJUaAw8fsLQZttnfJYpupzGOZqKVJZwY6cfMaD-)](https://books.google.com/books?id=4IzrDwAAQBAJ&printsec=frontcover)|   
---|---  
  
# 40 Algorithms Every Programmer Should Know: Hone your problem-solving skills ...

By Imran Ahmad

|  |   
---|---|---  
  
[About this book](https://books.google.com/books?id=4IzrDwAAQBAJ&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&lr=&source=gbs_navlinks_s)

[Terms of Service](/intl/en/googlebooks/tos.html)

### 

[![Packt Publishing Ltd](https://pagead2.googlesyndication.com/pagead/imgad?id=CLSgwOL1m8j4dxBaGDIyCDDh5GK-DOSe)](https://books.google.com/url?id=4IzrDwAAQBAJ&pg=PP1&q=http://www.packtpub.com&linkid=1&usg=AOvVaw3A035Drp4nC5Vy6Gfwqu4_&source=gbs_pub_info_r)| Pages displayed by permission of [Packt Publishing Ltd](https://books.google.com/url?id=4IzrDwAAQBAJ&pg=PP1&q=http://www.packtpub.com&linkid=1&usg=AOvVaw3A035Drp4nC5Vy6Gfwqu4_&source=gbs_pub_info_r). [Copyright](https://books.google.com/books?id=4IzrDwAAQBAJ&printsec=copyright&source=gbs_pub_info_r). | | | Front Cover| [](https://books.google.com/books?id=4IzrDwAAQBAJ&pg=PA357&lpg=PP1&ots=I6dYC8j4UK&focus=viewport&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&lr=)| [](https://books.google.com/books?id=4IzrDwAAQBAJ&pg=PP2&lpg=PP1&ots=I6dYC8j4UK&focus=viewport&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&lr=)  
---|---|---  
  | |   
  
|   
---|---  
  
[![Next Page](//www.google.com/images/cleardot.gif)](https://books.google.com/books?id=4IzrDwAAQBAJ&pg=PP2&lpg=PP1&ots=I6dYC8j4UK&focus=viewport&dq=What+is+the+most+efficient+Python+implementation+of+binary+search+for+large+datasets,+including+examples+of+how+to+use+it+to+find+elements+in+sorted+lists+and+arrays,+while+also+explaining+its+time+complexity+and+advantages+over+linear+search.&lr=)  
---


url: https://builtin.com/data-science/binary-search-implementation-python
title: Binary Search Implementation in Python: A Tutorial | Built In
scrape_date: 2025-03-14T13:30:57.707123
content_type: markdown
hash: d497b6dde3b49c5ff798ec24df36fb24ecf30717d9b2c28c35b66958b13c1b20
content:
[![Built In Logo](https://static.builtin.com/dist/images/bi-header-logo.svg) ![Built In Logo](https://static.builtin.com/dist/images/bi-header-logo.svg)](/)

__

__

[__ Can't find your company? Create a company profile.](/node/add/company)

[View All Jobs](/jobs)

[ For Employers ](/job-slots)

[ Join ](/auth/signup?destination=%2fdata-science%2fbinary-search-implementation-python)

[ Log In ](/auth/login?destination=%2fdata-science%2fbinary-search-implementation-python)

  * [Jobs](/jobs)
  * [Companies](/companies)
  * [Remote](/jobs/remote)
  * [Articles](/tech-topics)
  * [Salaries](/salaries)
  * [Best Places To Work](https://builtin.com/awards/us/2025/best-places-to-work)
  * [ __My items](/auth/login?destination=/home/jobs/saved)




[Data Science](/tag/data-science "Data Science") [Expert Contributors](/tag/expert-contributors "Expert Contributors") [Software Engineering Perspectives](/tag/software-engineering-perspectives "Software Engineering Perspectives")

+2




# How to Implement Binary Search in Python

Binary search is a method for searching a sorted list of data to find an item. Here’s how to implement it in Python. 

![Akshay Kumar](https://cdn.builtin.com/cdn-cgi/image/f=auto,w=96,h=96,q=100/https://builtin.com/sites/www.builtin.com/files/2022-12/Akshay%20Kumar.jpeg)

Written by [Akshay Kumar](https://builtin.com/authors/akshay-kumar)

Published on Feb. 28, 2023

__ __ [ __](https://www.linkedin.com/shareArticle?url=https%3A%2F%2Fbuiltin.com%2Fdata-science%2Fbinary-search-implementation-python&mini=true "Share on LinkedIn")

![A person coding with binary tree illustration](https://cdn.builtin.com/cdn-cgi/image/f=auto,fit=cover,w=320,h=200,q=80/https://builtin.com/sites/www.builtin.com/files/2023-02/binary-search-implementation-python.jpg)

Image: Shutterstock / Built In

![Brand Studio Logo](https://static.builtin.com/dist/images/expert-badge.svg)

Binary search is an efficient algorithm to find an item from a [_sorted list_](https://builtin.com/data-science/python-list) of items. In comparison to other searching algorithms, binary search is the most popular algorithm for efficiently identifying the target element.

## Binary Search Explained

Binary search is a method for searching a sorted list of data to find an item. It uses a divide-and-conquer algorithm, in which it selects a number in the middle of a sorted data array and splits the array. It then updates the array based on whether the target value is less than or greater than the middle element until it finds the desired value. It’s a useful algorithm when dealing with large quantities of sorted data and has a time complexity of O(log(n)). 

 

## What Is Binary Search?

Binary search is a method of searching __ for the desired item in a [sorted list of data](https://builtin.com/data-science/how-to-create-list-array-python). It is called binary because it [splits an array](https://builtin.com/data-science/data-types-statistics) into two halves as part of the algorithm.

Binary search is used to find an element in [O(log(n))](https://builtin.com/software-engineering-perspectives/nlogn) time in a sorted array, where n is the size of an array. The pre-requisite of the binary search algorithm is that the array must be sorted. The algorithm uses two pointers, representing the left and right endpoints of an array. It compares the target value with the middle element of an array and then updates the array based on whether the target value is less than or greater than the middle element. The process is repeated until the element is found.

Binary search uses the [divide and conquer](https://builtin.com/data-science/classification-tree) algorithm for searching an element. Before diving into the implementation and how it works, it’s important to understand what binary and divide and conquer mean.

More on Data Science[How Database B-Tree Indexing Works](https://builtin.com/data-science/b-tree-index)

 

### What Does Binary Mean?

In computer science, the term binary**** means 0,1 (we also call this bits). But in this algorithm, the term binary means if we have a long list of items and we split the list into two halves, then we call it a binary algorithm. In other words, it’s a search algorithm that divides the search interval into two halves at each step of the search until it either finds or determines that the target element is not in the list. Each division cuts the remaining portion of the list in half, which results in a binary tree structure.

Let’s look at an example.

Suppose we have a list of items inside an array. In the above definition, we understood that as part of the algorithm, binary means splitting an array into two halves. 

So, let’s divide the array into two halves while picturing the same thing in our minds.

![illustration of an array split into a binary](https://builtin.com/sites/www.builtin.com/files/styles/ckeditor_optimize/public/inline-images/1_binary-search-implementation-python.jpg) An illustration of an array split into two halves in a binary search. | Image: Akshay Kumar

In the above example we have an array of sorted items.We divide the list into two halves. As a part of the binary search method, this is referred to as binary.

 

### What Is Divide and Conquer?

Divide and conquer, as the names imply, mean splitting an array in half and merging. Let’s use the same example to explain conquering (merging) visually.

![Two arrays combined representing the divide and conquer algorithm](https://builtin.com/sites/www.builtin.com/files/styles/ckeditor_optimize/public/inline-images/2_binary-search-implementation-python.jpg) Two split arrays, merged together representing the divide and conquer algorithm. | Image: Akshay Kumar

Divide is the term used to describe splitting an array into two halves in the first image, while conquer**** is the term used to describe the merging. Two split arrays are combined into one large array in the second image.

 

## Is Binary Search Faster Than Linear Search?

When it comes to search algorithms, binary search is generally considered the most common one. Indeed, it’s a very useful algorithm to search an element from a list of sorted items.

Binary search has a [time complexity](https://builtin.com/software-engineering-perspectives/time-complexity) of O(log(n)). In contrast, a linear search algorithm has a time complexity of O(n). As a result, linear search will take linear time as the size of the array increases. What does that mean? Suppose we have 1000 elements in an array and the target element is 999. A linear search algorithm will take O(1000) time to search an element, whereas binary search will take O(9) time to search an element. 

As a result, binary search is faster than linear search for large arrays. On every iteration, binary search eliminates half of the remaining elements from the search space, whereas linear search examines each element one by one.

We can use two different algorithms to search an element from the list. Those two algorithms are linear search and binary search. 

 

### Linear search vs Binary Search

Linear search and binary search are the two common algorithms used for searching for an element in an array.

Linear is data that is connected one after another in a linear format. In the context of an algorithm, a linear search is a search that tries to find the element in a list one by one. Until a match is found, it will begin looking for an element from the beginning and move on to the next element. 

In binary search, we split the array into two halves and find the target element. Binary search doesn’t search for an element sequentially.

In terms of time and space efficiency, binary search is more effective because its time complexity is O(log(n)), whereas that of linear search is O(n). To compare the speeds, we use what’s called an asymptotic analysis**,** otherwise known as a run-time performance**,** which involves calculating the running time of the algorithm. 

The definition of**** logarithmic (log) in mathematics is: `log(x) = y if 2^y = x`. In computer science, we always assume the base is two for logs,**** i.e binary base two. Let’s look at some different values of x, and see the result.

  * When x = 1, log(1) = 0        [2^0 =1]
  * When x = 2, log(2) = 1,       [2^1 =2]
  * When x = 4, log(4) = 2,       [2^2 =4]
  * When x = 8, log(8) = 3,       [2^3 =8]
  * When x = 16, log(16) = 4    [2^4 =16]



The observation from the above-calculated value is “When we double x, we are only increasing y by 1.” Now, what this really means is, as the input doubles, the elementary operations in the algorithm only increase by 1.

Let’s take the example of a binary search. Given an array of integer elements, search the target number in an array.

The binary search algorithm uses the divide and conquer algorithm for searching an element. It splits the array into two halves, and based on the target element and middle element of the array, it decides which half of the number will be present and repeats until the target element is not found.

Suppose the number of elements in an array is 8 (n = 8). As we know: `log(8) = 3   [2^3 =8]`

If we do two to the third power we will get eight. So, to find the target element in a list, the algorithm will take only three operations. This proves that with three operations we get our target element. Let’s analyze binary search and linear search graphically. The graph analysis of the linear search algorithm and binary search algorithm is as follows:

![Time complexity graph comparing linear and binary search algorithms.](https://builtin.com/sites/www.builtin.com/files/styles/ckeditor_optimize/public/inline-images/3_binary-search-implementation-python.jpg) Time complexity graph comparing linear and binary search algorithms. | Image: Akshay Kumar

In the above figure, the yellow line is the time complexity of the linear search algorithm(O(n)). The blue line is the time complexity of the binary search algorithm(O(log n)).

 

## How Does the Binary Search Algorithm Work?

There are three possible scenarios to find the element in an array or list.

  * **Search criteria = middle item** : Item found.
  * **Search criteria < middle item**: Search the first half of the array.
  * **Search criteria > middle item**: Search the upper half of the array.



The steps followed by the binary search algorithm include:

  1. Let n = length of the array, let min = 0 and max = n-1.
  2. Calculate middle as the average of max and min, rounded down (so it’s an integer).
  3. If `array [middle]` equals the target, then stop. You found it. Return guess.
  4. If the middle was too low, that is, `array [middle] < target,` then set `min = middle + 1`.
  5. Otherwise, the middle was too high. Set `max = middle - 1`.
  6. Go back to step 2.



More on Data Science[How Do You Use Data Structures and Algorithms in Python](https://builtin.com/data-science/data-structures-and-algorithms-in-python)

 

## What Is Binary Search Algorithm’s Time-Space Complexity?

The time complexity of the binary search algorithm is logn,**** and the space complexity is constant (1) because we don’t use any extra auxiliary space to temporarily store data items.

 

## How to Implement Binary Search in Python

The following is the code implementation of the binary search algorithm. Two solutions have been covered for the implementation.

In binary search, we look for an element X(target) in a sorted array by first comparing the target to the middle element of an array. If the target is less than the middle element, then we search the left half of the array. If the target is greater than the middle element, then we search the right half of the array. We then repeat this process, until we find our target. 

If the target element isn’t found in the list, it returns a null value based on the return type of the specific programming language. In [Python](https://builtin.com/software-engineering-perspectives/python), if the target value isn’t in the list, it returns -1. This is because most binary search implementations return the index of the target element and -1 is not a valid index.

 

### Recursive Binary Search Implementation in Python 

A recursive implementation is the one that uses a function and calls itself to search for the target element. Here is an example implementation of binary search in [Python](https://builtin.com/software-engineering-perspectives/python-guide) using recursion.
    
    
    def binarySearch(array, target):
        return binarySearchHelper(array, target, 0, len(array)-1);
    def binarySearchHelper(array, target, left, right):
        if left > right:
            return -1
        middle = (left+right) // 2
        potentialMatch = array[middle]
        if target == potentialMatch:
                return middle
        elif target < potentialMatch:
            return binarySearchHelper(array, target, left, middle - 1)
        else:
            return binarySearchHelper(array, target, middle + 1, right)

In this implementation, the function `binarySearchHelper`takes four parameters: the array to search, the target element to find, the lowest index to search in the array (initially 0), and the highest index to search in the array (initially `len(arr) - 1`).

If we recall all the steps of binary search working, the algorithm will calculate the middle value and compare with the target element and if it doesn’t match, it will move the pointer left or right based on the middle value. The function uses recursion to call itself by passing new left and right values. The process continues until the target element found or search space is empty.

 

### Iterative Binary Search Implementation in Python.

An iterative implementation is the one that uses a [loop](https://builtin.com/software-engineering-perspectives/control-flow) to search for the target element. Here’s an example implementation of binary search in Python using iteration.
    
    
    def binarySearch(array, target):
        left, right = 0, len(array)-1
        while left <= right:
            middle = (left+right) // 2
            potentialMatch = array[middle]
            if target == potentialMatch:
                return middle
            elif target < potentialMatch:
                right = middle - 1
            else:
                left = middle + 1
        return -1

In this implementation, the function binarySearch takes two parameters: the array to search, the target element to find. The function initializes the ‘left’ and ‘right’ indices to the beginning and the end of the array respectively. 

The function enters the [while loop](https://builtin.com/software-engineering-perspectives/can-you-put-a-for-loop-in-an-if-statement). At each iteration, the middle value is calculated until it reaches the matching target number. Once it does, the algorithm will return the target element index. If the target number is less than the middle element, the function updates the left pointer to middle index +1. If the target element is greater than the middle element, the function updates the right pointer to middle index -1.

If the target element isn’t found in the array, the function returns -1. 

A tutorial on how to implement binary search in Python. | Video: Telusko

 

## Advantages of Binary Search

Binary search is a powerful and efficient algorithm that can be used to search datasets of any size. Its advantages include:

  * It’s a very efficient search algorithm, especially when dealing with large data sets.
  * It’s a simple algorithm to implement. It only requires basic loops and conditional statements, and it can be implemented with any programming language.
  * It can be used on a wide variety of data structures, including sorted arrays and binary trees. This makes it a versatile searching algorithm.
  * It doesn’t require additional memory to perform its search.
  * It’s guaranteed to find the target element if it exists in the list. If the target element doesn’t exist in the list, it returns -1.



Binary search is most useful in the following situations:

  * When dealing with larger data sets. Binary search is much faster than other search algorithms. So, we can use this algorithm when we need to search in a huge data set.
  * The search is frequent. If a particular search needs to be performed multiple times on the same data set, then it may be worth using binary search to improve overall performance of the application.



 

## Disadvantages of Binary Search

Binary search does have some limitations, and it may not be suitable for all situations. It’s important to consider the size and nature of the data set.  The disadvantages of binary search include:

  * Binary search can only be used on sorted data.
  * Sorting can be an expensive operation and can take additional time and space.
  * Binary search requires random access to elements in the data set, which means that it’s not suitable for linked lists and data structures that don’t use random access.
  * It can be memory inefficient in recursive implementation. When a function calls itself recursively, on every call, a new layer is added on the stack. This can be a problem if you’re operating in a memory-constrained environment.
  * Binary search is time-consuming when the data is dynamic.



And that’s the binary search algorithm. 

### Recent Data Science Articles

[ ![19 Natural Language Processing Examples to Know](https://cdn.builtin.com/cdn-cgi/image/f=auto,fit=contain,w=120,h=70,q=80/https://builtin.com/sites/www.builtin.com/files/2022-07/natural-language-processing-examples.png) 19 Natural Language Processing Examples to Know  ](https://builtin.com/artificial-intelligence/natural-language-processing-examples-applications) [ ![Elbow Method in K-Means Clustering: Definition, Drawbacks, vs. Silhouette Score](https://cdn.builtin.com/cdn-cgi/image/f=auto,fit=contain,w=120,h=70,q=80/https://builtin.com/sites/www.builtin.com/files/2023-08/elbow-method.jpg) Elbow Method in K-Means Clustering: Definition, Drawbacks, vs. Silhouette Score  ](https://builtin.com/data-science/elbow-method) [ ![Dscout Discusses How to Collect User Data on Gender Identity — and When Not to](https://cdn.builtin.com/cdn-cgi/image/f=auto,fit=contain,w=120,h=70,q=80/https://builtin.com/sites/www.builtin.com/files/Data%2520Rainbow.png) Dscout Discusses How to Collect User Data on Gender Identity -- and When Not to  ](https://builtin.com/data-science/dscout-gender-identity-data-practice)

__

Explore Job Matches.

Job Title or Keyword __ Clear search




Location __

No Results Found




__ Job Type

Clear Apply

See Jobs

  * [__ Jobs](/jobs)
  * [__ Companies](/companies)
  * [__ Articles](/tech-topics)
  * [ __ My Items](/home/jobs/saved)
  *  __

More




![Built In](https://static.builtin.com/dist/images/midnight_9.svg)

[ Join ](/auth/signup?destination=%2fdata-science%2fbinary-search-implementation-python)

[ Log In ](/auth/login?destination=%2fdata-science%2fbinary-search-implementation-python)

  * [__ Tech Jobs](/jobs)
  * [__ Companies](/companies)
  * [__ Articles](/tech-topics)
  * [__ Remote](/jobs/remote)
  * [ __ Salaries](/salaries)
  * [ __ Best Places To Work](https://builtin.com/awards/us/2025/best-places-to-work)
  * [ __ Tech Hubs](/tech-hubs)



[ Post Job ](https://employers.builtin.com/membership?utm_medium=BIReferral&utm_source=foremployers)

[![BuiltIn](https://static.builtin.com/dist/images/builtin-logo.svg)](/)

![United We Tech](https://static.builtin.com/dist/images/united-we-tech.svg)

Built In is the online community for startups and tech companies. Find startup jobs, tech news and events. 

[__](https://facebook.com/builtinhq)[__](https://twitter.com/builtin)[__](https://www.instagram.com/builtin)[__](https://www.linkedin.com/company/3763094)

About

[ Our Story ](https://builtin.com/our-story)

[ Careers ](https://employers.builtin.com/careers/)

[ Our Staff Writers ](https://builtin.com/our-staff)

[ Content Descriptions ](https://builtin.com/content-descriptions)

* * *

Get Involved

[ Recruit With Built In ](https://employers.builtin.com/membership?utm_medium=BIReferral&utm_source=foremployers)

[ Become an Expert Contributor ](https://builtin.com/expert-contributors)

* * *

Resources

[ Customer Support ](https://knowledgebase.builtin.com/s/)

[ Share Feedback ](https://form.jotform.com/223044927257054)

[ Report a Bug ](https://knowledgebase.builtin.com/s/contactsupport)

[ Browse Jobs ](https://builtin.com/browse-jobs)

[ Tech A-Z ](https://builtin.com/tech-dictionary)

* * *

Tech Hubs

[Our Sites](https://builtin.com/our-sites)

* * *

[ Learning Lab User Agreement ](https://builtin.com/learning-lab-user-agreement) [ Accessibility Statement ](https://builtin.com/accessibility-statement) [ Copyright Policy ](https://builtin.com/copyright-policy) [ Privacy Policy ](https://builtin.com/privacy-policy) [ Terms of Use ](https://builtin.com/community-terms-of-use) [ Your Privacy Choices/Cookie Settings ](https://builtin.com/california-do-not-sell-my-information) [ CA Notice of Collection ](https://builtin.com/ca-notice-collection)

© Built In 2025


url: https://doi.org/https://doi.org/10.1186/s40537-020-00305-w
title: Survey on categorical data for neural networks | Journal of Big Data | Full Text
scrape_date: 2025-03-14T13:30:57.707177
content_type: markdown
hash: ef4b1ef3311595ebe25f12090e525688e5fa3d3021f110bf874438188e4b35aa
content:
Skip to main content

Advertisement

[ ![Advertisement](//pubads.g.doubleclick.net/gampad/ad?iu=/270604982/springer_open/journalofbigdata/articles&sz=728x90,970x90&pos=LB1&doi=10.1186/s40537-020-00305-w&type=article&kwrd=Deep learning,Neural networks,Embedding,Encoding,Qualitative data,Big data&pmc=I18024,I18032,I18030,M14026,M13110,T24035&) ](//pubads.g.doubleclick.net/gampad/jump?iu=/270604982/springer_open/journalofbigdata/articles&sz=728x90,970x90&pos=LB1&doi=10.1186/s40537-020-00305-w&type=article&kwrd=Deep learning,Neural networks,Embedding,Encoding,Qualitative data,Big data&pmc=I18024,I18032,I18030,M14026,M13110,T24035&)

[ ![SpringerOpen](/static/images/springeropen/logo-springer-open-d04c3ea16c.svg) ](https://www.springeropen.com)

Search

  * [ Get published ](//www.springeropen.com/get-published)
  * [ Explore Journals ](//www.springeropen.com/journals)
  * [ Books ](https://www.springer.com/gp/open-access/books)
  * [ About ](//www.springeropen.com/about)
  * [ My account ](https://www.springeropen.com/account)



Search all SpringerOpen articles

Search

[Journal of Big Data](/)

  * [About](/about)
  * [Articles](/articles)
  * [Submission Guidelines](/submission-guidelines)
  * [Submit manuscript](https://submission.nature.com/new-submission/40537/3)




Survey on categorical data for neural networks 

[ Download PDF ](//journalofbigdata.springeropen.com/counter/pdf/10.1186/s40537-020-00305-w.pdf)

[ Download ePub ](//journalofbigdata.springeropen.com/counter/epub/10.1186/s40537-020-00305-w.epub)

[ Download PDF ](//journalofbigdata.springeropen.com/counter/pdf/10.1186/s40537-020-00305-w.pdf)

[ Download ePub ](//journalofbigdata.springeropen.com/counter/epub/10.1186/s40537-020-00305-w.epub)

  * Survey Paper
  * [Open access](https://www.springernature.com/gp/open-research/about/the-fundamentals-of-open-access-and-open-research)
  * Published: 10 April 2020



# Survey on categorical data for neural networks

  * John T. Hancock1 &
  * Taghi M. Khoshgoftaar1



[_Journal of Big Data_](/) **volume 7**, Article number: 28 (2020) Cite this article

  * 41k Accesses

  * 320 Citations

  * 4 Altmetric

  * [Metrics details](/articles/10.1186/s40537-020-00305-w/metrics)




## Abstract

This survey investigates current techniques for representing qualitative data for use as input to neural networks. Techniques for using qualitative data in neural networks are well known. However, researchers continue to discover new variations or entirely new methods for working with categorical data in neural networks. Our primary contribution is to cover these representation techniques in a single work. Practitioners working with big data often have a need to encode categorical values in their datasets in order to leverage machine learning algorithms. Moreover, the size of data sets we consider as big data may cause one to reject some encoding techniques as impractical, due to their running time complexity. Neural networks take vectors of real numbers as inputs. One must use a technique to map qualitative values to numerical values before using them as input to a neural network. These techniques are known as embeddings, encodings, representations, or distributed representations. Another contribution this work makes is to provide references for the source code of various techniques, where we are able to verify the authenticity of the source code. We cover recent research in several domains where researchers use categorical data in neural networks. Some of these domains are natural language processing, fraud detection, and clinical document automation. This study provides a starting point for research in determining which techniques for preparing qualitative data for use with neural networks are best. It is our intention that the reader should use these implementations as a starting point to design experiments to evaluate various techniques for working with qualitative data in neural networks. The third contribution we make in this work is a new perspective on techniques for using categorical data in neural networks. We organize techniques for using categorical data in neural networks into three categories. We find three distinct patterns in techniques that identify a technique as determined, algorithmic, or automated. The fourth contribution we make is to identify several opportunities for future research. The form of the data that one uses as an input to a neural network is crucial for using neural networks effectively. This work is a tool for researchers to find the most effective technique for working with categorical data in neural networks, in big data settings. To the best of our knowledge this is the first in-depth look at techniques for working with categorical data in neural networks.

## Introduction

There is a spectrum of techniques for using categorical variables in neural networks. Finding the right technique can have a significant impact on a model’s performance. At one end of the spectrum, we have determined encoding techniques. Determined techniques are simplest. We characterize determined encodings as having the quality that given the same dataset, a determined encoding will produce the same encoding every time a practitioner employs it. Also, determined techniques have low running time complexity. In the middle of the spectrum, we find algorithmic techniques, such as Latent Dirichlet Allocation. Algorithmic techniques may or may not have deterministic outcomes, but we wish to identify them in a class separate from determined techniques because they are more complex in terms of running time. At the other end of the spectrum, we have automatic techniques, where neural networks dynamically generate their own data representations as a part of their training phase. This is the key difference between automatic and algorithmic techniques. Automatic techniques encode categorical data as a side effect of a machine learning task, whereas algorithmic techniques encode categorical data _prior_ to the beginning of a machine learning task. In practice, we find encoding techniques are blended as we depict in Fig. [1](/articles/10.1186/s40537-020-00305-w#Fig1).

**Fig. 1**

[![figure 1](//media.springernature.com/lw685/springer-static/image/art%3A10.1186%2Fs40537-020-00305-w/MediaObjects/40537_2020_305_Fig1_HTML.png)](/articles/10.1186/s40537-020-00305-w/figures/1)

Encoding techniques are determined, algorithmic or automatic. Most works we review employ some blend of encoding techniques. It is possible to use compositions of up to all three varieties. After selecting a method for representing data, practitioners can transfer it to another algorithm, or use it directly in the next stage

[Full size image](/articles/10.1186/s40537-020-00305-w/figures/1)

In this survey, we aim to give the reader a solid understanding of current methods for applying neural networks to qualitative data. Therefore, our aim is to describe in detail the three primary techniques. One thing all three techniques have in common is that one must have a way to represent categorical data with numbers in order to use it in a neural network. _Determined_ techniques convert categorical data to vectors with a low amount of computational complexity. For example, the determined Label encoding technique simply replaces a categorical value with a distinct, scalar numerical value. _Algorithmic_ techniques are more sophisticated than determined techniques and require more intensive computation. Algorithmic techniques are not directly incorporated into the training of a neural network, but rather take the form of more involved pre-processing of data. _Automatic_ techniques employ machine learning algorithms to discover a data representation. Hence, they have an intrinsic dependence on the dataset the practitioner uses. In the literature, we find authors sometimes employ techniques separately, sometimes they compose techniques. Here we use the term “composition” in the mathematical sense of the word; i.e., to compose functions _f_ and _g_ is to apply _f_ to the output of _g_ , often denoted \\(f \circ g\\). Determined techniques are suitable for big-data because they have low running time complexity. Algorithmic and automatic techniques require more resources to encode qualitative data for use in neural networks. However, researchers may be able to leverage transfer learning to side-step having to generate encodings for their qualitative data.

By definition, neural networks operate on vectors of real numbers [[1](/articles/10.1186/s40537-020-00305-w#ref-CR1 "Goodfellow I, Bengio Y, Courville A. Deep learning. Cambridge: MIT Press; 2016.")]. Therefore, in order to apply neural networks to qualitative data, we must find a way to transform the categorical data to vectors of real numbers. One must begin with what we call a determined technique for representing categorical values with vectors of real numbers. The most common determined technique we find in this review is One-hot encoding. A determined technique is one that transforms categorical values to vectors with minimal processing. This is a defining characteristic of determined techniques. We may choose to use the result of a determined technique for transforming qualitative data as the input for a neural network. On the other hand, we may choose to use it only as the first step for an algorithmic or automatic technique. Both algorithmic and automatic techniques may exploit dataset labels in the computations they perform to convert qualitative data to numerical form. They are also more computationally complex than determined techniques. What separates algorithmic and automatic techniques is that practitioners must apply algorithmic techniques before initiating the learning process in neural networks. With automatic techniques, one need only convert data with a simple determined technique, like One-hot encoding, and the neural network itself will learn a dense encoding of the categorical data. Latent Dirichlet Analysis (\\(\text {LDA}\\)) [[2](/articles/10.1186/s40537-020-00305-w#ref-CR2 "Blei DM, Ng AY, Jordan MI. Latent dirichlet allocation. J Mach Learn Res. 2003;3\(Jan\):993–1022.")] is an example of an algorithmic technique. Entity embedding [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")] is an example of an automatic technique.

There are clear differences in techniques. However, a close look at experiments involving categorical data and neural networks reveals practitioners use these techniques in combination. We use overlapping regions in Fig. [1](/articles/10.1186/s40537-020-00305-w#Fig1) to show that researchers often employ combinations of all three techniques. If one aims to use qualitative data in neural networks, one should be open to using a combination of techniques. If the reader plans on extending another researcher’s work, understanding which sorts of encoding techniques are used is key to understanding over-all research results.

To help the reader understand the spectrum of techniques, in "[Definitions](/articles/10.1186/s40537-020-00305-w#Sec2)" section, we give definitions for some terms used in this work. We then present our search methodology and related works. In addition, we provide a table of works studied that summarizes them and includes the encoding technique category (determined, automatic, or aglorithmic) for each work. After that, we proceed with an analysis of techniques. Our research for this study reveals that there is a _spectrum_ of techniques. We separate works into sections by the interesting encoding technique. However, many works exhibit composition of techniques. Finally, we come to our conclusions on which encoding techniques show the most promise for future research.

### Definitions

One term central to this paper is “deep learning algorithm”. Here, deep learning algorithms and feed forward networks are synonyms. We rely on Goodfellow et al.’s definition of the term “feedforward network” in [[1](/articles/10.1186/s40537-020-00305-w#ref-CR1 "Goodfellow I, Bengio Y, Courville A. Deep learning. Cambridge: MIT Press; 2016.")]: “A feedforward network defines a mapping \\({\mathbf {y}}=f\left( x ; \theta \right)\\) and learns the values of the parameters \\(\theta\\) that result in the best function approximation”. Hence, the term “learning” in what we call a deep learning algorithm. A deep learning algorithm is an algorithm that employs a composition of functions where each function equates conceptually to a layer of a \\(k\\)-partite directed graph. For further clarification on what a deep learning algorithm is, we refer the reader to chapter 6 of [[1](/articles/10.1186/s40537-020-00305-w#ref-CR1 "Goodfellow I, Bengio Y, Courville A. Deep learning. Cambridge: MIT Press; 2016.")]. We use the terms “deep learning algorithm”, “neural network”, “feedforward network”, and “deep neural network”, interchangeably.

The next important term in this work is, “categorical data”. We use Lacey’s definition of categorical data, “Categorical variables represent types of data which may be divided into groups. Examples of categorical variables are race, sex, age group, and educational level [[4](/articles/10.1186/s40537-020-00305-w#ref-CR4 "Lacey M. Categorical data. 2019. 
http://www.stat.yale.edu/Courses/1997-98/101/catdat.htm

. Accessed 23 Sept 2019.")]”. Furthermore, we use the terms “categorical data” and “qualitative data” interchangeably.

We find a more specific definition of categorical variables in Lane [[5](/articles/10.1186/s40537-020-00305-w#ref-CR5 "Lane DM. Online statistics education: an interactive multimedia course of study. 2019. 
http://onlinestatbook.com/2/index.html

. Accessed 15 Dec 2019.")]. Lane writes about scales of measurement. He defines nominal scales, ordinal scales, interval scales, and ratio scales of measurement. Our notion of categorical variable includes variables that we measure using nominal or ordinal scales according to Lane’s definition of nominal and ordinal scales. A nominal variable is a variable whose values we cannot order. For example, the political party a person belongs to is a nominally scaled random variable. It does not make sense to say that Democrat comes before Republican. Variables we measure with ordinal scales have order, but we cannot associate a number with them. Lane gives the example of the variable “customer satisfaction” that may take levels such as “very dissatisfied” or “somewhat dissatisfied”.

In the works we study here, we find techniques for using categorical data in deep learning algorithms. We find works using several terms to refer to these techniques. Examples of terms referring to these techniques are “entity embeddings” [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")], “dense encoding” [[6](/articles/10.1186/s40537-020-00305-w#ref-CR6 "Johnson JM, Khoshgoftaar TM. Medicare fraud detection using neural networks. J Big Data. 2019;6:1–35.")], “distributed representation” [[7](/articles/10.1186/s40537-020-00305-w#ref-CR7 "Hinton GE, et al. Learning distributed representations of concepts. In: Proceedings of the eighth annual conference of the cognitive science society, vol. 1. Amherst, MA. 1986. p. 12.")], and simply “encoding.”. In this work, the terms dense encoding, dense embedding, entity embedding, and distributed representation refer to different ways of mapping categorical data to vectors \\(v \in {\mathbb {R}}^n\\) for the purpose of using those vectors as input to a deep learning algorithm.

We find that researchers have not reached a consensus on what to call what we refer to as entity embedding. We attempt to follow the succession of important works in deep learning research to find the terms the authors of these important works are using. Our conclusion is that machine learning researchers’ interest in deep learning starts with Krizhevsky, Sutskever, and Hinton’s 2012 success applying deep learning algorithms to the problem of classifying Imagenet data [[8](/articles/10.1186/s40537-020-00305-w#ref-CR8 "Krizhevsky A, Sutskever I, Hinton GE. Imagenet classification with deep convolutional neural networks. In: Pereira F, Burges CJC, Bottou L, Weinberger KQ, editors. Advances in neural information processing systems 25. Red Hook: Curran Associates, Inc.; 2012. pp. 1097–105. 
http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf

. Accessed 12 Sept 2019.")]. It is our belief that this success then inspired researchers to find ways to apply deep learning to data other than image data. The next milestone we see is Mikolov et al.’s publication, “Distributed representations of words and phrases and their compositionality” [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.")]. Interestingly, both the 2012 Imagenet paper, and the 2013 paper on distributed representations of words have a common author: Ilya Sutskever. This fact may lead one to believe the community should settle on, “distributed representations”, as the term for mapping categorical data to vectors for deep learning. There is, however, another work we find important. This is Guo and Berkhahn’s, “Entity embeddings of categorical variables” [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")]. We prefer the term entity embedding because we feel current and future research will develop techniques Guo and Berkhahn outline in their work.

In this analysis, we categorize, compare and contrast various techniques, in the form of algorithms, that carry out entity embeddings. We refer to these techniques as entity embedding algorithms. The output of an entity embedding algorithm is a mapping from some set of categorical values _S_ to a space of _n_ -dimensional vectors in \\({\mathbb {R}}^n\\). We denote the mapping with the letter _e_. An entity embedding algorithm may change the behavior of _e_ over time. One technique for updating _e_ that we find employed in Mikolov et al. [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.")] is to express _e_ as a feed forward neural network, and alter the behavior of _e_ by updating the parameters of the neural network. We have many options for network structure and weight updating schemes to choose from, thanks to the work of previous researchers. We find many works where the authors use entity embeddings to produce input values for other deep learning algorithms. Guo and Berkhahn give a rigorous definition in [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")] that we summarize here to introduce notation. Let _S_ be the set of distinct values of some variable that is characterized as categorical data. Then an entity embedding _e_ is a mapping

$$\begin{aligned} e:S \rightarrow {\mathbb {R}}^{d} \end{aligned}$$

(1) 

of the elements of _S_ to vectors of real numbers. We define the range of an entity embedding as \\({\mathbb {R}}^{d}\\) to allow us the luxury of employing any theorems that hold for real numbers. In practice, the range of our embedding is a finite subset of vectors of rational numbers \\({\mathbb {Q}}^{d}\\) because computers are currently only capable of storing rational approximations of real numbers. We refer to this as “entity embedding”, “embedding categorical data”, “embedding categorical values”, or simply as “embedding” when the context is clear.

The terms we define in this section are key to understanding the works we cover here. In the next section we report the search method we use to find the works we include. This search process is what leads to our formulation of categories of embedding techniques.

### Search method

We employ Google Scholar [[10](/articles/10.1186/s40537-020-00305-w#ref-CR10 "Google.com: Google Scholar. 
scholar.google.com

.")] and the Florida Atlantic University (FAU) online library database OneSearch [[11](/articles/10.1186/s40537-020-00305-w#ref-CR11 "University FA. OneSearch. 2019. 
https://library.fau.edu/

. Accessed 15 Sept 2019.")] to search for terms synonymous with embedding. These are the synonymous terms: “entity embedding”, “tabular data”, “dense encoding”, “distributed representation”, and, “encoding categorical variables”.

We combine each of the five synonyms for entity embedding above with each of the following phrases: “deep learning”, “neural network”, “deep learning survey”, and, “neural network survey”.

Our research group is interested in entity embeddings as they relate to medical research with respect to the Healthcare Common Procedure Coding System (HCPCS), so we also searched the databases we listed above using phrases, “deep learning HCPCS”, and, “neural network HCPCS”.

Hence, we conduct a total of 40 searches in each of the two databases. We include the term “survey” in our searches to find related works. In addition, we search for the phrase “encoding categorical variables” by itself in order to find literature that covers techniques that have potential to be used in neural networks. Through the course of conducting these searches, we discovered the spectrum of techniques for using qualitative data in neural networks.

### Related work

We find several existing studies that involve using categorical data in neural networks. However, we do not find work that identifies the spectrum of techniques we discover here. Related works we find here cover some aspects of what we find, but none of them present techniques for using qualitative data in neural networks with our unified approach.

Interestingly, when we query the Google Scholar search engine “encoding categorical variables neural networks” we find “A comparative study of categorical variable encoding techniques for neural network classifiers” [[12](/articles/10.1186/s40537-020-00305-w#ref-CR12 "Potdar K, Pardawala TS, Pai CD. A comparative study of categorical variable encoding techniques for neural network classifiers. Int J Comput Appl. 2017;175\(4\):7–9.")] is the second result. This 3-page work is from October 2017. One positive aspect of this work is that it covers seven techniques for encoding categorical variables. On the other hand, the authors evaluate each technique on the UCI Cars dataset [[13](/articles/10.1186/s40537-020-00305-w#ref-CR13 "Dua D, Graff C. UCI machine learning repository. 2017. 
http://archive.ics.uci.edu/ml

. Accessed 24 Aug 2019.")], with one neural network architecture. In our search for works to cover in this review we do not find papers that employ all of these techniques. Furthermore, we find that each of the seven techniques the authors listed are all available in the Scikit-learn Category Encoders library. All the techniques covered in this paper fall into the determined category of techniques for using categorical data in neural networks. This work appears to be a report on an exercise where the authors applied various encoding techniques available in a popular machine learning library to a dataset commonly used for teaching purposes. Although the scope of the work is limited, we find it useful for discussing determined techniques for encoding categorical variables.

One work with a promising title for researchers interested in using categorical data as input to neural networks is, “An overview on data representation learning: From traditional feature learning to recent deep learning” [[14](/articles/10.1186/s40537-020-00305-w#ref-CR14 "Zhong G, Wang L-N, Ling X, Dong J. An overview on data representation learning: From traditional feature learning to recent deep learning. J Finance Data Sci. 2016;2\(4\):265–78. 
https://doi.org/10.1016/j.jfds.2017.05.001

.")], by Zhong et al. However, this work traces the history of data representation starting with principal component analysis (\\(\text {PCA}\\)) and linear discriminant analysis (\\(\text {LDA}\\)) (On a side note, the reader should be aware that the abbreviation LDA is often used for two different techniques in machine learning literature, Latent Dirichlet Allocation, or linear discriminant analysis). Zhong et al. make a great contribution in describing PCA, LDA, and its descendants, but this work is not strictly dedicated to techniques for using categorical data in neural networks in the manner that this survey is. Another major theme in [[14](/articles/10.1186/s40537-020-00305-w#ref-CR14 "Zhong G, Wang L-N, Ling X, Dong J. An overview on data representation learning: From traditional feature learning to recent deep learning. J Finance Data Sci. 2016;2\(4\):265–78. 
https://doi.org/10.1016/j.jfds.2017.05.001

.")] is learned embeddings. Zhong et al. introduce learned embeddings by covering Mikolov et al.’s distributed representations in [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.")]. There is some overlap in this work and [[14](/articles/10.1186/s40537-020-00305-w#ref-CR14 "Zhong G, Wang L-N, Ling X, Dong J. An overview on data representation learning: From traditional feature learning to recent deep learning. J Finance Data Sci. 2016;2\(4\):265–78. 
https://doi.org/10.1016/j.jfds.2017.05.001

.")] in that regard. However, Zhong et al. present a collection of techniques from a historical point of view. We do not take a historical perspective in this work. This could imply some techniques are passe and others are en vogue. We find that there is a spectrum of techniques, and researchers often compose techniques.

Natural language is a common form of categorical data. On the subject of natural language processing, we also have the survey, “Semantic text classification: A survey of past and recent advances” [[15](/articles/10.1186/s40537-020-00305-w#ref-CR15 "Altınel B, Ganiz MC. Semantic text classification: a survey of past and recent advances. Inf Process Manage. 2018;54\(6\):1129–53.")] by Altinel and Ganiz. Part of this work covers embeddings for natural language data. However, the focus of [[15](/articles/10.1186/s40537-020-00305-w#ref-CR15 "Altınel B, Ganiz MC. Semantic text classification: a survey of past and recent advances. Inf Process Manage. 2018;54\(6\):1129–53.")] is on text classification, so it only covers techniques for using categorical data in neural networks for text classification. This work is not limited to neural networks only. For example, it also covers knowledge bases such as WordNet, non-parametric techniques for text processing such as K-Nearest Neighbors, Support Vector Machine, and so on. There is some overlap with Altinel and Ganiz’s coverage of deep learning based natural language processing techniques, and the automatic class of embedding techniques we study here. Altinel and Ganiz do not write about embedding techniques from a general perspective, so they do not provide a unified description of embedding techniques.

“Graph Embedding Techniques, Applications, and Performance: A Survey” [[16](/articles/10.1186/s40537-020-00305-w#ref-CR16 "Goyal P, Ferrara E. Graph embedding techniques, applications, and performance: a survey. Knowl Based Syst. 2018;151:78–94.")] is another survey of embedding techniques albeit exclusively for graph embeddings. We feel this is an interesting, emerging subject in deep learning. Moreover, one may characterize a qualitative attribute of some data as connections between data that share the attributes’ value. However, in this work we focus on existing techniques for working with qualitative data in neural networks. As previously, we feel applying graph embedding techniques to categorical data is a subject for future research.

In “Deep EHR: A Survey of Recent Advances in Deep Learning Techniques for Electronic Health Record (EHR) Analysis” [[17](/articles/10.1186/s40537-020-00305-w#ref-CR17 "Shickel B, Tighe PJ, Bihorac A, Rashidi P. Deep EHR: a survey of recent advances in deep learning techniques for electronic health record \(EHR\) analysis. IEEE J Biomed Health Inform. 2018;22\(5\):1589–604. 
https://doi.org/10.1109/JBHI.2017.2767063

.")], Shickel et al. cover entity embeddings in the section entitled, “Concept representation”. The introduction mentions DeepCare, and Med2Vec. However, the scope of their work is smaller than the scope of this work. They cover deep learning applications to electronic health records (\\(\text {EHR}\\)) data. This survey is interesting to us because it covers techniques for dealing with categorical health care data such as International Statistical Classification of Diseases (\\(\text {ICD}\\)) codes as input for deep learning algorithms. We aim to cover the same types of techniques in the context of qualitative data in general.

## Survey of techniques

In this section, we present our findings on the works we review. We present embedding techniques in works we study in terms of three categories: determined, algorithmic, and automated. Therefore, we group works into sections by category. We devise categories of techniques based on the degree of automation in the technique, and the degree of coupling the technique has with the neural network training. There is no strict dividing line among techniques. The absence of strict dividing lines is why we prefer the phrase “spectrum of techniques”.

We start with the simplest techniques first. We call these types of techniques _determined_ techniques, because the encoding process is straightforward, and does not require heavy computation. Determined techniques often require one pass over the dataset to complete an encoding. The next step in these techniques is to construct some data structure such as a look-up table. Finally, to encode the categorical variable, determined techniques require one pass over the entire dataset. After the encoding is complete, practitioners using determined techniques do not need to change the values of the encodings once computed.

We find some authors use a separate technique for mapping qualitative data to vectors of real numbers in a process that is unrelated to the neural network’s learning process. These techniques are computationally more intensive than determined techniques. Once the data is transformed, then the authors use the transformed data as input to a neural network. Since the authors employ the embedding technique outside of the functioning of the neural network, we call this class of embedding techniques _algorithmic_ embedding. Examples of algorithmic embedding techniques are Latent Dirichlet Allocation (\\(\text {LDA}\\)) [[18](/articles/10.1186/s40537-020-00305-w#ref-CR18 "Wang Y, Xu W. Leveraging deep learning with lda-based text analytics to detect automobile insurance fraud. Decis Support Syst. 2018;105:87–95.")], and “Generalized Feature Embedding for Supervised, Unsupervised, and Online Learning Tasks” [[19](/articles/10.1186/s40537-020-00305-w#ref-CR19 "Golinko E, Zhu X. Generalized feature embedding for supervised, unsupervised, and online learning tasks. Inf Syst Front. 2018;21:125–42.")]. Encoding values computed in this class of techniques may change as the encoding progresses. Once the algorithmic encoding process is complete, the encoded values are fixed, and the practitioner uses these fixed values as input to a neural network.

Automatically optimized embedding techniques rely on the neural network’s weight update process. We give an example of how an automated weight update process can work. However, the reader should be aware that algorithms that learn embeddings, such as Global Vectors for Word Representation (\\(\text {GloVe}\\)) are more sophisticated than this simple example.

The example we work through here is similar to the functioning of a Keras embedding layer [[20](/articles/10.1186/s40537-020-00305-w#ref-CR20 "Chollet F, et al. Embedding. 2019. 
https://keras.io/layers/embeddings/

. Accessed 29 Nov 2019.")]. To compute the embedded value \\({\mathbf {e}}\\) of the input we compute \\({\mathbf {e}}=W{\mathbf {v}}\\), where, _W_ is the edge weight matrix for nodes in the neural network’s embedding layer, and \\({\mathbf {v}}\\) is the input value. For embedding categorical variables, \\({\mathbf {v}}\\) must be some encoded value of a categorical variable. Typically, \\({\mathbf {v}}\\) is a One-hot encoded value. Please see "[One-hot encoding](/articles/10.1186/s40537-020-00305-w#Sec11)" section for a definition of One-hot encoding. Equations [2](/articles/10.1186/s40537-020-00305-w#Equ2), and [3](/articles/10.1186/s40537-020-00305-w#Equ3) give an example of how one may compute the embedded value of a One-hot encoded categorical variable.

$$\begin{aligned} {\mathbf {e}} = \begin{bmatrix} w_{1,1} &{} w_{1,2} &{} \dots \\\ \vdots &{} \ddots &{} \\\ w_{1,k} &{} \dots &{} w_{n,k} \\\ \end{bmatrix} \begin{bmatrix} 0 \\\ \vdots \\\ 1 \\\ 0 \\\ \vdots \\\ \end{bmatrix} \end{aligned}$$

(2) 

Assuming the entry equal to 1 in the column vector on the right-hand side of Eq. [2](/articles/10.1186/s40537-020-00305-w#Equ2) is the encoding vector \\({\mathbf {v}}\\), and the value equal to 1 is on the \\(jth\\) row of \\({\mathbf {v}}\\), the product on the right-hand side of Eq. [2](/articles/10.1186/s40537-020-00305-w#Equ2) will be

$$\begin{aligned} {\mathbf {e}} = \begin{bmatrix} w_{j,1} \\\ \vdots \\\ w_{j,k} \\\ \end{bmatrix} \end{aligned}$$

(3) 

An easy way to think of the embedding process we illustrate in Eqs. [2](/articles/10.1186/s40537-020-00305-w#Equ2) and [3](/articles/10.1186/s40537-020-00305-w#Equ3) is that _W_ is a look-up table for One-hot encoded values. A neural network’s optimizer applies some procedure such as Stochastic Gradient Descent (\\(\mathrm{SGD}\\)) to update its weight values, including those of the weight matrix _W_. Over time the optimizer finds a value of _W_ that minimizes the value of some loss function, _J_. As the neural network changes the value of _W_ , the components of the embedded vectors \\({\mathbf {e}}\\) change as well. Since the values of \\({\mathbf {e}}\\) are updated as a result of the neural network’s weight update function, we call the embedding _automatic_ embedding.

The reader should bear in mind that the example we give in Eqs. [2](/articles/10.1186/s40537-020-00305-w#Equ2) and [3](/articles/10.1186/s40537-020-00305-w#Equ3) is not comprehensive. This example illustrates the basic principle of how to use the values of edge weights that a neural network learns as embedded values of One-hot encoded vectors. In the research we cover below, we find more intricate adaptations in automated techniques. Some researchers use the weights in _W_ directly in a neural network that does some machine learning task. We call this the direct employment method that we describe more in the next section. At other times, practitioners may use the values in _W_ in a completely different neural network. This is the transfer learning employment technique we also describe in the next section. Transfer learning is not an embedding technique. Rather, it is a way to employ a data representation.

To sum up, we find three major categories of embedding techniques used to encode categorical values for use in neural networks. The degree of complexity in the techniques is one aspect that differentiates them. The other aspect that differentiates techniques is whether the encoding process is part of the neural network’s learning process. Determined techniques are the simplest. Algorithmic and automatic techniques are computationally more complex than determined techniques. Algorithmic techniques produce encodings in a manner that is not part of a neural network’s weight updating process. Automatic techniques learn embedded values of categorical variables. Once a categorical value is fully encoded, we have options for how to use it. We refer to these options as “employment techniques” that we cover in the next section.

### Employment techniques

Practitioners have options for employing embedding techniques. We illustrate these options in Fig. [1](/articles/10.1186/s40537-020-00305-w#Fig1) with the curly braces around the Venn diagram that depicts embedding techniques. The first option is to re-use an existing embedding. This option is known as _transfer learning_. Other researchers refer to this technique as using a pre-computed embedding. A pre-computed, or transfer learning, employment technique uses an existing encoding that some other algorithm has learned. In this work we only find practitioners using transfer learning in conjunction with automatic embedding techniques. An example of a transfer learning technique is using the embedding from the \\(\text {GloVe}\\) algorithm. This algorithm computes a map of natural language words to vector values [[21](/articles/10.1186/s40537-020-00305-w#ref-CR21 "Pennington J, Socher R, Manning C. Glove: global vectors for word representation. In: Proceedings of the 2014 conference on empirical methods in natural language processing \(EMNLP\). 2014. pp. 1532–43.")]. Francois Chollet covers this transfer learning technique in Chapter 6 of [[22](/articles/10.1186/s40537-020-00305-w#ref-CR22 "Chollet F. Deep learning with python. Shelter Island: Manning Publications Company; 2017.")]. In his example Chollet creates a neural network with an embedding layer. The weights for the embedding layer are the embedded values (vectors), that the \\(\text {GloVe}\\) algorithm learned when Pennington, Socher, and Manning ran it using a specific corpus of text for input. The corpus they used consists of a copy of Wikipedia from 2014, and the Gigaword dataset [[23](/articles/10.1186/s40537-020-00305-w#ref-CR23 "Linguistic Data Consortium TTotUoP. English Gigaword 5th edition–Linguistic Data Consortium. 2019. 
https://catalog.ldc.upenn.edu/LDC2011T07

. Accessed 11 Jul 2019.")]. We know Chollet is using this particular instance of \\(\text {GloVe}\\) vectors because we cross-reference the file name Chollet uses in his example, glove.6B.100d.txt, with the contents of [[24](/articles/10.1186/s40537-020-00305-w#ref-CR24 "Pennington J, Socher R, Manning C. GloVe: global vectors for word representation. 2015. 
https://nlp.stanford.edu/projects/glove/

. Accessed 25 Nov 2019.")]. In Chollet’s example he presents a classifier for sentiment analysis of a collection of movie reviews. In the example, Chollet defines a neural network with an embedding layer. He sets the weight matrix of the embedded layer to have one row for every word in the corpus of movie reviews. He then fixes the values of the weights in the embedding layer so that his algorithm does not update them during training. Furthermore, these fixed values are the embedded equivalent \\(\text {GloVe}\\) vectors from glove.6B.100d.txt. Chollet’s example is typical of how a practitioner employs transfer learning. One may simply take the appropriate part of the embedding layer that another algorithm learns, and use it as a layer in a completely different neural network. Some researchers use embedded values in machine learning algorithms other than neural networks. Guo and Berkhahn do this in [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")]; they use an embedded representation of categorical data for input into the K-Nearest Neighbors, Random Forest, and Gradient Boosted Trees algorithms.

The second option researchers have for employing an embedding technique is to use it directly as a part of a larger machine learning algorithm. We call this manner of employing an embedding technique _direct_ employment. Often embeddings that are reused in transfer learning are the result of one scientist’s direct employment of an embedding technique. In the same work where Guo and Berkhahn employ transfer learning with algorithms other than a neural network, they directly feed the representation of categorical variables the neural network learns into layers above it, and the parameters of the embedding layer are updated as part of the training phase of their algorithm. Just as researchers compose embedding techniques, they may use both direct and transfer employment techniques in the course of one paper. Hence, we encounter the documentation of both methods of employment in some works.

### Table of works studied

We summarize the techniques we find in this survey in the table below where we classify them according to the categories we describe above (Table [1](/articles/10.1186/s40537-020-00305-w#Tab1)). 

**Table 1 Works Studied**

[ Full size table](/articles/10.1186/s40537-020-00305-w/tables/1)

The common thread we find with research on distributed representation, dense encoding, and embedding is that all three of these subjects employ the same general idea. The idea is to define some mapping from qualitative data to vectors in \\({\mathbb {R}}^{n}\\) that are suitable as input to neural networks.

Usually the authors first assign One-hot encoded vectors to each possible value of some qualitative data as a starting point, and then they apply some transformation of the One-hot encoded vectors to obtain new vectors that are more suitable as input to neural networks.

## Determined techniques

In this section we cover determined techniques. Determined techniques are the least computationally complex encoding techniques. One way to spot a determined technique is the encoded values will be the same every time we apply the technique. We begin with the simplest possible of determined encoding techniques, label encoding.

### Label encoding

Label encoding is simply assigning an integer value to every possible value of a categorical variable. For example, if a dataset has a categorical variable with values drawn from the set {“vanilla”, "chocolate", "strawberry"} then label encoding might assign the mapped values from the set \\(\left\\{ 0,1,2 \right\\}\\) respectively. We cannot think of a simpler way to convert categorical values to numerical values. Label encoding is a good example of why we choose to call this class of encoding techniques determined. Once we know all the possible values of a categorical variable, their encoded equivalents are determined by how we arbitrarily choose to assign integer values to them.

The Python Scikit-learn library [[63](/articles/10.1186/s40537-020-00305-w#ref-CR63 "Buitinck L, Louppe G, Blondel M, Pedregosa F, Mueller A, Grisel O, Niculae V, Prettenhofer P, Gramfort A, Grobler J, et al. API design for machine learning software: experiences from the scikit-learn project. In: ECML PKDD workshop: languages for data mining and machine learning. 2013. pp. 108–22.")] has a Category Encoders module, with an Ordinal Encoder. The documentation for the Scikit-learn Ordinal Encoder explains that it is an implementation of Label encoding. Both Label encoding and the Ordinal Encoder assign a unique integer value to the distinct values of a categorical variable.

Potdar et al. compare seven encoders in “A comparative study of categorical variable encoding techniques for neural network classifiers”. One of the encoders in the comparison is the Ordinal encoder. The authors’ description of the ordinal encoder matches that of the Scikit-learn label encoder. Also, the names of the seven encoders match the names of seven encoders available in the Scikit-learn Category Encoders module. We suspect the authors used this module for the experiments in [[12](/articles/10.1186/s40537-020-00305-w#ref-CR12 "Potdar K, Pardawala TS, Pai CD. A comparative study of categorical variable encoding techniques for neural network classifiers. Int J Comput Appl. 2017;175\(4\):7–9.")]. For their experiments, the authors encode data from the Cars dataset [[13](/articles/10.1186/s40537-020-00305-w#ref-CR13 "Dua D, Graff C. UCI machine learning repository. 2017. 
http://archive.ics.uci.edu/ml

. Accessed 24 Aug 2019.")], pass it to a neural network, and report the accuracy. We reproduce the accuracy report in Table [2](/articles/10.1186/s40537-020-00305-w#Tab2).

**Table 2 Accuracy results reproduced from [[12](/articles/10.1186/s40537-020-00305-w#ref-CR12 "Potdar K, Pardawala TS, Pai CD. A comparative study of categorical variable encoding techniques for neural network classifiers. Int J Comput Appl. 2017;175\(4\):7–9.")]**

[Full size table](/articles/10.1186/s40537-020-00305-w/tables/2)

One may be curious about the best performing encoding techniques that Potdar et al. report in this table. However, as we noted in "[Related works](/articles/10.1186/s40537-020-00305-w#Sec4)" section [[12](/articles/10.1186/s40537-020-00305-w#ref-CR12 "Potdar K, Pardawala TS, Pai CD. A comparative study of categorical variable encoding techniques for neural network classifiers. Int J Comput Appl. 2017;175\(4\):7–9.")] is a brief work. From the authors’ description of their experiments, we do not find a theoretical justification for why the best techniques do so well. On the other hand, the result of the worst performing encoding technique is in line with our expectations. The worst performing technique is Ordinal Coding (_a.k.a. Label encoding_). We expect poor performance of label encoding because it introduces artificial order among categorical variables. For example, when we directly use label encoded values in neural networks optimized with stochastic gradient descent, the larger label values will contribute more to gradients we use to update weights. This does not make sense because we assigned integer values to the categorical variables arbitrarily. Label encoding also presents a problem for unsupervised learning with neural networks. The problem is that an unsupervised algorithm cannot exploit the numerical difference between encoded values because the numbers we assign those values are arbitrary. We feel this informal argument provides enough justification for why practitioners must use something more sophisticated than label encoding for input values. Moreover, it also aligns with the poor performance that Potdar et al. report.

While Label encoding may not be suitable for direct input to neural networks, one may need to use it as the very first step in an encoding technique. Some libraries for One-hot encoding require a list of integer values for input, and Label encoding is a reasonable way to obtain that list of values. Label encoding is the simplest determined technique, but it has its uses.

### Code counting

In “Improving palliative care with deep learning” [[55](/articles/10.1186/s40537-020-00305-w#ref-CR55 "Avati A, Jung K, Harman S, Downing L, Ng A, Shah NH. Improving palliative care with deep learning. In: 2017 IEEE international conference on bioinformatics and biomedicine \(BIBM\). 2017.")], Avati et al. document a simple determined encoding technique that is effective for the purpose of predicting patient mortality. Avati et al. derive a dataset from electronic heath records (\\(\text {EHR}\\)) data. They then use the derived dataset as input for a classifier that they employ to predict whether a patient will die in the next year. The \\(\text {EHR}\\) data Avati et al. use includes qualitative data in the form of International Classification of Diseases, 9th revision (ICD-9) code, Current Procedural Terminology (\\(\text {CPT}\\)) codes, and RxNorm prescription codes. To derive a record from the \\(\text {EHR}\\) data for a patient, the authors use the counts of types of codes as features. In order to calculate the counts, Avati et al. use the concept of windows and slices. In order to define a window for \\(\text {EHR}\\) data, Avati et al. select a prediction date. The prediction date is not necessarily the current date. We copy a table from [[55](/articles/10.1186/s40537-020-00305-w#ref-CR55 "Avati A, Jung K, Harman S, Downing L, Ng A, Shah NH. Improving palliative care with deep learning. In: 2017 IEEE international conference on bioinformatics and biomedicine \(BIBM\). 2017.")] to give the reader a clear idea of how Avati et al. segment \\(\text {EHR}\\) data into windows and slices. The copy of the table is in Table [3](/articles/10.1186/s40537-020-00305-w#Tab3). After the data is arranged into slices, Avati et al. use the counts of various qualitative values as features. Finally, they concatenate the lists of counts for each slice to complete the encoding technique.

**Table 3 Window slices in [[55](/articles/10.1186/s40537-020-00305-w#ref-CR55 "Avati A, Jung K, Harman S, Downing L, Ng A, Shah NH. Improving palliative care with deep learning. In: 2017 IEEE international conference on bioinformatics and biomedicine \(BIBM\). 2017.")], PD stands for prediction date**

[Full size table](/articles/10.1186/s40537-020-00305-w/tables/3)

Avati et al. explain that their machine learning task for predicting patient mortality is a proxy for recommending a patient for palliative care. They report that their model achieves 0.69 \\(\text {AUC}\\) for predicting whether the patient will die within the year after their prediction date. Avati et al. qualify this performance metric by pointing out that this model achieves a 0.93 \\(\text {AUC}\\) when they use it as a proxy to predict whether a patient is a candidate for palliative care. It would not be surprising to find that an embedding technique that discards less information in the \\(\text {EHR}\\) data would achieve better performance. For example one could employ techniques Duarte et al. use in [[48](/articles/10.1186/s40537-020-00305-w#ref-CR48 "Duarte F, Martins B, Pinto CS, Silva MJ. Deep neural models for ICD-10 coding of death certificates and autopsy reports in free-text. J Biomed Inform. 2018;80:64–77.")] to encode ICD-9 codes. On the other hand, the code counting technique that Avati et al. employ is amenable to large data sets since has a low running time complexity. Assuming there are _n_ \\(\text {EHR}\\) records, and the records have a patient ID, we could sort all the \\(\text {EHR}\\) records in \\(O\left( n \text {log}\left( n\right) \right)\\) time. See Section 7.2 of [[64](/articles/10.1186/s40537-020-00305-w#ref-CR64 "Cormen TH, Leiserson CE, Rivest RL, Stein C. Introduction to algorithms. Cambridge: MIT Press; 2009.")] for proof of running time complexity of sorting. Then we can count the codes for each patient ID in \\(O\left( n\right)\\) time, which means that count encoding has \\(O\left( n\right)\\) running time complexity. Count coding is a determined technique that might work when other techniques fail due to a huge dataset size. Indeed, in Section 2 of [[55](/articles/10.1186/s40537-020-00305-w#ref-CR55 "Avati A, Jung K, Harman S, Downing L, Ng A, Shah NH. Improving palliative care with deep learning. In: 2017 IEEE international conference on bioinformatics and biomedicine \(BIBM\). 2017.")] the authors explicitly claim their technique is suitable for big data. Otherwise, we suspect using other techniques that discard less information about qualitative data will provide better performance.

### One-hot encoding

One-hot encoding is a technique that requires very little work for to use, and practitioners often use it as a first step in more sophisticated techniques, such as employing a Keras embedding layer. Known colloquially as One-hot encoding [[65](/articles/10.1186/s40537-020-00305-w#ref-CR65 "Hackeling G. Mastering machine learning with Scikit-learn. Birmingham: Packt Publishing Ltd; 2017.")], we find that Guo and Berkhahn [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")] identify One-hot encoding as the Kroneker Delta Function. We express One-hot encoding formally as follows. Let \\({\mathbf {x}}\\) be some discrete categorical random variable with _n_ distinct values \\(x_1, x_2, \ldots x_n\\). Then, the One-hot encoding of a particular value \\(x_i\\) is a vector \\({\mathbf {v}}\\) where every component of \\({\mathbf {v}}\\) is zero except for the \\(ith\\) component, which has the value 1. For example, assume we have some random variable \\({\mathbf {x}}\\) that takes values from the set \\(S=\left\\{ a,b,c\right\\}\\) . Let \\(x_1=a\\), \\(x_2=b\\), and \\(x_3=c\\). A One-hot encoding for \\({\mathbf {x}}\\) is: \\(\left( 1,0,0\right)\\), \\(\left( 0,1,0\right)\\), and \\(\left( 0,0,1 \right)\\). Since the One-hot encoding of the levels of a categorical variable only depends on the number of levels, One-hot encoding falls into the determined family of techniques for encoding categorical variables for use in neural networks.

One clear disadvantage to One-hot encoding is that the distance between One-hot encoded vectors carries just a bit of information. Cui, Xie, and Shen mention in [[66](/articles/10.1186/s40537-020-00305-w#ref-CR66 "Cui L, Xie X, Shen Z. Prediction task guided representation learning of medical codes in EHR. J Biomed Inform. 2018;84:1–10.")] that the distance between any pair of distinct One-hot encoded vectors is the same. It is beyond the scope of this analysis to prove that a general distance metric is the same for any pair of distinct One-hot encoded vectors, but we can easily do so for the Euclidean distance

$$\begin{aligned} d_n\left( \mathbf {v_1}, \mathbf {v_2}\right) = \left( \sum _{i=1}^n \left( v_{1_{i}}- v_{2_{i}} \right) ^2\right) ^{\frac{1}{2}} \end{aligned}$$

(4) 

Only one component of \\(\mathbf {v_1}\\) and \\(\mathbf {v_2}\\) is 1 because they are One-hot encoded, so Eq. [4](/articles/10.1186/s40537-020-00305-w#Equ4) simplifies to

$$\begin{aligned} d_n\left( \mathbf {v_1}, \mathbf {v_2}\right) = 2^{\frac{1}{2}} \end{aligned}$$

(5) 

in the case that the vectors are different, and

$$\begin{aligned} d_n\left( \mathbf {v_1}, \mathbf {v_2}\right) = 0 \end{aligned}$$

(6) 

in the case the vectors are the same.

Hence, the Euclidean distance between two One-hot encoded features tells us only that two features are identical, or different. Therefore, distance between One-hot encoded features carries little information about their similarity.

A second disadvantage of One-hot encoding is that it consumes storage resources aggressively if we store One-hot encoded values directly. By storing One-hot encoded values directly, we mean storing a literal one or zero for every component of a vector. Suppose a dataset has a feature that is a categorical variable with _n_ values. Then we might require on the order of _n_ times the size of the feature in the dataset to store the One-hot encoded values of the feature. We can overcome this increase in the amount of storage that One-hot encoding requires with sparse representations. Sparse vector and matrix representations store data in a compressed form. Python’s Scikit-learn One-hot encoder uses a “sparse” option by default [[67](/articles/10.1186/s40537-020-00305-w#ref-CR67 "Developers S-l. sklearn.preprocessing.OneHotEncoder –scikit-learn 0.21.3 documentation. 2019. 
https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.OneHotEncoder.html

. Accessed 29 Jul 2019.")], so unless the user specifies otherwise, the Scikit-learn One-hot encoder will store One-hot encoded values efficiently.

Nevertheless, One-hot encoding is often a first step to using existing embedding libraries such as the Keras embedding layer [[20](/articles/10.1186/s40537-020-00305-w#ref-CR20 "Chollet F, et al. Embedding. 2019. 
https://keras.io/layers/embeddings/

. Accessed 29 Nov 2019.")]. Indeed, one may look at other encoding techniques in the spectrum as answering the question of what might we do to improve our results after One-hot encoding our data.

However, One-hot encoding it is not without its uses. One good aspect of One-hot encoding is that is simple to implement, and has efficient running time. Referring to the Kroneker Delta Function definition of One-hot encoding above, we see that the running time to One-hot encode a categorical variable is on the order of the number of possible values of the categorical variable, plus the size of the dataset to encode. A simple look-up table will suffice to produce the One-hot encoded equivalent of a categorical variable. The running time for using a simply implemented look-up table is also on the order of the number of One-hot encoded values, and slightly more sophisticated implementations would have order \\(log_2\\) running time in the number of encoded values.

We find research where One-hot encoding categorical variables for use in neural networks is sufficient to design a neural network that outperforms other machine learning algorithms. The work is entitled, “Financial system modeling using deep neural networks (DNNs) for effective risk assessment and prediction” [[61](/articles/10.1186/s40537-020-00305-w#ref-CR61 "Duan J. Financial system modeling using deep neural networks \(DNNs\) for effective risk assessment and prediction. J Frankl Inst. 2019;356\(8\):4716–31.")], by Jing Duan. In this work Duan evaluates various classifiers’ ability to classify loan applications into risk categories. The input to the classifiers includes categorical variables such as home ownership, and loan purpose (e.g. credit card debt consolidation, or home improvement). Duan uses One-hot encoding to encode these categorical values. Nevertheless, Duan reports the best results in loan risk prediction accuracy for a deep neural network classifier. In [[61](/articles/10.1186/s40537-020-00305-w#ref-CR61 "Duan J. Financial system modeling using deep neural networks \(DNNs\) for effective risk assessment and prediction. J Frankl Inst. 2019;356\(8\):4716–31.")], Duan compares the Performance of a Deep Neural Network to Logistic Regression, Linear Discriminant Analysis, Decision Tree, Support Vector Machine, Radial Basis Functions, and Adaptive Gradient Boosted Decision Tree. While it is true that Duan’s experiment shows a Deep Neural Network outperforms other machine learning algorithms with One-hot encoding, we see an opportunity for future research to employ other classes of encoding techniques, such as Golinko et al.’s algorithmic technique in [[68](/articles/10.1186/s40537-020-00305-w#ref-CR68 "Golinko E, Sonderman T, Zhu X. Learning convolutional neural networks from ordered features of generic data. In: 2018 17th IEEE international conference on machine learning and applications \(ICMLA\), IEEE. 2018. pp. 897–900.")].

One-hot encoding may be a good first choice for getting started on selecting a machine learning algorithm. For example, Duan’s experiment shows that under the conditions of his tests, a Deep Neural Network is the strongest candidate. After evaluating different algorithms, one may be convinced a Neural Network is the best model to use. After that, one may decide to invest resources in trying different encoding schemes for further gains in performance.

### Leave-one-out encoding

We learn about the Leave-one-out pre-processed encoding technique for categorical values in “Enhanced Network Intrusion Detection using Deep Convolutional Neural Networks” [[62](/articles/10.1186/s40537-020-00305-w#ref-CR62 "Naseer S, Saleem Y. Enhanced network intrusion detection using deep convolutional neural networks. KSII Trans Internet Inf Syst. 2018;12\(10\):5159.")], by Naseer and Saleem. The popular Scikit-learn Python library, that machine learning practitioners often employ, includes this encoding technique in its Category Encoders module [[69](/articles/10.1186/s40537-020-00305-w#ref-CR69 "McGinnis W. Leave one out—category encoders latest documentation. 2016. 
https://contrib.scikit-learn.org/categorical-encoding/leaveoneout.html

. Accessed 16 Aug 2019.")]. We are unable to find a peer reviewed publication that defines leave-one-out encoding. To the best of our knowledge, Zhang discovered the leave-one-out encoding technique, and it is documented on slides 25 and 26 of [[70](/articles/10.1186/s40537-020-00305-w#ref-CR70 "Zhang O. Tips for data science competitions. 2016. 
https://www.slideshare.net/OwenZhang2/tips-for-data-science-competitions

. Accessed 5 Aug 2019.")].

Leave-one-out encoding clearly falls into the determined class of techniques for using categorical data in neural networks. To leave-one-out encode a categorical value, we represent the categorical value with the mean value of all the response variables except the response that the categorical variable currently appears with. To complete the encoding, to avoid over fitting, we add a small random noise value to the mean we compute.

Leave-one-out encoding must be implemented carefully when working with big data. First of all, to compute the mean values of target variables, one must use a technique tailored to computing the mean value of a large set of numbers safely to avoid overflow errors. Second, for large datasets we must have an efficient method to calculate encoded values. A naive approach where we take a pass over the entire dataset to compute the mean value of labels for each and every row is an \\(O\left( n^2\right)\\) operation that is impractical for large datasets. We speculate that one should be able to compute all the possible leave-one-out encoded values of a categorical feature ahead of time, and store them in a look-up table indexed by the value of the categorical variable, and the value to be left out for efficient encoding. If there are so many values for the target variable that such a scheme is not feasible, then one may need to use an alternative encoding technique. This scenario is more likely the large datasets.

The first interesting result Nasir and Saleem give in [[62](/articles/10.1186/s40537-020-00305-w#ref-CR62 "Naseer S, Saleem Y. Enhanced network intrusion detection using deep convolutional neural networks. KSII Trans Internet Inf Syst. 2018;12\(10\):5159.")] is the result of an experiment they conduct to select an encoding technique. For this experiment Nasir and Saleem compare ten encoding techniques. They pre-process data from the NSLKDD [[71](/articles/10.1186/s40537-020-00305-w#ref-CR71 "Tavallaee M, Bagheri E, Lu W, Ghorbani AA. A detailed analysis of the kdd cup 99 data set. In: 2009 IEEE symposium on computational intelligence for security and defense applications. 2009. pp. 1–6. 
https://doi.org/10.1109/CISDA.2009.5356528

.")] dataset with each of the ten encoding techniques, and then feed the pre-processed data to Random Forest. Naseer and Saleem find that they get the highest accuracy from Random Forest when they use the leave-one-out encoding technique. We include a table from [[62](/articles/10.1186/s40537-020-00305-w#ref-CR62 "Naseer S, Saleem Y. Enhanced network intrusion detection using deep convolutional neural networks. KSII Trans Internet Inf Syst. 2018;12\(10\):5159.")] that summarizes these results in Table [4](/articles/10.1186/s40537-020-00305-w#Tab4).

**Table 4 Table comparing Random Forest accuracy for various encoding techniques, reproduced from [[62](/articles/10.1186/s40537-020-00305-w#ref-CR62 "Naseer S, Saleem Y. Enhanced network intrusion detection using deep convolutional neural networks. KSII Trans Internet Inf Syst. 2018;12\(10\):5159.")]**

[Full size table](/articles/10.1186/s40537-020-00305-w/tables/4)

Naseer and Saleem illustrate an interesting method for selecting an encoding technique. They use a classifier with fast training time to rank encoding techniques. One can inspect the training time column in Table [4](/articles/10.1186/s40537-020-00305-w#Tab4) to see that this entire experiment has a total running time of about three minutes. However, Naseer and Saleem do not stop here. Their goal is to employ deep neural networks in a computer network intrusion detection system. Therefore, Naseer and Saleem compare the performance of five different classifiers on the leave-one-out encoded NSLKDD data. We include a copy of results from [[62](/articles/10.1186/s40537-020-00305-w#ref-CR62 "Naseer S, Saleem Y. Enhanced network intrusion detection using deep convolutional neural networks. KSII Trans Internet Inf Syst. 2018;12\(10\):5159.")] in Table [5](/articles/10.1186/s40537-020-00305-w#Tab5).

**Table 5 Classifier performance results, reproduced from [[62](/articles/10.1186/s40537-020-00305-w#ref-CR62 "Naseer S, Saleem Y. Enhanced network intrusion detection using deep convolutional neural networks. KSII Trans Internet Inf Syst. 2018;12\(10\):5159.")], classifier names are abbreviated as follows: Deep Convolutional Neural Network (\\(\text {DCNN}\\)), Radial Basis Function Support Vector Machine (\\(\text {RBF SVM}\\)), Multi-Layer Perceptron (MLP), Extreme Learning Machine (\\(\text {ELM}\\)), Radial Basis Function (\\(\text {RBF}\\)); NSLKDDTest+ and NSLKDDTest21 are partitions of the NSLKDD dataset [[71](/articles/10.1186/s40537-020-00305-w#ref-CR71 "Tavallaee M, Bagheri E, Lu W, Ghorbani AA. A detailed analysis of the kdd cup 99 data set. In: 2009 IEEE symposium on computational intelligence for security and defense applications. 2009. pp. 1–6. 
https://doi.org/10.1109/CISDA.2009.5356528

.")] for evaluating trained models**

[Full size table](/articles/10.1186/s40537-020-00305-w/tables/5)

We see in Table [5](/articles/10.1186/s40537-020-00305-w#Tab5) that Naseer and Saleem obtain the best performance with a \\(\text {DCNN}\\) when they use leave-one-out encoding to pre-process its input data. One important note on how Naseer and Saleem use the NSLKDD data in the \\(\text {DCNN}\\) is that they reshape observations in the processed NSLKDD data into 32 × 32 grayscale images. We consider these steps to be elements of a pre-processing technique for using categorical data in neural networks. Naseer and Salim write that the way they convert the leave-one-out encoded data to an image is simply to triplicate each 41-element observation to obtain a list of 123 elements. Next they concatenate the first five elements of the observation to obtain a list of 128 values, and then they replicate this list 8 more times to obtain a 1024 element list that they reshape into a 32 × 32 array that may be interpreted as a 32 × 32 grayscale image.

Naseer and Saleem’s work is an example of a composition of encoding techniques. First the authors use Leave-one-out encoding, then convert their leave-one-out encoded data to images for use in a \\(\text {DCNN}\\). We see an opportunity for future research to employ this composition technique on other types of qualitative data.

### Hashing

In our survey, we find researchers sometimes use hash functions to convert categorical values to numeric values for input to deep learning algorithms. Hashing is on the borderline of determined and algorithmic techniques, since hash algorithms can be rather involved. However, a hash algorithm is deterministic, and they do not require something like a pass over all possible inputs before they are ready to produce output values. For these reasons we include hashing in the determined category of techniques for using qualitative data in neural networks. In the context of this work, we use the definition of hash function from MacKay [[72](/articles/10.1186/s40537-020-00305-w#ref-CR72 "MacKay DJ. Information theory, inference and learning algorithms. Cambridge: Cambridge University Press; 2003.")]. MacKay defines a hash function as a pseudo-random function that maps an _N_ -bit string to an _M_ -bit string where _N_ is smaller than _M_. However, we relax the constraint that the input to the hash function be strictly longer than the output of the hash function. We find in practice that hash functions such as the built-in Python hash function, or the md5sum function available in Debian Linux distributions behave in this manner. In practice, we find that both hash and md5sum accept values as small as a single character and produce a longer output.

In “Deep learning with Python” [[22](/articles/10.1186/s40537-020-00305-w#ref-CR22 "Chollet F. Deep learning with python. Shelter Island: Manning Publications Company; 2017.")], Chollet mentions hashing in Chapter 6. Chollet writes that one may choose to use hashing in lieu of One-hot encoding when the number of possible values one wishes to encode is so large that creating a mapping of the values to One-hot vectors is not practical. This is often the case when working with large datasets in a big data ecosystem. In [[22](/articles/10.1186/s40537-020-00305-w#ref-CR22 "Chollet F. Deep learning with python. Shelter Island: Manning Publications Company; 2017.")] Chollet gives an example that uses Python’s built in hash function. Python’s hash function accepts a string as a parameter and returns an integer. We refer the reader to [[73](/articles/10.1186/s40537-020-00305-w#ref-CR73 "Foundation PS. Built-in functions. 2019. 
https://docs.python.org/3/library/functions.html

. Accessed 29 Oct 2019.")] for details on this function. Reverting to Chollet’s coverage of the hashing technique in [[22](/articles/10.1186/s40537-020-00305-w#ref-CR22 "Chollet F. Deep learning with python. Shelter Island: Manning Publications Company; 2017.")] we point out that we see hashing categorical values to integers as a viable alternative to Label encoding categorical values as vectors. Even when we map categorical values to vectors using some embedding technique, we first need to map the categorical values to some vectors that we can then embed in a lower dimensional space. We conjecture that mapping categorical values to integers using some hashing function is an equivalent and possibly more practical method as one does need to maintain an explicit mapping in one’s own software. We give a caveat for using hashing that Chollet also mentions in [[22](/articles/10.1186/s40537-020-00305-w#ref-CR22 "Chollet F. Deep learning with python. Shelter Island: Manning Publications Company; 2017.")], and that is that one must be careful to ensure that hash collisions do not frequently occur for distinct values of the categorical values. One may choose a hash algorithm with a large range of output values to lower the probability of collisions. We recommend [[74](/articles/10.1186/s40537-020-00305-w#ref-CR74 "Why haven’t any SHA-256 collisions been found yet? 2017. 
https://crypto.stackexchange.com/a/47810

. Accessed 17 Nov 2019.")] for some context on the ranges of popular hash algorithms.

In our review, we find research that takes hashing a step further. In [[22](/articles/10.1186/s40537-020-00305-w#ref-CR22 "Chollet F. Deep learning with python. Shelter Island: Manning Publications Company; 2017.")] in the caption of Figure 6.2, Chollet writes, “...word representations obtained from One-hot encoding or hashing are sparse, high-dimensional, and hardcoded...” Chollet assumes a hash algorithm that does not change over time. We find research that challenges Chollet’s assumption in “Hash embeddings for efficient word representations” [[59](/articles/10.1186/s40537-020-00305-w#ref-CR59 "Svenstrup DT, Hansen J, Winther O. Hash embeddings for efficient word representations. In: Advances in neural information processing systems. 2017. pp. 4928–36.")]. In this work Svenstrup, Hansen, and Winther introduce hash embeddings. Hash embeddings incorporate hashing into trainable functions. That is Svenstrup, Hansen, and Winther discuss a technique where they apply several hash functions to input data, and use a weighted sum of the hash functions’ output for an embedding. The authors treat the output of the hash functions as vectors. The authors then combine the vectors into a matrix that they then multiply by another matrix _P_ whose entries are updated with a learning algorithm that discovers the optimal values for the entries of _P_. In [[59](/articles/10.1186/s40537-020-00305-w#ref-CR59 "Svenstrup DT, Hansen J, Winther O. Hash embeddings for efficient word representations. In: Advances in neural information processing systems. 2017. pp. 4928–36.")] the authors perform experiments that compare their hash embedding method to the hashing method Chollet presents in [[22](/articles/10.1186/s40537-020-00305-w#ref-CR22 "Chollet F. Deep learning with python. Shelter Island: Manning Publications Company; 2017.")], as well as to several other embedding methods. The point of the experiments is not that one may use hash embeddings to obtain better performing deep learning algorithms, but that hash embeddings require fewer trainable parameters and achieve performance on par with competing techniques. Therefore, the conclusion that the authors wish the reader to come to is that their technique is better from a resource consumption perspective. This may resonate well with researchers working in big data. From our point of view, Svenstrup, Hansen, and Winther’s is a unique composition of an automatic technique and a determined technique. We include it here because the focus of the work is employment of hashing functions.

We include this section on hash functions here because we find the idea of using hash algorithms in lieu of maintaining a look-up table to map categorical values to vectors to be an attractive technique, especially when working with big data. Hashing qualitative input values is a determined technique because the encoded value of hashed categorical data does not change with the context of the data.

### Summary of determined techniques

Here, the determined techniques we cover are: Code counting, One-hot encoding, Label encoding, Leave-one-out encoding, and hash-encoding. Our choice of encoding techniques to include is based on our finding these techniques used in recent works where the authors use categorical data for input to neural networks.

Determined techniques are suitable for big data when they have a low running time complexity. Researchers may need to use sparse representations for One-hot encoded values when working with big data to avoid overtaxing storage resources. Hash encoding, and label encoding are also suitable for big data since we can defer producing the encoded value of a variable until we require it for input to a machine learning algorithm. Leave-one-out encoding may not be feasible for encoding qualitative values in big data datasets if the subset of labels has a high cardinality.

The common theme we see in works where researchers employ determined techniques is that using one of them is unavoidable. It is necessary to use a determined technique to transform qualitative data to numerical form for use in neural networks. Often researchers use a determined technique as the beginning of a more sophisticated algorithmic or automatic technique. As a best practice for selecting a determined technique we recommend avoiding leave-one-out encoding for datasets with label sets of high cardinality, and avoiding label encoding for input values to neural networks because that introduces arbitrary order and magnitude to those values.

An experiment comparing the effectiveness of Svenstrup, Hansen, and Winther’s determined technique in [[59](/articles/10.1186/s40537-020-00305-w#ref-CR59 "Svenstrup DT, Hansen J, Winther O. Hash embeddings for efficient word representations. In: Advances in neural information processing systems. 2017. pp. 4928–36.")], to that of Zhu and Han’s work involving an algorithmic technique in [[57](/articles/10.1186/s40537-020-00305-w#ref-CR57 "Han H, Li Y, Zhu X. Convolutional neural network learning for generic data classification. Inf Sci. 2019;477:448–65. 
https://doi.org/10.1016/j.ins.2018.10.053

.")], Zhu and Golinko’s work involving the algorithmic technique in [[19](/articles/10.1186/s40537-020-00305-w#ref-CR19 "Golinko E, Zhu X. Generalized feature embedding for supervised, unsupervised, and online learning tasks. Inf Syst Front. 2018;21:125–42.")], and Guo and Berkhahn’s work on an automatic technique in [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")] is an avenue for future research. We find Svenstrup makes his hash embedding technique source code available in [[60](/articles/10.1186/s40537-020-00305-w#ref-CR60 "Svenstrup DT, Hansen J, Winther O. Hashembedding. 2017. 
https://github.com/dsv77/hashembedding

. Accessed 8 Aug 2019.")]. The researcher may want to use this source code to get started on comparing techniques.

## Algorithmic techniques

Techniques for representing qualitative data that require extensive computations fall into the algorithmic class of data representation techniques. These algorithmic techniques involve applying a process to convert categorical variables to numeric values for neural networks. When researchers put a significant amount of work in designing a process that converts qualitative data to numerical form, we call this algorithmic data representation. This effort sets algorithmic techniques apart from techniques like One-hot encoding.

### Latent Dirichlet Allocation

The first algorithmic data representation technique we cover is Latent Dirichlet Allocation (\\(\text {LDA}\\)). In “Leveraging deep learning with \\(\text {LDA}\\)-based text analytics to detect automobile insurance fraud” [[18](/articles/10.1186/s40537-020-00305-w#ref-CR18 "Wang Y, Xu W. Leveraging deep learning with lda-based text analytics to detect automobile insurance fraud. Decis Support Syst. 2018;105:87–95.")], Wang and Xu employ Latent Dirichlet Allocation in an algorithm to detect fraudulent auto insurance claims. The references of [[18](/articles/10.1186/s40537-020-00305-w#ref-CR18 "Wang Y, Xu W. Leveraging deep learning with lda-based text analytics to detect automobile insurance fraud. Decis Support Syst. 2018;105:87–95.")] contain a citation of “Latent Dirichlet Allocation” [[2](/articles/10.1186/s40537-020-00305-w#ref-CR2 "Blei DM, Ng AY, Jordan MI. Latent dirichlet allocation. J Mach Learn Res. 2003;3\(Jan\):993–1022.")] that appears to be a seminal work on \\(\text {LDA}\\). In “Latent Dirichlet Allocation” Blei, Ng, and Jordan write, “The basic idea [of \\(\text {LDA}\\)] is that documents are represented as random mixtures over latent topics, where each topic is characterized by a distribution over words”. In [[18](/articles/10.1186/s40537-020-00305-w#ref-CR18 "Wang Y, Xu W. Leveraging deep learning with lda-based text analytics to detect automobile insurance fraud. Decis Support Syst. 2018;105:87–95.")] Wang and Xu add to the description of \\(\text {LDA}\\), writing, “\\(\text {LDA}\\) uses a joint distribution to compute the conditional distribution of the hidden variable under a given observable variable. The observable variable is a set of words, and the latent variable is the topics”. From these two quotes we surmise that \\(\text {LDA}\\) is a method to represent a collection of documents as a distribution of topics where we infer the topic distribution using the distribution of words in documents. Both the direct encoding approach, such as One-hot encoding, and \\(\text {LDA}\\) involve executing a deterministic set of rules for converting categorical data to numerical form. However, algorithmic techniques, like \\(\text {LDA}\\) are more involved.

One distinguishing feature of algorithmic techniques is that they have hyper-parameters one must set. We see in [[18](/articles/10.1186/s40537-020-00305-w#ref-CR18 "Wang Y, Xu W. Leveraging deep learning with lda-based text analytics to detect automobile insurance fraud. Decis Support Syst. 2018;105:87–95.")] that the authors chose to set the number of topics parameter for \\(\text {LDA}\\) to 5, and that the authors’ model associates 5 scores with each document, one for each topic. In the context of Wang and Xu’s experiments, a document is the description section of an auto insurance claim. It contains a natural language description of the accident over which the insured is filing the claim. Wang and Xu write that they use One-hot encoding for other categorical variables for their models. In their experiments, Wang and Xu find that a deep neural network has the best performance when compared with support vector machine, and random forest models. Furthermore, in their conclusion they attribute the success of the deep neural network to increased sensitivity to the \\(\text {LDA}\\) values they compute for the claim descriptions. We reproduce a table of experimental results from [[18](/articles/10.1186/s40537-020-00305-w#ref-CR18 "Wang Y, Xu W. Leveraging deep learning with lda-based text analytics to detect automobile insurance fraud. Decis Support Syst. 2018;105:87–95.")] in Table [6](/articles/10.1186/s40537-020-00305-w#Tab6).

**Table 6 Results reproduced from [[18](/articles/10.1186/s40537-020-00305-w#ref-CR18 "Wang Y, Xu W. Leveraging deep learning with lda-based text analytics to detect automobile insurance fraud. Decis Support Syst. 2018;105:87–95.")], abbreviations are as follows: Support Vector Machine (SVM); Random Forest (RF); Deep Neural Network (DNN); true positive (\\(\text {TP}\\)); false positive (\\(\text {FP}\\)); F1 score (F1)**

[Full size table](/articles/10.1186/s40537-020-00305-w/tables/6)

Wang and Xu note that their \\(\text {DNN}\\) model performs worse when they remove the \\(\text {LDA}\\) values from its input. This fact supports the theory that the \\(\text {LDA}\\) values carry information about fraudulent and legitimate auto insurance claims. We see an opportunity for future research in applying Wang and Xu’s technique to other types of insurance claim data.

### Generalized feature embedding learning

Zhu and Golinko introduce an algorithmic technique for embedding categorical data in their paper entitled, “Generalized Feature Embedding for Supervised, Unsupervised, and Online Learning Tasks” [[19](/articles/10.1186/s40537-020-00305-w#ref-CR19 "Golinko E, Zhu X. Generalized feature embedding for supervised, unsupervised, and online learning tasks. Inf Syst Front. 2018;21:125–42.")]. The authors name their technique “Generalized feature embedding learning”, or, \\(\text {GEL}\\), for short. The first thing we notice about \\(\text {GEL}\\) that sets it apart from automatic techniques is that Zhu and Golinko’s \\(\text {GEL}\\) does not employ something like gradient descent to update the embedding it provides. This is a distinguishing characteristic of algorithmic techniques. In [[19](/articles/10.1186/s40537-020-00305-w#ref-CR19 "Golinko E, Zhu X. Generalized feature embedding for supervised, unsupervised, and online learning tasks. Inf Syst Front. 2018;21:125–42.")], the authors present \\(\text {GEL}\\) as a systematic technique for transforming a dataset into an alternate representation that one may then use as input to a variety of supervised and unsupervised machine learning algorithms. \\(\text {GEL}\\) assumes that the instances of a dataset form a matrix _X_. It is important to note that the entries of _X_ may have any data type; _X_ is different from matrices that are familiar to us in that the elements of _X_ may be text values, real numbers, ranges, or any kind of data that one might encode with One-hot encoding. \\(\text {GEL}\\) then transforms _X_ into a matrix of binary values _W_. We perform One-hot encoding of the rows of _X_ to obtain _W_. Therefore, _W_ may have many more columns than _X_. \\(\text {GEL}\\) then performs a series of computations on _W_ that expand it into a larger matrix of derived values _S_. \\(\text {GEL}\\) has a hyper-parameter _k_ that holds the number of eigenvectors of _S_ we use to form a matrix _V_. Finally, we multiply _W_ by \\(V^2\\) to obtain a matrix \\({\mathcal {F}}\\) that we use as input to a machine learning algorithm for training and evaluation. As practitioners, we are not so interested in the algebra of the calculations for GEL, but we are very interested in Golinko’s R language implementation of \\(\text {GEL}\\) on Github.com [[56](/articles/10.1186/s40537-020-00305-w#ref-CR56 "Golinko E. egolinko/GEL. 2019. 
https://github.com/egolinko/GEL

. Accessed 13 Oct 2019.")] as we can directly use this code, or easily translate it into implementations in different languages for use in future experiments.

In [[19](/articles/10.1186/s40537-020-00305-w#ref-CR19 "Golinko E, Zhu X. Generalized feature embedding for supervised, unsupervised, and online learning tasks. Inf Syst Front. 2018;21:125–42.")], Zhu and Golinko compare the performance of various machine learning algorithms on two different types of datasets. We refer the reader to Section 5.1.4 of [[19](/articles/10.1186/s40537-020-00305-w#ref-CR19 "Golinko E, Zhu X. Generalized feature embedding for supervised, unsupervised, and online learning tasks. Inf Syst Front. 2018;21:125–42.")] for more detail on what Zhu and Golinko refer to as baseline methods. The baseline method is one where Zhu and Golinko apply minimal data preparation to the dataset for use with a collection of machine learning algorithms. The second kind of dataset that Zhu and Golinko employ to train the collection of machine learning algorithms is one where they first transform the dataset using \\(\text {GEL}\\), and then train the machine learning algorithm with the transformed dataset. So, we conclude that we have an opportunity for future research to do a comparison of \\(\text {GEL}\\) to some other embedding technique or collection of techniques. In Figure 4 of [[19](/articles/10.1186/s40537-020-00305-w#ref-CR19 "Golinko E, Zhu X. Generalized feature embedding for supervised, unsupervised, and online learning tasks. Inf Syst Front. 2018;21:125–42.")] Zhu and Golinko show that using \\(\text {GEL}\\) to prepare the input for a collection of machine learning algorithms generally gives better performance than what they term the baseline method. However, one cannot use this result by itself to conclude how \\(\text {GEL}\\) performs in comparison with other embedding techniques.

Another interesting feature of \\(\text {GEL}\\) is that we can use it in an online learning scenario. For the reader who is unfamiliar with the term online learning, we recommend seeing [[75](/articles/10.1186/s40537-020-00305-w#ref-CR75 "Kivinen J, Smola AJ, Williamson RC. Online learning with kernels. IEEE Trans Signal Process. 2004;52\(8\):2165–76.")], Section II, B for a precise definition. Also, we refer the reader to Section 5.2.4 of [[19](/articles/10.1186/s40537-020-00305-w#ref-CR19 "Golinko E, Zhu X. Generalized feature embedding for supervised, unsupervised, and online learning tasks. Inf Syst Front. 2018;21:125–42.")] for details on how the authors use \\(\text {GEL}\\) in an online learning context. Here we summarize that Zhu and Golinko show that preparing data with GEL, and then feeding that data to a Naive Bayes classifier, has better performance in an online learning task, than when they use the same classifier, but feed it with data from a baseline data preparation. We see an opportunity for future work in comparing \\(\text {GEL}\\) to other embedding methods in an online learning setting.

We give a caveat for using \\(\text {GEL}\\) with large datasets. In a big data setting, the step where we convert a dataset to matrix form, and then calculate the values of the eigenvectors may not be feasible. Therefore, another avenue for future research would be to determine whether or not one can split a large dataset into smaller partitions and apply \\(\text {GEL}\\) to each partition.

### Convolutional neural networks for categorical data

In this section, we review another algorithmic technique in papers that Zhu is also an author on. We find “\\(\text {EDLT}\\): Enabling Deep Learning for Generic Data Classification” [[76](/articles/10.1186/s40537-020-00305-w#ref-CR76 "Han H, Zhu X, Li Y. EDLT: enabling deep learning for generic data classification. In: 2018 IEEE international conference on data mining \(ICDM\). Washington, DC: IEEE; 2018. 
https://doi.org/10.1109/icdm.2018.00030

.")] and “Convolutional neural network learning for generic data classification” [[57](/articles/10.1186/s40537-020-00305-w#ref-CR57 "Han H, Li Y, Zhu X. Convolutional neural network learning for generic data classification. Inf Sci. 2019;477:448–65. 
https://doi.org/10.1016/j.ins.2018.10.053

.")]. Han, Zhu, and Li are the authors of both works. We do not find that the authors explicitly define the term \\(\text {EDLT}\\) but it appears to be an abbreviation of “Enabling Deep Learning for Generic Classification Tasks”. Both papers cover the same topic of \\(\text {EDLT}\\). \\(\text {EDLT}\\) is a technique for transforming rows of data that is in tabular form to matrices that we then use as input to convolutional neural networks.

Han, Zhu, and Li’s \\(\text {EDLT}\\) technique begins with finding the matrix \\({\mathcal {M}}\\), which is the Pearson correlation matrix of all the features of some dataset \\({\mathbf {x}}\\), and a correlation vector of all the labels of \\({\mathbf {x}}\\) that we denote with \\({\mathcal {L}}\\). \\(\text {EDLT}\\) then uses \\({\mathcal {M}}\\) and \\({\mathcal {L}}\\) in an iterative process to generate a matrix \\({\mathcal {O}}\\) that we use to re-order and transform \\({\mathbf {x}}\\), one instance \\({\mathbf {x}}_t\\) at a time into synthetic matrices \\({\mathcal {F}}\left( {\mathbf {x}}_t\right)\\). After we use \\(\text {EDLT}\\) to obtain the \\({\mathcal {F}}\left( {\mathbf {x}}_t\right)\\), we use these matrices as input to convolutional neural networks. \\(\text {EDLT}\\) transforms instances of _x_ , \\(x_t\\), into matrices \\({\mathcal {F}}\left( {\mathbf {x}}_t\right)\\) such that the elements of the matrices \\({\mathcal {F}}\left( {\mathbf {x}}_t\right)\\) are spatially close to one and other if they are correlated. Convolutional neural networks are then suitable consumers of the \\({\mathcal {F}}\left( {\mathbf {x}}_t\right)\\) because convolutional neural networks excel in recognizing spatially correlated features in data such as images. In [[57](/articles/10.1186/s40537-020-00305-w#ref-CR57 "Han H, Li Y, Zhu X. Convolutional neural network learning for generic data classification. Inf Sci. 2019;477:448–65. 
https://doi.org/10.1016/j.ins.2018.10.053

."), [76](/articles/10.1186/s40537-020-00305-w#ref-CR76 "Han H, Zhu X, Li Y. EDLT: enabling deep learning for generic data classification. In: 2018 IEEE international conference on data mining \(ICDM\). Washington, DC: IEEE; 2018. 
https://doi.org/10.1109/icdm.2018.00030

.")], Han, Zhu and Li are able to show that convolutional neural networks show better performance in both supervised and unsupervised learning tasks if they use data that is treated with the \\(\text {EDLT}\\) technique versus what they term as baseline techniques.

According to Han, Zhu and Li in [[57](/articles/10.1186/s40537-020-00305-w#ref-CR57 "Han H, Li Y, Zhu X. Convolutional neural network learning for generic data classification. Inf Sci. 2019;477:448–65. 
https://doi.org/10.1016/j.ins.2018.10.053

."), [76](/articles/10.1186/s40537-020-00305-w#ref-CR76 "Han H, Zhu X, Li Y. EDLT: enabling deep learning for generic data classification. In: 2018 IEEE international conference on data mining \(ICDM\). Washington, DC: IEEE; 2018. 
https://doi.org/10.1109/icdm.2018.00030

.")] there are two baseline methods in the context of their work. The first baseline method is a random reordering of features. Han, Zhu, and Li name this baseline method \\(\text {RR}\\). The second baseline method Han, Zhu, and Li use is a partial application of \\(\text {EDLT}\\) where we do not carry out the steps to optimize the reordering matrix \\({\mathcal {O}}\\) to globally maximize correlation between nearby entries of the synthetic matrix \\({\mathcal {F}}\left( {\mathbf {x}}_t\right)\\). As Golinko and Zhu do in, “Generalized Feature Embedding for Supervised, Unsupervised, and Online Learning Tasks” [[19](/articles/10.1186/s40537-020-00305-w#ref-CR19 "Golinko E, Zhu X. Generalized feature embedding for supervised, unsupervised, and online learning tasks. Inf Syst Front. 2018;21:125–42.")], Zhu and Li compare the performance of \\(\text {EDLT}\\) to baseline methods that are not methods we would consider to be competitors to \\(\text {EDLT}\\). We feel it is obviously an interesting area of future research to make the comparison.

The authors make the source code for the \\(\text {EDLT}\\) technique available in [[58](/articles/10.1186/s40537-020-00305-w#ref-CR58 "Han H, Li Y, Zhu X. ELDT. 2019. 
https://github.com/hhmzwc/EDLT

. Accessed 12 Jul 2019.")]. However, one should note that this source code is a mixture of Python and Matlab code. We see an opportunity for a contribution. The source code in [[58](/articles/10.1186/s40537-020-00305-w#ref-CR58 "Han H, Li Y, Zhu X. ELDT. 2019. 
https://github.com/hhmzwc/EDLT

. Accessed 12 Jul 2019.")] should be translated into a single language that one might easily employ \\(\text {EDLT}\\) as a library function.

We see a challenge to employ \\(\text {EDLT}\\) on large datasets similar to the one we find with \\(\text {GEL}\\). \\(\text {EDLT}\\)’s requirement to calculate the Person correlation of a large dataset may be prohibitively expensive for big data. An interesting topic for future research is a study on whether or not we can make \\(\text {EDLT}\\) amenable to big data in some way, such as partitioning the data in some manner so as to make the Pearson correlation calculation tractable.

### Summary of algorithmic techniques

Algorithmic techniques may not be suitable for big data projects because they are computationally intensive. As a best practice for deciding to use an algorithmic technique, we recommend evaluating the running time of an algorithmic technique relative to a determined technique on a small sample of a dataset to gauge how much more time the algorithmic technique will require. One should also be able to compare the relative sizes of the datasets obtained with both the algorithmic and determined techniques to get a sense for how much space the algorithmic technique will require.

One common theme we notice about research on algorithmic techniques is that the authors present them as techniques to employ on a dataset directly. We did not notice any work where the authors recommend employing transfer learning when using an algorithmic technique. Indeed, it is unclear to us what, besides the encoded data itself, one would be able to reuse for separate machine learning tasks. In the long run, this may be an Achilles heel in algorithmic techniques.

We find researchers use algorithmic techniques to encode categorical variables to enhance the performance of some models. We suspect that algorithmic techniques tend to be more domain specific because they may exploit aspects of data in particular domains. For example, \\(\text {LDA}\\) operates on collections of documents, and \\(\text {EDLT}\\) operates on tabular data. \\(\text {GEL}\\) stands out in this regard because it can operate on categorical data in general.

## Automatic techniques

Automatic techniques for using categorical data in neural networks incorporate finding a data representation into the neural network’s learning process. Automatic techniques are appealing because they are more general-purpose than determined or algorithmic techniques. For example, Mikolov et al.’s Word2vec algorithm is reused in many domains. We cover some of these re-uses below. Due to their proven potential for reuse we include details on several works using automatic techniques, whether they are employed in a transfer learning manner, or directly. For big data applications, one may prefer to employ automatic techniques via transfer learning. This is because automatic techniques for encoding qualitative data often involve optimizing models with a number of parameters large enough that the encoding process becomes time-consuming.

### Distributed representation learning

One body of machine learning research literature uses the term “distributed representation” to refer to the concept of mapping qualitative data to vectors of real numbers. We find that when the term distributed representation appears in the literature, that it refers to an automatic technique for using qualitative data in neural networks. Our research indicates the lineage of the term is as follows: in “A neural probabilistic language model”, Bengio et al. [[27](/articles/10.1186/s40537-020-00305-w#ref-CR27 "Bengio Y, Ducharme R, Vincent P, Jauvin C. A neural probabilistic language model. J Mach Learn Res. 2003;3\(6\):1137–55.")] propose a technique for fighting what the authors refer to as the “curse of dimensionality”. The curse of dimensionality is an expression that refers to how the number of observations and labels one needs to accurately model a dataset grows as the number of labels in the data set raised to the power of the number of features. To use Goodfellow, Bengio, and Courville’s terminology, if we have a model that uses _d_ features and has _v_ distinct output values, then in order to accurately train and evaluate the model we require \\(O\left( v^d\right)\\) observations with their labels [[1](/articles/10.1186/s40537-020-00305-w#ref-CR1 "Goodfellow I, Bengio Y, Courville A. Deep learning. Cambridge: MIT Press; 2016.")]. For example, in [[27](/articles/10.1186/s40537-020-00305-w#ref-CR27 "Bengio Y, Ducharme R, Vincent P, Jauvin C. A neural probabilistic language model. J Mach Learn Res. 2003;3\(6\):1137–55.")] the authors point out the set of all possible 10-word phrases one may draw from a 100,000-word vocabulary contains \\(10^{50}-1\\) elements. To accurately model such a dataset, we require \\(O\left( 10^{50}\right)\\) labels and observations. Current storage technology capacity is on the order of terabytes \\(\left( 10^{12}\right)\\), or perhaps petabytes \\(\left( 10^{15}\right)\\). Therefore, it is not possible to store a sample of such a large dataset, such that the sample is large enough that we can accurately evaluate the model’s performance. Hence, Bengio et al. propose a technique for mapping words that appear in text documents to vectors. This technique incorporates machine learning to do the mapping. Bengio et al. refer to the collection of vectors as a distributed representation for words. They summarize their technique for finding distributed representations for words in natural language as follows:

>   1. 1.
> 
> Associate with each word in the vocabulary a distributed _word feature vector_ (a real-valued vector in \\({\mathbb {R}}^m\\)),
> 
>   2. 2.
> 
> Express the joint _probability function_ of word sequences in terms of the feature vectors of these words in the sequence, and
> 
>   3. 3.
> 
> Learn simultaneously the _word feature vectors_ and the parameters of that _probability function_.
> 
> 


Bengio et al. emphasize the term “probability function” because their paper makes the contribution of showing how we can use neural networks to implement a function that computes the probability of a sequence of words. Also, the third step in the technique Bengio et al. describe is a key characteristic of automatic techniques; the process for embedding the qualitative data is tightly coupled with the algorithm that finds the parameters of a probability function. It is worth noting that the probability function Bengio et al. write about is a neural network.

One work related to Bengio et al. [[27](/articles/10.1186/s40537-020-00305-w#ref-CR27 "Bengio Y, Ducharme R, Vincent P, Jauvin C. A neural probabilistic language model. J Mach Learn Res. 2003;3\(6\):1137–55.")] that stands out to us due to the number of times we see references to it is “Distributed representations of words and phrases and their compositionality”, by Mikolov et al. [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.")]. This work builds on Mikolov’s earlier, oft cited work, “Efficient Estimation of Word Representations in Vector Space” [[43](/articles/10.1186/s40537-020-00305-w#ref-CR43 "Mikolov T, Chen K, Corrado G, Dean J. Efficient estimation of word representations in vector space. 2013. arXiv preprint 
arXiv:1301.3781

.")]. These two works are both published in 2013, with [[43](/articles/10.1186/s40537-020-00305-w#ref-CR43 "Mikolov T, Chen K, Corrado G, Dean J. Efficient estimation of word representations in vector space. 2013. arXiv preprint 
arXiv:1301.3781

.")] preceding [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.")] by a few months. We use Google Scholar to check the number of references to [[43](/articles/10.1186/s40537-020-00305-w#ref-CR43 "Mikolov T, Chen K, Corrado G, Dean J. Efficient estimation of word representations in vector space. 2013. arXiv preprint 
arXiv:1301.3781

.")], and [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.")]. The numbers of references are 11,298, and 13,924, respectively. Furthermore, we use our research facility database to search the term, “distributed representation”, for a sample of works related to this keyword. We take the first 49 works that the search engine returns, and check the references in these works. We use no other search parameters save for the search term “distributed representation”. Approximately 71%, or 35 out of 49, of the works refer to Mikolov et al.’s [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.")] or [[43](/articles/10.1186/s40537-020-00305-w#ref-CR43 "Mikolov T, Chen K, Corrado G, Dean J. Efficient estimation of word representations in vector space. 2013. arXiv preprint 
arXiv:1301.3781

.")]. So not only is the work of Mikolov et al. widely cited, but also specifically in the context of work where the term, “distributed representation”, is a subject. Moreover, we are interested in the techniques Mikolov et al. employ because these are techniques for using categorical data as input for deep learning algorithms. Therefore, it behooves the reader to have a good understanding of Mikolov et al.’s work because other researchers have extended it in so many ways. In addition, many of the works citing Mikolov et al. include domain specific embeddings that researchers may be able to re-use in their work.

“Efficient estimation of word representations in vector space” [[43](/articles/10.1186/s40537-020-00305-w#ref-CR43 "Mikolov T, Chen K, Corrado G, Dean J. Efficient estimation of word representations in vector space. 2013. arXiv preprint 
arXiv:1301.3781

.")] is interesting because this is the work where Mikolov et al. introduce two techniques for word embeddings: skip-gram and continuous bag of words (\\(\text {CBOW}\\)). The objective function for the deep learning algorithm in \\(\text {CBOW}\\) is a function of how well the embedding vectors of surrounding words predict the word they surround. In [[43](/articles/10.1186/s40537-020-00305-w#ref-CR43 "Mikolov T, Chen K, Corrado G, Dean J. Efficient estimation of word representations in vector space. 2013. arXiv preprint 
arXiv:1301.3781

.")] the authors refer to the _i_ words that surround a given word as, “the context”, and the word itself as, “the center word”.

We find [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.")] more interesting because it has more content to it. This work focuses primarily on the skip-gram approach to word embedding. A key result reported in the work is that skip-gram produces representations of words that do better than previous representations, and the skip-gram algorithm has a faster running time than its competitors. Thankfully, there is a footnote at the end of [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.")] that links to source code for running both algorithms. The entry of the references section in this work [[44](/articles/10.1186/s40537-020-00305-w#ref-CR44 "Mikolov T, Sutskever I. word2vec. 2015. 
https://code.google.com/archive/p/word2vec/

. Accessed 29 Dec 2019.")], has the uniform resource locator (\\(\text {URL}\\)) for this source code. If one is curious as to precisely how skip-gram and \\(\text {CBOW}\\) learn vector representations for natural language words as categorical data, the file Word2vec.c in [[44](/articles/10.1186/s40537-020-00305-w#ref-CR44 "Mikolov T, Sutskever I. word2vec. 2015. 
https://code.google.com/archive/p/word2vec/

. Accessed 29 Dec 2019.")] contains these calculations. Another important file in [[44](/articles/10.1186/s40537-020-00305-w#ref-CR44 "Mikolov T, Sutskever I. word2vec. 2015. 
https://code.google.com/archive/p/word2vec/

. Accessed 29 Dec 2019.")] is distance.c, which serves as an example of how to use the mappings that \\(\text {CBOW}\\) and skip-gram learn, to convert categorical data to vectors in \\({\mathbb {R}}^{n}.\\) Here _n_ is smaller than the number of dimensions one would need to use One-hot encoding. The points that the reader should gather from [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9."), [43](/articles/10.1186/s40537-020-00305-w#ref-CR43 "Mikolov T, Chen K, Corrado G, Dean J. Efficient estimation of word representations in vector space. 2013. arXiv preprint 
arXiv:1301.3781

.")] are:

  * Both skip-gram and \\(\text {CBOW}\\) are algorithms that employ neural networks to learn a mapping of words in natural language, i.e. categorical data, to vectors in \\({\mathbb {R}}^n\\),

  * Skip-gram learns a mapping with a loss function that measures how well skip gram predicts the words that surround the current word,

  * \\(\text {CBOW}\\) learns a mapping with a loss function that is a measure of how well \\(\text {CBOW}\\) predicts the current word, given the words that surround the current word,

  * In practice, Mikolov et al. [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.")] find that when they use the vectors for categorical data that skip-gram learns, they get the best results, and skip-gram consumes fewer resources than its competitors, and

  * One can do arithmetic on the vectors in \\({\mathbb {R}}^n\\) that skip-gram or \\(\text {CBOW}\\) learn in such a way that the vector arithmetic is compatible with human intuition.




To expand on the last point on vector arithmetic above, we give an example from [[9](/articles/10.1186/s40537-020-00305-w#ref-CR9 "Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.")]. If we use vectors from the Word2vec embedding algorithm, the result of subtracting the vector for “man” from the vector that represents, “king”, and adding the vector for, “woman” to the result gives a vector that is closest to the vector that skip-gram or \\(\text {CBOW}\\) learns for, “queen”. This is one result that inspires much subsequent research. Researchers find that one may use qualitative data, other than words, as input to deep learning algorithms and obtain similar, intuitive results. In the next section, we study the progeny of Mikolov et al.’s discoveries.

There are many implementations of skip-gram and \\(\text {CBOW}\\) that researchers should take advantage of and re-use, if transfer learning is feasible. One can easily find implementations on <http://github.com>. At the time of this writing a search on <http://github.com> for the term, “Word2vec”, garners 6320 results. Suffice it to say, Word2vec is an automated technique for converting categorical data for use in neural networks.

#### Optimal embedding vector length

Word2vec discovers representations for categorical, natural language data automatically. However, it is up to the user of the Word2vec algorithm to select the number of dimensions the embedded vectors will have. In our search for material for this work, we find Yin and Shen’s work, “On the Dimensionality of Word Embedding” [[77](/articles/10.1186/s40537-020-00305-w#ref-CR77 "Yin Z, Shen Y. On the dimensionality of word embedding. In: Bengio S, Wallach H, Larochelle H, Grauman K, Cesa-Bianchi N, Garnett R, editors. Advances in neural information processing systems 31. Red Hook: Curran Associates, Inc.; 2018. pp. 887–98. 
http://papers.nips.cc/paper/7368-on-the-dimensionality-of-word-embedding.pdf

. Accessed 16 Sept 2019.")]. Yin and Shen present a method to find an optimal value for the dimensionality of word embeddings. Word embeddings are a special case of entity embeddings. Therefore, we see opportunities for future work to apply Yin and Shen’s method to entity embeddings.

Yin and Shen’s method for estimating the dimension of a word embedding is to estimate the Pairwise Inner Product (\\(\text {PIP}\\)) loss of embeddings as we increase the number of dimensions in the embedding. Yin and Shen show that the value of the \\(\text {PIP}\\) loss versus dimensions reflects a trade off between the bias and the variance of the word embedding algorithms. This trade off implies the existence of an optimal value for the number of dimensions one may select when choosing the number of dimensions in the domain of an embedding.

Yin and Shen qualify their technique as useful for embedding algorithms that are based on matrix factorization. In [[77](/articles/10.1186/s40537-020-00305-w#ref-CR77 "Yin Z, Shen Y. On the dimensionality of word embedding. In: Bengio S, Wallach H, Larochelle H, Grauman K, Cesa-Bianchi N, Garnett R, editors. Advances in neural information processing systems 31. Red Hook: Curran Associates, Inc.; 2018. pp. 887–98. 
http://papers.nips.cc/paper/7368-on-the-dimensionality-of-word-embedding.pdf

. Accessed 16 Sept 2019.")] the authors write that \\(\text {GloVe}\\) [[21](/articles/10.1186/s40537-020-00305-w#ref-CR21 "Pennington J, Socher R, Manning C. Glove: global vectors for word representation. In: Proceedings of the 2014 conference on empirical methods in natural language processing \(EMNLP\). 2014. pp. 1532–43.")] and Word2vec [[43](/articles/10.1186/s40537-020-00305-w#ref-CR43 "Mikolov T, Chen K, Corrado G, Dean J. Efficient estimation of word representations in vector space. 2013. arXiv preprint 
arXiv:1301.3781

.")], “...learn word embeddings by optimizing over some objective functions using stochastic gradient methods, they have both been shown to be implicitly matrix factorizations.” We feel it lies in the realm of future work to check if other embedding techniques for embedding categorical data other than words might be characterized as implicit matrix factorizations. This would be a strong indicator that applying Yin and Shen’s method for calculating the optimal number of dimensions in an embedding applies. We might be able to improve upon existing results that use embeddings of categorical data by setting the number of dimensions according to the value that Yin and Shen’s method finds.

Our discovery of the work [[77](/articles/10.1186/s40537-020-00305-w#ref-CR77 "Yin Z, Shen Y. On the dimensionality of word embedding. In: Bengio S, Wallach H, Larochelle H, Grauman K, Cesa-Bianchi N, Garnett R, editors. Advances in neural information processing systems 31. Red Hook: Curran Associates, Inc.; 2018. pp. 887–98. 
http://papers.nips.cc/paper/7368-on-the-dimensionality-of-word-embedding.pdf

. Accessed 16 Sept 2019.")] leads us to two related works regarding the dimensionality of word embedding. First of all, we find a longer work that Yin writes on the same subject as [[77](/articles/10.1186/s40537-020-00305-w#ref-CR77 "Yin Z, Shen Y. On the dimensionality of word embedding. In: Bengio S, Wallach H, Larochelle H, Grauman K, Cesa-Bianchi N, Garnett R, editors. Advances in neural information processing systems 31. Red Hook: Curran Associates, Inc.; 2018. pp. 887–98. 
http://papers.nips.cc/paper/7368-on-the-dimensionality-of-word-embedding.pdf

. Accessed 16 Sept 2019.")], “Understand Functionality and Dimensionality of Vector Embeddings: the Distributional Hypothesis, the Pairwise Inner Product Loss and Its Bias-Variance Trade-off” [[78](/articles/10.1186/s40537-020-00305-w#ref-CR78 "Yin Z. Understand functionality and dimensionality of vector embeddings: the distributional hypothesis, the pairwise inner product loss and its bias-variance trade-off. 2018. arXiv preprint 
arXiv:1803.00502

.")]. This work is far longer than [[77](/articles/10.1186/s40537-020-00305-w#ref-CR77 "Yin Z, Shen Y. On the dimensionality of word embedding. In: Bengio S, Wallach H, Larochelle H, Grauman K, Cesa-Bianchi N, Garnett R, editors. Advances in neural information processing systems 31. Red Hook: Curran Associates, Inc.; 2018. pp. 887–98. 
http://papers.nips.cc/paper/7368-on-the-dimensionality-of-word-embedding.pdf

. Accessed 16 Sept 2019.")]. We see that [[77](/articles/10.1186/s40537-020-00305-w#ref-CR77 "Yin Z, Shen Y. On the dimensionality of word embedding. In: Bengio S, Wallach H, Larochelle H, Grauman K, Cesa-Bianchi N, Garnett R, editors. Advances in neural information processing systems 31. Red Hook: Curran Associates, Inc.; 2018. pp. 887–98. 
http://papers.nips.cc/paper/7368-on-the-dimensionality-of-word-embedding.pdf

. Accessed 16 Sept 2019.")] was submitted to arxiv.org December 2018, and [[78](/articles/10.1186/s40537-020-00305-w#ref-CR78 "Yin Z. Understand functionality and dimensionality of vector embeddings: the distributional hypothesis, the pairwise inner product loss and its bias-variance trade-off. 2018. arXiv preprint 
arXiv:1803.00502

.")] was submitted to arxiv.org March 2018, so [[77](/articles/10.1186/s40537-020-00305-w#ref-CR77 "Yin Z, Shen Y. On the dimensionality of word embedding. In: Bengio S, Wallach H, Larochelle H, Grauman K, Cesa-Bianchi N, Garnett R, editors. Advances in neural information processing systems 31. Red Hook: Curran Associates, Inc.; 2018. pp. 887–98. 
http://papers.nips.cc/paper/7368-on-the-dimensionality-of-word-embedding.pdf

. Accessed 16 Sept 2019.")] summarizes the greater detail of [[78](/articles/10.1186/s40537-020-00305-w#ref-CR78 "Yin Z. Understand functionality and dimensionality of vector embeddings: the distributional hypothesis, the pairwise inner product loss and its bias-variance trade-off. 2018. arXiv preprint 
arXiv:1803.00502

.")]. Therefore, the interested reader may wish to consult [[78](/articles/10.1186/s40537-020-00305-w#ref-CR78 "Yin Z. Understand functionality and dimensionality of vector embeddings: the distributional hypothesis, the pairwise inner product loss and its bias-variance trade-off. 2018. arXiv preprint 
arXiv:1803.00502

.")] for clarification.

Researchers interested in applying Yin and Shen’s method for finding the optimal dimensionality for an embedding should also know about the repository [[79](/articles/10.1186/s40537-020-00305-w#ref-CR79 "Yin Z. Word embedding dimensionality selection. 2019. 
https://github.com/ziyin-dl/word-embedding-dimensionality-selection

. Accessed 10 Dec 2019.")] that has an implementation of the techniques that Yin and Shen cover in [[77](/articles/10.1186/s40537-020-00305-w#ref-CR77 "Yin Z, Shen Y. On the dimensionality of word embedding. In: Bengio S, Wallach H, Larochelle H, Grauman K, Cesa-Bianchi N, Garnett R, editors. Advances in neural information processing systems 31. Red Hook: Curran Associates, Inc.; 2018. pp. 887–98. 
http://papers.nips.cc/paper/7368-on-the-dimensionality-of-word-embedding.pdf

. Accessed 16 Sept 2019."), [78](/articles/10.1186/s40537-020-00305-w#ref-CR78 "Yin Z. Understand functionality and dimensionality of vector embeddings: the distributional hypothesis, the pairwise inner product loss and its bias-variance trade-off. 2018. arXiv preprint 
arXiv:1803.00502

.")]. The implementation in this repository is in the Python programming language. Hence, we have source code for using Yin and Shen’s technique, which makes it easy to incorporate into existing projects. We feel that the degree of generality of Yin and Shen’s technique is unclear. It may apply to more than just embedding techniques for natural language data. If the technique proves to be generally applicable for entity embeddings then an implementation similar to the code in [[79](/articles/10.1186/s40537-020-00305-w#ref-CR79 "Yin Z. Word embedding dimensionality selection. 2019. 
https://github.com/ziyin-dl/word-embedding-dimensionality-selection

. Accessed 10 Dec 2019.")] should become part of any library for entity embedding.

#### Reusing natural language processing techniques

In “Using word embedding technique to efficiently represent protein sequences for identifying substrate specificities of transporters” [[45](/articles/10.1186/s40537-020-00305-w#ref-CR45 "Ho Q-T, Phan D-V, Ou Y-Y, et al. Using word embedding technique to efficiently represent protein sequences for identifying substrate specificities of transporters. Anal Biochem. 2019;577:73–81. 
https://doi.org/10.1016/j.ab.2019.04.011

.")], the authors Nguyen et al. reuse skip gram and continuous bag of words embedding techniques. They treat amino acids as letters, and the proteins the amino acids comprise as words. Nguyen et al. then apply natural language processing techniques to a database of protein data that they treat as their corpus. This illustrates an interesting possiblity with embedding techniques. If a pre-computed embedding is not available, one may find it is possible to reuse an existing algorithm from another domain to produce one suitable for the machine learning task at hand.

There are myriads of derivative works and refinements to Mikolov’s work and an exposition of those works is a topic worthy of a survey in its own right. We give Nguyen et al.’s work as one example of how general Mikolov’s technique is and its applicability to other domains beyond natural language processing. The success of Mikolov et al. is rooted in an automatic technique for embedding qualitative data for use in neural networks (Word2vec), and shows that automatic techniques are attractive due to their potential for reuse. This is especially true in big data environments where computing a new embedding of a large dataset may be too time-consuming to be practical.

### Entity embeddings

Guo and Berkhahn employed an automatic technique to win third place in a 2015 Kaggle competition. The technique is known as entity embedding. Entity embedding is a method to embed categorical variables in real-valued vector spaces [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")]. Guo and Berkhan’s success gives us an indication that neural networks are perhaps capable of operating on all sorts of qualitative data, if we can map that data to vectors we can use as input to neural networks effectively. In [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")] Guo and Berkhahn do not reveal a new technique. In fact, we find that in the source code for their Kaggle competition entry [[35](/articles/10.1186/s40537-020-00305-w#ref-CR35 "Guo C. Entity-embedding-rossmann. 2015. 
https://github.com/entron/entity-embedding-rossmann/blob/kaggle/models.py

. Accessed 19 Dec 2019.")] Guo and Berkhahn use the Keras library Embedding Layer function. The Keras Embedding Layer is a convenient means to automatically find a dense encoding for qualitative data. Nevertheless, we believe the embedding technique that Guo and Berkhahn use shows promise. We believe their success serves as an endorsement of the technique.

The abstract of [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")] mentions the Rossman Store Sales [[80](/articles/10.1186/s40537-020-00305-w#ref-CR80 "Inc K. Rossmann store sales. 2015. 
https://www.kaggle.com/c/rossmann-store-sales

. Accessed 11 Dec 2019.")] Kaggle competition. Part of [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")] is an explanation of the workings of their solution to a Kaggle competition where the authors won third place using a model that employs ideas they expose in this paper. The goal of the Kaggle competition is to discover the best model for predicting the sales, by store, for stores in the Rossman Drugstore chain. The source code of Guo and Berkhahn’s entry into the Kaggle competition, “Entity-embedding-rossman” [[35](/articles/10.1186/s40537-020-00305-w#ref-CR35 "Guo C. Entity-embedding-rossmann. 2015. 
https://github.com/entron/entity-embedding-rossmann/blob/kaggle/models.py

. Accessed 19 Dec 2019.")], is publicly available. In this repository, we see the authors use Keras [[20](/articles/10.1186/s40537-020-00305-w#ref-CR20 "Chollet F, et al. Embedding. 2019. 
https://keras.io/layers/embeddings/

. Accessed 29 Nov 2019.")] embedding layers repeatedly.

We are unable to find a seminal work that explicitly documents a theoretical justification for when encoding categorical variables with embedding layers can improve a model’s performance. Therefore, we see an opportunity for future work to provide this theoretical justification. We include a summary of the history and references here for those who might be interested in researching a theoretical justification for the performance enhancements Guo and Berkhahn report in their results in [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")]. One can surmise that events happen in rapid succession. We can see from the Keras source code repository commit history [[20](/articles/10.1186/s40537-020-00305-w#ref-CR20 "Chollet F, et al. Embedding. 2019. 
https://keras.io/layers/embeddings/

. Accessed 29 Nov 2019.")] that the authors add the embedding layer to Keras starting in April 2015. We see in Arxiv.org’s listing for Gal and Ghahramani’s paper that their first submission is in December 2015, so the Keras embedding functionality must have existed in Github before Gal and Ghahramani submitted their work to Arxiv.org.

Therefore, we conclude that the attribution implicit in the Keras documentation authors’ listing of Gal and Ghahramani’s work is correct. Furthermore, we conclude that Gal and Ghahramani’s is part of the succession of ideas that leads to Guo and Berkhahn’s work. And Guo and Berkhan’s work depends on Gal and Ghahramani’s work in that they use Keras embedding layers to embed categorical variables’ values for use in a neural network.

Guo and Berkhan’s design is sufficiently general that we feel compelled to explain its details. We include a copy of a diagram from [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")] in Fig. [2](/articles/10.1186/s40537-020-00305-w#Fig2) to help us explain the architecture.

**Fig. 2**

[![figure 2](//media.springernature.com/lw685/springer-static/image/art%3A10.1186%2Fs40537-020-00305-w/MediaObjects/40537_2020_305_Fig2_HTML.png)](/articles/10.1186/s40537-020-00305-w/figures/2)

Image copied from [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")]. The authors perform experiments with and without embedding layers. The schematic here shows the Author’s approach when they use embedding layers. Categorical variables are embedded separately, then the output of the embedded layers are concatenated and fed forward to dense layers

[Full size image](/articles/10.1186/s40537-020-00305-w/figures/2)

Guo and Berkhahn’s architecture is elegant. The architecture diagram in Fig. [2](/articles/10.1186/s40537-020-00305-w#Fig2) aligns with the actual neural network Guo and Berkhan implement in the source code in reference [[35](/articles/10.1186/s40537-020-00305-w#ref-CR35 "Guo C. Entity-embedding-rossmann. 2015. 
https://github.com/entron/entity-embedding-rossmann/blob/kaggle/models.py

. Accessed 19 Dec 2019.")]. Therefore, understanding the diagram will assist the reader in understanding the source code. The primary idea for Guo and Berkhahn’s architecture is to use One-hot Encoding for categorical variables, then feed the encoded categorical values to embedding layers. The output of all the embedding layers is then concatenated and fed to dense layers. Results Guo and Berkhahn present in [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")] highlight the utility of embedding layers. Furthermore, the results show that using embedding layers can improve performance when employed directly, or employed with transfer learning. The results in Table [7](/articles/10.1186/s40537-020-00305-w#Tab7) for “neural network” are where Guo and Berkhahn directly employ the encoding that the embedding layers provide. The results for other machine learning algorithms are where Guo and Berkhahn employ transfer learning. Guo and Berkhahn report the best performance when using direct employment with neural networks.

**Table 7 Results copied from Guo and Berkhahn [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")], \\(\text {MAPE}\\) is mean absolute percentage error, \\(\text {EE}\\) is entity embedding \\(\text {KNN}\\) is K-Nearest Neighbors, in all cases using entity embedding for encoding gives lower error, transfer learning employed for all models except neural network where direct learning is employed**

[Full size table](/articles/10.1186/s40537-020-00305-w/tables/7)

Guo and Berkhahn’s results may lead one to believe that entity embedding as a technique for encoding categorical variables is something one should always do. However, we raise two points one should consider when digesting their results. The first is that Guo and Berkhahn report one metric, mean absolute percentage error (\\(\text {MAPE}\\)). They define \\(\text {MAPE}\\) as

$$\begin{aligned} \left|\frac{ Sales - Sales_{predict}}{Sales} \right|. \end{aligned}$$

(7) 

We think it would be interesting to see how much of the variance in \\(\text {MAPE}\\) is explained by the model used, versus the use of entity embeddings.

We see some opportunities for future work given the results Guo and Berkhahn present. Guo and Berkhahn provide the source code for their experiments in [[35](/articles/10.1186/s40537-020-00305-w#ref-CR35 "Guo C. Entity-embedding-rossmann. 2015. 
https://github.com/entron/entity-embedding-rossmann/blob/kaggle/models.py

. Accessed 19 Dec 2019.")]. This makes extending their work easier. The first opportunity for future work that we see is computing the analysis of variance we mention above. Another opportunity for future research is to add the determined encoding technique as a level to the experiments Guo and Berkhahn perform in [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")]. Guo and Berkhahn’s implementation is written in Python, and the Scikit-learn Python library includes modules for seven different determined encoding techniques. Therefore, adding these different techniques is a straightforward effort.

Guo and Berkhan’s work in [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")] is a clear example of how to use an automatic technique to encode categorical variables, and how to employ it using transfer learning, or directly into a larger neural network. When it is possible to use a library such as Keras for implementation, embedding layers require little effort to implement. Guo and Berhahn’s results show that using embedding layers may improve performance. Therefore, practitioners may wish to include an embedding layer for any One-hot encoded categorical variables they are working with since it only requires adding an extra layer to an existing neural network.

#### Entity embedding for anomaly detection

One interesting application of entity embeddings we find when searching for work using the term, “entity embedding”, is “Entity Embedding-based Anomaly Detection for Heterogeneous Categorical Events” [[30](/articles/10.1186/s40537-020-00305-w#ref-CR30 "Chen T, Tang L-A, Sun Y, Chen Z, Zhang K. Entity embedding-based anomaly detection for heterogeneous categorical events. 2016. 
arXiv:1608.07502

.")] by Chen et al. Here we have an automatic technique for anomaly detection. We find the authors report that they use methods similar to Mikolov et al. However, we do not find that the authors share the source code for their experiments so it is not easy to leverage their research in other avenues. On the other hand, the work is interesting, since it describes a technique for using categorical data for input into deep learning algorithms. The authors do not give precise details on how they map categorical features that constitute events in some computing environment. Chen et al. write that in the context of their research, an event is a collection of categorical values describing something that happens in a computer system. They treat events as categorical values that they then embed into a vector space. Since the authors do not provide their source code, we speculate that they use One-hot encoding for the event data, and then use something like a Keras embedding layer to implement the embedding. After embedding the authors indicate they optimize the maximum likelihood objective

$$\begin{aligned} \underset{\theta }{\mathrm {argmax}}\sum _{e \in D} \text {log}P_{\theta }\left( e \right) \end{aligned}$$

(8) 

where _e_ is an event, \\(P\left( \cdot \right)\\) is the probability of \\(\cdot\\), and _D_ is the set of events.

Our understanding of the results Chen et al. present is that they give enough detail to earn a place to present this work in the International Joint Conference on Artificial Intelligence, but not quite enough detail for one to be able to reproduce their results easily. However, since the work falls under the subject of this review we feel it is worth mentioning. One thing researchers should note is that the technique Chen et al. cover in [[30](/articles/10.1186/s40537-020-00305-w#ref-CR30 "Chen T, Tang L-A, Sun Y, Chen Z, Zhang K. Entity embedding-based anomaly detection for heterogeneous categorical events. 2016. 
arXiv:1608.07502

.")] is a way to assign a probability to a pair of events that occur in sequence. This is interesting and reusable in future research. The technique works as follows: let \\(v_{a_i}\\), and \\(v_{a_j}\\) be the embedding vectors for two entities. Note that we are free to think of \\(v_{a_i}\\), and \\(v_{a_j}\\) as lists of categorical data mapped to vectors in \\({\mathbb {R}}^n\\). Furthermore, we define the event _e_ to be an ordered collection of _m_ entities. Then we can define a scoring function \\(S_{\theta }\left( e \right)\\),

$$\begin{aligned} S_{\theta }\left( e \right) =\sum _{i,j:1 \le i \le j \le m} w_{ij}\left( v_{a_i} \cdot v_{a_j} \right) . \end{aligned}$$

(9) 

where \\(w_{ij}\\) is a parameter that we can adjust via some machine learning algorithm. We can furthermore define a loss function for training that machine learning algorithm that determines values for \\(w_{ij}\\) that give the best performance. Hence, the algorithm is capable of assigning importance to pairs of events. Under proper conditions, this algorithm learns to produce significantly different outputs when pairs of events occur simultaneously. One should be able to abstract this technique to apply to entities in general, and not simply events.

Since Chen et al. do not provide source code for their experiments we need to do some reverse engineering. We see an opportunity for future research to use Mikolov and Sutskever’s source code from [[44](/articles/10.1186/s40537-020-00305-w#ref-CR44 "Mikolov T, Sutskever I. word2vec. 2015. 
https://code.google.com/archive/p/word2vec/

. Accessed 29 Dec 2019.")] and incorporate the ideas in [[30](/articles/10.1186/s40537-020-00305-w#ref-CR30 "Chen T, Tang L-A, Sun Y, Chen Z, Zhang K. Entity embedding-based anomaly detection for heterogeneous categorical events. 2016. 
arXiv:1608.07502

.")] in detecting fraudulent transactions. We treat the transactions as Chen et al. treat entities in [[30](/articles/10.1186/s40537-020-00305-w#ref-CR30 "Chen T, Tang L-A, Sun Y, Chen Z, Zhang K. Entity embedding-based anomaly detection for heterogeneous categorical events. 2016. 
arXiv:1608.07502

.")], and we use the time of the transaction to place an ordering on entities. It is important to note that we do not find that Chen et al. report an embedding technique, so to get started on the future research we are suggesting, we would use Keras’ embedding layer [[20](/articles/10.1186/s40537-020-00305-w#ref-CR20 "Chollet F, et al. Embedding. 2019. 
https://keras.io/layers/embeddings/

. Accessed 29 Nov 2019.")].

Chen et al.’s work also shows how using an automatic technique for encoding qualitative data, in this case entity embedding, is reusable in different domains. Here we see the same technique used for estimating sales in drugstores, and for detecting anomalies in computing systems.

### Neural probabilistic outlier detection

“A Neural Probabilistic outlier detection method for categorical data” [[50](/articles/10.1186/s40537-020-00305-w#ref-CR50 "Cheng L, Wang Y, Ma X. A neural probabilistic outlier detection method for categorical data. Neurocomputing. 2019;365:325–35.")], by Cheng, Wang and Ma presents an automatic technique for finding outliers in datasets with categorical data. Outlier detection is a suitable perspective to take for classifying highly imbalanced datasets. With imbalanced datasets, minority class observations may be identifiable as outliers. In this case one may be able to employ an automatic technique for representing categorical data in a neural network for the unsupervised task of outlier detection. If one finds an acceptable overlap between the set of outliers and the minority class, then one also has a classifier that can separate a dataset. Hence, Cheng, Wang and Ma’s automatic way to learn a data representation for categorical variables for outlier detection is also a potential classifier for imbalanced data.

The architecture Cheng, Wang, and Ma present is a three-layer neural network. The simplicity of the architecture is attractive. Cheng, Wang, and Ma propose a loss function that guides their model to learn parameters such that the loss function will output large values for outliers, and small values for observations that are not outliers. We do not find source code for Cheng, Wang, and Ma’s work, so we must rely on the theoretical discussion they give in [[50](/articles/10.1186/s40537-020-00305-w#ref-CR50 "Cheng L, Wang Y, Ma X. A neural probabilistic outlier detection method for categorical data. Neurocomputing. 2019;365:325–35.")]. The loss function Cheng, Wang, and Ma propose is

$$\begin{aligned} {\mathscr {L}} = - \frac{1}{n} \sum _{o \in {\mathscr {O}}} \text {log} P \left( o^i \big | con\left( o^i\right) \right) \end{aligned}$$

(10) 

We use Cheng, Wang, and Ma’s terminology to define the elements of Eq. [10](/articles/10.1186/s40537-020-00305-w#Equ10). The _i_ th attribute value of an object is \\(o^i\\). The context of \\(o^i\\) is \\(con\left( o^i\right)\\). An attribute’s context is the value of all the other attributes that we observe along with it in a particular instance of a dataset. Therefore, \\(P\left( o^i\big | con\left( o^i\right) \right)\\) is the conditional probability of the attribute value given the other attributes along with it. To compute the loss function Cheng, Wang, and Ma sum the negative logarithm of the conditional probabilities over all the objects in \\({\mathscr {O}}\\). Cheng, Wang, and Ma define \\({\mathscr {O}}\\) as a set of objects with categorical attributes. Since we are taking the negative logarithm of the conditional probabilities, this sum will be large when its components are small. When the components of the sum are small, this implies that the conditional probabilities are small. When the conditional probabilities are small, this means we have an attribute that is not likely to occur with other attributes, or if we prefer, an outlier. Hence, the three-layer Neural Network that Cheng, Wang, and Ma propose is an algorithm that automatically learns to partition elements of a dataset into outliers, and non-outliers. It learns via backpropagation of the loss function defined in [10](/articles/10.1186/s40537-020-00305-w#Equ10). They name this algorithm Neural Probabilistic Outlier Detection (\\(\text {NPOD}\\)).

In order to evaluate \\(\text {NPOD}\\), Cheng, Wang, and Ma compare \\(\text {NPOD}\\)’s ability to detect outliers to eight algorithms for detecting outliers in categorical data. They use 12 publicly available datasets as input to the nine algorithms and report that their technique achieves the best Area under the curve (\\(\text {AUC}\\)) score for seven of the twelve datasets.

The simplicity and elegance of Cheng, Wang, and Ma’s approach makes it an attractive choice for working with categorical data in neural networks, but it is limited in scope. On the one hand, it is a technique that is capable of finding outliers in data that employs unsupervised machine learning. However, we find it difficult to conceive of how to employ it as a general purpose technique for transforming categorical data for use in neural networks. We choose to include it in this study because it involves neural networks, and feeding categorical data into them. We are aware of important machine learning tasks, such as medicare fraud detection Johnson et al. cover in [[6](/articles/10.1186/s40537-020-00305-w#ref-CR6 "Johnson JM, Khoshgoftaar TM. Medicare fraud detection using neural networks. J Big Data. 2019;6:1–35.")], that can be solved from an outlier detection perspective.

### Hierarchical gated recurrent units

“Deep neural models for \\(\text {ICD-10}\\) coding of death certificates and autopsy reports in free-text” [[48](/articles/10.1186/s40537-020-00305-w#ref-CR48 "Duarte F, Martins B, Pinto CS, Silva MJ. Deep neural models for ICD-10 coding of death certificates and autopsy reports in free-text. J Biomed Inform. 2018;80:64–77.")], by Duarte et al., presents an intricate model for automated labeling of medical documents. We consider the author’s technique for encoding qualitative data an automated technique because at a high level it relies on entity embedding via Keras Embedding layers. However, the details in their paper, and source code reveal a blending of techniques. Their approach involves nested components. The source code in [[49](/articles/10.1186/s40537-020-00305-w#ref-CR49 "Contributors T. ciscorduarte/mortality_coding_dnn. 2018. 
https://github.com/ciscorduarte/mortality_coding_dnn

. Accessed 4 Dec 2019.")] that accompanies the paper [[48](/articles/10.1186/s40537-020-00305-w#ref-CR48 "Duarte F, Martins B, Pinto CS, Silva MJ. Deep neural models for ICD-10 coding of death certificates and autopsy reports in free-text. J Biomed Inform. 2018;80:64–77.")] is most helpful in guiding one to understand Duarte et al.’s approach. The authors use a Keras Embedding layer to encode the words in the fields of the clinical forms that constitute the input to their model. They then connect the embedding layer to a Bi-directional Gated Recurrent Unit (\\(\text {BiGRU}\\)) that is capable of detecting patterns in the word embedding layer. Duarte et al. then connect the first \\(\text {BiGRU}\\) to an attention layer that is able to recognize patterns in the sequences of word embeddings in the \\(\text {BiGRU}\\) layer to form a representation of a sentence. In addition, Duarte et al. use a duplicate word embedding layer that they combine with the output of the attention layer to feed into an output layer. The output layer has three components that give a representation of various \\(\text {ICD-10}\\) codes. We provide the reader a copy of a diagram of Duarte et al.’s in Fig. [3](/articles/10.1186/s40537-020-00305-w#Fig3). Duarte et al.’s design is intricate, and specialized for the purpose of generating \\(\text {ICD-10}\\) codes from autopsy reports and death certificates. Their use of a Keras embedding layer implies that their model automatically learns a representation of its input.

**Fig. 3**

[![figure 3](//media.springernature.com/lw685/springer-static/image/art%3A10.1186%2Fs40537-020-00305-w/MediaObjects/40537_2020_305_Fig3_HTML.png)](/articles/10.1186/s40537-020-00305-w/figures/3)

Architecture diagram copied from Duarte et al. [[48](/articles/10.1186/s40537-020-00305-w#ref-CR48 "Duarte F, Martins B, Pinto CS, Silva MJ. Deep neural models for ICD-10 coding of death certificates and autopsy reports in free-text. J Biomed Inform. 2018;80:64–77.")]

[Full size image](/articles/10.1186/s40537-020-00305-w/figures/3)

Duarte et al. compare six variations of the model we show in Fig. [3](/articles/10.1186/s40537-020-00305-w#Fig3) with two variations of a Support Vector Machine (SVM) model for evaluation. They report their model outperforms SVM, but that their model requires a trade off between accuracy, precision, and recall. The trade-off is in the choice of initialization technique for the output layers of their model. Duarte et al. get the highest values for accuracy when they initialize the output layer of their model with weights they derive from the frequencies of co-occurrences of \\(\text {ICD-10}\\) codes using the Apriori algorithm. On the other hand, Duarte et al. report the highest precision and recall scores for the configuration of their model where they initialize the weights of its output layers with Non-Negative Matrix Factorization (\\(\text {NMF}\\)). The interested reader should consult the source code in [[49](/articles/10.1186/s40537-020-00305-w#ref-CR49 "Contributors T. ciscorduarte/mortality_coding_dnn. 2018. 
https://github.com/ciscorduarte/mortality_coding_dnn

. Accessed 4 Dec 2019.")] to see precisely how Duarte et al. employ these initialization techniques.

Duarte et al. present an automated technique for encoding qualitative natural language clinical data for use in a classifier that categorizes the data into \\(\text {ICD-10}\\) codes. Since they provide the source code [[49](/articles/10.1186/s40537-020-00305-w#ref-CR49 "Contributors T. ciscorduarte/mortality_coding_dnn. 2018. 
https://github.com/ciscorduarte/mortality_coding_dnn

. Accessed 4 Dec 2019.")] to accompany [[48](/articles/10.1186/s40537-020-00305-w#ref-CR48 "Duarte F, Martins B, Pinto CS, Silva MJ. Deep neural models for ICD-10 coding of death certificates and autopsy reports in free-text. J Biomed Inform. 2018;80:64–77.")], we have easy opportunities to extend their work. One possibility is replacing the embedding layer they use for representing text with another encoding technique such as Latent Dirichlet Allocation that Wang and Xu use in [[18](/articles/10.1186/s40537-020-00305-w#ref-CR18 "Wang Y, Xu W. Leveraging deep learning with lda-based text analytics to detect automobile insurance fraud. Decis Support Syst. 2018;105:87–95.")]. Duarte et al.’s work is a clear example for researchers interested in employing representation learning to use qualitative data in neural networks.

### Transfer learning

Instead of reusing an algorithm to learn data representation, we can transfer an existing data representation for use in another algorithm. This technique saves training time, since we do not have to learn a new representation for input data. Bengio, Courville, and Vincent define transfer learning as, “... the ability of a learning algorithm to exploit commonalities between different learning tasks in order to share statistical strength, and transfer knowledge across tasks” [[81](/articles/10.1186/s40537-020-00305-w#ref-CR81 "Bengio Y, Courville A, Vincent P. Representation learning: a review and new perspectives. IEEE Trans Pattern Anal Mach Intell. 2013;35\(8\):1798.")]. Practically, in the context of neural networks, transfer learning amounts to using part of a neural network that we train using one algorithm, for use in another. This is the meaning of the term transfer learning in the context of this study. In this section we describe one work that uses transfer learning, as a way to use categorical data as input for a neural network.

Before we cover the example of transfer learning, we must clarify that our definition of “transfer learning” differs from another definition present in current literature. In works such as [[82](/articles/10.1186/s40537-020-00305-w#ref-CR82 "Day O, Khoshgoftaar TM. A survey on heterogeneous transfer learning. J Big Data. 2017;4\(1\):1–42.")], “transfer learning” refers to training a supervised machine learning algorithm with a labeled dataset, and then feeding the trained algorithm input values from a different dataset. This is not the technique we refer to as transfer learning here.

#### The sent2affect algorithm

In “Deep learning for affective computing: Text-based emotion recognition in decision support” [[47](/articles/10.1186/s40537-020-00305-w#ref-CR47 "Kratzwald B, Ilić S, Kraus M, Feuerriegel S, Prendinger H. Deep learning for affective computing: text-based emotion recognition in decision support. Decis Support Syst. 2018;115:24–35.")], Kratzwald et al. use transfer learning for classifying the emotional content of various samples of texts from different datasets. Kratzwald et al. reuse the text embedding that the \\(\text {GloVe}\\) algorithm learns for the machine learning task of recognizing the emotional nature of a body of text.

The samples of text that Kratzwald et al. use in their experiments are labeled according to the emotional content of the text. Krazwald et al. write that they use a factorial experiment design to evaluate the performance of different machine learning algorithms’ performance on various datasets. Krazwald et al. use five datasets, and six different machine learning algorithms. The datasets are samples of text from literary tales, twitter messages related to an election, self-reported experiences, headlines, and a general collection of twitter messages. The classifiers Kratzwald et al. use are Random Forest, Support Vector Machine (\\(\text {SVM}\\)), Long Short-term Memory (\\(\text {LSTM}\\)), and Bi-directional Long Short-term Memory (\\(\text {BiLSTM}\\)). Furthermore, Kratzwald et al. explore two architectural variations on \\(\text {LSTM}\\) and \\(\text {BiLSTM}\\). In one configuration they use a randomly initialized embedding layer. In this configuration the authors do not apply transfer learning. This is necessary because they are controlling for the effect of using transfer learning to assess the impact of it in their experiments. In the second configuration of their \\(\text {LSTM}\\) and \\(\text {BiLSTM}\\) models, Kratzwald et al. use a pre-trained word embedding from a \\(\text {GloVe}\\) model to convert the text they classify into vectors. Most notably, Kratzwald et al. report that the experiments where they record the highest F1-scores for classifying the emotional content of text are the trials involving \\(\text {BiLSTM}\\) with the pre-trained \\(\text {GloVe}\\) word embedding. In fact, this configuration is the one that achieves the highest F1 score on every dataset.

Another important fact about the work Kratzwald et al. report in [[47](/articles/10.1186/s40537-020-00305-w#ref-CR47 "Kratzwald B, Ilić S, Kraus M, Feuerriegel S, Prendinger H. Deep learning for affective computing: text-based emotion recognition in decision support. Decis Support Syst. 2018;115:24–35.")] is that the corpus they apply the \\(\text {GloVe}\\) algorithm to, to obtain their pre-trained word embedding is a dataset from a Kaggle Twitter Sentiment Analysis contest in 2017 [[83](/articles/10.1186/s40537-020-00305-w#ref-CR83 "Kaggle I. Twitter sentiment analysis. 2017. 
https://www.kaggle.com/c/twitter-sentiment-analysis2

. Accessed 10 Dec 2019.")]. Their approach is to train \\(\text {GloVe}\\) on the labeled dataset from the Kaggle Twitter Sentiment Analysis contest where Twitter messages (tweets) are labeled as positive or negative. They then replace the output layer above an \\(\text {LSTM}\\) or \\(\text {BiLSTM}\\) with a layer that has more output values, and train the new model again with one of the different datasets we mention above. It is important to note that Kratzwald et al. do not freeze the parameters of their \\(\text {LSTM}\\) or \\(\text {BiLSTM}\\) once they are finished training it with the Kaggle Twitter Sentiment Analysis contest dataset.

Krazwald et al.’s paper is a good example of why we use the term spectrum to write about techniques for using categorical data in neural networks. They start with reusing an existing word embedding algorithm for sentiment analysis which we would consider an automatic technique. Ultimately, they apply transfer learning to reuse a data representation to achieve the best performance in their experiments.

### Autoencoders

Another interesting application of embeddings is with time series data, and autoencoders. In [[38](/articles/10.1186/s40537-020-00305-w#ref-CR38 "Kieu T, Yang B, Jensen CS. Outlier detection for multidimensional time series using deep neural networks. In: 2018 19th IEEE international conference on mobile data management \(MDM\), IEEE. 2018. pp. 125–34.")] Kieu et al. use an embedding algorithm similar to Guo and Berkhahn’s [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")]. Kieu et al. show that their model improves with an embedding layer. They encode categorical values using an embedding to capture contextual information to enhance time-series data. They show that using the embedded contextual information improves the accuracy of their deep neural network algorithm for outlier detection. Autoencoders provide another form of automatic technique for using categorical data in neural networks.

Lei et al. [[40](/articles/10.1186/s40537-020-00305-w#ref-CR40 "Lei L, Zhou Y, Zhai J, Zhang L, Fang Z, He P, Gao J. An effective patient representation learning for time-series prediction tasks based on EHRs. In: 2018 IEEE international conference on bioinformatics and biomedicine \(BIBM\), IEEE. 2018. pp. 885–92.")] use an autoencoder to embed medical records in a vector space. Goodfellow, Bengio, and Courville cover autoencoders in Chapter 14 of [[1](/articles/10.1186/s40537-020-00305-w#ref-CR1 "Goodfellow I, Bengio Y, Courville A. Deep learning. Cambridge: MIT Press; 2016.")]. Autoencoders are pairs of neural networks that together learn the identity function of their input. We do not find modeling the identity function interesting. However, the process of training the autoencoder to compute the identity function causes the hidden layers of the autoencoder to develop a representation of the input domain. In order to accommodate time-series data, Lei et al. use recurrent neural networks in their autoencoder. Lei et al. treat medical records as time series data. However, their approach is different from that of Kieu et al. because Lei et al. use an autoencoder to do their embedding, whereas Kieu et al. first embed their input data using an embedding layer, and use the output of the embedding layer as input to an autoencoder. The reader should note that according to the way Lei et al. describe their approach, they use a sequence of time series data to produce one feature vector that is the output of the autoencoder. That is interesting because the model produces an embedding that is sensitive to the way the data that represents a patient changes over time, and thus the embedding technique is capable of producing similar representations of patients when their records change in the same way over time.

One area for further research is to compare the effectiveness of Kieu et al.’s and Lei et al.’s techniques. Since Kieu et al. found that using the embedding layer enhances the performance of their algorithm, it could be the case that we could improve the algorithm that Lei et al. devise if we add an embedding layer that would then provide the input for an autoencoder. On the other hand, it may be the case that we could feed an autoencoder the data Kieu et al. use, without an embedding layer, and obtain a result with performance comparable to what Lei et al. report.

Dealing with categorical values in time series data as inputs for deep learning algorithms presents its own unique challenges. However, we find researchers use different architectures to accommodate time series data. Which approach is more advantageous is an avenue for future research. Another opportunity for future research is to compare automatic techniques with a controlled set of machine learning algorithms. One could design a set of experiments to feed a fixed group of algorithms data from autoencoders, or entity embedding to determine which technique is better.

### Convolutional neural network for time series data

“Analysis and prediction of unplanned intensive care unit readmission using recurrent neural networks with long short-term memory” [[51](/articles/10.1186/s40537-020-00305-w#ref-CR51 "Lin Y-W, Zhou Y, Faghri F, Shaw MJ, Campbell RH. Analysis and prediction of unplanned intensive care unit readmission using recurrent neural networks with long short-term memory. PLoS ONE. 2019;. 
https://doi.org/10.1371/journal.pone.0218942

.")], by Lin et al. is another work that involves using a convolutional neural network that uses qualitative data for input. The central theme of the work is using electronic health records (\\(\text {EHR}\\)’s) to predict when a patient will be readmitted to a hospital’s intensive care unit (ICU). One may readily leverage this work because the authors provide the source code [[52](/articles/10.1186/s40537-020-00305-w#ref-CR52 "Lin Y-W, Zhou Y, Faghri F, Shaw MJ, Campbell RH. Jeffreylin0925/MIMIC-III_ICU_Readmission_Analysis: This is the source code for the paper ‘Analysis and Prediction of Unplanned Intensive Care Unit Readmission’. 2018. 
https://github.com/Jeffreylin0925/MIMIC-III_ICU_Readmission_Analysis

.")], and the data [[84](/articles/10.1186/s40537-020-00305-w#ref-CR84 "Johnson AE, Pollard TJ, Shen L, Li-wei HL, Feng M, Ghassemi M, Moody B, Szolovits P, Celi LA, Mark RG. Mimic-iii, a freely accessible critical care database. Sci Data. 2016;3:160035.")] for their experiments. We include this work in the automatic family of techniques for using categorical data in neural networks because of the manner in which Lin et al. prepare their data for input into a neural network. However, we view [[51](/articles/10.1186/s40537-020-00305-w#ref-CR51 "Lin Y-W, Zhou Y, Faghri F, Shaw MJ, Campbell RH. Analysis and prediction of unplanned intensive care unit readmission using recurrent neural networks with long short-term memory. PLoS ONE. 2019;. 
https://doi.org/10.1371/journal.pone.0218942

.")] as a borderline case because the authors report their best metrics with a model that uses both transfer learning and One-hot encoding for its qualitative inputs. It is borderline cases, such as [[51](/articles/10.1186/s40537-020-00305-w#ref-CR51 "Lin Y-W, Zhou Y, Faghri F, Shaw MJ, Campbell RH. Analysis and prediction of unplanned intensive care unit readmission using recurrent neural networks with long short-term memory. PLoS ONE. 2019;. 
https://doi.org/10.1371/journal.pone.0218942

.")] that inspires the term spectrum when we discuss techniques for using categorical data in neural networks.

**Fig. 4**

[![figure 4](//media.springernature.com/lw685/springer-static/image/art%3A10.1186%2Fs40537-020-00305-w/MediaObjects/40537_2020_305_Fig4_HTML.png)](/articles/10.1186/s40537-020-00305-w/figures/4)

Image copied from [[51](/articles/10.1186/s40537-020-00305-w#ref-CR51 "Lin Y-W, Zhou Y, Faghri F, Shaw MJ, Campbell RH. Analysis and prediction of unplanned intensive care unit readmission using recurrent neural networks with long short-term memory. PLoS ONE. 2019;. 
https://doi.org/10.1371/journal.pone.0218942

.")], structure of time series dataset shows mix of quantitative and qualitative data, including embedding of \\(\text {ICD-9}\\) codes

[Full size image](/articles/10.1186/s40537-020-00305-w/figures/4)

Figure [4](/articles/10.1186/s40537-020-00305-w#Fig4) shows the reader Lin et al.’s approach to using qualitative data for input to neural networks. It also indicates how the authors can use a block of 48 h of \\(\text {EHR}\\) data for one patient as one input to a convolutional neural network for experiments where they use a convolutional neural network. For the purpose of this work we are interested in how Lin et al. deal with the categorical values they use as input to their neural networks. We see from Fig. [4](/articles/10.1186/s40537-020-00305-w#Fig4) that the authors convert \\(\text {ICD-9}\\) codes to embedded values. Lin et al. write that they use Choi, Chill, and Sontag’s technique from “Learning low-dimensional representations of medical concepts” [[53](/articles/10.1186/s40537-020-00305-w#ref-CR53 "Choi Y, Chiu CY-I, Sontag D. Learning low-dimensional representations of medical concepts. AMIA Summits Transl Sci Proc. 2016;16:41.")] to embed the \\(\text {ICD-9}\\) codes. Lin, Chill, and Sontag’s technique is based on Mikolov et al.’s Word2vec algorithm. This is why we chose to place this work in the category of automatic techniques. The reader may be interested to know that the source code for Lin, Chill, and Sontag’s embedding technique is available in [[54](/articles/10.1186/s40537-020-00305-w#ref-CR54 "Choi Y, Chiu CY-I, Sontag D. clinicalml/embeddings: Code for AMIA CRI 2016 paper “Learning low-dimensional representations of medical concepts”. 2016. 
https://github.com/clinicalml/embeddings

. Accessed 23 Dec 2019.")]. For categorical features in the charted events and demographics areas indicated in Fig. [4](/articles/10.1186/s40537-020-00305-w#Fig4) Lin et al. use One-hot encoding. This use of One-hot encoding immediately raises a prospect for future research. We see their Glasgow coma scale categorical value has 13 dimensions. In [[3](/articles/10.1186/s40537-020-00305-w#ref-CR3 "Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. 
arXiv:1604.06737

.")], Guo and Berkhahn embed categorical variables with a similar number of One-hot encoding dimensions, and they achieve a lower mean approximate percentage error when they use embedded categorical variables.

Lin et al. evaluate the performance of Convolutional Neural Networks (\\(\text {CNN}\\)’s), Long Short-term Memory (\\(\text {LSTM}\\)), and combinations of \\(\text {LSTM}\\) and \\(\text {CNN}\\)’s that use the input data pictured in Fig. [4](/articles/10.1186/s40537-020-00305-w#Fig4). In this evaluation they also include a comparison to Logistic Regression, Naive Bayes, Random Forest, and Support Vector Machine classifiers, but they must treat their input data differently for use as input to these classifiers. Out of all the models they include in their experiments, Lin et al. find that the best performing configuration is an \\(\text {LSTM}\\) that takes the data illustrated in Fig. [4](/articles/10.1186/s40537-020-00305-w#Fig4), and the output of the \\(\text {LSTM}\\) goes to a \\(\text {CNN}\\) that produces the final prediction of whether the patient is likely to return to the \\(\text {ICU}\\).

The model Lin et al. present is a complex example that reflects the authors’ expertise in the domain of the input data they use. When such expertise is employed to construct a dataset with categorical data, we encounter a blending of techniques. Still, one can analyze the techniques the authors use and identify determined and automatic techniques. This work is an example of how to employ multiple techniques to encode categorical data for use in a complex neural network.

### Summary of automatic techniques

Researchers have achieved state-of-the-art results using data encoded with automatic techniques. See [[32](/articles/10.1186/s40537-020-00305-w#ref-CR32 "Devlin J, Chang M-W, Lee K, Toutanova K. BERT: pre-training of deep bidirectional transformers for language understanding 2018. 
arXiv:1810.04805

."), [43](/articles/10.1186/s40537-020-00305-w#ref-CR43 "Mikolov T, Chen K, Corrado G, Dean J. Efficient estimation of word representations in vector space. 2013. arXiv preprint 
arXiv:1301.3781

.")] for reports of such superior results. However, the reader should bear in mind that when starting from scratch, automatic techniques are resource intensive. Especially when working with big data, a new automatic technique could require a lot of space and time to compute an embedding of qualitative values. For example, in [[43](/articles/10.1186/s40537-020-00305-w#ref-CR43 "Mikolov T, Chen K, Corrado G, Dean J. Efficient estimation of word representations in vector space. 2013. arXiv preprint 
arXiv:1301.3781

.")] Mikolov et al. report a training times on the order of one day on datasets of billions of words.

Fortunately many automatic techniques lend themselves to transfer learning, so often it is possible to reuse parts of models previously trained to avoid duplicating the effort. On one hand, we notice there is a common theme of current best-in-class algorithms employing automatic techniques. On the other we recommend trying to use transfer learning first to avoid the resource intensive process of employing an automatic technique for working with qualitative data in neural networks.

Automatic techniques are compelling to study because they are reusable across a wide variety of domains. Furthermore, the symmetry between operations on vectors learned by Word2vec, and semantic relationships between the encoded words is exciting. It is exciting because this pattern emerges from an automated technique that does not encode prior knowledge of its input domain. In this section, we cover distributed representations, entity embeddings, autoencoders, and how transfer learning plays a role in sophisticated models. We also find that while an automatic technique may be the most important aspect of the way in which researchers deal with qualitative data in neural networks, in practice one must employ a composition of techniques.

## Conclusion

In this survey, we provide an overview of techniques for using categorical data as inputs to deep learning algorithms. To the best of our knowledge, this is the first work to present a unified description of techniques for encoding categorical values for use in neural networks. We present a new perspective on encoding techniques. The new perspective is a view of encoding techniques in three categories: determined, algorithmic, and automatic. In practice, one must use a blend of techniques for working with categorical data in neural networks, unless one is satisfied with using only determined techniques. Automatic and algorithmic techniques rely on some determined technique as a first step. Determined and automatic techniques are most suitable for big data projects. We find algorithmic techniques to be less attractive because they have lower potential for re-use, and when working with big data, may have running times that are prohibitive. We see an opportunity for future research in a systematic study to compare combinations of embedding techniques on various machine learning tasks. We provide the reader with references to the source code of multiple implementations of models that use categorical encoding techniques to facilitate opportunities for future research. For the long term, it appears that automatic techniques for using categorical data in neural networks may be the most important. We assume industry will be more interested in funding development of techniques that are easy to employ, general-purpose, and reusable. Algorithmic techniques fit this description. However, for the short term, determined techniques are more suitable for encoding quantitative data in large datasets because they are less computationally expensive than automatic or algorithmic techniques. Despite longstanding research on embedding techniques for neural networks, opportunities for further research still exist. For specific tasks, it could be the case that more sophisticated techniques, such as \\(\text {EDLT}\\) [[76](/articles/10.1186/s40537-020-00305-w#ref-CR76 "Han H, Zhu X, Li Y. EDLT: enabling deep learning for generic data classification. In: 2018 IEEE international conference on data mining \(ICDM\). Washington, DC: IEEE; 2018. 
https://doi.org/10.1109/icdm.2018.00030

.")] and \\(\text {GEL}\\) [[19](/articles/10.1186/s40537-020-00305-w#ref-CR19 "Golinko E, Zhu X. Generalized feature embedding for supervised, unsupervised, and online learning tasks. Inf Syst Front. 2018;21:125–42.")], are better. However, to the best of our knowledge we do not have a study that compares \\(\text {GEL}\\) or \\(\text {EDLT}\\) to automatic techniques. This is an opportunity for future research. In this study, we have found a way to organize techniques for working with categorical data in neural networks. Researchers should be aware of the spectrum of techniques available, as well as the methods of employing them.

## Availability of data and materials

Not applicable.

## Abbreviations

AUC:
    

Area under the curve

BERT:
    

Bidirectional Encoder Representations from Transformers

BiGRU:
    

Bi-directional Gated Recurrent Unit

BiLSTM:
    

Bi-directional Long Short-term Memory

CBOW:
    

Continuous bag of words

CNN:
    

Convolutional neural network

CPT:
    

Current Procedural Terminology

DCNN:
    

Deep Convolutional Neural Network

DNA:
    

Deoxyribonucleic acid

DNN:
    

Deep neural network

EDLT:
    

Enabling Deep Learning for Generic Classification Tasks

EE:
    

Entity embedding

EHR:
    

Electronic health records

ELM:
    

Extreme learning machine

FP:
    

False positive

GEL:
    

Generalized feature embedding learning

RR:
    

Random reordering

SGD:
    

Stochastic gradient descent

SVM:
    

Support Vector Machine

GloVe:
    

Global Vectors for Word Representation

ICD:
    

International Statistical Classification of Diseases

ICD-10:
    

International Statistical Classification of Diseases Tenth Revision

ICD-9:
    

International Statistical Classification of Diseases Ninth Revision

ICU:
    

Intensive care unit

KNN:
    

K-Nearest Neighbors

LDA:
    

Latent Dirichlet Analysis

LSTM:
    

Long Short-term Memory

MAPE:
    

Mean absolute percentage error

NMF:
    

Non-Negative Matrix Factorization

NPOD:
    

Neural probabilistic outlier detection

PCA:
    

Principal component analysis

PIP:
    

Pairwise Inner Product

RBF:
    

Radial Basis Function

RBF SVM:
    

Radial Basis Function Support Vector Machine

TP:
    

True positive

URL:
    

Uniform resource locator

## References

  1. Goodfellow I, Bengio Y, Courville A. Deep learning. Cambridge: MIT Press; 2016.

[MATH](http://www.emis.de/MATH-item?1373.68009) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Deep%20learning&publication_year=2016&author=Goodfellow%2CI&author=Bengio%2CY&author=Courville%2CA)

  2. Blei DM, Ng AY, Jordan MI. Latent dirichlet allocation. J Mach Learn Res. 2003;3(Jan):993–1022.

[MATH](http://www.emis.de/MATH-item?1112.68379) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Latent%20dirichlet%20allocation&journal=J%20Mach%20Learn%20Res&volume=3&issue=Jan&pages=993-1022&publication_year=2003&author=Blei%2CDM&author=Ng%2CAY&author=Jordan%2CMI)

  3. Cheng G, Berkhahn F. Entity embeddings of categorical variables. CoRR. 2016. [arXiv:1604.06737](http://arxiv.org/abs/1604.06737).

  4. Lacey M. Categorical data. 2019. <http://www.stat.yale.edu/Courses/1997-98/101/catdat.htm>. Accessed 23 Sept 2019.

  5. Lane DM. Online statistics education: an interactive multimedia course of study. 2019. <http://onlinestatbook.com/2/index.html>. Accessed 15 Dec 2019.

  6. Johnson JM, Khoshgoftaar TM. Medicare fraud detection using neural networks. J Big Data. 2019;6:1–35.

[Article](https://link.springer.com/doi/10.1186/s40537-018-0162-3) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Medicare%20fraud%20detection%20using%20neural%20networks&journal=J%20Big%20Data&doi=10.1186%2Fs40537-018-0162-3&volume=6&pages=1-35&publication_year=2019&author=Johnson%2CJM&author=Khoshgoftaar%2CTM)

  7. Hinton GE, et al. Learning distributed representations of concepts. In: Proceedings of the eighth annual conference of the cognitive science society, vol. 1. Amherst, MA. 1986. p. 12.

  8. Krizhevsky A, Sutskever I, Hinton GE. Imagenet classification with deep convolutional neural networks. In: Pereira F, Burges CJC, Bottou L, Weinberger KQ, editors. Advances in neural information processing systems 25. Red Hook: Curran Associates, Inc.; 2012. pp. 1097–105. <http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf>. Accessed 12 Sept 2019.

  9. Mikolov T, Sutskever I, Chen K, Corrado GS, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in neural information processing systems. 2013. pp. 3111–9.

  10. Google.com: Google Scholar. [scholar.google.com](http://scholar.google.com).

  11. University FA. OneSearch. 2019. <https://library.fau.edu/>. Accessed 15 Sept 2019.

  12. Potdar K, Pardawala TS, Pai CD. A comparative study of categorical variable encoding techniques for neural network classifiers. Int J Comput Appl. 2017;175(4):7–9.

[ Google Scholar](http://scholar.google.com/scholar_lookup?&title=A%20comparative%20study%20of%20categorical%20variable%20encoding%20techniques%20for%20neural%20network%20classifiers&journal=Int%20J%20Comput%20Appl&volume=175&issue=4&pages=7-9&publication_year=2017&author=Potdar%2CK&author=Pardawala%2CTS&author=Pai%2CCD)

  13. Dua D, Graff C. UCI machine learning repository. 2017. <http://archive.ics.uci.edu/ml>. Accessed 24 Aug 2019.

  14. Zhong G, Wang L-N, Ling X, Dong J. An overview on data representation learning: From traditional feature learning to recent deep learning. J Finance Data Sci. 2016;2(4):265–78. <https://doi.org/10.1016/j.jfds.2017.05.001>.

[Article](https://doi.org/10.1016%2Fj.jfds.2017.05.001) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=An%20overview%20on%20data%20representation%20learning%3A%20From%20traditional%20feature%20learning%20to%20recent%20deep%20learning&journal=J%20Finance%20Data%20Sci&doi=10.1016%2Fj.jfds.2017.05.001&volume=2&issue=4&pages=265-78&publication_year=2016&author=Zhong%2CG&author=Wang%2CL-N&author=Ling%2CX&author=Dong%2CJ)

  15. Altınel B, Ganiz MC. Semantic text classification: a survey of past and recent advances. Inf Process Manage. 2018;54(6):1129–53.

[Article](https://doi.org/10.1016%2Fj.ipm.2018.08.001) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Semantic%20text%20classification%3A%20a%20survey%20of%20past%20and%20recent%20advances&journal=Inf%20Process%20Manage&doi=10.1016%2Fj.ipm.2018.08.001&volume=54&issue=6&pages=1129-53&publication_year=2018&author=Alt%C4%B1nel%2CB&author=Ganiz%2CMC)

  16. Goyal P, Ferrara E. Graph embedding techniques, applications, and performance: a survey. Knowl Based Syst. 2018;151:78–94.

[Article](https://doi.org/10.1016%2Fj.knosys.2018.03.022) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Graph%20embedding%20techniques%2C%20applications%2C%20and%20performance%3A%20a%20survey&journal=Knowl%20Based%20Syst&doi=10.1016%2Fj.knosys.2018.03.022&volume=151&pages=78-94&publication_year=2018&author=Goyal%2CP&author=Ferrara%2CE)

  17. Shickel B, Tighe PJ, Bihorac A, Rashidi P. Deep EHR: a survey of recent advances in deep learning techniques for electronic health record (EHR) analysis. IEEE J Biomed Health Inform. 2018;22(5):1589–604. <https://doi.org/10.1109/JBHI.2017.2767063>.

[Article](https://doi.org/10.1109%2FJBHI.2017.2767063) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Deep%20EHR%3A%20a%20survey%20of%20recent%20advances%20in%20deep%20learning%20techniques%20for%20electronic%20health%20record%20%28EHR%29%20analysis&journal=IEEE%20J%20Biomed%20Health%20Inform&doi=10.1109%2FJBHI.2017.2767063&volume=22&issue=5&pages=1589-604&publication_year=2018&author=Shickel%2CB&author=Tighe%2CPJ&author=Bihorac%2CA&author=Rashidi%2CP)

  18. Wang Y, Xu W. Leveraging deep learning with lda-based text analytics to detect automobile insurance fraud. Decis Support Syst. 2018;105:87–95.

[Article](https://doi.org/10.1016%2Fj.dss.2017.11.001) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Leveraging%20deep%20learning%20with%20lda-based%20text%20analytics%20to%20detect%20automobile%20insurance%20fraud&journal=Decis%20Support%20Syst&doi=10.1016%2Fj.dss.2017.11.001&volume=105&pages=87-95&publication_year=2018&author=Wang%2CY&author=Xu%2CW)

  19. Golinko E, Zhu X. Generalized feature embedding for supervised, unsupervised, and online learning tasks. Inf Syst Front. 2018;21:125–42.

[Article](https://link.springer.com/doi/10.1007/s10796-018-9850-y) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Generalized%20feature%20embedding%20for%20supervised%2C%20unsupervised%2C%20and%20online%20learning%20tasks&journal=Inf%20Syst%20Front&doi=10.1007%2Fs10796-018-9850-y&volume=21&pages=125-142&publication_year=2018&author=Golinko%2CE&author=Zhu%2CX)

  20. Chollet F, et al. Embedding. 2019. <https://keras.io/layers/embeddings/>. Accessed 29 Nov 2019.

  21. Pennington J, Socher R, Manning C. Glove: global vectors for word representation. In: Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP). 2014. pp. 1532–43.

  22. Chollet F. Deep learning with python. Shelter Island: Manning Publications Company; 2017.

[ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Deep%20learning%20with%20python&publication_year=2017&author=Chollet%2CF)

  23. Linguistic Data Consortium TTotUoP. English Gigaword 5th edition–Linguistic Data Consortium. 2019. <https://catalog.ldc.upenn.edu/LDC2011T07>. Accessed 11 Jul 2019.

  24. Pennington J, Socher R, Manning C. GloVe: global vectors for word representation. 2015. <https://nlp.stanford.edu/projects/glove/>. Accessed 25 Nov 2019.

  25. Abadi M, Barham P, Chen J, Chen Z, Davis A, Dean J, Devin M, Ghemawat S, Irving G, Isard M, et al. Tensorflow: a system for large-scale machine learning. In: 12th USENIX symposium on operating systems design and implementation (OSDI 16). 2016. pp. 265–83 . <https://www.usenix.org/system/files/conference/osdi16/osdi16-abadi.pdf>. Accessed 12 Sept 2019.

  26. Contributors T. tensorflow/tensorflow: an open source machine learning framework for everyone. 2019. <https://www.kaggle.com/c/gendered-pronoun-resolution/overview/evaluation>. Accessed 14 Dec 2019.

  27. Bengio Y, Ducharme R, Vincent P, Jauvin C. A neural probabilistic language model. J Mach Learn Res. 2003;3(6):1137–55.

[MATH](http://www.emis.de/MATH-item?1061.68157) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=A%20neural%20probabilistic%20language%20model&journal=J%20Mach%20Learn%20Res&volume=3&issue=6&pages=1137-55&publication_year=2003&author=Bengio%2CY&author=Ducharme%2CR&author=Vincent%2CP&author=Jauvin%2CC)

  28. De Brébisson A, Simon É, Auvolat A, Vincent P, Bengio Y. Artificial neural networks applied to taxi destination prediction. 2015. [arXiv:1508.00021](http://arxiv.org/abs/1508.00021).

  29. De Brébisson A, Simon É, Auvolat A, Vincent P, Bengio Y. Adbrebs/taxi: winning entry to the kaggle taxi competition. 2015. <https://github.com/adbrebs/taxi>. Accessed 7 Dec 2019.

  30. Chen T, Tang L-A, Sun Y, Chen Z, Zhang K. Entity embedding-based anomaly detection for heterogeneous categorical events. 2016. [arXiv:1608.07502](http://arxiv.org/abs/1608.07502).

  31. Chollet F et al. Keras/embeddings.py at master—keras-team/keras. 2019. <https://github.com/keras-team/keras/blob/master/keras/layers/embeddings.py>. Accessed 26 Dec 2019.

  32. Devlin J, Chang M-W, Lee K, Toutanova K. BERT: pre-training of deep bidirectional transformers for language understanding 2018. [arXiv:1810.04805](http://arxiv.org/abs/1810.04805).

  33. Devlin J, Chang M-W, Lee K, Toutanova K et al. google-research/bert: TensorFlow code and pre-trained models for BERT. 2019. <https://github.com/google-research/bert>. Accessed 17 Nov 2019.

  34. Goyal P, Ferrara E. Gem: a python package for graph embedding methods. J Open Sour Softw. 2018;3(29):876.

[Article](https://doi.org/10.21105%2Fjoss.00876) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Gem%3A%20a%20python%20package%20for%20graph%20embedding%20methods&journal=J%20Open%20Sour%20Softw&doi=10.21105%2Fjoss.00876&volume=3&issue=29&publication_year=2018&author=Goyal%2CP&author=Ferrara%2CE)

  35. Guo C. Entity-embedding-rossmann. 2015. <https://github.com/entron/entity-embedding-rossmann/blob/kaggle/models.py>. Accessed 19 Dec 2019.

  36. Howard J et al. layers.fast.ai 2019.

  37. Howard J, et al. fastai. GitHub 2019.

  38. Kieu T, Yang B, Jensen CS. Outlier detection for multidimensional time series using deep neural networks. In: 2018 19th IEEE international conference on mobile data management (MDM), IEEE. 2018. pp. 125–34.

  39. Kocmi T, Bojar O. An exploration of word embedding initialization in deep-learning tasks. 2017. [arXiv:1711.09160](http://arxiv.org/abs/1711.09160).

  40. Lei L, Zhou Y, Zhai J, Zhang L, Fang Z, He P, Gao J. An effective patient representation learning for time-series prediction tasks based on EHRs. In: 2018 IEEE international conference on bioinformatics and biomedicine (BIBM), IEEE. 2018. pp. 885–92.

  41. Li Y, Huang C, Ding L, Li Z, Pan Y, Gao X. Deep learning in bioinformatics: introduction, application, and perspective in the big data era. Methods. 2019;. <https://doi.org/10.1016/j.ymeth.2019.04.008>.

[Article](https://doi.org/10.1016%2Fj.ymeth.2019.04.008) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Deep%20learning%20in%20bioinformatics%3A%20introduction%2C%20application%2C%20and%20perspective%20in%20the%20big%20data%20era&journal=Methods&doi=10.1016%2Fj.ymeth.2019.04.008&publication_year=2019&author=Li%2CY&author=Huang%2CC&author=Ding%2CL&author=Li%2CZ&author=Pan%2CY&author=Gao%2CX)

  42. Li Y, Huang C, Ding L, Li Z, Pan Y, Gao X. Lykaust15/deep_learning_examples: examples of using deep learning in bioinformatics. 2019. <https://github.com/lykaust15/Deep_learning_examples>. Accessed 22 Aug 2019.

  43. Mikolov T, Chen K, Corrado G, Dean J. Efficient estimation of word representations in vector space. 2013. arXiv preprint [arXiv:1301.3781](http://arxiv.org/abs/1301.3781).

  44. Mikolov T, Sutskever I. word2vec. 2015. <https://code.google.com/archive/p/word2vec/>. Accessed 29 Dec 2019.

  45. Ho Q-T, Phan D-V, Ou Y-Y, et al. Using word embedding technique to efficiently represent protein sequences for identifying substrate specificities of transporters. Anal Biochem. 2019;577:73–81. <https://doi.org/10.1016/j.ab.2019.04.011>.

[Article](https://doi.org/10.1016%2Fj.ab.2019.04.011) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Using%20word%20embedding%20technique%20to%20efficiently%20represent%20protein%20sequences%20for%20identifying%20substrate%20specificities%20of%20transporters&journal=Anal%20Biochem&doi=10.1016%2Fj.ab.2019.04.011&volume=577&pages=73-81&publication_year=2019&author=Ho%2CQ-T&author=Phan%2CD-V&author=Ou%2CY-Y)

  46. Pennington J, Socher R, Manning C et al. stanfordnlp/GloVe: GloVe model for distributed word representation. 2018. <https://github.com/stanfordnlp/GloVe/>. Accessed 23 Aug 2019.

  47. Kratzwald B, Ilić S, Kraus M, Feuerriegel S, Prendinger H. Deep learning for affective computing: text-based emotion recognition in decision support. Decis Support Syst. 2018;115:24–35.

[Article](https://doi.org/10.1016%2Fj.dss.2018.09.002) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Deep%20learning%20for%20affective%20computing%3A%20text-based%20emotion%20recognition%20in%20decision%20support&journal=Decis%20Support%20Syst&doi=10.1016%2Fj.dss.2018.09.002&volume=115&pages=24-35&publication_year=2018&author=Kratzwald%2CB&author=Ili%C4%87%2CS&author=Kraus%2CM&author=Feuerriegel%2CS&author=Prendinger%2CH)

  48. Duarte F, Martins B, Pinto CS, Silva MJ. Deep neural models for ICD-10 coding of death certificates and autopsy reports in free-text. J Biomed Inform. 2018;80:64–77.

[Article](https://doi.org/10.1016%2Fj.jbi.2018.02.011) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Deep%20neural%20models%20for%20ICD-10%20coding%20of%20death%20certificates%20and%20autopsy%20reports%20in%20free-text&journal=J%20Biomed%20Inform&doi=10.1016%2Fj.jbi.2018.02.011&volume=80&pages=64-77&publication_year=2018&author=Duarte%2CF&author=Martins%2CB&author=Pinto%2CCS&author=Silva%2CMJ)

  49. Contributors T. ciscorduarte/mortality_coding_dnn. 2018. <https://github.com/ciscorduarte/mortality_coding_dnn>. Accessed 4 Dec 2019.

  50. Cheng L, Wang Y, Ma X. A neural probabilistic outlier detection method for categorical data. Neurocomputing. 2019;365:325–35.

[Article](https://doi.org/10.1016%2Fj.neucom.2019.07.069) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=A%20neural%20probabilistic%20outlier%20detection%20method%20for%20categorical%20data&journal=Neurocomputing&doi=10.1016%2Fj.neucom.2019.07.069&volume=365&pages=325-35&publication_year=2019&author=Cheng%2CL&author=Wang%2CY&author=Ma%2CX)

  51. Lin Y-W, Zhou Y, Faghri F, Shaw MJ, Campbell RH. Analysis and prediction of unplanned intensive care unit readmission using recurrent neural networks with long short-term memory. PLoS ONE. 2019;. <https://doi.org/10.1371/journal.pone.0218942>.

[Article](https://doi.org/10.1371%2Fjournal.pone.0218942) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Analysis%20and%20prediction%20of%20unplanned%20intensive%20care%20unit%20readmission%20using%20recurrent%20neural%20networks%20with%20long%20short-term%20memory&journal=PLoS%20ONE&doi=10.1371%2Fjournal.pone.0218942&publication_year=2019&author=Lin%2CY-W&author=Zhou%2CY&author=Faghri%2CF&author=Shaw%2CMJ&author=Campbell%2CRH)

  52. Lin Y-W, Zhou Y, Faghri F, Shaw MJ, Campbell RH. Jeffreylin0925/MIMIC-III_ICU_Readmission_Analysis: This is the source code for the paper ‘Analysis and Prediction of Unplanned Intensive Care Unit Readmission’. 2018. <https://github.com/Jeffreylin0925/MIMIC-III_ICU_Readmission_Analysis>.

  53. Choi Y, Chiu CY-I, Sontag D. Learning low-dimensional representations of medical concepts. AMIA Summits Transl Sci Proc. 2016;16:41.

[ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Learning%20low-dimensional%20representations%20of%20medical%20concepts&journal=AMIA%20Summits%20Transl%20Sci%20Proc&volume=16&publication_year=2016&author=Choi%2CY&author=Chiu%2CCY-I&author=Sontag%2CD)

  54. Choi Y, Chiu CY-I, Sontag D. clinicalml/embeddings: Code for AMIA CRI 2016 paper “Learning low-dimensional representations of medical concepts”. 2016. <https://github.com/clinicalml/embeddings>. Accessed 23 Dec 2019.

  55. Avati A, Jung K, Harman S, Downing L, Ng A, Shah NH. Improving palliative care with deep learning. In: 2017 IEEE international conference on bioinformatics and biomedicine (BIBM). 2017.

  56. Golinko E. egolinko/GEL. 2019. <https://github.com/egolinko/GEL>. Accessed 13 Oct 2019.

  57. Han H, Li Y, Zhu X. Convolutional neural network learning for generic data classification. Inf Sci. 2019;477:448–65. <https://doi.org/10.1016/j.ins.2018.10.053>.

[Article](https://doi.org/10.1016%2Fj.ins.2018.10.053) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Convolutional%20neural%20network%20learning%20for%20generic%20data%20classification&journal=Inf%20Sci&doi=10.1016%2Fj.ins.2018.10.053&volume=477&pages=448-65&publication_year=2019&author=Han%2CH&author=Li%2CY&author=Zhu%2CX)

  58. Han H, Li Y, Zhu X. ELDT. 2019. <https://github.com/hhmzwc/EDLT>. Accessed 12 Jul 2019.

  59. Svenstrup DT, Hansen J, Winther O. Hash embeddings for efficient word representations. In: Advances in neural information processing systems. 2017. pp. 4928–36.

  60. Svenstrup DT, Hansen J, Winther O. Hashembedding. 2017. <https://github.com/dsv77/hashembedding>. Accessed 8 Aug 2019.

  61. Duan J. Financial system modeling using deep neural networks (DNNs) for effective risk assessment and prediction. J Frankl Inst. 2019;356(8):4716–31.

[Article](https://doi.org/10.1016%2Fj.jfranklin.2019.01.046) [MathSciNet](http://www.ams.org/mathscinet-getitem?mr=3950460) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Financial%20system%20modeling%20using%20deep%20neural%20networks%20%28DNNs%29%20for%20effective%20risk%20assessment%20and%20prediction&journal=J%20Frankl%20Inst&doi=10.1016%2Fj.jfranklin.2019.01.046&volume=356&issue=8&pages=4716-31&publication_year=2019&author=Duan%2CJ)

  62. Naseer S, Saleem Y. Enhanced network intrusion detection using deep convolutional neural networks. KSII Trans Internet Inf Syst. 2018;12(10):5159.

[ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Enhanced%20network%20intrusion%20detection%20using%20deep%20convolutional%20neural%20networks&journal=KSII%20Trans%20Internet%20Inf%20Syst&volume=12&issue=10&publication_year=2018&author=Naseer%2CS&author=Saleem%2CY)

  63. Buitinck L, Louppe G, Blondel M, Pedregosa F, Mueller A, Grisel O, Niculae V, Prettenhofer P, Gramfort A, Grobler J, et al. API design for machine learning software: experiences from the scikit-learn project. In: ECML PKDD workshop: languages for data mining and machine learning. 2013. pp. 108–22.

  64. Cormen TH, Leiserson CE, Rivest RL, Stein C. Introduction to algorithms. Cambridge: MIT Press; 2009.

[MATH](http://www.emis.de/MATH-item?1187.68679) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Introduction%20to%20algorithms&publication_year=2009&author=Cormen%2CTH&author=Leiserson%2CCE&author=Rivest%2CRL&author=Stein%2CC)

  65. Hackeling G. Mastering machine learning with Scikit-learn. Birmingham: Packt Publishing Ltd; 2017.

[ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Mastering%20machine%20learning%20with%20Scikit-learn&publication_year=2017&author=Hackeling%2CG)

  66. Cui L, Xie X, Shen Z. Prediction task guided representation learning of medical codes in EHR. J Biomed Inform. 2018;84:1–10.

[Article](https://doi.org/10.1016%2Fj.jbi.2018.06.013) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Prediction%20task%20guided%20representation%20learning%20of%20medical%20codes%20in%20EHR&journal=J%20Biomed%20Inform&doi=10.1016%2Fj.jbi.2018.06.013&volume=84&pages=1-10&publication_year=2018&author=Cui%2CL&author=Xie%2CX&author=Shen%2CZ)

  67. Developers S-l. sklearn.preprocessing.OneHotEncoder –scikit-learn 0.21.3 documentation. 2019. <https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.OneHotEncoder.html>. Accessed 29 Jul 2019.

  68. Golinko E, Sonderman T, Zhu X. Learning convolutional neural networks from ordered features of generic data. In: 2018 17th IEEE international conference on machine learning and applications (ICMLA), IEEE. 2018. pp. 897–900.

  69. McGinnis W. Leave one out—category encoders latest documentation. 2016. <https://contrib.scikit-learn.org/categorical-encoding/leaveoneout.html>. Accessed 16 Aug 2019.

  70. Zhang O. Tips for data science competitions. 2016. <https://www.slideshare.net/OwenZhang2/tips-for-data-science-competitions>. Accessed 5 Aug 2019.

  71. Tavallaee M, Bagheri E, Lu W, Ghorbani AA. A detailed analysis of the kdd cup 99 data set. In: 2009 IEEE symposium on computational intelligence for security and defense applications. 2009. pp. 1–6. <https://doi.org/10.1109/CISDA.2009.5356528>.

  72. MacKay DJ. Information theory, inference and learning algorithms. Cambridge: Cambridge University Press; 2003.

[MATH](http://www.emis.de/MATH-item?1055.94001) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Information%20theory%2C%20inference%20and%20learning%20algorithms&publication_year=2003&author=MacKay%2CDJ)

  73. Foundation PS. Built-in functions. 2019. <https://docs.python.org/3/library/functions.html>. Accessed 29 Oct 2019.

  74. Why haven’t any SHA-256 collisions been found yet? 2017. <https://crypto.stackexchange.com/a/47810>. Accessed 17 Nov 2019.

  75. Kivinen J, Smola AJ, Williamson RC. Online learning with kernels. IEEE Trans Signal Process. 2004;52(8):2165–76.

[Article](https://doi.org/10.1109%2FTSP.2004.830991) [MathSciNet](http://www.ams.org/mathscinet-getitem?mr=2085578) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Online%20learning%20with%20kernels&journal=IEEE%20Trans%20Signal%20Process&doi=10.1109%2FTSP.2004.830991&volume=52&issue=8&pages=2165-76&publication_year=2004&author=Kivinen%2CJ&author=Smola%2CAJ&author=Williamson%2CRC)

  76. Han H, Zhu X, Li Y. EDLT: enabling deep learning for generic data classification. In: 2018 IEEE international conference on data mining (ICDM). Washington, DC: IEEE; 2018. <https://doi.org/10.1109/icdm.2018.00030>.

  77. Yin Z, Shen Y. On the dimensionality of word embedding. In: Bengio S, Wallach H, Larochelle H, Grauman K, Cesa-Bianchi N, Garnett R, editors. Advances in neural information processing systems 31. Red Hook: Curran Associates, Inc.; 2018. pp. 887–98. <http://papers.nips.cc/paper/7368-on-the-dimensionality-of-word-embedding.pdf>. Accessed 16 Sept 2019.

  78. Yin Z. Understand functionality and dimensionality of vector embeddings: the distributional hypothesis, the pairwise inner product loss and its bias-variance trade-off. 2018. arXiv preprint [arXiv:1803.00502](http://arxiv.org/abs/1803.00502).

  79. Yin Z. Word embedding dimensionality selection. 2019. <https://github.com/ziyin-dl/word-embedding-dimensionality-selection>. Accessed 10 Dec 2019.

  80. Inc K. Rossmann store sales. 2015. <https://www.kaggle.com/c/rossmann-store-sales>. Accessed 11 Dec 2019.

  81. Bengio Y, Courville A, Vincent P. Representation learning: a review and new perspectives. IEEE Trans Pattern Anal Mach Intell. 2013;35(8):1798.

[Article](https://doi.org/10.1109%2FTPAMI.2013.50) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Representation%20learning%3A%20a%20review%20and%20new%20perspectives&journal=IEEE%20Trans%20Pattern%20Anal%20Mach%20Intell&doi=10.1109%2FTPAMI.2013.50&volume=35&issue=8&publication_year=2013&author=Bengio%2CY&author=Courville%2CA&author=Vincent%2CP)

  82. Day O, Khoshgoftaar TM. A survey on heterogeneous transfer learning. J Big Data. 2017;4(1):1–42.

[Article](https://link.springer.com/doi/10.1186/s40537-017-0089-0) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=A%20survey%20on%20heterogeneous%20transfer%20learning&journal=J%20Big%20Data&doi=10.1186%2Fs40537-017-0089-0&volume=4&issue=1&pages=1-42&publication_year=2017&author=Day%2CO&author=Khoshgoftaar%2CTM)

  83. Kaggle I. Twitter sentiment analysis. 2017. <https://www.kaggle.com/c/twitter-sentiment-analysis2>. Accessed 10 Dec 2019.

  84. Johnson AE, Pollard TJ, Shen L, Li-wei HL, Feng M, Ghassemi M, Moody B, Szolovits P, Celi LA, Mark RG. Mimic-iii, a freely accessible critical care database. Sci Data. 2016;3:160035.

[Article](https://doi.org/10.1038%2Fsdata.2016.35) [ Google Scholar](http://scholar.google.com/scholar_lookup?&title=Mimic-iii%2C%20a%20freely%20accessible%20critical%20care%20database&journal=Sci%20Data&doi=10.1038%2Fsdata.2016.35&volume=3&publication_year=2016&author=Johnson%2CAE&author=Pollard%2CTJ&author=Shen%2CL&author=Li-wei%2CHL&author=Feng%2CM&author=Ghassemi%2CM&author=Moody%2CB&author=Szolovits%2CP&author=Celi%2CLA&author=Mark%2CRG)




[Download references](https://citation-needed.springer.com/v2/references/10.1186/s40537-020-00305-w?format=refman&flavour=references)

## Acknowledgements

The authors would like to thank the anonymous reviewers for their constructive evaluation of this paper, and the various members of the Data Mining and Machine Learning Laboratory, Florida Atlantic University, for assistance with the reviews.

## Funding

Not applicable.

## Author information

### Authors and Affiliations

  1. Florida Atlantic University, 777 Glades Road, Boca Raton, FL, USA

John T. Hancock & Taghi M. Khoshgoftaar




Authors

  1. John T. Hancock

[View author publications](https://www.biomedcentral.com/search?query=author%23John%20T.%20Hancock)

You can also search for this author in [PubMed](http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&term=John%20T.%20Hancock) [Google Scholar](http://scholar.google.co.uk/scholar?as_q=&num=10&btnG=Search+Scholar&as_epq=&as_oq=&as_eq=&as_occt=any&as_sauthors=%22John%20T.%20Hancock%22&as_publication=&as_ylo=&as_yhi=&as_allsubj=all&hl=en)

  2. Taghi M. Khoshgoftaar

[View author publications](https://www.biomedcentral.com/search?query=author%23Taghi%20M.%20Khoshgoftaar)

You can also search for this author in [PubMed](http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&term=Taghi%20M.%20Khoshgoftaar) [Google Scholar](http://scholar.google.co.uk/scholar?as_q=&num=10&btnG=Search+Scholar&as_epq=&as_oq=&as_eq=&as_occt=any&as_sauthors=%22Taghi%20M.%20Khoshgoftaar%22&as_publication=&as_ylo=&as_yhi=&as_allsubj=all&hl=en)




### Contributions

JTH performed the literature review and drafted the manuscript. TMK worked with JTH to develop the article’s framework and focus. TMK introduced this topic to JTH. Both authors read and approved the final manuscript.

### Corresponding author

Correspondence to [John T. Hancock](mailto:jhancoc4@fau.edu).

## Ethics declarations

### Ethics approval and consent to participate

Not applicable.

### Consent for publication

Not applicable.

### Competing interests

The authors declare that they have no competing interests.

## Additional information

### Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit <http://creativecommons.org/licenses/by/4.0/>.

[Reprints and permissions](https://s100.copyright.com/AppDispatchServlet?title=Survey%20on%20categorical%20data%20for%20neural%20networks&author=John%20T.%20Hancock%20et%20al&contentID=10.1186%2Fs40537-020-00305-w&copyright=The%20Author%28s%29&publication=2196-1115&publicationDate=2020-04-10&publisherName=SpringerNature&orderBeanReset=true&oa=CC%20BY)

## About this article


### Cite this article

Hancock, J.T., Khoshgoftaar, T.M. Survey on categorical data for neural networks. _J Big Data_ **7** , 28 (2020). https://doi.org/10.1186/s40537-020-00305-w

[Download citation](https://citation-needed.springer.com/v2/references/10.1186/s40537-020-00305-w?format=refman&flavour=citation)

  * Received: 31 January 2020

  * Accepted: 30 March 2020

  * Published: 10 April 2020

  * DOI: https://doi.org/10.1186/s40537-020-00305-w




### Share this article

Anyone you share the following link with will be able to read this content:

Get shareable link

Sorry, a shareable link is not currently available for this article.

Copy to clipboard

Provided by the Springer Nature SharedIt content-sharing initiative 

### Keywords

  * [Deep learning](/search?query=Deep%20learning&facet-discipline="Computer%20Science")
  * [Neural networks](/search?query=Neural%20networks&facet-discipline="Computer%20Science")
  * [Embedding](/search?query=Embedding&facet-discipline="Computer%20Science")
  * [Encoding](/search?query=Encoding&facet-discipline="Computer%20Science")
  * [Qualitative data](/search?query=Qualitative%20data&facet-discipline="Computer%20Science")
  * [Big data](/search?query=Big%20data&facet-discipline="Computer%20Science")



[ Download PDF ](//journalofbigdata.springeropen.com/counter/pdf/10.1186/s40537-020-00305-w.pdf)

[ Download ePub ](//journalofbigdata.springeropen.com/counter/epub/10.1186/s40537-020-00305-w.epub)

Advertisement

[ ![Advertisement](//pubads.g.doubleclick.net/gampad/ad?iu=/270604982/springer_open/journalofbigdata/articles&sz=300x250&pos=MPU1&doi=10.1186/s40537-020-00305-w&type=article&kwrd=Deep learning,Neural networks,Embedding,Encoding,Qualitative data,Big data&pmc=I18024,I18032,I18030,M14026,M13110,T24035&) ](//pubads.g.doubleclick.net/gampad/jump?iu=/270604982/springer_open/journalofbigdata/articles&sz=300x250&pos=MPU1&doi=10.1186/s40537-020-00305-w&type=article&kwrd=Deep learning,Neural networks,Embedding,Encoding,Qualitative data,Big data&pmc=I18024,I18032,I18030,M14026,M13110,T24035&)

![](/track/article/10.1186/s40537-020-00305-w)

  * [Support and Contact](https://support.biomedcentral.com/support/home)
  * [Jobs](//www.springeropen.com/about/jobs)
  * [Language editing for authors](https://authorservices.springernature.com/language-editing/)
  * [Scientific editing for authors](https://authorservices.springernature.com/scientific-editing/)
  * [Leave feedback](https://biomedcentral.typeform.com/to/VLXboo)


  * [Terms and conditions](//www.springeropen.com/terms-and-conditions)
  * [Privacy statement](//www.springeropen.com/privacy-statement)
  * [Accessibility](//www.springeropen.com/accessibility)
  * [Cookies](//www.springeropen.com/cookies)



### Follow SpringerOpen

  * [ SpringerOpen Twitter page ](https://twitter.com/springeropen)
  * [ SpringerOpen Facebook page ](https://www.facebook.com/SpringerOpn)



By using this website, you agree to our [Terms and Conditions](//www.springeropen.com/terms-and-conditions), [Your US state privacy rights](https://www.springernature.com/ccpa), [Privacy statement](//www.springeropen.com/privacy-statement) and [Cookies](//www.springeropen.com/cookies) policy. [Your privacy choices/Manage cookies](javascript:void\(0\);) we use in the preference centre. 

![Springer Nature](/static/images/logo-springernature-acb40b85fb.svg)

(C) 2025 BioMed Central Ltd unless otherwise stated. Part of [Springer Nature](https://www.springernature.com). 
  *[DOI]: Digital Object Identifier


