Expectation Reflection for classification
Project description
Expectation Reflection
The current version of Expectation Reflection is applied for binary classication. Its extension for regression tasks is in development.
History
Installation
From PyPi
pip install expectation-reflection
From Repository
git clone https://github.com/danhtaihoang/expectation-reflection.git
Usage
- Import
expectation_reflection
package into python script:
from expectation_reflection import classication as ER
- Train the model with
(X_train, y_train)
to get the value of interceptb
and interaction weightsw
from featuresX_train
to targety_train
. In the current version, the target needs to be formatted in form of [0,1].
b,w = ER.fit(X_train, y_train)
print('intercept:', b)
print('interaction weights:', b)
- Using the trained
b
andw
, we can predict outputsy_pred
and their probabilityp_pred
of new inputsX_test
:
y_pred,p_pred = model.predict(X_test,b,w)
print('predicted output:',y_pred)
print('predicted probability:',y_pred)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for expectation_reflection-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32a0106cb02558d32938f54b26962627223461abf062011a5af6f4c3f07c796d |
|
MD5 | a05d389abf03484e8715dfb4223d5acf |
|
BLAKE2b-256 | 959e13e7130942e4162738361d5dcbda4ef02875cd173c37344c5c01de16a3f0 |
Close
Hashes for expectation_reflection-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b4a9091815a0e6096b8ce7ce41f3387be8ded0f7424a32fadddafc6f23041cf |
|
MD5 | 3b508639faf8926752ab8d2d7c1283f8 |
|
BLAKE2b-256 | be1b32fee1a806a4fb09bcfd46d85ebb33ce879843945c188cd04e65f62a7262 |