Sparti - Spatial partition inference¶
Sparti is a statistical software package for spatial partition inference such as inference methods for the Mondrian Process , the Binary Space Partitioning-Tree Process , the Rectangular Bounding Process . Currently, Markov chain Monte Carlo method is the main strategy for the inference.
Sparti is licensed under BSD3. The source is in GitHub.
Currently implemented Sparti models:¶
- Infinite Relational Model (For relational data only.)
- Bayesian Additive Regression Tree (For regression tree only.)
- the Mondrian Process
- the Binary Space Partitioning-Tree Process
- the Rectangular Bounding Process
- Deep Partitioning Model
Currently, Sparti can be applied in the following two tasks (More tasks are under exploration.)
- Relational modelling
- Regression Tree (including classification and regression)
Additionally, Sparti integrates tools for visualization, model comparison, diagnostics and post-processing.
Example Usage¶
import sparti
import numpy as np
xdata = np.random.rand(100, 2) # Generate the feature data X
ydata = np.random.rand(100) # Generate the label data Y
IterationTime = 200 # Set the number of iterations
NumTree = 50 # Set the number of trees in the Binary Space Partitioning Forest
budget_val = 0.5 # Set the budget value used in each Binary Space Partitioning Tree
sparti.BSPF.BSPF_Main(IterationTime, NumTree, budget_val, xdata, ydata)