Friday, June 03, 2022

How to manipulate a 20G CSV file efficiently with Python?

 .

Import the Required Libraries: Start by importing the necessary libraries, such as csv and pandas. These libraries provide efficient tools for working with CSV files.

Read More

Thursday, March 03, 2022

How to Load Kaggle Datasets Directly into Google Colab?

 .

Almost every data science aspirant uses Kaggle. It houses datasets for every domain. You can get a dataset for every possible use case ranging from the entertainment industry, medical, e-commerce, and even astronomy. Its users practice on various datasets to test out their skills in the field of Data Science and Machine learning.


The Kaggle datasets can have varying sizes. Some datasets can be as small as under 1MB and as large as 100 GB. Also, some of the Deep learning practices require GPU support that can boost the training time. Google Colab is a promising platform that can help beginners to test out their code in the cloud environment.


Step 1: Select any dataset from Kaggle

Step 2: Download API Credentials

Step 3: Setup the Colab Notebook

Step 4: Download datasets


.

https://www.analyticsvidhya.com/blog/2021/06/how-to-load-kaggle-datasets-directly-into-google-colab/

Read More

Google's Python Class

 .

Welcome to Google's Python Class -- this is a free class for people with a little bit of programming experience who want to learn Python. The class includes written materials, lecture videos, and lots of code exercises to practice Python coding. These materials are used within Google to introduce Python to people who have just a little programming experience. The first exercises work on basic Python concepts like strings and lists, building up to the later exercises which are full programs dealing with text files, processes, and http connections. The class is geared for people who have a little bit of programming experience in some language, enough to know what a "variable" or "if statement" is. Beyond that, you do not need to be an expert programmer to use this material.

.

https://developers.google.com/edu/python/

Read More

Getting Started With Google Colab Python

 .

The ‘Colaboratory’ Data Scientist:

The case for using Google Colab for data science in the cloud.

.

https://towardsdatascience.com/the-colaboratory-data-scientist-working-in-the-cloud-2a48fc967e00

Read More

Colab Python Machine Learning With Scikit-API

.

To introduce the fundamental vocabulary and concepts of machine learning.

To introduce the Scikit-Learn API and show some examples of its use.

To take a deeper dive into the details of several of the most important machine learning approaches, and develop an intuition into how they work and when and where they are applicable.

.

https://colab.research.google.com/github/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/05.00-Machine-Learning.ipynb


Read More

Colab Python Statistics

 .

In this section, we will introduce three types of statistics inference methods: evaluating and comparing estimators, conducting hypothesis tests, and constructing confidence intervals. These methods can help us infer the characteristics of a given population, i.e., the true parameter θ. For brevity, we assume that the true parameter θ of a given population is a scalar value. It is straightforward to extend to the case where θ is a vector or a tensor, thus we omit it in our discussion.

.

https://colab.research.google.com/github/d2l-ai/d2l-en-colab/blob/master/chapter_appendix-mathematics-for-deep-learning/statistics.ipynb

.

Read More

Monday, January 10, 2022

Top 10 JavaScript Libraries for Machine Learning

.
As a developer, having and using the right JavaScript machine learning Libraries will help you in the quest for putting together an algorithm that will tap into the strengths and capabilities of the machine learning project of your choice. In this article, 10 best open-source JavaScript machine learning libraries to extend JavaScript’s capabilities are discussed.
.
Top JavaScript libraries for Machine Learning.
Fahad Ahmad.
Oct 28, 2021.


Top javaScript libraries for Machine learning

1. TensorFlow.js

TensorFlow.js is a JavaScript library for training and deploying models in the browser and on Node.js. TensorFlow.js in 2019 has become the bread and butter for all Machine Learning Javascript projects due to its comprehensive linear algebra core and deep learning layers.
It has rapidly caught up with its Python sister in the number of supported APIs and almost any problems in Machine Learning can be solved using it at this point.
TensorFlow.js can be used directly in the browsers while leveraging WebGL for accelerations.


2. Neuro.js

Neuro.js is a machine learning framework for building AI assistants and chat-bots.
Neuro is a library for developing and training ML models in JavaScript, and deploying them in the browser or on Node.js


3. Synaptic.js

Synaptic is a JavaScript neural network library for Node.js and the browser, its generalized algorithm is architecture-free, so you can build and train basically any type of first-order or even second-order neural network architecture.
This library includes a few built-in architectures like multilayer perceptrons, multilayer long-short term memory networks (LSTM), liquid state machines or Hopfield networks, and a trainer capable of training any given network, which includes built-in training tasks/tests like solving an XOR, completing a Distracted Sequence Recall task or an Embedded Reber Grammar test, so you can easily test and compare the performance of different architectures.


4. Brain.js

Brain.js: GPU accelerated Neural Networks in JavaScript for browsers and Node.js.
Brain.js is a JavaScript library for Neural Networks replacing the (now deprecated) “brain” library, which can be used with Node.js or in the browser (note computation ) and provides different types of networks for different tasks.


5. Keras.js

Run Keras models in the browser, with GPU support provided by WebGL 2. Models can be run in Node.js as well, but only in CPU mode. Because Keras abstracts away a number of frameworks as backends, the models can be trained in any backend, including TensorFlow, CNTK, etc.
Basic Convent for MNIST
Convolutional Variational Autoencoder, trained on MNIST
Auxiliary Classifier Generative Adversarial Networks (AC-GAN) on MNIST
50-layer Residual Network, trained on ImageNet
Inception v3, trained on ImageNet
DenseNet-121, trained on ImageNet
SqueezeNet v1.1, trained on ImageNet
Bidirectional LSTM for IMDB sentiment classification


6 . Neatptic.js

Neataptic offers flexible neural networks; neurons and synapses can be removed with a single line of code. No fixed architecture is required for neural networks to function at all. This flexibility allows networks to be shaped for your dataset through neuro-evolution, which is done using multiple threads.


7. Mind

Flexible neural networks in JavaScript.
Mind lets you easily create networks that learn to make predictions.


8. ConvNetJS

ConvNetJS is a JavaScript library for training Deep Learning models (Neural Networks) entirely in your browser. Open a tab and you’re training. No software requirements, no compilers, no installations, no GPUs, no sweat.


9 . ml.js

ml.js is a comprehensive, general-purpose JavaScript ML library for browsers and Node.js.It provides straightforward and mission-critical models and utilities for supervised and unsupervised problems. Focusing on the simplicity and all-in-one general-purpose machine learning for JavaScript and TypeScript developers, it provides clustering, decomposition, ensemble, bagging, linear models, feature extractions, and more.

10. math.js

Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices. Powerful and easy to use.


Conclusion

In this article, we look at the 10 best open-source JavaScript machine learning libraries to extend JavaScript’s capabilities.
Further, as a developer, having and using the right JavaScript machine learning Libraries will help you in the quest for putting together an algorithm that will tap into the strengths and capabilities of the machine learning project of your choice.
This article just covers the tip of the JavaScript Machine Learning libraries.
Have a nice day! 🙌
Follow me for more articles 👈
More content at plainenglish.io
.
Read More

NLP Libraries for Node.js and JavaScript

.

NLP libraries such as Spacy, NLTK, and CoreNLP are not available in JavaScript. After a lot of research and testing, the following are some good NLP libraries in JavaScript that have been found.

NLP Libraries for Node.js and JavaScript

BY PARTH SHRIVASTAVA  9 JUN 2020

Last Updated on June 14, 2020

[https://www.kommunicate.io/blog/nlp-libraries-node-javascript/]


In this post, we will talk about the best NLP libraries for Node.js and JavaScript that we have come across. Let’s start right away. We have also compiled a video for the same as well:



What is Natural Language Processing (NLP)?

Natural language refers to the way humans communicate with each other.


Natural Language Processing (NLP) is broadly defined as the electronic manipulation of natural language, like speech and text, by software.


NLP is important because we want to open up communication between machines and humans in a more natural way. NLP has various use cases such as running a search engine, sentimental analysis, entity-recognition, voice-based apps, chatbots, and personal assistants.


The history of natural language processing (NLP) generally started in the 1950s. Alan Turing published the article “Computing Machinery and Intelligence,” a pioneer seminal paper on artificial intelligence.


NLP libraries Kommunicate - alan turing's paper

The introduction to Turing’s paper

Some of the notably successful NLP systems developed in the 1960s were SHRDLU and ELIZA. Up to the 1980s, most natural language processing systems were based on complex sets of hand-written rules. In the 1980s, the NLP started to pick up after the introduction of machine learning algorithms.


Now, decades later, the world is full of multiple NLP libraries and engines. Let’s look at some of them, especially for the newer languages, such as Node.js and JavaScript.


NLP Libraries for Node.js and JavaScript

Though there are many useful NLP libraries available such as Spacy, NLTK, and CoreNLP. However, most of these libraries are not available in JavaScript. We had a hard time finding some good NLP libraries in JavaScript. After a lot of research and testing, the following are the libraries we found to be useful:


#1 NLP.js

Github: https://github.com/axa-group/nlp.js


NLP.js is developed by the AXA group. It is an NLP library for building bots, with entity extraction, sentiment analysis, automatic language identify, and so more, supports 40 languages.


NLP.js is a perfect node.js library for building chatbots. Documentation is very clear, and usage is very easy.


Here is a basic code snippet to help you understand how easy it is to set it up.


const { NlpManager } = require('node-nlp');

const manager = new NlpManager({ languages: ['en'] });


// Adds the utterances and intents for the NLP

manager.addDocument('en', 'goodbye for now', 'greetings.bye');

manager.addDocument('en', 'bye bye take care', 'greetings.bye');


// Train also the NLG

manager.addAnswer('en', 'greetings.bye', 'Till next time');

manager.addAnswer('en', 'greetings.bye', 'see you soon!');


// Train and save the model.

(async() => {

    await manager.train();

    manager.save();

    const response = await manager.process('en', 'I should go now');

    console.log(response);

})();


#2 Natural

Github: https://github.com/NaturalNode/natural


Natural is another famous NLP library for Node.js. “Natural” is a general natural language facility for Node.js. It currently supports tokenizing, stemming, classification, phonetics, tf-idf, WordNet, string similarity, and some inflections.


var natural = require('natural');

var tokenizer = new natural.WordTokenizer();

console.log(tokenizer.tokenize("your dog has fleas."));

// [ 'your', 'dog', 'has', 'fleas' ]


console.log(natural.HammingDistance("karolin", "kathrin", false));

console.log(natural.HammingDistance("karolin", "kerstin", false));

// If strings differ in length -1 is returned


#3 Compromise.cool

Github: https://github.com/spencermountain/compromise/


Compromise.cool is indeed a cool and lightweight library and very easy to use. It can be used to run NLP on your browser.


Please note that, Compromise works with the English language only.


let doc = nlp(entireNovel)


doc.if('the #Adjective of times').text()

// "it was the blurst of times??"

if (doc.has('simon says #Verb')) {

  return true

}


#4 Wink.js

Github: https://github.com/winkjs/wink-nlp-utils


Wink provides NLP functions for amplifying negations, managing elisions, creating ngrams, stems, phonetic codes to tokens, and more.


// Load wink-nlp-utils

var nlp = require( 'wink-nlp-utils' );


// Extract person's name from a string:

var name = nlp.string.extractPersonsName( 'Dr. Sarah Connor M. Tech., PhD. - AI' );

console.log( name );


// Tokenize a sentence.

var s = 'For details on wink, check out http://winkjs.org/ URL!';

console.log( nlp.string.tokenize( s, true ) );

// -> [ { value: 'For', tag: 'word' },

//      { value: 'details', tag: 'word' },

//      { value: 'on', tag: 'word' },

//      { value: 'wink', tag: 'word' },

//      { value: ',', tag: 'punctuation' },

//      { value: 'check', tag: 'word' },

//      { value: 'out', tag: 'word' },

//      { value: 'http://winkjs.org/', tag: 'url' },

//      { value: 'URL', tag: 'word' },

//      { value: '!', tag: 'punctuation' } ]

  

Conclusion

Choosing a library depends finally on the use case and the tech stack you are using. If you are looking for an NLP library for building chatbots, then I would recommend NLP.js.


References: https://machinelearningmastery.com/natural-language-processing/

.

Read More