repo stringlengths 1 191 ⌀ | file stringlengths 23 351 | code stringlengths 0 5.32M | file_length int64 0 5.32M | avg_line_length float64 0 2.9k | max_line_length int64 0 288k | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
JSAT | JSAT-master/JSAT/src/jsat/linear/DenseVector.java |
package jsat.linear;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import static java.lang.Math.*;
import java.util.Arrays;
import java.util.List;
/**
* A vector implementation that is dense, meaning all values are allocated -
* even if their values will be impli... | 13,966 | 26.332681 | 150 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/EigenValueDecomposition.java |
package jsat.linear;
import java.io.Serializable;
import static java.lang.Math.*;
import java.util.Arrays;
import java.util.Comparator;
import jsat.math.Complex;
import jsat.utils.DoubleList;
import jsat.utils.IndexTable;
/**
* Class for performing the Eigen Value Decomposition of a matrix. The EVD of a
* real ma... | 37,976 | 29.09271 | 138 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/GenericMatrix.java |
package jsat.linear;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.List;
import java.util.ArrayList;
import java.util.concurrent.Callable;
import jsat.utils.FakeExecutor;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
imp... | 32,697 | 33.785106 | 168 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/HessenbergForm.java | package jsat.linear;
import java.io.Serializable;
import java.util.concurrent.ExecutorService;
import static jsat.linear.Matrix.*;
/**
*
* @author Edward Raff
*/
public class HessenbergForm implements Serializable
{
private static final long serialVersionUID = 1411467026933172901L;
public static void hess(Matr... | 3,508 | 34.806122 | 148 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/IndexValue.java |
package jsat.linear;
/**
* The value at a specified index for one dimension. This is a tool mean for use with sparce data structures.
* The values should not be backed by any list, and changes to the IndexValue should not alter any data
* structures. This class is mean to be returned by an iterator, and the iter... | 1,453 | 21.369231 | 110 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/LUPDecomposition.java |
package jsat.linear;
import java.io.Serializable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;
import jsat.utils.SystemInfo;
/**
* This class uses the LUP decomposition of a matrix to provide efficient metho... | 12,001 | 30.920213 | 192 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/Lanczos.java | /*
* This implementation has been contributed under the Public Domain.
*/
package jsat.linear;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Random;
import jsat.utils.random.RandomUtil;
/**
* Computes the top <i>k</i> Eigen Values and Eigen Vectors of a symmetric
* matrix <b>A<sup>n,n</s... | 6,476 | 32.559585 | 147 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/Matrix.java |
package jsat.linear;
import java.io.Serializable;
import java.util.Iterator;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;
import jsat.utils.ModifiableCountDownLatch;
import static jsat... | 37,415 | 32.023831 | 128 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/MatrixOfVecs.java | package jsat.linear;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* This class provides a base mechanism to create a Matrix 'view' from a list of
* {@link Vec} objects. The vector objects will be used to back the rows of the
* matrix, so changes to one are shown in the other. If... | 6,362 | 29.014151 | 168 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/MatrixStatistics.java |
package jsat.linear;
import static java.lang.Math.pow;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Random;
import java.util... | 27,972 | 37.797503 | 155 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/Poly2Vec.java |
package jsat.linear;
import java.util.Arrays;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* This class is used to create an implicit representation of the degree 2
* polynomial of an input vector, with an implicit bias term added so that the
* original vector values are present in the ... | 11,703 | 34.466667 | 167 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/QRDecomposition.java |
package jsat.linear;
import java.io.Serializable;
import java.util.concurrent.ExecutorService;
import static java.lang.Math.*;
/**
*
* @author Edward Raff
*/
public class QRDecomposition implements Serializable
{
private static final long serialVersionUID = 7578073062361216223L;
private Matrix Q_T, R;
pub... | 2,574 | 23.292453 | 97 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/RandomMatrix.java | package jsat.linear;
import java.util.Random;
import jsat.utils.random.RandomUtil;
/**
* Stores a Matrix full of random values in constant O(1) space by re-computing
* all matrix values on the fly as need. This allows memory reduction and use
* when it is necessary to use the matrix with a large sparse data set,... | 4,833 | 29.594937 | 85 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/RandomVector.java | package jsat.linear;
import java.util.Random;
import jsat.utils.random.RandomUtil;
/**
* Stores a Vector full of random values in constant O(1) space by re-computing
* all matrix values on the fly as need. This allows memory reduction and use
* when it is necessary to use the matrix with a large sparse data set,... | 5,612 | 25.352113 | 150 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/RowColumnOps.java |
package jsat.linear;
/**
* A collection of mutable Row and Column operations that can be performed on matrices.
* @author Edward Raff
*/
public class RowColumnOps
{
/**
* Updates the values along the main diagonal of the matrix by adding a constant to them
* @param A the matrix to perform the update... | 16,931 | 37.657534 | 146 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/ScaledVector.java |
package jsat.linear;
import java.util.Collections;
import java.util.Iterator;
/**
* A wrapper for a vector that represents the vector multiplied by a scalar
* constant. This allows for using and altering the value multiplied by a
* constant factor quickly, especially when the multiplicative factor must be
* c... | 6,599 | 20.568627 | 80 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/ShiftedVec.java |
package jsat.linear;
import static java.lang.Math.abs;
import static java.lang.Math.pow;
import java.util.Iterator;
/**
* A wrapper for a vector that represents the vector added with a scalar value.
* This allows for using and altering the value added by a
* constant factor quickly. Mutable operations will alter... | 9,642 | 26.011204 | 144 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/SingularValueDecomposition.java | package jsat.linear;
import java.io.Serializable;
import java.util.Arrays;
import java.util.concurrent.ExecutorService;
import static java.lang.Math.*;
import static jsat.linear.RowColumnOps.*;
/**
* The Singular Value Decomposition (SVD) of a matrix A<sub>m,n </sub> = U<sub>m,n </sub> Σ<sub>n,n </sub> V<sup>T... | 23,684 | 29.133588 | 143 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/SparseMatrix.java | package jsat.linear;
import java.util.Arrays;
import java.util.Iterator;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;
import jsat.utils.SystemInfo;
/**
* Creates a new Sparse Matrix where each row is backed b... | 20,011 | 31.43436 | 168 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/SparseVector.java |
package jsat.linear;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import static java.lang.Math.*;
import java.util.*;
import jsat.math.Function1D;
import jsat.math.IndexFunction;
import jsat.utils.DoubleList;
import jsat.utils.IndexTable;
/**
* Provides a vector i... | 28,958 | 29.19708 | 207 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/SubMatrix.java |
package jsat.linear;
/**
* This class allows for the selection of an area of a matrix to operate on independently.
* Mutable matrix operations perform on this sub matrix, will be visible in the base matrix
* given. This allows for easy implementation of blocking algorithms, but care must be taken
* to not create... | 7,520 | 37.968912 | 160 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/SubVector.java |
package jsat.linear;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* SubVector takes an already existing vector and creates a new one that is a
* subset of and backed by the original one. Altering the sub vector will effect
* the original and vise versa.
*
* @author Edward Raff
*/... | 3,653 | 28 | 135 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/TransposeView.java |
package jsat.linear;
/**
* This class provides a free view of the transpose of a matrix. This is done by accessing
* the matrix elements in swapped order. This has a serious performance impact. If the base
* matrix storage is row major order, then accessing the TransposeView in column major order
* will provid... | 1,500 | 18.24359 | 93 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/TruncatedSVD.java | /*
* This implementation contributed under the Public Domain.
*/
package jsat.linear;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.nextUp;
import java.util.Arrays;
/**
* Computes the Truncated version of the Singular Value Decomposition (SVD).
* Given a rectang... | 6,501 | 30.110048 | 138 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/Vec.java |
package jsat.linear;
import java.io.Serializable;
import static java.lang.Math.*;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Random;
import jsat.math.Function1D;
import jsat.math.IndexFunction;
import jsat.utils.random.RandomUtil;
/**
* Vec is a object representing the math concept of a ve... | 35,449 | 28.99154 | 150 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/VecOps.java |
package jsat.linear;
import java.util.Iterator;
import jsat.math.Function;
import jsat.math.Function1D;
/**
* This class provides efficient implementations of use full vector
* operations and updates. The implementations are efficient for
* both dense and sparse vectors.
*
* @author Edward Raff
*/
public c... | 5,382 | 34.649007 | 117 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/VecPaired.java |
package jsat.linear;
import java.util.Comparator;
import java.util.Iterator;
/**
* This data structure allows to wrap a Vector so that it is
* associated with some object time. Note, that operations
* that return a vector will not be a Paired Vector, as there
* is no reason to associate a different vector wit... | 6,558 | 17.476056 | 109 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/VecPairedComparable.java | package jsat.linear;
/**
* Utility class for using {@link VecPaired} when the paired value is comparable
* , and the vectors need to be sorted based on their paired value. This class
* performs exactly the same, and its only modification is that it is comparable
* based on the paired object type.
*
* @author ... | 764 | 26.321429 | 145 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/VecWithNorm.java | package jsat.linear;
import java.util.Iterator;
/**
* A wrapper for a vector that allows for transparent tracking of the 2-norm of
* the base vector. This class is meant primarily for use when most updates are
* done by sparse vectors accumulated to a single dense vector. If there are
* only O(s) non zero valu... | 4,472 | 23.178378 | 111 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/ChebyshevDistance.java |
package jsat.linear.distancemetrics;
import java.util.List;
import java.util.concurrent.ExecutorService;
import jsat.linear.Vec;
/**
* Chebyshev Distance is the L<sub>∞</sub> norm.
*
* @author Edward Raff
*/
public class ChebyshevDistance implements DistanceMetric
{
private static final long serialV... | 1,259 | 17.529412 | 79 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/CosineDistance.java |
package jsat.linear.distancemetrics;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;
import jsat.linear.Vec;
import jsat.utils.DoubleList;
import jsat.utils.FakeExecutor;
import jsat.utils.... | 4,700 | 26.491228 | 124 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/CosineDistanceNormalized.java | package jsat.linear.distancemetrics;
import java.util.List;
import java.util.concurrent.ExecutorService;
import jsat.linear.Vec;
/**
* This distance metric returns the same cosine distance as
* {@link CosineDistance}. This implementation assumes that all vectors being
* passed in for distance computations have al... | 1,917 | 24.918919 | 80 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/DenseSparseMetric.java | package jsat.linear.distancemetrics;
import jsat.linear.Vec;
/**
* Many algorithms require computing the distances from a small set of points to
* many other points. In these scenarios, if the small set of points contain
* dense vectors - and the large set contain sparse vectors, a large amount of
* unnecessary... | 1,861 | 42.302326 | 81 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/DistanceCounter.java | /*
* Copyright (C) 2017 Edward Raff <Raff.Edward@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
... | 3,904 | 24.522876 | 99 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/DistanceMetric.java |
package jsat.linear.distancemetrics;
import java.io.Serializable;
import java.util.List;
import java.util.concurrent.ExecutorService;
import jsat.linear.Vec;
/**
* A distance metric defines the distance between two points in a metric space.
* There are three necessary properties for a metric to be valid,
* {@li... | 10,439 | 41.612245 | 145 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/EuclideanDistance.java |
package jsat.linear.distancemetrics;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;
import jsat.linear.IndexValue;
import jsat.linear.Vec;
import jsat.utils.DoubleList;
import jsat.utils.F... | 4,046 | 24.77707 | 128 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/JaccardDistance.java | /*
* Copyright (C) 2017 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 6,622 | 27.670996 | 135 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/KernelDistance.java |
package jsat.linear.distancemetrics;
import java.util.List;
import jsat.classifiers.knn.NearestNeighbour;
import jsat.distributions.kernels.*;
import jsat.linear.Vec;
/**
* Creates a distance metric from a given kernel trick.
* For the distance metric to be valid, the kernel used
* must be positive definite.
*... | 3,069 | 22.615385 | 136 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/MahalanobisDistance.java |
package jsat.linear.distancemetrics;
import java.util.List;
import jsat.DataSet;
import jsat.classifiers.ClassificationDataSet;
import jsat.linear.*;
import jsat.regression.RegressionDataSet;
import jsat.utils.concurrent.ParallelUtils;
/**
* The Mahalanobis Distance is a metric that takes into account the variance ... | 5,570 | 25.783654 | 115 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/ManhattanDistance.java |
package jsat.linear.distancemetrics;
import java.util.List;
import java.util.concurrent.ExecutorService;
import jsat.linear.IndexValue;
import jsat.linear.Vec;
/**
* Manhattan Distance is the L<sub>1</sub> norm.
*
* @author Edward Raff
*/
public class ManhattanDistance implements DenseSparseMetric
{
priva... | 1,731 | 19.139535 | 74 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/MinkowskiDistance.java | package jsat.linear.distancemetrics;
import java.util.List;
import java.util.concurrent.ExecutorService;
import jsat.linear.IndexValue;
import jsat.linear.Vec;
/**
* Minkowski Distance is the L<sub>p</sub> norm.
*
* @author Edward Raff
*/
public class MinkowskiDistance implements DenseSparseMetric
{
privat... | 2,711 | 21.229508 | 118 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/NormalizedEuclideanDistance.java | package jsat.linear.distancemetrics;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;
import jsat.DataSet;
import jsat.classifiers.ClassificationDataSet;
import jsat.datatransform.UnitVarianc... | 5,665 | 24.522523 | 127 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/PearsonDistance.java |
package jsat.linear.distancemetrics;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ExecutorService;
import jsat.linear.IndexValue;
import jsat.linear.Vec;
/**
* A valid distance metric formed from the Pearson Correlation between two vectors.
* The distance in the range of [0, 1].
... | 8,789 | 31.798507 | 122 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/SquaredEuclideanDistance.java |
package jsat.linear.distancemetrics;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;
import jsat.linear.SparseVector;
import jsat.linear.Vec;
import jsat.utils.DoubleList;
import jsat.utils... | 3,684 | 24.413793 | 141 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/TrainableDistanceMetric.java |
package jsat.linear.distancemetrics;
import java.util.List;
import java.util.concurrent.ExecutorService;
import jsat.DataSet;
import jsat.classifiers.ClassificationDataSet;
import jsat.linear.Vec;
import jsat.regression.RegressionDataSet;
/**
* Some Distance Metrics require information that can be learned from the ... | 9,780 | 39.251029 | 118 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/distancemetrics/WeightedEuclideanDistance.java |
package jsat.linear.distancemetrics;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;
import jsat.linear.Vec;
import jsat.linear.VecOps;
import jsat.utils.DoubleList;
import jsat.utils.FakeE... | 4,372 | 25.185629 | 107 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/solvers/ConjugateGradient.java |
package jsat.linear.solvers;
import jsat.linear.DenseVector;
import jsat.linear.Matrix;
import jsat.linear.Vec;
/**
* Provides an iterative implementation of the COnjugate Gradient Method.
* <br><br>
* The Conjugate method, if using exact arithmetic, produces the exact result after a finite
* number of iterati... | 6,931 | 35.87234 | 120 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/BallTree.java | /*
* Copyright (C) 2018 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 41,434 | 34.475171 | 143 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/BaseCaseDT.java | /*
* Copyright (C) 2018 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 848 | 30.444444 | 72 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/CoverTree.java | /*
* Copyright (C) 2017 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 30,611 | 33.865604 | 147 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/DCI.java | /*
* Copyright (C) 2019 Edward Raff <Raff.Edward@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
... | 15,535 | 25.110924 | 112 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/DefaultVectorCollection.java | /*
* Copyright (C) 2018 edwardraff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distrib... | 3,225 | 25.016129 | 100 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/DualTree.java | /*
* Copyright (C) 2018 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 26,555 | 36.350211 | 168 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/IncrementalCollection.java | /*
* Copyright (C) 2017 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 1,781 | 38.6 | 81 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/IndexDistPair.java | /*
* Copyright (C) 2017 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 1,737 | 23.478873 | 80 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/IndexNode.java | /*
* Copyright (C) 2018 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 5,344 | 28.860335 | 117 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/IndexTuple.java | /*
* Copyright (C) 2018 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 1,186 | 24.804348 | 72 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/KDTree.java |
package jsat.linear.vectorcollection;
import java.io.Serializable;
import java.util.*;
import java.util.concurrent.ExecutorService;
import jsat.linear.IndexValue;
import jsat.linear.Vec;
import jsat.linear.distancemetrics.*;
import jsat.math.FastMath;
import jsat.math.OnLineStatistics;
import jsat.utils.*;
import js... | 23,374 | 32.827786 | 142 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/RTree.java |
package jsat.linear.vectorcollection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Stack;
import java.util.stream.Collectors;
import jsat.linear.DenseVector;
import jsat.linear.Vec;... | 32,558 | 30.336862 | 146 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/RandomBallCover.java | package jsat.linear.vectorcollection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import jsat.linear.Vec;
import jsat.linear.distancemetrics.DistanceMetric;
import jsat.utils.*;
import static java.lang.Math.*;
import jsat.linear.dis... | 17,903 | 35.390244 | 115 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/RandomBallCoverOneShot.java | package jsat.linear.vectorcollection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutorService;
import jsat.linear.Vec;
import jsat.linear.distancemetrics.DistanceMetric;
import jsat.linear.distancemetrics.EuclideanDistance;
i... | 8,993 | 30.893617 | 100 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/SVPTree.java | package jsat.linear.vectorcollection;
import java.io.Serializable;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Stack;
import java.util.concu... | 36,107 | 34.022308 | 143 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/ScoreDT.java | /*
* Copyright (C) 2018 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 1,746 | 30.763636 | 80 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/ScoreDTLazy.java | /*
* Copyright (C) 2018 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 1,036 | 27.805556 | 74 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/VPTree.java | package jsat.linear.vectorcollection;
import java.io.Serializable;
import static java.lang.Math.min;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.List;
import java.util.Random;
import java.util.Stack;
import jav... | 45,817 | 35.363492 | 144 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/VPTreeMV.java |
package jsat.linear.vectorcollection;
import java.util.List;
import java.util.Random;
import jsat.linear.Vec;
import jsat.linear.distancemetrics.DistanceMetric;
import jsat.math.OnLineStatistics;
import jsat.utils.Pair;
/**
* The VPTreeMV is an extension of the VPTree, the MV meaning "of Minimum Variance". This ext... | 3,575 | 30.646018 | 146 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/VectorArray.java |
package jsat.linear.vectorcollection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import jsat.linear.Vec;
import jsat.linear.distancemetrics.DistanceMetric;
import jsat.linear.distancemetrics.EuclideanDistance;
import jsat.utils.BoundedSortedList;
import jsat.utils.DoubleList;
impo... | 5,014 | 26.707182 | 100 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/VectorCollection.java |
package jsat.linear.vectorcollection;
import java.io.Serializable;
import static java.lang.Math.max;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Int... | 10,767 | 38.443223 | 161 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/VectorCollectionUtils.java |
package jsat.linear.vectorcollection;
import java.util.*;
import java.util.concurrent.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import jsat.linear.Vec;
import jsat.linear.VecPaired;
import jsat.math.OnLineStatistics;
import jsat.utils.ListUtils;
import sta... | 13,447 | 45.532872 | 215 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/lsh/E2LSH.java | package jsat.linear.vectorcollection.lsh;
import java.util.List;
import jsat.distributions.Normal;
import jsat.linear.Vec;
import static java.lang.Math.*;
import java.util.*;
import jsat.linear.DenseVector;
import jsat.linear.VecPaired;
import jsat.linear.VecPairedComparable;
import jsat.linear.distancemetrics.Dist... | 12,248 | 33.897436 | 128 | java |
JSAT | JSAT-master/JSAT/src/jsat/linear/vectorcollection/lsh/RandomProjectionLSH.java | package jsat.linear.vectorcollection.lsh;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import jsat.linear.*;
import jsat.linear.distancemetrics.CosineDistance;
import jsat.linear.distancemetrics.CosineDistanceNormalized;
import jsat.linear.distancemetrics.Distanc... | 11,465 | 31.76 | 125 | java |
JSAT | JSAT-master/JSAT/src/jsat/lossfunctions/AbsoluteLoss.java | package jsat.lossfunctions;
/**
* The AbsoluteLoss loss function for regression <i>L(x, y) = |x-y|</i>.
* <br>
* This function is only one differentiable.
*
* @author Edward Raff
*/
public class AbsoluteLoss implements LossR
{
private static final long serialVersionUID = -3398199227407867808L;
/**
... | 1,864 | 18.840426 | 89 | java |
JSAT | JSAT-master/JSAT/src/jsat/lossfunctions/EpsilonInsensitiveLoss.java | package jsat.lossfunctions;
/**
* The ε-insensitive loss for regression <i>L(x, y) =
* max(0, |x-y|-ε)</i> is the common loss function used for Support
* Vector Regression. <br>
* When ε = 0, the loss becomes equivalent to the {@link AbsoluteLoss}.
*
* @author Edward Raff
*/
public cla... | 2,895 | 22.737705 | 91 | java |
JSAT | JSAT-master/JSAT/src/jsat/lossfunctions/HingeLoss.java | package jsat.lossfunctions;
import jsat.classifiers.CategoricalResults;
import jsat.linear.Vec;
/**
* The HingeLoss loss function for classification <i>L(x, y) = max(0, 1-y*x)</i>
* . This also includes the multi-class version of the hinge loss.
* <br>
* This function is only once differentiable.
*
* @author E... | 4,148 | 24.29878 | 276 | java |
JSAT | JSAT-master/JSAT/src/jsat/lossfunctions/HuberLoss.java | package jsat.lossfunctions;
/**
* The HuberLoss loss function for regression. The HuberLoss loss switches between
* {@link SquaredLoss} and {@link AbsoluteLoss} loss based on a threshold value.
* <br>
* This function is only partially twice differentiable.
*
* @author Edward Raff
*/
public class HuberLoss imple... | 3,381 | 22.164384 | 111 | java |
JSAT | JSAT-master/JSAT/src/jsat/lossfunctions/LogisticLoss.java | package jsat.lossfunctions;
import static java.lang.Math.*;
import jsat.classifiers.CategoricalResults;
/**
* The LogisticLoss loss function for classification <i>L(x, y) =
* log(1+exp(-y*x))</i>.
* <br>
* This function is twice differentiable.
*
* @author Edward Raff
*/
public class LogisticLoss implements L... | 3,490 | 22.910959 | 152 | java |
JSAT | JSAT-master/JSAT/src/jsat/lossfunctions/LossC.java | package jsat.lossfunctions;
import jsat.classifiers.CategoricalResults;
/**
* Specifies a loss function for binary classification problems.
*
* @author Edward Raff
*/
public interface LossC extends LossFunc
{
/**
* Computes the getLoss for a classification problem.
*
* @param pred the predicte... | 1,546 | 26.625 | 79 | java |
JSAT | JSAT-master/JSAT/src/jsat/lossfunctions/LossFunc.java | package jsat.lossfunctions;
import java.io.Serializable;
/**
* Provides a generic interface for some loss function on some problem that can
* be described with a single real prediction value and a single real expected
* value.
* <br><br>
* A loss function must be non-negative and should be convex.
*
* @author ... | 2,613 | 33.853333 | 157 | java |
JSAT | JSAT-master/JSAT/src/jsat/lossfunctions/LossMC.java | package jsat.lossfunctions;
import jsat.classifiers.CategoricalResults;
import jsat.linear.Vec;
/**
* Specifies a loss function for multi-class problems. A multi-class loss
* function must support a raw vector of scores for each class, where positive
* values indicate preference for the class associated with the... | 2,150 | 36.736842 | 80 | java |
JSAT | JSAT-master/JSAT/src/jsat/lossfunctions/LossR.java | package jsat.lossfunctions;
/**
* Specifies a getLoss function for regression problems.
*
* @author Edward Raff
*/
public interface LossR extends LossFunc
{
/**
* Computes the getLoss for a regression problem.
*
* @param pred the predicted value in (-Infinity, Infinity)
* @param y the true... | 1,546 | 28.188679 | 80 | java |
JSAT | JSAT-master/JSAT/src/jsat/lossfunctions/SoftmaxLoss.java | package jsat.lossfunctions;
import jsat.classifiers.CategoricalResults;
import jsat.linear.Vec;
import jsat.math.MathTricks;
/**
* The Softmax loss function is a multi-class generalization of the
* {@link LogisticLoss Logistic loss}.
*
* @author Edward Raff
*/
public class SoftmaxLoss extends LogisticLoss imp... | 1,161 | 23.208333 | 70 | java |
JSAT | JSAT-master/JSAT/src/jsat/lossfunctions/SquaredLoss.java | package jsat.lossfunctions;
/**
* The SquaredLoss loss function for regression <i>L(x, y) = (x-y)<sup>2</sup></i>.
* <br>
* This function is twice differentiable.
*
* @author Edward Raff
*/
public class SquaredLoss implements LossR
{
private static final long serialVersionUID = 130786305325167077L;
/**... | 2,241 | 19.759259 | 89 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/Complex.java | package jsat.math;
import java.io.Serializable;
/**
* A class for representing a complex value by a real and imaginary double pair.
*
* @author Edward Raff
*/
public class Complex implements Cloneable, Serializable
{
private static final long serialVersionUID = -2219274170047061708L;
private double real, imag... | 10,650 | 27.402667 | 122 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/ContinuedFraction.java |
package jsat.math;
/**
* This class provides a means to represent and evaluate continued fractions in
* a multitude of ways.
*
* @author Edward Raff
*/
public abstract class ContinuedFraction
{
/**
* The a term of a continued fraction is the value that occurs as one of the
* numerators, an its d... | 2,820 | 28.082474 | 82 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/DescriptiveStatistics.java |
package jsat.math;
import jsat.linear.Vec;
/**
*
* @author Edward Raff
*/
public class DescriptiveStatistics
{
/**
* Computes the sample correlation coefficient for two data sets X and Y. The lengths of X and Y must be the same, and each element in X should correspond to the element in Y.
*
* ... | 2,237 | 25.329412 | 179 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/ExponentialMovingStatistics.java | /*
* Copyright (C) 2016 Edward Raff <Raff.Edward@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
... | 4,457 | 28.523179 | 96 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/FastMath.java | package jsat.math;
import static java.lang.Double.*;
import static java.lang.Math.PI;
import static java.lang.Math.tan;
/**
* This class contains fast implementations of many of the methods located in
* {@link Math} and {@link SpecialMath}. This speed comes at the cost of
* correctness, and in general the method... | 7,567 | 29.764228 | 137 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/Function.java |
package jsat.math;
import java.io.Serializable;
import jsat.linear.DenseVector;
import jsat.linear.Vec;
/**
* This functional interface defines a function over a vector input and returns
* a scalar output.
*
* @author Edward Raff
*/
public interface Function extends Serializable
{
/**
* Evaluates the g... | 2,335 | 27.487805 | 79 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/Function1D.java | /*
* Copyright (C) 2017 Edward Raff
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distri... | 889 | 30.785714 | 80 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/FunctionMat.java | package jsat.math;
import java.util.concurrent.ExecutorService;
import jsat.linear.Matrix;
import jsat.linear.Vec;
/**
* Interface for representing a function that should return a Matrix object as
* the result.
*
* @author Edward Raff
*/
public interface FunctionMat
{
/**
* Computes a matrix based on... | 1,636 | 31.74 | 79 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/FunctionVec.java | package jsat.math;
import jsat.linear.DenseVector;
import jsat.linear.Vec;
/**
* Interface for representing a function that takes a vector as input should
* return a vector as the output.
*
* @author Edward Raff
*/
public interface FunctionVec
{
/**
* Computes the function value given the input {@code x... | 1,805 | 29.610169 | 77 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/IndexFunction.java |
package jsat.math;
import jsat.linear.Vec;
/**
*
* @author Edward Raff
*/
public interface IndexFunction extends Function
{
/**
* An index function, meant to be applied to vectors where the
* value to be computed may vary based on the position in the
* vector of the value.
*
* @pa... | 868 | 26.15625 | 106 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/MathTricks.java | package jsat.math;
import static java.lang.Math.*;
import jsat.linear.Vec;
/**
* This class provides utilities for performing specific arithmetic patterns in
* numerically stable / efficient ways.
*
* @author Edward Raff
*/
public class MathTricks
{
private MathTricks()
{
}
/**
*
... | 5,304 | 31.347561 | 80 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/OnLineStatistics.java |
package jsat.math;
import java.io.Serializable;
import java.util.function.BinaryOperator;
/**
*
* This class provides a means of updating summary statistics as each
* new data point is added. The data points are not stored, and values
* are updated with an online algorithm.
* <br>
* As such, this class has c... | 12,356 | 31.179688 | 133 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/SimpleLinearRegression.java |
package jsat.math;
import jsat.linear.Vec;
/**
*
* @author Edward Raff
*/
public class SimpleLinearRegression
{
/**
* Performs a Simple Linear Regression on the data set, calculating the best fit a and b such that y = a + b * x <br><br>
*
* @param yData the Y data set (to be predicted)
* @... | 864 | 26.03125 | 125 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/SpecialMath.java |
package jsat.math;
import jsat.distributions.Normal;
import jsat.linear.Vec;
import jsat.math.rootfinding.RiddersMethod;
import static java.lang.Math.*;
import static jsat.math.MathTricks.*;
/**
* This class provides static methods for computing accurate approximations to
* many special functions. <br>
* <br>... | 40,472 | 33.415816 | 209 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/TrigMath.java |
package jsat.math;
import static java.lang.Math.*;
/**
* This class includes additional trig and hyperbolic trig that
* does not come with Java.Math by default.
*
* @author Edward Raff
*/
public class TrigMath
{
public static double coth(double x)
{
double eX = exp(x);
double eNX =... | 1,420 | 19.014085 | 64 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/decayrates/DecayRate.java | package jsat.math.decayrates;
import java.io.Serializable;
/**
* Many algorithms use a learning rate to adjust the step size by which the
* search space is covered. In practice, it is often useful to reduce this
* learning rate over time. In this way, large steps can be taken in the
* beginning when we are far... | 1,306 | 32.512821 | 79 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/decayrates/ExponetialDecay.java | package jsat.math.decayrates;
import java.util.List;
import jsat.math.FastMath;
import jsat.parameters.Parameter;
import jsat.parameters.Parameterized;
/**
* The Exponential Decay requires the maximum time step to be explicitly known ahead
* of time. Provided either in the call to
* {@link #rate(double, double, ... | 3,632 | 26.732824 | 90 | java |
JSAT | JSAT-master/JSAT/src/jsat/math/decayrates/InverseDecay.java | package jsat.math.decayrates;
import java.util.List;
import jsat.classifiers.svm.Pegasos;
import jsat.parameters.Parameter;
import jsat.parameters.Parameterized;
/**
*
* Decays an input by the inverse of the amount of time that has occurred, the
* max time being irrelevant. More specifically as
* η / ({@lin... | 3,047 | 24.613445 | 98 | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.