bgrimstad / splinter Goto Github PK
View Code? Open in Web Editor NEWLibrary for multivariate function approximation with splines (B-spline, P-spline, and more) with interfaces to C++, C, Python and MATLAB
License: Mozilla Public License 2.0
Library for multivariate function approximation with splines (B-spline, P-spline, and more) with interfaces to C++, C, Python and MATLAB
License: Mozilla Public License 2.0
All current BSpline tests have to few sample points to trigger the use of a sparse linear solver. Thus, this use case is not being tested. I suggest that we increase the number of sample points in a few of the tests so that it triggers this use case.
The k-nearest neighbors (k-NN) regression is a simple algorithm for high dimensional function approximation.
Read more here: https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm
SPLINTER's Eigen should be updated to the latest stable version (currently Eigen 3.2.7). SPLINTER must compile on all supported platform for the change to be accepted.
Note: It seems like Eigen 3.3 is on the way and it may make sense to wait for the release of this version.
Currently SPLINTER uses Eigen types (typedefs DenseVector and DenseMatrix) all over the interface. This requires the user to investigate what those types actually are, and also requires the user to have Eigen installed to use the library. Replacing these with std::vector and std::vector < std::vector < double > > will resolve these issues.
/include/cinterface/builder.h should be merged into cinterface.h since the old Builder base class has been removed.
Replace assertions with exceptions (assertions halts execution when testing).
Add test case testing the accuracy of the hessian of Approximants. Should use same methodology as the test cases testing the jacobians of Approximants currently do, but with second order central difference instead of first order.
Finish implementation of operator== overloads in test/operator_overloads.cpp
Implement new end conditions for the B-spline, e.g. Hermite and Natural end conditions.
Implement a new class for Kriging interpolation.
Add random shuffling and subdivision to Sample using operator overloading. This will be useful when doing cross validation.
Write Doxygen, prioritize classes and methods that are visible to the end user.
Add batch evaluation of points to MatLab interface to avoid overhead of calling library once for each point.
I am seeing a compiler error when building SPLINTER in a debug configuration. The problem seems to be caused by the assert()
on line 154 of psplineapproximant.cpp
for (unsigned int i=0; i < numVariables; i++)
{
// Need at least three coefficients in each variable
assert(basis.getNumBasisFunctions(i) >= 3);
}
The compiler reports that it cannot find the symbol basis
splinter/src/psplineapproximant.cpp:154:16: error: use of undeclared identifier 'basis'
assert(basis.getNumBasisFunctions(i) >= 3);
and indeed I cannot see that PSplineApproximant
or any of the classes it inherits from have such a member.
This seems to happen in both the master and development branches. Building with asserts disabled fixes the problem.
Add some examples and documentation for the Python interface.
Add facilities for assessing approximation (in-sample and out-of-sample) error. The facilities should include MSE, cross-validation, and more.
The current moving average filter for automatic knot vector selection does not work well when the number of knots is much less than the number of samples. The resulting knot vector will in this case be very skewed; it will have almost all knots close to the left-most samples.
BSplines of degree 3 and 4 (and possibly more) fail when given a set of samples that all have the value 0.0
Hey Guys,
Love this library, and I'm still feeling my way around it. But what do you think would be the best way to find the closest point on the spline from an arbitrary point? Are there some specific functions that would help?
If this is something that I could implement, I would gladly PR it back in if y'all find it useful.
when compiled with -Wall -Wextra -pedantic:
lots of warning of type "comparison between signed and unsigned integer expressions [-Wsign-compare]"
due to variable Basis1D::degree being declared as int. I guess that degree cannot be less than 0, and therefore can be declared as unsigned int.
Same thing goes for num_knots in Basis1D::knotSequenceFree and elsewhere.
In BSpline::computeControlPoints the line bspline.cpp:378, i.e.
bool successfulSolve = (s.solve(Ad,Bx,Cx) && s.solve(Ad,By,Cy));
triggers warning: unused variable ‘successfulSolve’ [-Wunused-variable]
Since the variable is used in assert fun below, one could write
assert(s.solve(Ad,Bx,Cx) && s.solve(Ad,By,Cy));
and many more similar warnings dealing with [-Wsign-compare] and [-Wunused-variable].
Add a flexibility parameter to the BSplineApproximant constructor. The parameter should be a number p so that 0<=p<=1, where p=1 means building a B-spline approximant with enough segments to interpolate all samples and p=0 means building a B-spline approximant with a minimum number of segments. In all cases, the resulting B-spline approximation should minimize the mean squared approximation error.
Compare test executable run time on different compilers
Investigate if the following should be implemented:
Test PolynomialRegression on several problems of varying dimension using different polynomial degrees.
Implement Tikhonov regularization for general Tikhonov matrices. The current implementation uses an identity matrix. Note that the builder classes must be updated to allow the specification of a Tikhonov matrix.
Put MATLAB examples in a new folder: matlab/examples. Note: the build script may need an update after this change.
The following functions in BSpline should be made available in all interfaces:
std::vector< std::vector> getKnotVectors() const;
DenseMatrix getControlPoints() const;
DenseVector getCoefficients() const;
Hi! Imagine I have multi-dimensional DataTable and I want to find it's maximal Y element in some X - slice (defined by, e.g. x(0), x(5) fixed). Is there a smart way to do this without scanning over all the Data?
Thanks,
Sergey
Simplify the B-spline classes by putting functionality for interpolation (computation of control points and selection of knot vectors) into a new class.
Describe in the README how the issues are structured according to type of work and difficulty.
Create a new class for non-uniform rational basis splines (NURBS) that utilizes the existing B-spline implementation.
Add tests that are designed to provoke errors.
At least for the MatLab interface this is not currently the case.
Add Python interface for Python versions 2 and 3. Investigate if a single C interface may be used by both Python and MatLab.
Update class names in MATLAB interface and corresponding documentation.
Wrap all code that can throw an exception with try catch, and use set_error_string to communicate what went wrong.
Use #pragma once instead of
to avoid including headers more than once. This has several benefits, two of them being:
Compiler support: All major (GCC >= 3.4).
Default compilation target architecture should be equal to the architecture of the host computer
After building all desired combinations of architectures and compilers we should run all tests. Return value of last command is stored in $? in bash. Catch seems to return 0 when all tests pass, 1 otherwise. Check if this assumption is true before implementing.
Remove code redundancy by wrapping affine operations on the control points (BSpline) and sequential tensor products (BSplineBasis).
Hi! I have 6 variables on a regular grid, and constructing of even the LINEAR spline loads the processor forever. Is that a bug?
Thanks,
Sergey
Add a description of the Catch testing facilities to the documentation.
The Hessian of B-splines (BSpline) of all degrees seems to be wrong. It is not symmetrical over the diagonal. Test function: 4.5(x^4)-(x^3)+3(x^2)*y
As the title says: put save and load in a dedicated class.
Implement support for scattered data interpolation with B-Splines (look into MBA algorithm).
Implement a proper preconditioning matrix for radial basis function weight computations.
Add more unit tests using the Catch testing framework. Unit tests should reside in the folder "test/unit/filename", where "filename" is the file containing the units being tested.
When the Python interface is done and working well (which is the case very soon), we should add SPLINTER to PyPI, the Python Package Index, so users can easily install and use it.
Implement and test the Hessian matrix of radial basis functions (RadialBasisFunction).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.