Giter VIP home page Giter VIP logo

gaussianize's People

Contributors

gmgeorg avatar gregversteeg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gaussianize's Issues

Data not transformed

I tried to transform my data to gaussian distribution and the output of the transform function is the same as the original data. I created this script to run some tests.
Thank you in advance.
Test script:

import gaussianize as g
import numpy as np

x_uni = np.random.uniform(size=(1000,1))
out_uni = g.Gaussianize()
out_uni.fit(x_uni)
print("out_uni coefficients:", out_uni.coefs_, "\n")
y_uni = out_uni.transform(x_uni)
print("sum of transform minus original uniform:", sum(y_uni-x_uni), "\n")

x_norm = np.random.normal(size=(1000,1))
out_norm = g.Gaussianize()
out_norm.fit(x_norm)
print("out_norm coefficients:", out_norm.coefs_, "\n")
y_norm = out_norm.transform(x_norm)
print("sum of transform minus original normal:", sum(y_norm-x_norm), "\n")

import scipy.io as scio
import os

midep1 = scio.loadmat(os.path.join("D:\\", "Shared", "Data - sLorTimeseries", "LorTimeSeries_2_EC_MID_001_ep1.mat"))["LoretaTimeSeries"]
x = midep1[0, :]
x.shape = (4001, 1)
out= g.Gaussianize()
out.fit(x)
print("my data coefficients:", out.coefs_, "\n")
y = out.transform(x)
print("tranform minus original of my data:")
print(y-x, "\n")
print("sum of transform minus original:", sum(y-x), `"\n")

Output:

out_uni coefficients: [(0.4964280888006252, 0.2880773918099591, 0.0)] 
sum of transform minus original uniform: [-8.04911693e-16] 
out_norm coefficients: [(-0.013567057474285795, 0.9626024748274751, 0.013488)] 
sum of transform minus original normal: [-0.15229739] 
my data coefficients: [(2.8030224, 1.3002187, 0.0)] 
tranform minus original of my data:
[[ 0.0000000e+00]
 [ 0.0000000e+00]
 [-1.3737008e-08]
 ...
 [ 0.0000000e+00]
 [ 0.0000000e+00]
 [ 0.0000000e+00]] 
sum of transform minus original: [1.0423828e-06] `

The fit of x_uni has different coefficients compared to x_norm but y_uni and y_norm are equal to x_uni and x_norm respectively. In my understanding the transformed signal should scale to resemple a gaussian distribution. Am I missing something or not running the transforms correctly?

License

Hi,
What is the license of this code?

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.