***During the COVID-19 pandemic, it is important to remember not to panic, but to be precautious and stay safe. Please be sure to wash your hands thoroughly and properly, and practice social distancing at this time.*** Stay safe we can fight this ❤️ Whenever I think of a linear classifier or linear machine learning model the first thing that comes to my mind is the equation y = mx + b. This equation does wonders in sooooo many different fields and applications. It is essentially the foundation of how some ML models make predictions for testing data points. What's 'classification'?Classification is when we use some form of data's characteristics to determine which group the piece of data falls into. For example detecting whether a movie review is "good" or "bad", or grouping email as "spam" or "not spam". These situations all fall into "statistical classification", where the underlying problem is to identify which group a new piece of data belongs to, by using training data to learn the pattern. Linear ClassifiersLinear classifiers use classification on a linear function of inputs. A binary linear classifier uses classification on a linear function and identifies which of the two groups a new observation belongs to. Note: that binary classifiers only deal with two targets or 'groups'. So how would we collect the input data or 'image', (as shown in the previous example above)? When dealing with classification, our data consists of input dimensions or features. It also consists of target variables, which represents the 'end result'. In binary classification, the 'target' variable (or the end result) can be 1 of 2 values (0 or 1, true or false..etc - a binary valued target). An example can be to implement a medical diagnosis system, where you predict whether a certain patient might carry an infection. The input data consists of the patient's history, and symptoms, which are the features, and the target is whether they are carrying the infection or not. A classifier acts as a decision boundary, where one side corresponds to one input, and the other side corresponds to the other input. Inputs and Weights and BiasesA binary target value has two different possibilities, or "classes", which represents the end result (for ex: whether the email was spam, or not spam). In a machine learning model, the training dataset consists of the feature variables and the corresponding target values for those variables. This is for the data we already know about, or have with us. We are going to use this data to predict the target variable for other 'not seen' cases. Hope this makes sense because it does get kind of tricky! So how are the predictions for the unseen data computed from this training data? The model basically computes a linear function (like Y = MX + B) based on something called weights and biases. The model then checks whether the output of the function is greater than or less than a constant threshold, lets call it r. So this is essentially the raw model output: raw model output = coefficients • features + interceptSo the raw model output is basically the dot product of the 'coefficients' (which are the weights) and the feature variables, and an intercept (which is the bias). The weights essentially represent the importance of a particular feature variable in a model. For instance a particular symptom for an infection might be a very critical factor as to whether the patient is infected or not, so it has a greater weight associated with it. So in binary linear classification, if the model output is less than the threshold, it is equivalent to one class; if it is greater than the threshold the data point belongs to the other class. In this example, the threshold value is 0. Therefore, if the model output is a positive value, it is predicted as one class, and if the output is negative, the model predicts it as the other class. The linear classifier is the decision boundary (which is the line). Along the line, the outputs are 0. If the intercept changes, the line's orientation also changes (so does the data value points). If the weights or coefficients of the linear function change, the line's slope value and shape change as well. There are lots lots and lots of applications that are correlated with linear classification. And there are also other models which use multi class linear classification, instead of with just 2 classes.
0 Comments
Ok so today my professor decided to tell us a Halloween joke, and I thought it was the funniest thing ever: "What is the circumference of a jack-o-lantern divided by its diameter??" Pumpkin pi !!!!!!!!!!!! lol, i thought it was funny!!!!!!!!!!!! (its ok if you didn't) :) happy halloween lol i didn't really dress up like anything because I barely even have time to fully get ready in the morning, but if "a student who is heading over to class to take her exam in matrices" counts as a costume, then yeah sure, I did "dress up". Ok so I was reading this article a while ago about implementing AI algorithms in hardware chips, and I was like WOW?!!! That sounds VERY VERY cool and interesting, and can be valuable and have a positive impact in so many other industries. So recently, deep learning and machine learning have become pretty big things. This is because it can be used in practically any context. However, it also requires an intensive amount of algorithms, and complex processes. We need efficient tools to accelerate the tasks of Artificial Intelligence. But what is deep learning, machine learning, artificial intelligence? I feel like these are like the main words everyone using lol, but we need to understand why we use these types of "learnings". We use ML (abbreviation for machine learning cuz I've already used it 100 times lol) to make a machine intelligent without explicitly programming it. intro to machine learning, deep learningSo lets start with machine learning. It is one of the new technologies that is out right now. If you haven't heard of the term, thats totally cool! It is a pretty new thing, and many industries (not even tech related btw) are using machine learning to efficiently do human tasks. Machine Learning is a branch of study all about training a machine (computer for example) to do complete tasks without explicitly programming it. Image classification is an excellent example to explain machine learning. If you want a computer to classify a specific image as a cat, you would train your computer to learn certain features of the cat that are distinguishable from another animal. Another example is being able to detect if your email is spam or not. So you basically need to feed in large amounts of data to your machine learning model for it to learn patterns from that data, and accurately predict future datasets. This requires lots of algorithms and processes, which is where deep learning comes into play. Deep Learning uses an algorithm called neural networks to process, classify and make predictions on data sets. In order to get accurate results, you need LOTS of data. When you need more datasets, its gonna take a longer time to efficiently analyze the data. This is where accelerating the 'analysis' of data comes into play: and hardware processors can take care of that. Making a processor/microcontroller do many "intelligent" things sounds like such an amazing feat. In order to run such complex neural networks and process so much data and information, you need powerful and efficient processors. But what processors do we use? Which ones are the most efficient? what is a CPU?A CPU is basically the brain of a computer: the Central Processing Unit. It essentially executes and performs all of the instructions (in a program, software, application..etc.) such as logical operations, arithmetic, and I/O (input/output - communication between devices). A long time ago, CPUs were built with one core - which means they could only perform one task at a time. However, due to advancements in technology, we can now build multi-core CPUs - which means they are able to perform couple more tasks at a time. CPUs vs. GPUsA GPU is called a Graphical Processing Unit, and its designed differently compared to the CPU. A GPU has many, many more cores, and they are much smaller compared to the ones in the CPU. The cores are designed like this so that parallel, but simple computation (since the cores are smaller) can be performed, and many tasks can my completed simultaneously. GPUs are used a lot in the gaming industry, for image processing and computer graphics (hence the term "Graphics Processing Unit"). In general, the design of the GPU makes algorithms more efficient, compared to the design of a CPU. A great example of the development of GPUs is NVIDIA's platform called CUDA! NVIDIA's CUDA computing platform uses GPUs to make algorithms and computing more efficient and fast for developers. ....and which one is better?This totally totally depends on what situation you are working on. If you are working with deep learning and ML models, chances are that GPUs are a better fit. This is because ML requires a lot of matrix math related calculations, which can be really effective if done in parallel. CPUs are better for more complex but sequential, step by step math or logical problems. Also, there is a huge cost factor too. GPUs generally cost more than CPUs, so there are multiple factors to consider before coming to a decision.
A lot of people say "S..Q..L", by separating the letters or some pronounce it as "sequel". It's up to you, I like "sequel", it just sounds cooler. SQL is a superrrrrrrrrrr important skill to learn when dealing with huge amounts of data sets. SQL, which stands for Structured Query Language, is a programming language used for retrieving data and manipulating the data models (aka in table format). To specify that, it is used to extract data from a relational database. A relational database is basically a bunch of tables put together. This skill is very useful for applications in machine learning, when you are dealing with a vast amount of data sets and you need a way to extract the important information so you can predict things with future data. In a table, the rows are the records of the database, and the columns are the fields or parameters of the data. So for example, if we were dealing with a table of movies, then the fields of a movie can be 'genre', 'rating' and 'duration'. Every row, or record, would consist of a single movie. The 'SELECT' and 'FROM' commandsJust like any other programming language, SQL comes with certain syntax. The syntax is used to gather specific information from a huge table, so you can process the most important and valuable information you need. The SELECT and FROM commands are one of the foundational commands of SQL, used to extract the columns of a table. The commands in SQL can be in uppercase or lowercase, but most people prefer uppercase since its easier to distinguish from the column and table names. For instance, if we had a table featuring regular customers in a store, and we want to extract the name column of the customers table, we would write: SQL Tutorial 1
Suppose our customer database kinda looks like the one above. The above commands are basically focusing on the 'name' column in the table, highlighted in orange. What if you also wanted to take in the age aspect of the customers into consideration? If you want to select more than one column of a table, you simply have to add a comma to the SELECT statement and type in the additional column right next to it. Also, at the end of every SQL statement, we have to add a semicolon for the compiler to understand that the SQL commands are over. If you want to select all of the columns of the table (so you are essentially selecting the whole table), you need to type in the asterisk symbol next to SELECT like this: ' WHERE', 'LIKE' and 'AND' commandswhat if you want to make your commands even more specific and extract those details from large datasets? What if you want to get the names of the customers that start with the letter A? Or what if you wanted to get the customers who are 18-25 years old? To filter a dataset, you can use the WHERE command. The 'WHERE' command allows you to filter the data in order to get the information you need. So, if you want to get the names of the customers who are in 18-25 age range, you first select all of the column 'name' from the customers table. Then, you use WHERE to get the names of the customers who are 18 years old or older. But we have a boundary. We need to get the customers who are younger than 25 AND older than 18. This is where the AND command comes in. The AND command allows you to combine conditions of a particular field. So since we need to find customers who are older than 18 but younger than 25, we can use the AND command to restrict the range of the age. To get the customers who are 18-25 years old
That's a wrap for SQL! These are like the simple, intro commands; there are lots more!!!!!!!!!!!!!!!!!
Machine learning is one of the most interesting and advancing aspects of engineering and computer science. It shows you the potential of machines in our modern day world. Machine learning is essentially making a machine learn to perform different tasks by feeding enormous amounts of data. To accomplish this, there are multiple algorithms used for machines to learn and adapt to perform a task easier with new inputs. One of the algorithms is called neural networks. A Neural Network (usually abbreviated as NN) is a learning algorithm that is very similar to a biological neural network. Before going into depth of a neural network (more in depth posts coming up), lets take a look at what kinds of machine learning problems there are and their classifications:
An example of Supervised learning is segregating spam and not spam mail. The computer takes in bunch of mail, and uses a machine learning algorithm to assign the mail one output; either spam, or not spam. The machine does this by learning from previous examples of inputs and it grasps the algorithm or pattern to use for future inputs.
|
Archives
December 2020
Topics
All
|