Skip to main content

Machine Learning

 

 Machine Learning:

The field of study that gives computer the ability to learn without being explicitly programmed.

 Types:

  • Supervised Learning
  • Unsupervised Learning  
  • Recommender Systems
  • Reinforcement Learning   

Supervised Learning:

    It is a method in which we give our algorithm both inputs and outputs, and the algorithm automatically generates an algorithm or mappings, so that at some point, that generated algorithm is so effective that if we give them inputs, respective outputs are automatically generated. 

The Two Main Types

  1. Regression: Predicting a number (e.g., predicting the price of a house).

  2. Classification: Predicting a category (e.g., deciding if an email is "Spam" or "Not Spam"). 

 

     Example:

 

  Here in this example, to predict the prices of houses, we plotted a graph, and we observed that we could use the function of curve to find the unknown value. But computers can't plot the graph and analyze here function of curve would be better. So, we need to figure some way to decide which function would be better here, or maybe some general function which can be applied to anything (right now i am guessing, function of derivation would be applied).

 Regression: 

 This type is called regression. In this type, we are trying to predict the number from infinitely many possible outputs.

In simple terms, regression is about predicting a specific number.

If you're trying to figure out a price, a temperature, or a score based on other data, you're doing regression.

Classification:

In classification, we usually do identification, like identifying a spam or identifying whether patient has breast cancer or not? In it the outcomes are limited (finite), not like regression, in which possible outcomes are infinite.

Key Types

  • Binary Classification: Only two choices (Yes/No, 0/1, True/False).

  • Multiclass Classification: More than two choices (Red, Blue, or Green). 

    The model looks at the data features and tries to find a boundary that separates the different groups. When you give it new data, it just checks which side of the boundary that data falls on.

    Want to see the common algorithms used for this, or should we talk about the difference between this and Regression?

     

    Example:

      

     

    SUMMARY:

      

     

Unsupervised Learning: 

A type of learning, in which we just give inputs to the model and it automatically find some meaningful information like structures, groups or meaningful outliers (exceptions).

Types:

1. Clustering

  • Definition: Automatically grouping data points that are "similar" based on their features.

  • Logic: If points are mathematically close to each other, they become a group (cluster).

  • Example: Grouping news articles by topic (Sports, Tech, Politics) without being told what the topics are.

2. Anomaly Detection

  • Definition: Identifying data points that are significantly different from the "normal" pattern.

  • Logic: The model learns what "average" looks like and flags anything that sits way outside that range.

  • Example: A bank flagging a $5,000 transaction in another country when you usually spend $20 on lunch locally.

 

 

 

Comments

Popular posts from this blog

Java Servlets

  According to me its just a translator, who manages the HTTP requests and handle them to the appropriate function of the API. So then, API turns out to be a term or set of those functions which are kept public. Now let us see in little bit of detail what servlets are: For that we need to see few terms: Static Web Pages: Static web pages are the pages, which are already built, and whose content and design always remain the same.  For Example: About us page of some website. Contact info page of some website Dynamic Web Pages: Dynamic pages are not already defined. They are dependent on search queries. For Example: If we search top 5 books, and click on search button, result would be different. If we search top 5 countries and enter search, result would be different.  So, the search result for every search is different. Working: Now if we have to search static page let's say the first page of any website (which is same for every use in every country) then the process is sim...

What is an API? A Simple Explanation for Programming Beginners

API What is an interface? Interface is a control system, through which we can use something. For Example: The interface of car includes: Steering Wheel Brakes Gear Acceleration pedal Mirrors Interface is concerned with the fact that how to use something, rather than how it works. The Easiest Analogy for an API : The Restaurant Imagine you're at a  restaurant . You are the user. You want food (data or a service). You can't just walk into the kitchen and start cooking. That would be  chaotic  and unsafe! Instead, you interact with the  waiter . You look at a  menu  (the  API  documentation) and give your order to the waiter. The waiter takes your request to the kitchen. The kitchen prepares your food. The waiter then brings the response (your delicious meal) back to you. The  waiter  is the contract, the messenger, the interface in our case the  API . They provide a secure and simple way for you to get what you need from the kitchen ...

Why do I need to create Java Classes? Why don't just use database for searching?

The Bridge Between Data and Display A Conceptual Guide to Java, Databases, and the "Why" behind the Code. 1. The Core Problem When building a web application, you have data sitting in a Database (SQL Server) and a user waiting at a Browser . The challenge is moving that data efficiently and safely. Beginners often ask: "Why do I need to create Java Classes ( Student.java ) and copy data into Lists? Why can't I just print the database results directly to the screen?" To answer this, we must understand how the database actually talks to Java. 2. The Anatomy of a Connection The ResultSet is NOT Data — It is a "Live Wire" A common misconception is that when you run a query, the data is instantly sent to your Java program. It is not. The ResultSet is a Cursor (Pointer) . It points to a row on the database hard drive. The Connection is a Pipe . The Streaming Analogy: Think of a ResultSet like a Phone Call . When you say rs.next() , you are asking the da...