Skip to main content

Posts

Showing posts with the label knn

KNN and ANN with Vector Database

  Here are the details for both Approximate Nearest Neighbors (ANN) and K-Nearest Neighbors (KNN) algorithms, including their usage in vector databases: Approximate Nearest Neighbors (ANN) Overview Approximate Nearest Neighbors (ANN) is an algorithm used for efficient similarity search in high-dimensional vector spaces. It quickly finds the closest points (nearest neighbors) to a query vector. How ANN Works Indexing: The ANN algorithm builds an index of the vector database, which enables efficient querying. Querying: When a query vector is provided, the algorithm searches the index for the closest vectors. Approximation: ANN sacrifices some accuracy to achieve efficiency, hence "approximate" nearest neighbors. Advantages Speed: ANN is significantly faster than exact nearest neighbor searches, especially in high-dimensional spaces. Scalability: Suitable for large vector databases. Disadvantages Accuracy: May not always find the exact nearest neighbors due to approximations. Us...

Basic Machine Learning Alogrithms

Here is a table of the machine learning algorithms, along with whether they are supervised or unsupervised learning algorithms: Algorithm Supervised Unsupervised Linear regression Supervised No Decision trees Supervised No Random forest Supervised No Ada boost Supervised No Gradient boost Supervised No Logistic regression Supervised No K-nearest neighbors (KNN) Supervised No Support vector machines (SVM) Supervised No K-means Unsupervised Yes Collaborative filtering Unsupervised Yes Principal component analysis (PCA) Unsupervised Yes In supervised learning, the algorithm is given labeled data, which means that the data is paired with the correct output. The algorithm then learns to map the input data to the output data. In unsupervised learning, the algorithm is not given labeled data. The algorithm must learn to find patterns in the data without any guidance. Here is a table of the above machine learning algorithms whether they can be used for regression or classification: Algorith...