Simulated Annealing

Simulated Annealing (SA) is a probabilistic technique used for finding an approximate solution to an optimization problem. To find the optimal solution when the search space is large and we search through an enormous number of possible solutions the task can be incredibly difficult, often impossible. Even with today’s modern computing power, there are still often too many possible solutions to consider. Therefore, we often settle for something that’s close enough to optimal solution when we may be not able to find the optimal solution within a certain time.

Continue reading

Advertisements

Introduction Machine Learning: K-nearest neighbors and Perceptron Learning Algorithm

Machine learning is a subfield of computer science where computers have the ability to learn without being explicitly programmed. List of the machine learning task:

  • Supervised: Approximation where the all data is labeled and the algorithms learn to predict the output from the input data (training, cross validation and testing sets). We have two types of supervised problems:
    • Regression: When the output variable is a real value, such as “dollars” or “age”.
    • Classification: When the output variable is a category, such as “cat” or “dog” or “Tumor benign” and “Tumor malignant”.

screen-shot-2017-03-05-at-2-08-54-pmRegression vs Classification

  • Unsupervised: Description where the all data is unlabeled and the algorithms learn to inherent structure from the input data.
    • Clustering: A clustering problem is where you want to discover the inherent groupings in the data, such as grouping customers by purchasing behavior.
    • Association: An association rule learning problem is where you want to discover rules that describe large portions of your data, such as people that buy X also tend to buy Y.

Continue reading

Best Practices of Java Singleton Design Pattern

Singleton Pattern

We have different approaches but all of them have following common concepts to implement Singleton pattern:

  • Private constructor which restricts instantiation of the class from other classes.
  • Private static variable of the same class that is the only instance of the class.
  • Public static method that returns the instance of the class, this is the global access point for outer world to get the instance of the singleton class.

Where do you use the Singleton pattern?

Most of the scenarios, Singleton classes are created for resources such as File System, Database connections etc…

Continue reading