Skip to main content

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 intercept b and interaction weights w from features X_train to target y_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 and w, we can predict outputs y_pred and their probability p_pred of new inputs X_test:
y_pred,p_pred = model.predict(X_test,b,w)
print('predicted output:',y_pred)
print('predicted probability:',y_pred)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

expectation_reflection-0.0.1.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

expectation_reflection-0.0.1-py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page