mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-12-26 17:49:09 +00:00
super ultra working
This commit is contained in:
parent
abc1c26cd2
commit
33e0cc19a5
Binary file not shown.
@ -348,17 +348,17 @@ def histo_analysis(hist_data):
|
|||||||
|
|
||||||
def regression(inputs, outputs, args): # inputs, outputs expects N-D array
|
def regression(inputs, outputs, args): # inputs, outputs expects N-D array
|
||||||
|
|
||||||
inputs = inputs[~np.isnan(inputs)]
|
inputs = np.array(inputs)
|
||||||
outputs = outputs[~np.isnan(outputs)]
|
outputs = np.array(outputs)
|
||||||
|
|
||||||
|
inputs = inputs[np.isfinite(inputs)]
|
||||||
|
outputs = outputs[np.isfinite(outputs)]
|
||||||
regressions = []
|
regressions = []
|
||||||
|
|
||||||
if 'lin' in args: # formula: ax + b
|
if 'lin' in args: # formula: ax + b
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
X = np.array(inputs)
|
|
||||||
y = np.array(outputs)
|
|
||||||
|
|
||||||
def func(x, a, b):
|
def func(x, a, b):
|
||||||
|
|
||||||
return a * x + b
|
return a * x + b
|
||||||
@ -375,9 +375,6 @@ def regression(inputs, outputs, args): # inputs, outputs expects N-D array
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
X = np.array(inputs)
|
|
||||||
y = np.array(outputs)
|
|
||||||
|
|
||||||
def func(x, a, b, c, d):
|
def func(x, a, b, c, d):
|
||||||
|
|
||||||
return a * np.log(b*(x + c)) + d
|
return a * np.log(b*(x + c)) + d
|
||||||
@ -394,9 +391,6 @@ def regression(inputs, outputs, args): # inputs, outputs expects N-D array
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
X = np.array(inputs)
|
|
||||||
y = np.array(outputs)
|
|
||||||
|
|
||||||
def func(x, a, b, c, d):
|
def func(x, a, b, c, d):
|
||||||
|
|
||||||
return a * np.exp(b*(x + c)) + d
|
return a * np.exp(b*(x + c)) + d
|
||||||
@ -411,8 +405,8 @@ def regression(inputs, outputs, args): # inputs, outputs expects N-D array
|
|||||||
|
|
||||||
if 'ply' in args: # formula: a + bx^1 + cx^2 + dx^3 + ...
|
if 'ply' in args: # formula: a + bx^1 + cx^2 + dx^3 + ...
|
||||||
|
|
||||||
inputs = [inputs]
|
inputs = np.array([inputs])
|
||||||
outputs = [outputs]
|
outputs = np.array([outputs])
|
||||||
|
|
||||||
plys = []
|
plys = []
|
||||||
limit = len(outputs[0])
|
limit = len(outputs[0])
|
||||||
@ -436,9 +430,6 @@ def regression(inputs, outputs, args): # inputs, outputs expects N-D array
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
X = np.array(inputs)
|
|
||||||
y = np.array(outputs)
|
|
||||||
|
|
||||||
def func(x, a, b, c, d):
|
def func(x, a, b, c, d):
|
||||||
|
|
||||||
return a * np.tanh(b*(x + c)) + d
|
return a * np.tanh(b*(x + c)) + d
|
||||||
|
Loading…
Reference in New Issue
Block a user