Sunday, March 13, 2022

Text to Speech APIs in different browsers for Ubuntu 21.10

OS Information

(base) ashish@ashishdesktop:~$ uname Linux (base) ashish@ashishdesktop:~$ uname -a Linux ashishdesktop 5.13.0-35-generic #40-Ubuntu SMP Mon Mar 7 08:03:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux (base) ashish@ashishdesktop:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 21.10 Release: 21.10 Codename: impish

Firefox Does Not Have Text-to-Speech Support on Ubuntu as of Ubuntu 21.10

Logs From Firefox Console:

>>> window.speechSynthesis.getVoices()

Array []
length: 0
<prototype>: Array []

In Google Chrome, We Have 19 Voices Available

Logs From Chrome Console

>>> window.speechSynthesis.getVoices()

(19) [SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice]

0: SpeechSynthesisVoice {voiceURI: 'Google Deutsch', name: 'Google Deutsch', lang: 'de-DE', localService: false, default: true}

1: SpeechSynthesisVoice {voiceURI: 'Google US English', name: 'Google US English', lang: 'en-US', localService: false, default: false}

2: SpeechSynthesisVoice {voiceURI: 'Google UK English Female', name: 'Google UK English Female', lang: 'en-GB', localService: false, default: false}

3: SpeechSynthesisVoice {voiceURI: 'Google UK English Male', name: 'Google UK English Male', lang: 'en-GB', localService: false, default: false}

4: SpeechSynthesisVoice {voiceURI: 'Google español', name: 'Google español', lang: 'es-ES', localService: false, default: false}

5: SpeechSynthesisVoice {voiceURI: 'Google español de Estados Unidos', name: 'Google español de Estados Unidos', lang: 'es-US', localService: false, default: false}

6: SpeechSynthesisVoice {voiceURI: 'Google français', name: 'Google français', lang: 'fr-FR', localService: false, default: false}

7: SpeechSynthesisVoice {voiceURI: 'Google हिन्दी', name: 'Google हिन्दी', lang: 'hi-IN', localService: false, default: false}

8: SpeechSynthesisVoice {voiceURI: 'Google Bahasa Indonesia', name: 'Google Bahasa Indonesia', lang: 'id-ID', localService: false, default: false}

9: SpeechSynthesisVoice {voiceURI: 'Google italiano', name: 'Google italiano', lang: 'it-IT', localService: false, default: false}

10: SpeechSynthesisVoice {voiceURI: 'Google 日本語', name: 'Google 日本語', lang: 'ja-JP', localService: false, default: false}

11: SpeechSynthesisVoice {voiceURI: 'Google 한국의', name: 'Google 한국의', lang: 'ko-KR', localService: false, default: false}

12: SpeechSynthesisVoice {voiceURI: 'Google Nederlands', name: 'Google Nederlands', lang: 'nl-NL', localService: false, default: false}

13: SpeechSynthesisVoice {voiceURI: 'Google polski', name: 'Google polski', lang: 'pl-PL', localService: false, default: false}

14: SpeechSynthesisVoice {voiceURI: 'Google português do Brasil', name: 'Google português do Brasil', lang: 'pt-BR', localService: false, default: false}

15: SpeechSynthesisVoice {voiceURI: 'Google русский', name: 'Google русский', lang: 'ru-RU', localService: false, default: false}

16: SpeechSynthesisVoice {voiceURI: 'Google 普通话(中国大陆)', name: 'Google 普通话(中国大陆)', lang: 'zh-CN', localService: false, default: false}

17: SpeechSynthesisVoice {voiceURI: 'Google 粤語(香港)', name: 'Google 粤語(香港)', lang: 'zh-HK', localService: false, default: false}

18: SpeechSynthesisVoice {voiceURI: 'Google 國語(臺灣)', name: 'Google 國語(臺灣)', lang: 'zh-TW', localService: false, default: false}

length: 19
[[Prototype]]: Array(0) 

Steps For Installation of Edge on Ubuntu

1: Microsoft Edge is not available in 'Ubuntu Software Center' by default.
2:
3:
4:
5:
6:

In Microsoft Edge, We Have 93 Voices Available in Different Languages

>>> window.speechSynthesis.getVoices()

(93) [SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice, SpeechSynthesisVoice]

0: SpeechSynthesisVoice {voiceURI: 'Microsoft Adri Online (Natural) - Afrikaans (South Africa)', name: 'Microsoft Adri Online (Natural) - Afrikaans (South Africa)', lang: 'af-ZA', localService: false, default: true}

1: SpeechSynthesisVoice {voiceURI: 'Microsoft Mekdes Online (Natural) - Amharic (Ethiopia)', name: 'Microsoft Mekdes Online (Natural) - Amharic (Ethiopia)', lang: 'am-ET', localService: false, default: false}

2: SpeechSynthesisVoice {voiceURI: 'Microsoft Salma Online (Natural) - Arabic (Egypt)', name: 'Microsoft Salma Online (Natural) - Arabic (Egypt)', lang: 'ar-EG', localService: false, default: false}

3: SpeechSynthesisVoice {voiceURI: 'Microsoft Zariyah Online (Natural) - Arabic (Saudi Arabia)', name: 'Microsoft Zariyah Online (Natural) - Arabic (Saudi Arabia)', lang: 'ar-SA', localService: false, default: false}

4: SpeechSynthesisVoice {voiceURI: 'Microsoft Nabanita Online (Natural) - Bangla (Bangladesh)', name: 'Microsoft Nabanita Online (Natural) - Bangla (Bangladesh)', lang: 'bn-BD', localService: false, default: false}

5: SpeechSynthesisVoice {voiceURI: 'Microsoft Tanishaa Online (Natural) - Bengali (India)', name: 'Microsoft Tanishaa Online (Natural) - Bengali (India)', lang: 'bn-IN', localService: false, default: false}

6: SpeechSynthesisVoice {voiceURI: 'Microsoft Kalina Online (Natural) - Bulgarian (Bulgaria)', name: 'Microsoft Kalina Online (Natural) - Bulgarian (Bulgaria)', lang: 'bg-BG', localService: false, default: false}

7: SpeechSynthesisVoice {voiceURI: 'Microsoft Nilar Online (Natural) - Burmese (Myanmar)', name: 'Microsoft Nilar Online (Natural) - Burmese (Myanmar)', lang: 'my-MM', localService: false, default: false}

8: SpeechSynthesisVoice {voiceURI: 'Microsoft Joana Online (Natural) - Catalan (Spain)', name: 'Microsoft Joana Online (Natural) - Catalan (Spain)', lang: 'ca-ES', localService: false, default: false}

9: SpeechSynthesisVoice {voiceURI: 'Microsoft HiuMaan Online (Natural) - Chinese (Hong Kong)', name: 'Microsoft HiuMaan Online (Natural) - Chinese (Hong Kong)', lang: 'zh-HK', localService: false, default: false}

10: SpeechSynthesisVoice {voiceURI: 'Microsoft Xiaoxiao Online (Natural) - Chinese (Mainland)', name: 'Microsoft Xiaoxiao Online (Natural) - Chinese (Mainland)', lang: 'zh-CN', localService: false, default: false}

11: SpeechSynthesisVoice {voiceURI: 'Microsoft Yunyang Online (Natural) - Chinese (Mainland)', name: 'Microsoft Yunyang Online (Natural) - Chinese (Mainland)', lang: 'zh-CN', localService: false, default: false}

12: SpeechSynthesisVoice {voiceURI: 'Microsoft HsiaoChen Online (Natural) - Chinese (Taiwan)', name: 'Microsoft HsiaoChen Online (Natural) - Chinese (Taiwan)', lang: 'zh-TW', localService: false, default: false}

13: SpeechSynthesisVoice {voiceURI: 'Microsoft Gabrijela Online (Natural) - Croatian (Croatia)', name: 'Microsoft Gabrijela Online (Natural) - Croatian (Croatia)', lang: 'hr-HR', localService: false, default: false}

14: SpeechSynthesisVoice {voiceURI: 'Microsoft Vlasta Online (Natural) - Czech (Czech)', name: 'Microsoft Vlasta Online (Natural) - Czech (Czech)', lang: 'cs-CZ', localService: false, default: false}

15: SpeechSynthesisVoice {voiceURI: 'Microsoft Christel Online (Natural) - Danish (Denmark)', name: 'Microsoft Christel Online (Natural) - Danish (Denmark)', lang: 'da-DK', localService: false, default: false}

16: SpeechSynthesisVoice {voiceURI: 'Microsoft Dena Online (Natural) - Dutch (Belgium)', name: 'Microsoft Dena Online (Natural) - Dutch (Belgium)', lang: 'nl-BE', localService: false, default: false}

17: SpeechSynthesisVoice {voiceURI: 'Microsoft Colette Online (Natural) - Dutch (Netherlands)', name: 'Microsoft Colette Online (Natural) - Dutch (Netherlands)', lang: 'nl-NL', localService: false, default: false}

18: SpeechSynthesisVoice {voiceURI: 'Microsoft Natasha Online (Natural) - English (Australia)', name: 'Microsoft Natasha Online (Natural) - English (Australia)', lang: 'en-AU', localService: false, default: false}

19: SpeechSynthesisVoice {voiceURI: 'Microsoft Clara Online (Natural) - English (Canada)', name: 'Microsoft Clara Online (Natural) - English (Canada)', lang: 'en-CA', localService: false, default: false}

20: SpeechSynthesisVoice {voiceURI: 'Microsoft Neerja Online (Natural) - English (India)', name: 'Microsoft Neerja Online (Natural) - English (India)', lang: 'en-IN', localService: false, default: false}

21: SpeechSynthesisVoice {voiceURI: 'Microsoft Emily Online (Natural) - English (Ireland)', name: 'Microsoft Emily Online (Natural) - English (Ireland)', lang: 'en-IE', localService: false, default: false}

22: SpeechSynthesisVoice {voiceURI: 'Microsoft Abeo Online (Natural) - English (Nigeria)', name: 'Microsoft Abeo Online (Natural) - English (Nigeria)', lang: 'en-NG', localService: false, default: false}

23: SpeechSynthesisVoice {voiceURI: 'Microsoft Rosa Online (Natural) - English (Philippines)', name: 'Microsoft Rosa Online (Natural) - English (Philippines)', lang: 'en-PH', localService: false, default: false}

24: SpeechSynthesisVoice {voiceURI: 'Microsoft Leah Online (Natural) - English (South Africa)', name: 'Microsoft Leah Online (Natural) - English (South Africa)', lang: 'en-ZA', localService: false, default: false}

25: SpeechSynthesisVoice {voiceURI: 'Microsoft Sonia Online (Natural) - English (United Kingdom)', name: 'Microsoft Sonia Online (Natural) - English (United Kingdom)', lang: 'en-GB', localService: false, default: false}

26: SpeechSynthesisVoice {voiceURI: 'Microsoft Aria Online (Natural) - English (United States)', name: 'Microsoft Aria Online (Natural) - English (United States)', lang: 'en-US', localService: false, default: false}

27: SpeechSynthesisVoice {voiceURI: 'Microsoft Guy Online (Natural) - English (United States)', name: 'Microsoft Guy Online (Natural) - English (United States)', lang: 'en-US', localService: false, default: false}

28: SpeechSynthesisVoice {voiceURI: 'Microsoft Jenny Online (Natural) - English (United States)', name: 'Microsoft Jenny Online (Natural) - English (United States)', lang: 'en-US', localService: false, default: false}

29: SpeechSynthesisVoice {voiceURI: 'Microsoft Anu Online (Natural) - Estonian (Estonia)', name: 'Microsoft Anu Online (Natural) - Estonian (Estonia)', lang: 'et-EE', localService: false, default: false}

30: SpeechSynthesisVoice {voiceURI: 'Microsoft Blessica Online (Natural) - Filipino (Philippines)', name: 'Microsoft Blessica Online (Natural) - Filipino (Philippines)', lang: 'fil-PH', localService: false, default: false}

31: SpeechSynthesisVoice {voiceURI: 'Microsoft Noora Online (Natural) - Finnish (Finland)', name: 'Microsoft Noora Online (Natural) - Finnish (Finland)', lang: 'fi-FI', localService: false, default: false}

32: SpeechSynthesisVoice {voiceURI: 'Microsoft Charline Online (Natural) - French (Belgium)', name: 'Microsoft Charline Online (Natural) - French (Belgium)', lang: 'fr-BE', localService: false, default: false}

33: SpeechSynthesisVoice {voiceURI: 'Microsoft Sylvie Online (Natural) - French (Canada)', name: 'Microsoft Sylvie Online (Natural) - French (Canada)', lang: 'fr-CA', localService: false, default: false}

34: SpeechSynthesisVoice {voiceURI: 'Microsoft Denise Online (Natural) - French (France)', name: 'Microsoft Denise Online (Natural) - French (France)', lang: 'fr-FR', localService: false, default: false}

35: SpeechSynthesisVoice {voiceURI: 'Microsoft Ariane Online (Natural) - French (Switzerland)', name: 'Microsoft Ariane Online (Natural) - French (Switzerland)', lang: 'fr-CH', localService: false, default: false}

36: SpeechSynthesisVoice {voiceURI: 'Microsoft Sabela Online (Natural) - Galician (Spain)', name: 'Microsoft Sabela Online (Natural) - Galician (Spain)', lang: 'gl-ES', localService: false, default: false}

37: SpeechSynthesisVoice {voiceURI: 'Microsoft Ingrid Online (Natural) - German (Austria)', name: 'Microsoft Ingrid Online (Natural) - German (Austria)', lang: 'de-AT', localService: false, default: false}

38: SpeechSynthesisVoice {voiceURI: 'Microsoft Katja Online (Natural) - German (Germany)', name: 'Microsoft Katja Online (Natural) - German (Germany)', lang: 'de-DE', localService: false, default: false}

39: SpeechSynthesisVoice {voiceURI: 'Microsoft Leni Online (Natural) - German (Switzerland)', name: 'Microsoft Leni Online (Natural) - German (Switzerland)', lang: 'de-CH', localService: false, default: false}

40: SpeechSynthesisVoice {voiceURI: 'Microsoft Athina Online (Natural) - Greek (Greece)', name: 'Microsoft Athina Online (Natural) - Greek (Greece)', lang: 'el-GR', localService: false, default: false}

41: SpeechSynthesisVoice {voiceURI: 'Microsoft Dhwani Online (Natural) - Gujarati (India)', name: 'Microsoft Dhwani Online (Natural) - Gujarati (India)', lang: 'gu-IN', localService: false, default: false}

42: SpeechSynthesisVoice {voiceURI: 'Microsoft Hila Online (Natural) - Hebrew (Israel)', name: 'Microsoft Hila Online (Natural) - Hebrew (Israel)', lang: 'he-IL', localService: false, default: false}

43: SpeechSynthesisVoice {voiceURI: 'Microsoft Swara Online (Natural) - Hindi (India)', name: 'Microsoft Swara Online (Natural) - Hindi (India)', lang: 'hi-IN', localService: false, default: false}

44: SpeechSynthesisVoice {voiceURI: 'Microsoft Noemi Online (Natural) - Hungarian (Hungary)', name: 'Microsoft Noemi Online (Natural) - Hungarian (Hungary)', lang: 'hu-HU', localService: false, default: false}

45: SpeechSynthesisVoice {voiceURI: 'Microsoft Gudrun Online (Natural) - Icelandic (Iceland)', name: 'Microsoft Gudrun Online (Natural) - Icelandic (Iceland)', lang: 'is-IS', localService: false, default: false}

46: SpeechSynthesisVoice {voiceURI: 'Microsoft Gadis Online (Natural) - Indonesian (Indonesia)', name: 'Microsoft Gadis Online (Natural) - Indonesian (Indonesia)', lang: 'id-ID', localService: false, default: false}

47: SpeechSynthesisVoice {voiceURI: 'Microsoft Orla Online (Natural) - Irish(Ireland)', name: 'Microsoft Orla Online (Natural) - Irish(Ireland)', lang: 'ga-IE', localService: false, default: false}

48: SpeechSynthesisVoice {voiceURI: 'Microsoft Elsa Online (Natural) - Italian (Italy)', name: 'Microsoft Elsa Online (Natural) - Italian (Italy)', lang: 'it-IT', localService: false, default: false}

49: SpeechSynthesisVoice {voiceURI: 'Microsoft Nanami Online (Natural) - Japanese (Japan)', name: 'Microsoft Nanami Online (Natural) - Japanese (Japan)', lang: 'ja-JP', localService: false, default: false}

50: SpeechSynthesisVoice {voiceURI: 'Microsoft Siti Online (Natural) - Javanese (Indonesia)', name: 'Microsoft Siti Online (Natural) - Javanese (Indonesia)', lang: 'jv-ID', localService: false, default: false}

51: SpeechSynthesisVoice {voiceURI: 'Microsoft Sapna Online (Natural) - Kannada (India)', name: 'Microsoft Sapna Online (Natural) - Kannada (India)', lang: 'kn-IN', localService: false, default: false}

52: SpeechSynthesisVoice {voiceURI: 'Microsoft Aigul Online (Natural) - Kazakh (Kazakhstan)', name: 'Microsoft Aigul Online (Natural) - Kazakh (Kazakhstan)', lang: 'kk-KZ', localService: false, default: false}

53: SpeechSynthesisVoice {voiceURI: 'Microsoft Sreymom Online (Natural) - Khmer (Cambodia)', name: 'Microsoft Sreymom Online (Natural) - Khmer (Cambodia)', lang: 'km-KH', localService: false, default: false}

54: SpeechSynthesisVoice {voiceURI: 'Microsoft SunHi Online (Natural) - Korean (Korea)', name: 'Microsoft SunHi Online (Natural) - Korean (Korea)', lang: 'ko-KR', localService: false, default: false}

55: SpeechSynthesisVoice {voiceURI: 'Microsoft Keomany Online (Natural) - Lao (Laos)', name: 'Microsoft Keomany Online (Natural) - Lao (Laos)', lang: 'lo-LA', localService: false, default: false}

56: SpeechSynthesisVoice {voiceURI: 'Microsoft Everita Online (Natural) - Latvian (Latvia)', name: 'Microsoft Everita Online (Natural) - Latvian (Latvia)', lang: 'lv-LV', localService: false, default: false}

57: SpeechSynthesisVoice {voiceURI: 'Microsoft Ona Online (Natural) - Lithuanian (Lithuania)', name: 'Microsoft Ona Online (Natural) - Lithuanian (Lithuania)', lang: 'lt-LT', localService: false, default: false}

58: SpeechSynthesisVoice {voiceURI: 'Microsoft Marija Online (Natural) - Macedonian (Republic of North Macedonia)', name: 'Microsoft Marija Online (Natural) - Macedonian (Republic of North Macedonia)', lang: 'mk-MK', localService: false, default: false}

59: SpeechSynthesisVoice {voiceURI: 'Microsoft Yasmin Online (Natural) - Malay (Malaysia)', name: 'Microsoft Yasmin Online (Natural) - Malay (Malaysia)', lang: 'ms-MY', localService: false, default: false}

60: SpeechSynthesisVoice {voiceURI: 'Microsoft Sobhana Online (Natural) - Malayalam (India)', name: 'Microsoft Sobhana Online (Natural) - Malayalam (India)', lang: 'ml-IN', localService: false, default: false}

61: SpeechSynthesisVoice {voiceURI: 'Microsoft Grace Online (Natural) - Maltese (Malta)', name: 'Microsoft Grace Online (Natural) - Maltese (Malta)', lang: 'mt-MT', localService: false, default: false}

62: SpeechSynthesisVoice {voiceURI: 'Microsoft Aarohi Online (Natural) - Marathi (India)', name: 'Microsoft Aarohi Online (Natural) - Marathi (India)', lang: 'mr-IN', localService: false, default: false}

63: SpeechSynthesisVoice {voiceURI: 'Microsoft Pernille Online (Natural) - Norwegian (Bokmål, Norway)', name: 'Microsoft Pernille Online (Natural) - Norwegian (Bokmål, Norway)', lang: 'nb-NO', localService: false, default: false}

64: SpeechSynthesisVoice {voiceURI: 'Microsoft Latifa Online (Natural) - Pashto (Afghanistan)', name: 'Microsoft Latifa Online (Natural) - Pashto (Afghanistan)', lang: 'ps-AF', localService: false, default: false}

65: SpeechSynthesisVoice {voiceURI: 'Microsoft Dilara Online (Natural) - Persian (Iran)', name: 'Microsoft Dilara Online (Natural) - Persian (Iran)', lang: 'fa-IR', localService: false, default: false}

66: SpeechSynthesisVoice {voiceURI: 'Microsoft Zofia Online (Natural) - Polish (Poland)', name: 'Microsoft Zofia Online (Natural) - Polish (Poland)', lang: 'pl-PL', localService: false, default: false}

67: SpeechSynthesisVoice {voiceURI: 'Microsoft Francisca Online (Natural) - Portuguese (Brazil)', name: 'Microsoft Francisca Online (Natural) - Portuguese (Brazil)', lang: 'pt-BR', localService: false, default: false}

68: SpeechSynthesisVoice {voiceURI: 'Microsoft Raquel Online (Natural) - Portuguese (Portugal)', name: 'Microsoft Raquel Online (Natural) - Portuguese (Portugal)', lang: 'pt-PT', localService: false, default: false}

69: SpeechSynthesisVoice {voiceURI: 'Microsoft Alina Online (Natural) - Romanian (Romania)', name: 'Microsoft Alina Online (Natural) - Romanian (Romania)', lang: 'ro-RO', localService: false, default: false}

70: SpeechSynthesisVoice {voiceURI: 'Microsoft Svetlana Online (Natural) - Russian (Russia)', name: 'Microsoft Svetlana Online (Natural) - Russian (Russia)', lang: 'ru-RU', localService: false, default: false}

71: SpeechSynthesisVoice {voiceURI: 'Microsoft Sophie Online (Natural) - Serbian (Serbia)', name: 'Microsoft Sophie Online (Natural) - Serbian (Serbia)', lang: 'sr-RS', localService: false, default: false}

72: SpeechSynthesisVoice {voiceURI: 'Microsoft Thilini Online (Natural) - Sinhala (Sri Lanka)', name: 'Microsoft Thilini Online (Natural) - Sinhala (Sri Lanka)', lang: 'si-LK', localService: false, default: false}

73: SpeechSynthesisVoice {voiceURI: 'Microsoft Viktoria Online (Natural) - Slovak (Slovakia)', name: 'Microsoft Viktoria Online (Natural) - Slovak (Slovakia)', lang: 'sk-SK', localService: false, default: false}

74: SpeechSynthesisVoice {voiceURI: 'Microsoft Petra Online (Natural) - Slovenian (Slovenia)', name: 'Microsoft Petra Online (Natural) - Slovenian (Slovenia)', lang: 'sl-SI', localService: false, default: false}

75: SpeechSynthesisVoice {voiceURI: 'Microsoft Ubax Online (Natural) - Somali (Somalia)', name: 'Microsoft Ubax Online (Natural) - Somali (Somalia)', lang: 'so-SO', localService: false, default: false}

76: SpeechSynthesisVoice {voiceURI: 'Microsoft Elena Online (Natural) - Spanish (Argentina)', name: 'Microsoft Elena Online (Natural) - Spanish (Argentina)', lang: 'es-AR', localService: false, default: false}

77: SpeechSynthesisVoice {voiceURI: 'Microsoft Salome Online (Natural) - Spanish (Colombia)', name: 'Microsoft Salome Online (Natural) - Spanish (Colombia)', lang: 'es-CO', localService: false, default: false}

78: SpeechSynthesisVoice {voiceURI: 'Microsoft Dalia Online (Natural) - Spanish (Mexico)', name: 'Microsoft Dalia Online (Natural) - Spanish (Mexico)', lang: 'es-MX', localService: false, default: false}

79: SpeechSynthesisVoice {voiceURI: 'Microsoft Elvira Online (Natural) - Spanish (Spain)', name: 'Microsoft Elvira Online (Natural) - Spanish (Spain)', lang: 'es-ES', localService: false, default: false}

80: SpeechSynthesisVoice {voiceURI: 'Microsoft Tuti Online (Natural) - Sundanese (Indonesia)', name: 'Microsoft Tuti Online (Natural) - Sundanese (Indonesia)', lang: 'su-ID', localService: false, default: false}

81: SpeechSynthesisVoice {voiceURI: 'Microsoft Zuri Online (Natural) - Swahili (Kenya)', name: 'Microsoft Zuri Online (Natural) - Swahili (Kenya)', lang: 'sw-KE', localService: false, default: false}

82: SpeechSynthesisVoice {voiceURI: 'Microsoft Sofie Online (Natural) - Swedish (Sweden)', name: 'Microsoft Sofie Online (Natural) - Swedish (Sweden)', lang: 'sv-SE', localService: false, default: false}

83: SpeechSynthesisVoice {voiceURI: 'Microsoft Pallavi Online (Natural) - Tamil (India)', name: 'Microsoft Pallavi Online (Natural) - Tamil (India)', lang: 'ta-IN', localService: false, default: false}

84: SpeechSynthesisVoice {voiceURI: 'Microsoft Shruti Online (Natural) - Telugu (India)', name: 'Microsoft Shruti Online (Natural) - Telugu (India)', lang: 'te-IN', localService: false, default: false}

85: SpeechSynthesisVoice {voiceURI: 'Microsoft Premwadee Online (Natural) - Thai (Thailand)', name: 'Microsoft Premwadee Online (Natural) - Thai (Thailand)', lang: 'th-TH', localService: false, default: false}

86: SpeechSynthesisVoice {voiceURI: 'Microsoft Emel Online (Natural) - Turkish (Turkey)', name: 'Microsoft Emel Online (Natural) - Turkish (Turkey)', lang: 'tr-TR', localService: false, default: false}

87: SpeechSynthesisVoice {voiceURI: 'Microsoft Polina Online (Natural) - Ukrainian (Ukraine)', name: 'Microsoft Polina Online (Natural) - Ukrainian (Ukraine)', lang: 'uk-UA', localService: false, default: false}

88: SpeechSynthesisVoice {voiceURI: 'Microsoft Uzma Online (Natural) - Urdu (Pakistan)', name: 'Microsoft Uzma Online (Natural) - Urdu (Pakistan)', lang: 'ur-PK', localService: false, default: false}

89: SpeechSynthesisVoice {voiceURI: 'Microsoft Madina Online (Natural) - Uzbek (Uzbekistan)', name: 'Microsoft Madina Online (Natural) - Uzbek (Uzbekistan)', lang: 'uz-UZ', localService: false, default: false}

90: SpeechSynthesisVoice {voiceURI: 'Microsoft HoaiMy Online (Natural) - Vietnamese (Vietnam)', name: 'Microsoft HoaiMy Online (Natural) - Vietnamese (Vietnam)', lang: 'vi-VN', localService: false, default: false}

91: SpeechSynthesisVoice {voiceURI: 'Microsoft Nia Online (Natural) - Welsh (United Kingdom)', name: 'Microsoft Nia Online (Natural) - Welsh (United Kingdom)', lang: 'cy-GB', localService: false, default: false}

92: SpeechSynthesisVoice {voiceURI: 'Microsoft Thando Online (Natural) - Zulu (South Africa)', name: 'Microsoft Thando Online (Natural) - Zulu (South Africa)', lang: 'zu-ZA', localService: false, default: false}

length: 93
[[Prototype]]: Array(0)

Microsoft Edge: DevTools: Screenshots

English Voices in Microsoft Edge

Other Languages in Microsoft Edge

Tags: Technology,FOSS,Web Development,Natural Language Processing,JavaScript,

Alphabets with Prince and Piyush (Day 1)


Trial 1:
Trial 2:
Trial 3:
Trial 4:
Trial 5:
Trial 6:
Trial 7:
Trial 8:
Tags: Vlog,English Lessons,Communication Skills,

Interpretation of Decision Tree J48 output in Weka


Data Set Glimpse

@RELATION iris @ATTRIBUTE sepallength NUMERIC @ATTRIBUTE sepalwidth NUMERIC @ATTRIBUTE petallength NUMERIC @ATTRIBUTE petalwidth NUMERIC @ATTRIBUTE class {Iris-setosa,Iris-versicolor,Iris-virginica} The Data of the ARFF file looks like the following: @DATA 5.1,3.5,1.4,0.2,Iris-setosa 4.9,3.0,1.4,0.2,Iris-setosa 4.7,3.2,1.3,0.2,Iris-setosa 4.6,3.1,1.5,0.2,Iris-setosa 5.0,3.6,1.4,0.2,Iris-setosa ...

=== Run information ===

Scheme: weka.classifiers.trees.J48 -C 0.25 -M 2 Relation: iris Instances: 150 Attributes: 5 sepallength sepalwidth petallength petalwidth class Test mode: 10-fold cross-validation === Classifier model (full training set) === J48 pruned tree ------------------ petalwidth <= 0.6: Iris-setosa (50.0) petalwidth > 0.6 | petalwidth <= 1.7 | | petallength <= 4.9: Iris-versicolor (48.0/1.0) | | petallength > 4.9 | | | petalwidth <= 1.5: Iris-virginica (3.0) | | | petalwidth > 1.5: Iris-versicolor (3.0/1.0) | petalwidth > 1.7: Iris-virginica (46.0/1.0) Number of Leaves : 5 Size of the tree : 9 Time taken to build model: 0.36 seconds === Stratified cross-validation === === Summary === Correctly Classified Instances 144 96 % Incorrectly Classified Instances 6 4 % Kappa statistic 0.94 Mean absolute error 0.035 Root mean squared error 0.1586 Relative absolute error 7.8705 % Root relative squared error 33.6353 % Total Number of Instances 150 === Detailed Accuracy By Class === TP Rate FP Rate Precision Recall F-Measure MCC ROC Area PRC Area Class 0.980 0.000 1.000 0.980 0.990 0.985 0.990 0.987 Iris-setosa 0.940 0.030 0.940 0.940 0.940 0.910 0.952 0.880 Iris-versicolor 0.960 0.030 0.941 0.960 0.950 0.925 0.961 0.905 Iris-virginica Weighted Avg. 0.960 0.020 0.960 0.960 0.960 0.940 0.968 0.924 === Confusion Matrix === a b c <-- classified as 49 1 0 | a = Iris-setosa 0 47 3 | b = Iris-versicolor 0 2 48 | c = Iris-virginica

Interpretation of Model Output From Weka

=== Confusion Matrix === a b c <-- classified as 49 1 0 | a = Iris-setosa 0 47 3 | b = Iris-versicolor 0 2 48 | c = Iris-virginica TRUE LABEL and CLASSIFIER LABEL: Data points classified as Setosa and are actually Setosa: 49 (True Positives) False Positives (predicted Setosa but are not Setosa): 0 False Negative: 1 True Negative: 47 + 3 + 2 + 48 = 100 When TRUE LABEL == CLASSIFIER LABEL => TRUE POSITIVES For Versicolor: True Positives: 47 False Positives: (1 + 2) = 3 False Negative: 3 True Negative: 49 + 48 For Virginica: True Positives: 48 False Positives: 3 False Negative: 2 (predicted as "not virginica" but were actually "virginica") True Negative: 49 + 1 + 47 Recall: How many of the setosa class were predicted as setosa? How many of data points belonging to class X were also predicted as X? Recall = (TP) / (TP + FN) For Setosa = 49 / 50 = 0.98 For Versicolor: 47 / 50 = 0.94 For Virginica: 48 / 50 = 0.96 Precision: How many of the total predictions of X were actually X? Precision = (TP) / (TP + FP) For Setosa = 49 / (49 + 0) = 1 For Versicolor = 47 / (47 + 3) = 0.940 For Virginica = 48 / (48 + 3) = 0.941
Tags: Machine Learning,Weka,Technology,

Friday, March 11, 2022

The Soviet Cauldron (Joke)

There is an old Soviet joke. An American dies and goes to hell. Satan himself shows him around. They pass a large cauldron. The American peers in. It’s full of suffering souls, burning in hot pitch. As they struggle to leave the pot, low-ranking devils, sitting on the rim, pitchfork them back in. The American is properly shocked. Satan says, “That’s where we put sinful Englishmen.” 

The tour continues. Soon the duo approaches a second cauldron. It’s slightly larger, and slightly hotter. The American peers in. It is also full of suffering souls, all wearing berets. Devils are pitchforking wouldbe escapees back into this cauldron, as well. “That’s where we put sinful Frenchmen,” Satan says. 

In the distance is a third cauldron. It’s much bigger, and is glowing, white hot. The American can barely get near it. Nonetheless, at Satan’s insistence, he approaches it and peers in. It is absolutely packed with souls, barely visible, under the surface of the boiling liquid. Now and then, however, one clambers out of the pitch and desperately reaches for the rim. Oddly, there are no devils sitting on the edge of this giant pot, but the clamberer disappears back under the surface anyway. 

The American asks, “Why are there no demons here to keep everyone from escaping?” Satan replies, “This is where we put the Russians. If one tries to escape, the others pull him back in.”


The Joke is About: Gulag in Soviet Union

The Gulag was a system of Soviet labour camps and accompanying detention and transit camps and prisons. From the 1920s to the mid-1950s it housed political prisoners and criminals of the Soviet Union. At its height, the Gulag imprisoned millions of people. Key People: Aleksandr Isayevich Solzhenitsyn Date: 1930 - 1955 Related Places: Russia Soviet Union
Tags: Joke,Management,Politics,

Wednesday, March 9, 2022

Interpretation of output from Weka for Apriori Algorithm


Our Dataset:

Best rules found in Weka using Apriori:

1. item5=t 2 ==> item1=t 2 <conf:(1)> lift:(1.5) lev:(0.07) [0] conv:(0.67) 2. item4=t 2 ==> item2=t 2 <conf:(1)> lift:(1.29) lev:(0.05) [0] conv:(0.44) 3. item5=t 2 ==> item2=t 2 <conf:(1)> lift:(1.29) lev:(0.05) [0] conv:(0.44) 4. item2=t item5=t 2 ==> item1=t 2 <conf:(1)> lift:(1.5) lev:(0.07) [0] conv:(0.67) 5. item1=t item5=t 2 ==> item2=t 2 <conf:(1)> lift:(1.29) lev:(0.05) [0] conv:(0.44) 6. item5=t 2 ==> item1=t item2=t 2 <conf:(1)> lift:(2.25) lev:(0.12) [1] conv:(1.11) 7. item1=t item4=t 1 ==> item2=t 1 <conf:(1)> lift:(1.29) lev:(0.02) [0] conv:(0.22) 8. item3=t item5=t 1 ==> item1=t 1 <conf:(1)> lift:(1.5) lev:(0.04) [0] conv:(0.33) 9. item3=t item5=t 1 ==> item2=t 1 <conf:(1)> lift:(1.29) lev:(0.02) [0] conv:(0.22) 10. item2=t item3=t item5=t 1 ==> item1=t 1 <conf:(1)> lift:(1.5) lev:(0.04) [0] conv:(0.33)

Rule 1: item5=t 2 ==> item1=t 2 <conf:(1)> lift:(1.5) lev:(0.07) [0] conv:(0.67)

INTERPRETATION OF RULES:

item5=t 2

Meaning: item5 is in two transactions.

item1=t 2

Meaning: item1 is in two transactions. Confidence(X -> Y) = P(Y | X) = (# txn with both X and Y) / (# txn with X) Lift = P(A and B) / (P(A) * P(B)) A -> item5 B -> item1 = (2/9) / ((2/9) * (6/9)) = 1.5 Conviction(X -> Y) = (1 - supp(Y)) / (1 - conf(X -> Y)) Support(X) => Support(item5) = 2/9 Support(Y) => Support(item1) = 6/9 Support(x -> Y) = 2 / 9 Confidence(item5 -> item1) = 1 Conviction(X -> Y) = (1 - (6/9)) / (1 - (1)) = Division by zero error Coverage (also called cover or LHS-support) is the support of the left-hand-side of the rule X => Y, i.e., supp(X). It represents a measure of to how often the rule can be applied. Coverage can be quickly calculated from the rule's quality measures (support and confidence) stored in the quality slot. Leverage computes the difference between the observed frequency of A and C appearing together and the frequency that would be expected if A and C were independent. A leverage value of 0 indicates independence. Leverage(A -> C) = support(A -> C) - support(A) * support(C) Range: [-1,1] Leverage(item5 -> item1) = support(item5 -> item1) - support(item5)*support(item5) Leverage(item5 -> item1) = (2/9) - (2/9)*(6/9) = 0.074

Rule 2: item4=t 2 ==> item2=t 2 <conf:(1)> lift:(1.29) lev:(0.05) [0] conv:(0.44)

Confidence(X -> Y) = P(Y | X) (# of txns with Y and X) / (# of txns with X) X = item4 Y = item2 (# of txns with Y and X) = 2 (# of txns with item4) = 2 Confidence = 2/2 = 1 Lift = P(A and B) / (P(A) * P(B)) A = item4 B = item2 P(A and B) = (2/9) / ((2/9) * (7/9)) (P(A) * P(B)) = (2/9) * (7/9) Lift = (2/9) / ((2/9) * (7/9)) = 1.285

Rule 10: item2=t item3=t item5=t 1 ==> item1=t 1 <conf:(1)> lift:(1.5) lev:(0.04) [0] conv:(0.33)

item2=t item3=t item5=t 1

Meaning: Items 2, 3 and 5 are appearing together in one transaction.

item2=t item3=t item5=t 1 ==> item1=t 1

Meaning: Items 1, 2, 3 and 5 are appearing together in one transaction. Confidence(X -> Y) = P(Y | X) RHS = (# txn with both X and Y) / (# txn with X) = 1 / 1 = 1 Lift = P(A and B) / (P(A) * P(B)) = (1/9) / ((1/9) * (6/9)) = 1.5 Leverage(A -> C) = support(A -> C) - support(A) * support(C) support(Items 2, 3, 5) = 1/9 support(Item 1) = 6/9 support(Items 1, 2, 3, 5) = 1/9 Leverage(A -> C) = (1/9) - ((1/9) * (6/9)) = 0.037
Tags: Technology,Machine Learning,Weka,

Monday, March 7, 2022

Anomalies in 'survival8' Viewers' Stats (Mar 2022)

Anomaly 1: 10K Views on a single day (on 2021-Oct-29)

Anomaly 2: of Unknown Region (Noted on: 2022-Mar-7)

Tags: Technology,Machine Learning,

Running Weka Apriori on 9_TXN_5_ITEMS Dataset

A CSV file not following Weka format of questions marks failed to load.

Error Message:
Full Screen:

The File Erroneous For Weka is opening without any issues in LibreOffice:

So, we create our custom file in similar manner to Weka's Supermarket dataset:
tid,item1,item2,item3,item4,item5
T100,t,t,?,?,t
T200,?,t,?,t,?
T300,?,t,t,?,?
T400,t,t,?,t,?
T500,t,?,t,?,?
T600,?,t,t,?,?
T700,t,?,t,?,?
T800,t,t,t,?,t
T900,t,t,t,?,?

Weka's Apriori Run Information For Small Dataset As Above With TID

=== Run information ===

Scheme:       weka.associations.Apriori -N 10 -T 0 -C 0.9 -D 0.05 -U 1.0 -M 0.1 -S -1.0 -c -1
Relation:     9_txn_5_items
Instances:    9
Attributes:   6
                tid
                item1
                item2
                item3
                item4
                item5
=== Associator model (full training set) ===


Apriori
=======

Minimum support: 0.16 (1 instances)
Minimum metric <confidence>: 0.9
Number of cycles performed: 17

Generated sets of large itemsets:

Size of set of large itemsets L(1): 14

Size of set of large itemsets L(2): 31

Size of set of large itemsets L(3): 25

Size of set of large itemsets L(4): 8

Size of set of large itemsets L(5): 1

Best rules found:

1. item5=t 2 ==> item1=t 2    <conf:(1)> lift:(1.5) lev:(0.07) [0] conv:(0.67)
2. item4=t 2 ==> item2=t 2    <conf:(1)> lift:(1.29) lev:(0.05) [0] conv:(0.44)
3. item5=t 2 ==> item2=t 2    <conf:(1)> lift:(1.29) lev:(0.05) [0] conv:(0.44)
4. item2=t item5=t 2 ==> item1=t 2    <conf:(1)> lift:(1.5) lev:(0.07) [0] conv:(0.67)
5. item1=t item5=t 2 ==> item2=t 2    <conf:(1)> lift:(1.29) lev:(0.05) [0] conv:(0.44)
6. item5=t 2 ==> item1=t item2=t 2    <conf:(1)> lift:(2.25) lev:(0.12) [1] conv:(1.11)
7. tid=T100 1 ==> item1=t 1    <conf:(1)> lift:(1.5) lev:(0.04) [0] conv:(0.33)
8. tid=T100 1 ==> item2=t 1    <conf:(1)> lift:(1.29) lev:(0.02) [0] conv:(0.22)
9. tid=T100 1 ==> item5=t 1    <conf:(1)> lift:(4.5) lev:(0.09) [0] conv:(0.78)
10. tid=T200 1 ==> item2=t 1    <conf:(1)> lift:(1.29) lev:(0.02) [0] conv:(0.22) 

We run the Apriori again without TID column this time:

Logs from Weka:

=== Run information ===

Scheme:       weka.associations.Apriori -N 10 -T 0 -C 0.9 -D 0.05 -U 1.0 -M 0.1 -S -1.0 -c -1
Relation:     9_txn_5_items_without_tid
Instances:    9
Attributes:   5
                item1
                item2
                item3
                item4
                item5
=== Associator model (full training set) ===


Apriori
=======

Minimum support: 0.16 (1 instances)
Minimum metric <confidence>: 0.9
Number of cycles performed: 17

Generated sets of large itemsets:

Size of set of large itemsets L(1): 5

Size of set of large itemsets L(2): 8

Size of set of large itemsets L(3): 5

Size of set of large itemsets L(4): 1

Best rules found:

1. item5=t 2 ==> item1=t 2    <conf:(1)> lift:(1.5) lev:(0.07) [0] conv:(0.67)
2. item4=t 2 ==> item2=t 2    <conf:(1)> lift:(1.29) lev:(0.05) [0] conv:(0.44)
3. item5=t 2 ==> item2=t 2    <conf:(1)> lift:(1.29) lev:(0.05) [0] conv:(0.44)
4. item2=t item5=t 2 ==> item1=t 2    <conf:(1)> lift:(1.5) lev:(0.07) [0] conv:(0.67)
5. item1=t item5=t 2 ==> item2=t 2    <conf:(1)> lift:(1.29) lev:(0.05) [0] conv:(0.44)
6. item5=t 2 ==> item1=t item2=t 2    <conf:(1)> lift:(2.25) lev:(0.12) [1] conv:(1.11)
7. item1=t item4=t 1 ==> item2=t 1    <conf:(1)> lift:(1.29) lev:(0.02) [0] conv:(0.22)
8. item3=t item5=t 1 ==> item1=t 1    <conf:(1)> lift:(1.5) lev:(0.04) [0] conv:(0.33)
9. item3=t item5=t 1 ==> item2=t 1    <conf:(1)> lift:(1.29) lev:(0.02) [0] conv:(0.22)
10. item2=t item3=t item5=t 1 ==> item1=t 1    <conf:(1)> lift:(1.5) lev:(0.04) [0] conv:(0.33)
Tags: Technology,Machine Learning,Weka,

Apriori Algorithm For Association Mining Using Weka's Supermarket Dataset

We will see that the 'Supermarket.arff' dataset from Weka Repository is a: Fixed columns, True-False Format
@relation supermarket
@attribute 'department1' { t}
@attribute 'department2' { t}
@attribute 'department3' { t}
@attribute 'department4' { t}
@attribute 'department5' { t}
@attribute 'department6' { t}
@attribute 'department7' { t}
@attribute 'department8' { t}
@attribute 'department9' { t}
@attribute 'grocery misc' { t}
@attribute 'department11' { t}
@attribute 'baby needs' { t}
@attribute 'bread and cake' { t}
@attribute 'baking needs' { t}
@attribute 'coupons' { t}
@attribute 'juice-sat-cord-ms' { t}
@attribute 'tea' { t}
@attribute 'biscuits' { t}
@attribute 'canned fish-meat' { t}
...
... 
... 
@attribute 'department215' { t}
@attribute 'department216' { t}
@attribute 'total' { low, high} % low < 100
@data
?,?,?,?,?,?,?,?,?,?,?,t,t,t,?,t,?,t,?,?,t,?,?,?,t,t,t,t,?,t,?,t,t,?,?,?,?,?,?,t,t,t,?,?,?,?,?,?,?,t,?,?,?,?,?,?,?,?,t,?,t,?,?,t,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,t,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,high
t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,t,t,t,?,?,?,?,?,t,?,?,?,t,t,?,?,?,?,?,t,t,?,t,?,?,?,?,?,?,?,t,?,?,t,?,?,?,?,?,?,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,t,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,low
?,?,?,?,?,?,?,?,?,?,?,?,t,t,?,t,?,t,?,t,?,?,?,?,?,?,t,?,t,?,?,?,?,?,?,?,?,?,?,?,?,t,?,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,t,t,?,?,?,t,?,t,?,?,?,?,?,?,?,?,?,t,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,low
t,?,?,?,?,?,?,?,?,?,?,?,t,t,?,t,?,t,?,?,t,t,?,?,t,?,?,?,?,?,?,t,?,?,?,t,?,t,?,t,t,?,?,?,?,?,?,?,t,t,?,?,?,?,?,?,?,?,t,?,?,?,?,t,?,?,t,?,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,t,?,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,low
?,?,?,?,?,?,?,?,?,?,?,?,t,t,?,t,t,?,?,?,?,?,?,?,t,t,t,?,?,?,?,t,?,?,?,t,?,?,t,?,?,t,?,?,?,?,?,?,t,?,?,t,t,?,?,?,?,t,?,?,t,?,?,t,?,?,?,?,?,?,t,?,?,?,?,t,?,?,?,?,?,?,?,?,t,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,t,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,low
... 
... 
... 

Error We Encountered in Weka When Loading "Sparse Matrix, Varying Columns Format" Input Format Dataset

IMG 1

IMG 2

Apriori Output in Weka For Supermarket Data

=== Run information ===

Scheme:       weka.associations.Apriori -N 10 -T 0 -C 0.9 -D 0.05 -U 1.0 -M 0.1 -S -1.0 -c -1
Relation:     supermarket
Instances:    4627
Attributes:   217
              [list of attributes omitted]
=== Associator model (full training set) ===


Apriori
=======

Minimum support: 0.15 (694 instances)
Minimum metric <confidence>: 0.9
Number of cycles performed: 17

Generated sets of large itemsets:

Size of set of large itemsets L(1): 44

Size of set of large itemsets L(2): 380

Size of set of large itemsets L(3): 910

Size of set of large itemsets L(4): 633

Size of set of large itemsets L(5): 105

Size of set of large itemsets L(6): 1

Best rules found:

 1. biscuits=t frozen foods=t fruit=t total=high 788 ==> bread and cake=t 723    <conf:(0.92)> lift:(1.27) lev:(0.03) [155] conv:(3.35)
 2. baking needs=t biscuits=t fruit=t total=high 760 ==> bread and cake=t 696    <conf:(0.92)> lift:(1.27) lev:(0.03) [149] conv:(3.28)
 3. baking needs=t frozen foods=t fruit=t total=high 770 ==> bread and cake=t 705    <conf:(0.92)> lift:(1.27) lev:(0.03) [150] conv:(3.27)
 4. biscuits=t fruit=t vegetables=t total=high 815 ==> bread and cake=t 746    <conf:(0.92)> lift:(1.27) lev:(0.03) [159] conv:(3.26)
 5. party snack foods=t fruit=t total=high 854 ==> bread and cake=t 779    <conf:(0.91)> lift:(1.27) lev:(0.04) [164] conv:(3.15)
 6. biscuits=t frozen foods=t vegetables=t total=high 797 ==> bread and cake=t 725    <conf:(0.91)> lift:(1.26) lev:(0.03) [151] conv:(3.06)
 7. baking needs=t biscuits=t vegetables=t total=high 772 ==> bread and cake=t 701    <conf:(0.91)> lift:(1.26) lev:(0.03) [145] conv:(3.01)
 8. biscuits=t fruit=t total=high 954 ==> bread and cake=t 866    <conf:(0.91)> lift:(1.26) lev:(0.04) [179] conv:(3)
 9. frozen foods=t fruit=t vegetables=t total=high 834 ==> bread and cake=t 757    <conf:(0.91)> lift:(1.26) lev:(0.03) [156] conv:(3)
10. frozen foods=t fruit=t total=high 969 ==> bread and cake=t 877    <conf:(0.91)> lift:(1.26) lev:(0.04) [179] conv:(2.92)  
Tags: Technology,Machine Learning,Weka

Three Types of Input Data Format For Apriori Algorithm

Input Data Format (1)

Two Column Format

order_id,product_id
2,33120
2,28985
2,9327
2,45918
2,30035
2,17794
2,40141
2,1819
2,43668
3,33754
3,24838
3,17704
3,21903
3,17668
3,46667
3,17461
3,32665
4,46842
4,26434
4,39758
4,27761
4,10054
4,21351
4,22598
4,34862
4,40285
4,17616
4,25146
4,32645
4,41276
5,13176
5,15005
5,47329
5,27966
5,23909
5,48370
5,13245
5,9633
5,27360

Input Data Format (2)

Fixed columns, True-False Format

,Apple,Bread,Butter,Cheese,Corn,Dill,Eggs,Ice cream,Kidney Beans,Milk,Nutmeg,Onion,Sugar,Unicorn,Yogurt,chocolate

0,False,True,False,False,True,True,False,True,False,False,False,False,True,False,True,True

1,False,False,False,False,False,False,False,False,False,True,False,False,False,False,False,False

2,True,False,True,False,False,True,False,True,False,True,False,False,False,False,True,True

3,False,False,True,True,False,True,False,False,False,True,True,True,False,False,False,False

4,True,True,False,False,False,False,False,False,False,False,False,False,False,False,False,False

Input Data Format (3)

Sparse Matrix, Varying Columns Format

shrimp,almonds,avocado,vegetables mix,green grapes,whole weat flour,yams,cottage cheese,energy drink,tomato juice,low fat yogurt,green tea,honey,salad,mineral water,salmon,antioxydant juice,frozen smoothie,spinach,olive oil

burgers,meatballs,eggs

chutney

turkey,avocado

mineral water,milk,energy bar,whole wheat rice,green tea

low fat yogurt

whole wheat pasta,french fries

soup,light cream,shallot

frozen vegetables,spaghetti,green tea

french fries

eggs,pet food

cookies

turkey,burgers,mineral water,eggs,cooking oil

spaghetti,champagne,cookies

mineral water,salmon
Tags: Technology,Machine Learning,

Sunday, March 6, 2022

Linear Regression Using Java Code And Weka JAR

File: Regression.java

import weka.core.Instance; import weka.core.Instances; import weka.core.converters.ConverterUtils.DataSource; import weka.classifiers.functions.LinearRegression; public class Regression{ public static void main(String args[]) throws Exception{ //Load Data set DataSource source = new DataSource("/home/ashish/Desktop/ws/weka/e4_linear_regression_using_java_code/house.arff"); Instances dataset = source.getDataSet(); //set class index to the last attribute dataset.setClassIndex(dataset.numAttributes()-1); //Build model LinearRegression model = new LinearRegression(); model.buildClassifier(dataset); //output model System.out.println("LR FORMULA : "+model); // Now Predicting the cost Instance myHouse = dataset.lastInstance(); double price = model.classifyInstance(myHouse); System.out.println("-------------------------"); System.out.println("PRECTING THE PRICE : "+price); } }

File: house.arff

@RELATION house @ATTRIBUTE houseSize NUMERIC @ATTRIBUTE lotSize NUMERIC @ATTRIBUTE bedrooms NUMERIC @ATTRIBUTE granite NUMERIC @ATTRIBUTE bathroom NUMERIC @ATTRIBUTE sellingPrice NUMERIC @DATA 3529,9191,6,0,0,205000 3247,10061,5,1,1,224900 4032,10150,5,0,1,197900 2397,14156,4,1,0,189900 2200,9600,4,0,1,195000 3536,19994,6,1,1,325000 2983,9365,5,0,1,230000

File: Execution.log

~/Desktop/ws/weka/e4_linear_regression_using_java_code$ javac -cp ./weka-3.7.0.jar Regression.java ~/Desktop/ws/weka/e4_linear_regression_using_java_code$ ~/Desktop/ws/weka/e4_linear_regression_using_java_code$ ls -l total 5232 -rw-rw-r-- 1 ashish ashish 365 Mar 5 09:05 house.arff drwxrwxr-x 2 ashish ashish 4096 Mar 5 09:12 jar -rw-rw-r-- 1 ashish ashish 1714 Mar 5 09:24 Regression.class -rw-rw-r-- 1 ashish ashish 924 Mar 5 09:18 Regression.java -rw-rw-r-- 1 ashish ashish 5340945 Sep 27 2011 weka-3.7.0.jar ~/Desktop/ws/weka/e4_linear_regression_using_java_code$ java -cp .:./weka-3.7.0.jar Regression LR FORMULA : Linear Regression Model sellingPrice = -26.6882 * houseSize + 7.0551 * lotSize + 43166.0767 * bedrooms + 42292.0901 * bathroom + -21661.1208 ------------------------- PRECTING THE PRICE : 222921.57101904938 ~/Desktop/ws/weka/e4_linear_regression_using_java_code$ (base) ashish@ashish-VirtualBox:~/Desktop/ws/weka/e4_linear_regression_using_java_code$ ls -l total 13852 -rw-rw-r-- 1 ashish ashish 923 Mar 5 09:25 execution.log -rw-rw-r-- 1 ashish ashish 365 Mar 5 09:05 house.arff drwxrwxr-x 2 ashish ashish 4096 Mar 6 15:04 jar -rw-rw-r-- 1 ashish ashish 1714 Mar 5 09:24 Regression.class -rw-rw-r-- 1 ashish ashish 924 Mar 5 09:18 Regression.java -rwxrwxrwx 1 ashish ashish 14163929 Jan 25 16:06 weka-3.8.6.jar (base) ashish@ashish-VirtualBox:~/Desktop/ws/weka/e4_linear_regression_using_java_code$ java -cp .:./weka-3.8.6.jar Regression Exception in thread "main" java.lang.NoClassDefFoundError: no/uib/cipr/matrix/Matrix at Regression.main(Regression.java:15) Caused by: java.lang.ClassNotFoundException: no.uib.cipr.matrix.Matrix at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 1 more (base) ashish@ashish-VirtualBox:~/Desktop/ws/weka/e4_linear_regression_using_java_code$ javac -cp .:./weka-3.8.6.jar Regression.java (base) ashish@ashish-VirtualBox:~/Desktop/ws/weka/e4_linear_regression_using_java_code$ java -cp .:./weka-3.8.6.jar Regression Exception in thread "main" java.lang.NoClassDefFoundError: no/uib/cipr/matrix/Matrix at Regression.main(Regression.java:15) Caused by: java.lang.ClassNotFoundException: no.uib.cipr.matrix.Matrix at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 1 more - - - TRYING AGAIN WITH WEKA-3.7.0.JAR: (base) ashish@ashish-VirtualBox:~/Desktop/ws/weka/e4_linear_regression_using_java_code$ java -cp .:./weka-3.7.0.jar Regression LR FORMULA : Linear Regression Model sellingPrice = -26.6882 * houseSize + 7.0551 * lotSize + 43166.0767 * bedrooms + 42292.0901 * bathroom + -21661.1208 ------------------------- PRECTING THE PRICE : 222921.57101904938
Tags: Technology,Machine Learning,Regression

Weka clustering experiment on Iris dataset

1: Weka Explorer: Preprocess tab: Before clustering

2: Weka Explorer: Cluster tab: Ignore attribute

3: Weka Explorer: Cluster tab: Algo (Expectation Maximization) parameters

4: Weka Explorer: Cluster tab: Algo EM: Results

5: Weka Explorer: Cluster tab: kMeans algo: Parameters

6: Weka Explorer: Cluster tab: kMeans: results (A)

7: Weka Explorer: Cluster tab: kMeans: results (B)

Tags: Technology,Machine Learning,Clustering

Weka classification experiment on Iris dataset

1: Weka Explorer: Preprocess Tab: Iris dataset

2: Weka Experiment Environment: New experiment

3: Weka Experiment Environment: Selecting Naive Bayes' Classifier

4: Weka Experiment Environment: Selecting kNN for comparison with Naive Bayes' Classifier

5: Weka Experiment Environment: Go to 'Run' tab and click on 'start'

6: Weka Experiment Environment: Go to 'Analyze' tab and compare three algorithms

7: Weka Experiment Environment: Analyze tab: Perform test

Tags: Technology,Machine Learning,Classification,