Git Product home page Git Product logo

fusinter_optimization's Introduction

Compilation

cd cpp
cmake -DCMAKE_BUILD_TYPE=Release -S. -B build
cd build
make FUSINTER_v3_pybind 

then copy the resulting file to into the PYTHONPATH

Usage

import numpy as np

from fusinter import FUSINTERDiscretizer
from sklearn.datasets import load_iris

x = load_iris()["data"]
y = load_iris()["target"]

discretizer = FUSINTERDiscretizer(0.95, 0.99)
discretizer.fit(x,y)

print(discretizer.splits)
print(discretizer.transform(x))

Save and Load Splits

import numpy as np
import pandas as pd
from fusinter import FUSINTERDiscretizer

cov_x = pd.read_csv("datasets/covtype.data", header=None)
data_y = cov_x.pop(cov_x.shape[1] - 1).to_numpy()
data_x = cov_x.iloc[:, 0:10].to_numpy()

discretizer1 = FUSINTERDiscretizer().fit(data_x, data_y)
results1 = discretizer1.transform(data_x)
discretizer1.save_splits("splits.txt")

discretizer2 = FUSINTERDiscretizer()
discretizer2.load_splits("splits.txt")
results2 = discretizer2.transform(data_x)

if np.all(results1 == results2):
    print("it worked")
else:
    print("it failed")

Change Between Python/C++ and Concurrent/Nonconcurrent

alpha = 0.95
lam = 0.975
start = time.perf_counter()
discretizer = FUSINTERDiscretizer(alpha, lam, not_concurrent=False, discretizer_python=False)
res1 = discretizer.fit(data_x, data_y)

Change the Number of Minimum Examples per Initial Interval

discretizer = FUSINTERDiscretizer(min_examples_in_interval=100).fit(data_x, data_y)

fusinter_optimization's People

Contributors

floxo115 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.