Giter Club home page Giter Club logo

blog-posts's Introduction

blog-posts's People

Contributors

imaddabbura avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

blog-posts's Issues

K-means Clustering

Hi Imad,

Your article, K-means Clustering: Algorithm, Applications, Evaluation Methods, and Drawbacks, is great!

I would like to point out a couple of issues:

  • In Kmeans class implementation

    1. In def initializ_centroids, simply putting np.random.RandomState in a line doesn't have an effect (FYR). You could do
      $ r = np.random.RandomState(self.random_state)
      $ random_idx = r.permutation(X.shape[0])
    2. In def predict, old_centroids is out of the scope. You could do
      $ distance = self.compute_distance(X, self.centroids)
    3. In def compute_distance, squaring the calculated distance is unnecessary, although it doesn't hurt. I would do
      $ distance[:, k] = norm(X - centroids[k, :], axis=1)
  • In the Image Compression instance, the following description doesn't make sense to me:
    "The original image size was 396 x 396 x 24 = 3,763,584 bits; however, the new compressed image would be 30 x 24 + 396 x 396 x 4 = 627,984 bits. The huge difference comes from the fact that we’ll be using centroids as a lookup for pixels’ colors and that would reduce the size of each pixel location to 4-bit instead of 8-bit."

    1. The original size of the image is 396 x 396 x 24 because the image has in total 396 x 396 pixels and each pixel has 24-bit color representation; however, after the compression, each pixel has 30 colors that can be represented with at least 5 bits (4-bit can represent 16 colors); Plus the overhead storage of 30 colors, the number of bits should be 30 x 24 + 396 x 396 x 5.
    2. The number of bits at each pixel location is reduced to 5-bit from 24-bit.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.