Artificial intelligence, robotics, PHP, Javascript, hacking, CSS, Photoshop, deep learning, machine learning, Visual basic

Tuesday, 31 July 2018

Javascript

JavaScript is a programming language commonly used in web development. It was originally developed by Netscape as a means to add dynamic and interactive elements to websites. While JavaScript is influenced by Java, the syntax is more similar to C and is based on ECMAScript, a scripting language developed by Sun Microsystems.



JavaScript is a client-side scripting language, which means the source code is processed by the client's web browser rather than on the web server. This means JavaScript functions can run after a webpage has loaded without communicating with the server. For example, a JavaScript function may check a web form before it is submitted to make sure all the required fields have been filled out. The JavaScript code can produce an error message before any information is actually transmitted to the server.
Like server-side scripting languages, such as PHP and ASP, JavaScript code can be inserted anywhere within the HTML of a webpage. However, only the output of the server-side code is displayed in the HTML, while JavaScript code remains fully visible in the source of the webpage. It can also be referenced in a separate, JS file, which may also be viewed in a browser.
JavaScript functions can be called within <script> tags or when specific events take place. While standard JavaScript is still used for performing basic client-side functions, many web developers now prefer to use JavaScript libraries like jQuery to add more advanced dynamic elements to websites.

Advantage and disadvantage of javascript

Advantages of JavaScript

  • Speed. Client-side JavaScript is very fast because it can be run immediately within the client-side browser. Unless outside resources are required, JavaScript is unhindered by network calls to a backend server. It also has no need to be compiled on the client side which gives it certain speed advantages (granted, adding some risk dependent on that quality of the code developed).

  • Simplicity. JavaScript is relatively simple to learn and implement.

  • Popularity. JavaScript is used everywhere in the web. The resources to learn JavaScript are numerous. StackOverflow and GitHub have many projects that are using Javascript and the language as a whole has gained a lot of traction in the industry in recent years especially.

  • Interoperability. JavaScript plays nicely with other languages and can be used in a huge variety of applications. Unlike PHP or SSI scripts, JavaScript can be inserted into any web page regardless of the file extension. JavaScript can also be used inside scripts written in other languages such as Perl and PHP.

  • Server Load. Being client-side reduces the demand on the website server.

  • Extended Functionality. Third party add-ons like Greasemonkey enable JavaScript developers to write snippets of JavaScript which can execute on desired web pages to extend its functionality.

  • Versatility. Nowadays, there are many ways to use JavaScript through Node.js servers. If you were to bootstrap node.js with Express, use a document database like mongodb, and use JavaScript on the front-end for clients, it is possible to develop an entire JavaScript app from front to back using only JavaScript.

  • Updates. Since the advent of EcmaScript 5 (the scripting specification that Javascript relies on), Ecma International has dedicated to updating JavaScript annually. So far, we have received browser support for ES6 in 2017 and look forward to ES7 being supported in future months.

Disadvantages of JavaScript

  • Client-Side Security. Because the code executes on the users’ computer, in some cases it can be exploited for malicious purposes. This is one reason some people choose to disable Javascript.

  • Browser Support. JavaScript is sometimes interpreted differently by different browsers. Whereas server-side scripts will always produce the same output, client-side scripts can be a little unpredictable. Don’t be overly concerned by this though - as long as you test your script in all the major browsers you should be safe. Also, there are services out there that will allow you to test your code automatically on check-in of an update to make sure all browsers support your code.

Basic concepts of javascript

Let's explain some of the core features of the JavaScript language, to give you a better understanding of how it all works.

Variables
Variables are containers that you can store values in. You start by declaring a variable with the var keyword, followed by any name you want to call it:
var myVariable;

Comments
You can put comments into JavaScript code, just as you can in CSS:
/*
Everything in between is a comment.
*/

If your comment contains no line breaks, it's often easier to put it behind two slashes like this:
// This is a comment

Operators


An operator is a mathematical symbol which produces a result based on two values (or variables). In the following table, you can see some of the simplest operators, along with some examples to try out in the JavaScript console.


Operator
Explanation
Symbol(s)
Example
Addition
Used to add two numbers together or glue two strings together.
+
6 + 9;


"Hello " + "world!";
Subtraction, Multiplication, Division
These do what you'd expect them to do in basic math.
-*/
9 - 3;


8 * 2; // multiply in JS is an asterisk

9 / 3;
Assignment
You've seen this already: it assigns a value to a variable.
=
var myVariable = 'Bob';
Equality
Does a test to see if two values are equal to one another and return a true/false (Boolean) result.
===
var myVariable = 3;


myVariable === 4;
Not, Does-not-equal
Returns the logically opposite value of what it precedes; it turns a true into a false, etc. When it is used alongside the Equality operator, the negation operator tests whether two values are not equal.
!!==
The basic expression is true, but the comparison returns false because we've negated it:
var myVariable = 3;


!(myVariable === 3);

Here we are testing "is myVariable NOT equal to 3". This returns false because myVariable IS equal to 3.
var myVariable = 3;


myVariable !== 3;

There are some more operators to be explored in javascripts.


Conditions
Conditionals are code structures which allow you to test if an expression returns true or not, running alternative code revealed by its result. A very common form of conditionals is the if ... else statement.

for example:
var x = '1000';
if (x === '1000') {
  alert('true');    
} else {
  alert('false');    
}

Functions
Functions are a way of packaging functionality that you wish to reuse. When you need the procedure you can call a function, with the function name, instead of rewriting the entire code each time.
Document.getelementbyid(), alert, etc are the inbuilt functions.

for example:
function multiply(num1,num2) {
  var result = num1 * num2;
  return result;
}

Events
Real interactivity on a website needs events. These are code structures which listen for things happening in the browser, running code in response. The most obvious example is the click event, which is fired by the browser when you click on something with your mouse. 

for example:
document.querySelector('html').onclick = function() {
    alert('Ouch! Stop poking me!');
}



Share:

Wednesday, 18 July 2018

Deep learning

Deep learning 

Deep learning is a set of machine learning algorithms that model high-level abstractions in data using architectures consisting of multiple nonlinear transformations. A deep learning technology is based on ANNs. These ANNs constantly receive learning algorithms and continuously growing amounts of data to increase the efficiency of training processes.


Advantage and disadvantages of Deep learning is a machine learning framework.

Advantages

·         Has best-in-class performance on problems that significantly outperforms other solutions in multiple domains. This includes speech, language, vision, playing games like Go etc. This isn’t by a little bit, but by a significant amount.
·         Reduces the need for feature engineering, one of the most time-consuming parts of machine learning practice.
·         Is an architecture that can be adapted to new problems relatively easily (e.g. Vision, time series, language etc using techniques like convolutional neural networks, recurrent neural networks, long short-term memory etc.

Disadvantages

·         Requires a large amount of data — if you only have thousands of example, deep learning is unlikely to outperform other approaches.
·         Is extremely computationally expensive to train. The most complex models take weeks to train using hundreds of machines equipped with expensive GPUs.
·         Do not have much in the way of a strong theoretical foundation. This leads to the next disadvantage.
·         Determining the topology/flavor/training method/hyperparameters for deep learning is a black art with no theory to guide you.
·         What is learned is not easy to comprehend. Other classifiers (e.g. decision trees, logistic regression etc) make it much easier to understand what’s going on.



Applications

Automatic speech recognition

large-scale automatic speech recognition is the first and most convincing successful case of deep learning. LSTM RNNs can learn "Very Deep Learning" tasks[2] that involve multi-second intervals containing speech events separated by thousands of discrete time steps, where one-time step corresponds to about 10 ms. LSTM with forget gates[107] is competitive with traditional speech recognizers on certain tasks.
The initial success in speech recognition was based on small-scale recognition tasks based on TIMIT. The dataset contains 630 speakers from eight major dialects of American English, where each speaker reads 10 sentences. Its small size lets many configurations be tried. More importantly, the TIMIT task concerns phone-sequence recognition, which, unlike word-sequence recognition, allows weak phone bigram language models.

Image recognition

A common evaluation set for image classification is the MNIST database data set. MNIST is composed of handwritten digits and includes 60,000 training examples and 10,000 test examples. As with TIMIT, its small size lets users test multiple configurations. A comprehensive list of results on this set is available.
Deep learning-based image recognition has become "superhuman", producing more accurate results than human contestants. This first occurred in 2011

Visual art processing


Closely related to the progress that has been made in image recognition is the increasing application of deep learning techniques to various visual art tasks. DNNs have proven themselves capable, for example, of a) identifying the style period of a given painting, b) "capturing" the style of a given painting and applying it in a visually pleasing manner to an arbitrary photograph, and c) generating striking imagery based on random visual input fields

Natural language processing

Neural networks have been used for implementing language models since the early 2000s. LSTM helped to improve machine translation and language modeling.
Other key techniques in this field are negative sampling and word embedding. Word embedding, such as word2vec, can be thought of as a representational layer in a deep learning architecture that transforms an atomic word into a positional representation of the word relative to other words in the dataset; the position is represented as a point in a vector space. Using word embedding as an RNN input layer allows the network to parse sentences and phrases using an effective compositional vector grammar. A compositional vector grammar can be thought of as probabilistic context-free grammar (PCFG) implemented by an RNN. Recursive auto-encoders built atop word embedding can assess sentence similarity and detect paraphrasing. Deep neural architectures provide the best results for constituency parsing. sentiment analysis, information retrieval, spoken language understanding, machine translation, contextual entity linking,] writing style recognition, Text classification, and others
Atom Net is a deep learning system for structure-based rational drug design. Atom Net was used to predict novel candidate biomolecules for disease targets such as the Ebola virus[ and multiple sclerosis.

Customer relationship management

Deep reinforcement learning has been used to approximate the value of possible direct marketing actions, defined in terms of RFM variables. The estimated value function was shown to have a natural interpretation as customer lifetime value.

Recommendation systems

Recommendation systems have used deep learning to extract meaningful features for a latent factor model for content-based music recommendations. Multi-view deep learning has been applied for learning user preferences from multiple domains. The model uses a hybrid collaborative and content-based approach and enhances recommendations in multiple tasks.

Bioinformatics

An autoencoder ANN was used in bioinformatics, to predict gene ontology annotations and gene-function relationships.
In medical informatics, deep learning was used to predict sleep quality based on data from wearables and predictions of health complications from electronic health record data. Deep learning has also shown efficacy in healthcare.

Mobile advertising

Finding the appropriate mobile audience for mobile advertising is always challenging since many data points must be considered and assimilated before a target segment can be created and used in ad serving by any ad server. Deep learning has been used to interpret large, many-dimensioned advertising datasets. Many data points are collected during the request/serve/click internet advertising cycle. This information can form the basis of machine learning to improve ad selection.

Image restoration

Deep learning has been successfully applied to inverse problems such as denoising, super-resolution, and inpainting. These applications include learning methods such as "Shrinkage Fields for Effective Image Restoration which trains on an image dataset, and Deep Image Prior, which trains on the image that needs restoration.

Financial fraud detection

Deep learning is being successfully applied to financial fraud detection and anti-money laundering. "Deep anti-money laundering detection system can spot and recognize relationships and similarities between data and, further down the road, learn to detect anomalies or classify and predict specific events". The solution leverages both supervised learning techniques, such as the classification of suspicious transactions, and unsupervised learning, e.g. anomaly detection. 

What Is the Difference between Deep Learning and Machine Learning?


Deep learning is a kind of traditional machine learning. Classical machine learning is the extraction of new knowledge from a large data array loaded into the machine. Users formulate the machine training rules and correct errors made by a machine. This approach eliminates a negative overtraining effect frequently appearing in deep learning.

In machine learning, users provide a machine with both examples and training data to help the system make correct decisions. This principle is called supervised learning. In other words, in a classical machine learning, a computer solves a large number of tasks, but it cannot form such tasks without a human control.

Diversity between machine learning (ML) and deep learning (DL):

·   DL requires a lot of unlabeled training data to make concise conclusions while ML can use small data amounts provided by users.

·   Unlike ML, DL needs high-performance hardware.

·    ML requires features to be accurately identified by users while DL creates new features by itself.

·    ML divides tasks into small pieces and then combine received results into one conclusion while DL solves the problem on the end-to-end basis.

·    In comparison with ML, DL needs much more time to train.

·    Unlike DL, ML can provide enough transparency for its decisions.

The concept of deep learning implies that the machine creates its functionality by itself as long as it is possible at the current time. To infer, deep learning applications use a hierarchical approach involving determining the most important characteristics to compare.




Share:

Wednesday, 11 July 2018

Machine Learning Algorithms

Machine Learning algorithms deepen your understanding of ML Applications and techniques. To better understand how algorithms work, you must have a basic understanding of their different types.

There are mainly three types of Machine Learning Algorithms


· Supervised Learning

Supervised learning is where you train the algorithm using existing data sets and input/output variables. You basically “hand-hold” the algorithm and train it under supervision to reach specific judgment so that it can carry out those processes on its own later on.


In other words, supervised learning, in the context of artificial intelligence (AI) and machine learning, is a type of system in which both input and desired output data are provided. Input and output data are labeled for classification to provide a learning basis for future data processing.
Supervised machine learning systems provide the learning algorithms with known quantities to support future judgments. Chabot’sself-driving carsfacial recognition programs, systems, and robots are among the systems that may use either supervised or unsupervised learning. Supervised learning systems are mostly associated with retrieval-based AI but they may also be capable of using a generative learning model. 
Training data for supervised learning includes a set of examples with paired input subjects and desired output (which is also referred to as the supervisory signal). In supervised learning for image processing, for example, an AI system might be provided with labeled pictures of vehicles in categories such as cars and trucks. After a sufficient amount of observation, the system should be able to distinguish between and categorize unlabeled images, at which time training can be said to be complete.
Supervised learning models have some advantages over the unsupervised approach, but they also have limitations. The systems are more likely to make judgments that humans can relate to, for example, because humans have provided the basis for decisions. However, in the case of a retrieval-based method, supervised learning systems have trouble dealing with new information. If a system with categories for cars and trucks is presented with a bicycle, for example, it would have to be incorrectly lumped in one category or the other. If the AI system was generative, however, it may not know what the bicycle is but would be able to recognize it as belonging to a separate category.

·         Unsupervised Learning

Unsupervised learning is where there are no specific answers and algorithms learn on their own by analyzing unstructured data sets. You simply provide input variables, and the algorithm reaches conclusions on its own from there.
In other words, Unsupervised learning is the training of an artificial intelligence (AIalgorithm using information that is neither classified nor labeled and allowing the algorithm to act on that information without guidance.


In unsupervised learning, an AI system may group unsorted information according to similarities and differences even though there are no categories provided. AI systems capable of unsupervised learning are often associated with generative learning models, although they may also use a retrieval-based approach (which is most often associated with supervised learning). Chabot’sself-driving cars, recognition programs, expert systems, and robots are among the systems that may use either supervised or unsupervised learning approaches.
In unsupervised learning, an AI system is presented with unlabeled, uncategorized data and the system’s algorithms act on the data without prior training. The output is dependent upon the coded algorithms. Subjecting a system to unsupervised learning is one way of testing AI.
Unsupervised learning algorithms can perform more complex processing tasks than supervised learning systems. However, unsupervised learning can be more unpredictable than the alternate model. While an unsupervised learning AI system might, for example, figure out on its own how to sort cats from dogs, it might also add unforeseen and undesired categories to deal with unusual breeds, creating clutter instead of order.

·         Reinforcement Learning

Reinforcement Learning is a type of Machine Learning algorithm that uses simple reward feedback to reinforce an ideal behavior. It learns through interactions from its environment instead of being explicitly taught.

In other words, Reinforcement Learning is a type of Machine Learning, and thereby also a branch of Artificial Intelligence. It allows machines and software agents to automatically determine the ideal behavior within a specific context, in order to maximize its performance. Simple reward feedback is required for the agent to learn its behavior; this is known as the reinforcement signal.
There are many different algorithms that tackle this issue. As a matter of fact, Reinforcement Learning is defined by a specific type of problem, and all of its solutions are classed as Reinforcement Learning algorithms. In the problem, an agent is supposed to decide the best action to select based on his current state. When this step is repeated, the problem is known as a Markov Decision Process.
Reinforcement Learning allows the machine or software agent to learn its behavior based on feedback from the environment. This behavior can be learned once and for all, or keep on adapting as time goes by. If the problem is modeled with care, some Reinforcement Learning algorithms can converge to the global optimum; this is the ideal behavior that maximizes the reward.
This automated learning scheme implies that there is little need for a human expert who knows about the domain of application. Much less time will be spent designing a solution, since there is no need for hand-crafting complex sets of rules as with Expert Systems, and all that is required is someone familiar with Reinforcement Learning.

10 Machine Learning Algorithms for Beginners

Top Machine Learning Algorithms you can get started with today in order to expand your skills and proficiency as a Data Scientist.

1.) Naive Bayes Classifier Algorithm

If you’re planning to automatically classify web pages, forum posts, blog snippets and tweets without manually going through them, then the Naive Bayes Classifier Algorithm will make your life easier.  This classifies words based on the popular Bayes Theorem of probability and is used in applications related to disease prediction, document classification, spam filters and sentiment analysis projects.
You can use the Naive Bayes Classifier Algorithm for ranking pages, indexing relevancy scores and classifying data categorically.

2.) K-Means Clustering Algorithm

The K-Means Clustering Algorithm is an unsupervised Machine Learning Algorithm that is used in cluster analysis. It works by categorizing unstructured data into a number of different groups ‘k’ being the number of groups. Each dataset contains a collection of features and the algorithm classifies unstructured data and categorizes them based on specific features.
This algorithm is frequently used in applications such as grouping images into different categories, detecting different activity types in motion sensors and for monitoring whether tracked data points change between different groups over time.  There are business use cases of this algorithm as well such as segmenting data by purchase history, classifying personas based on different interests, grouping inventories by manufacturing and sales metrics, etc.

3.) Support Vector Machine (SVM) Learning Algorithm

Support Vector Machine Learning Algorithm is used in business applications such as comparing the relative performance of stocks over a period of time. These comparisons are later used to make wiser investment choices. SVM Algorithm is a supervised learning algorithm, and the way it works is by classifying data sets into different classes through a hyperplane.
It marginalizes the classes and maximizes the distances between them to provide unique distinctions. You can use this algorithm for classification tasks that require more accuracy and efficiency of data.

4.) Recommender System Algorithm

The Recommender Algorithm works by filtering and predicting user ratings and preferences for items by using collaborative and content-based techniques. The algorithm filters information and identifies groups with similar tastes to a target user and combines the ratings of that group for making recommendations to that user. It makes global product-based associations and gives personalized recommendations based on a user’s own rating. For example, if a user likes the TV series ‘The Flash’ and likes the Netflix channel, then the algorithm would recommend shows of a similar genre to the user.

5.) Regression Machine Learning Algorithms

Regression Machine Learning Algorithms are of two types – Linear regression and logistic regression.

Linear Regression

Linear regression is one of the easiest to understand Machine Learning Algorithms for beginners. It is basically used to showcase the relationship between dependent and independent variables and show what happens to the dependent variables when changes are made to independent variables. It’s widely used for applications such as sales forecasting, risk assessment analysis in health insurance companies and requires minimal tuning.

Logistic Regression

Logistic Regression is a statistical analysis technique which is used for predictive analysis. It uses binary classification to reach specific outcomes and models the probabilities of default classes. A good example of logistic regression is when credit card companies develop models which decide whether a customer will default on their loan EMIs or not. The best part of logistic regression is that you can include more explanatory (dependent) variables such as dichotomous, ordinal and continuous variables to model binomial outcomes.
Logistic regression is used in applications such as-
·         To Identifying risk factors for diseases and planning preventive measures
·         Classifying words as nouns, pronouns, and verbs
·         Weather forecasting applications for predicting rainfall and weather conditions
·         In voting applications to find out whether voters will vote for a particular candidate or not
6.) Decision Tree Machine Learning Algorithm
You want to buy a video game DVD for your best friend’s birthday but aren’t sure whether he will like it or not. You ask the Decision Tree Machine Learning Algorithm, and it will ask you a set of questions related to his preferences such as what console he uses, what is your budget. It’ll also ask whether he likes RPG or first-person shooters, does he like playing single player or multiplayer games, how much time he spends gaming daily and his track record for completing games.
Its model is operational in nature, and depending on your answers, the algorithm will use forward, and backward calculation steps to arrive at different conclusions.
Applications of this algorithm range from data exploration, pattern recognition, option pricing in finances and identifying disease and risk trends.
7.) Random Forest ML Algorithm
The Random Forest ML Algorithm is a versatile supervised learning algorithm that’s used for both classification and regression analysis tasks. It creates a forest with a number of trees and makes them random. Although similar to the decision trees algorithm, the key difference is that it runs processes related to finding root nodes and splitting feature nodes randomly.
It essentially takes features and constructs randomly created decision trees to predict outcomes, votes each of them and consider the outcome with the highest votes as the final prediction. The random forest algorithm is used in industrial applications such as finding out whether a loan applicant is low-risk or high-risk, predicting the failure of mechanical parts in automobile engines and predicting social media share scores and performance scores.
8.) Principal Component Analysis (PCA) Algorithm
The Principal Component Analysis (PCA) is a dimensionality reduction algorithm, used for speeding up learning algorithms and can be used for making compelling visualizations of complex datasets. It identifies patterns in data and aims to make correlations of variables in them. Whatever correlations the PCA finds is projected on a similar (but smaller) dimensional subspace. The algorithm is used in applications such as gene expression analysis, stock market predictions and in pattern classification tasks that ignore class labels.
9.) Artificial Neural Networks
Artificial Neural Network algorithms consist of different layers which analyze data. There are hidden layers which detect patterns in data and the greater the number of layers, the more accurate the outcomes are. Neural networks learn on their own and assign weights to neurons every time their networks process data.
Convolutional Neural Networks and Recurrent Neural Networks are two popular Artificial Neural Network Algorithms.

Convolutional Neural Networks are feed-forward Neural networks which take in fixed inputs and give fixed outputs. For example – image feature classification and video processing tasks.

Recurrent Neural Networks use internal memory and are versatile since they take in arbitrary length sequences and use time-series information for giving outputs. For example – language processing tasks and text and speech analysis
Essentially, deep learning networks are collectively used in a wide variety of applications such as handwriting analysis, colorization of black and white images, computer vision processes and describing or captioning photos based on visual features.
10.) K-Nearest Neighbors Algorithm
The K-Nearest Neighbors Algorithm is a lazy algorithm that takes a non-parametric approach to predictive analysis. If you have unstructured data or lack knowledge regarding the distribution data, then the K-Nearest Neighbors Algorithm will come to your rescue. The training phase is pretty fast, and there is a lack of generalization in its training processes. The algorithm works by finding similar examples to your unknown example and using the properties of those neighboring examples to estimate the properties of your unknown examples.
The only downside is its accuracy can be affected as it is not sensitive to outliers in data points.
This algorithm is used in industrial applications in tasks such as when a user wants to look for similar items in comparison to others. It’s even used in handwriting detection applications and image/video recognition tasks.


Share:

Copyright © Technotalk | Powered by Academy for brilliance