Skip to content

Commit f08b1b2

Browse files
10.7.0
1 parent 56c403c commit f08b1b2

File tree

7 files changed

+45
-15
lines changed

7 files changed

+45
-15
lines changed

API_REFERENCE_FOR_REGRESSION.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,4 +352,14 @@ Prevents the output from having significantly more than ***max_rows_before_sampl
352352

353353
## Method: get_cv_error()
354354

355-
***Returns the cv error for the model.***
355+
***Returns the cv error for the model.***
356+
357+
358+
## Method: set_intercept(value:float)
359+
360+
***Sets the model's intercept term to value. Use if you want to change the intercept.***
361+
362+
### Parameters
363+
364+
#### value
365+
A float representing the new intercept.

README.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
# APLR
2-
Automatic Piecewise Linear Regression.
2+
**Automatic Piecewise Linear Regression**
33

4-
# About
5-
Build predictive and interpretable parametric regression or classification machine learning models in Python based on the Automatic Piecewise Linear Regression (APLR) methodology developed by Mathias von Ottenbreit. APLR is often able to compete with tree-based methods on predictiveness, but unlike tree-based methods APLR is interpretable. Furthermore, APLR produces smoother predictions than tree-based methods. Please see the [documentation](https://github.com/ottenbreit-data-science/aplr/tree/main/documentation) for more information. Links to published article: [https://link.springer.com/article/10.1007/s00180-024-01475-4](https://link.springer.com/article/10.1007/s00180-024-01475-4) and [https://rdcu.be/dz7bF](https://rdcu.be/dz7bF). More functionality has been added to APLR since the article was published.
4+
## About
5+
APLR allows you to build predictive and interpretable regression or classification machine learning models in Python, using the Automatic Piecewise Linear Regression (APLR) methodology developed by Mathias von Ottenbreit. APLR often rivals tree-based methods in predictive accuracy, while offering smoother, more interpretable predictions.
66

7-
# How to install
8-
***pip install aplr***
7+
For further details, see the [documentation](https://github.com/ottenbreit-data-science/aplr/tree/main/documentation). You may also read the published article for additional insights: [Link 1](https://link.springer.com/article/10.1007/s00180-024-01475-4) and [Link 2](https://rdcu.be/dz7bF). Additional functionality has been added since the article was published.
98

10-
# Availability
11-
Available for Windows, most Linux distributions and MacOS.
9+
## Installation
10+
To install APLR, use the following command:
1211

13-
# How to use
14-
Please see example Python scripts [here](https://github.com/ottenbreit-data-science/aplr/tree/main/examples).
12+
```bash
13+
pip install aplr
14+
```
1515

16-
# Sponsorship
17-
Please consider sponsoring Ottenbreit Data Science by clicking on the Sponsor button. Sufficient funding will enable maintenance of APLR and further development.
16+
## Availability
17+
APLR is available for Windows, most Linux distributions, and macOS.
1818

19-
# API reference
20-
Please see the [API reference for regression](https://github.com/ottenbreit-data-science/aplr/blob/main/API_REFERENCE_FOR_REGRESSION.md) and [API reference for classification](https://github.com/ottenbreit-data-science/aplr/blob/main/API_REFERENCE_FOR_CLASSIFICATION.md).
19+
## Usage
20+
Example Python scripts are available [here](https://github.com/ottenbreit-data-science/aplr/tree/main/examples).
21+
22+
## Sponsorship
23+
Consider sponsoring Von Ottenbreit Data Science by clicking the **Sponsor** button on the repository. Sufficient funding will help maintain and further develop APLR.
24+
25+
## API Reference
26+
- [API reference for regression](https://github.com/ottenbreit-data-science/aplr/blob/main/API_REFERENCE_FOR_REGRESSION.md)
27+
- [API reference for classification](https://github.com/ottenbreit-data-science/aplr/blob/main/API_REFERENCE_FOR_CLASSIFICATION.md)
28+
29+
## Contact Information
30+
For inquiries, please email: [[email protected]](mailto:[email protected])

aplr/aplr.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ def get_unique_term_affiliation_shape(
304304
def get_cv_error(self) -> float:
305305
return self.APLRRegressor.get_cv_error()
306306

307+
def set_intercept(self, value: float):
308+
self.APLRRegressor.set_intercept(value)
309+
307310
# For sklearn
308311
def get_params(self, deep=True):
309312
return {

cpp/APLRRegressor.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ class APLRRegressor
296296
MatrixXd generate_predictor_values_and_contribution(const std::vector<size_t> &relevant_term_indexes,
297297
size_t unique_term_affiliation_index);
298298
double get_cv_error();
299+
void set_intercept(double value);
299300

300301
friend class APLRClassifier;
301302
};
@@ -2695,4 +2696,9 @@ MatrixXd APLRRegressor::get_unique_term_affiliation_shape(const std::string &uni
26952696
double APLRRegressor::get_cv_error()
26962697
{
26972698
return cv_error;
2699+
}
2700+
2701+
void APLRRegressor::set_intercept(double value)
2702+
{
2703+
intercept = value;
26982704
}

cpp/pythonbinding.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ PYBIND11_MODULE(aplr_cpp, m)
7777
.def("get_unique_term_affiliation_shape", &APLRRegressor::get_unique_term_affiliation_shape, py::arg("unique_term_affiliation"),
7878
py::arg("max_rows_before_sampling") = 100000)
7979
.def("get_cv_error", &APLRRegressor::get_cv_error)
80+
.def("set_intercept", &APLRRegressor::set_intercept, py::arg("value"))
8081
.def_readwrite("intercept", &APLRRegressor::intercept)
8182
.def_readwrite("m", &APLRRegressor::m)
8283
.def_readwrite("m_optimal", &APLRRegressor::m_optimal)
Binary file not shown.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
setuptools.setup(
2929
name="aplr",
30-
version="10.6.4",
30+
version="10.7.0",
3131
description="Automatic Piecewise Linear Regression",
3232
ext_modules=[sfc_module],
3333
author="Mathias von Ottenbreit",

0 commit comments

Comments
 (0)