Giter VIP home page Giter VIP logo

clj-knn's People

Contributors

emgrasmeder avatar

Stargazers

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

Watchers

 avatar  avatar

clj-knn's Issues

Optionally handle nested maps

The current, most basic implementation will return a Hamming distance of 1 between

{:abc {:hello "world"
       :goodnight "moon"
       :farewell "auf wiedersehen, goodbye!"}}
{:abc {:hello "darkness my old friend"
       :goodnight "moon"
       :farewell "farewell"}}

because the :abc key's value is not equal. By not flattening the input, we lose fidelity and miss the one similarity that does exist in these maps.

One proposal is to handle flattened maps without adding a weight, thus comparing the following maps instead:

{:abc:hello "world"
 :abc:goodnight "moon"
 :abc:farewell "auf wiedersehen, goodbye!"}}
{:abc:hello "darkness my old friend"
 :abc:goodnight "moon"
 :abc:farewell "farewell"}}

Fix Hamming Distance

Right now the Hamming Distance function does a simple (sort (vals vect)) which can't differentiate between {:a 1 :b 2 :c 3} and {:a 1 :b 2 :d 3}.

The two vectors above should have a Hamming distance of either 1 or 2, but definitely not 0, which it currently calculates.

Make Hamming Distance weighted

Predictive power could be increased if each feature were assigned weight w โˆˆ [0,1].

Dropping features could be weighted 0, more important features would be given weight 1. By default, every feature should be weighted as 1

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.