# Overview of available functions

**URL:** <https://forum.inductiveautomation.com/t/overview-of-available-functions/18377>\
**Category:** Ignition\
**Created:** [June 9, 2018, 5:15pm UTC](https://forum.inductiveautomation.com/t/overview-of-available-functions/18377 "2018-06-09T17:15:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpoulsen921](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mpoulsen921](https://forum.inductiveautomation.com/u/mpoulsen921)\
**Post date:** [June 9, 2018, 5:15pm UTC](https://forum.inductiveautomation.com/t/overview-of-available-functions/18377/1 "2018-06-09T17:15:19Z")

</div>

Hi

I am trying out the newly added library Apache Math.  
However, I am struggling a bit with getting an overview of what functions really exists.

I have found the documentation of Apache Math here:  
[http://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/index.html](http://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/index.html)

I have tried to import the machine learning module but I am getting an error that “No module named ml”. So apparently it does not exist?

Does a documentation exist for ignition that outlines what functions are actually available?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 9, 2018, 8:51pm UTC](https://forum.inductiveautomation.com/t/overview-of-available-functions/18377/2 "2018-06-09T20:51:46Z")

</div>

You have to import the specific classes you will use, not entire packages. Jython can’t do that with Java libraries. Nor can it use a wildcard import with them. You’ll probably also have to import many of the interfaces for data types you wish to use, so you can define python classes that implement them.

---

<div class="post-metadata">

**Author:** ![mpoulsen921](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mpoulsen921](https://forum.inductiveautomation.com/u/mpoulsen921)\
**Post date:** [June 10, 2018, 9:53am UTC](https://forum.inductiveautomation.com/t/overview-of-available-functions/18377/3 "2018-06-10T09:53:53Z")

</div>

Okay, but isn’t this what Kathy Applebaun is doing here?:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c81c043082c7c3e5af05e8ca7b26e4937f4502b9.png)

The image is taken from here: [Ignition v7.9.8: Better Algorithm Access, Quicker Named Queries & More | Inductive Automation](https://inductiveautomation.com/blog/ignition-v798-better-algorithm-access-quicker-named-queries-more)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 10, 2018, 12:08pm UTC](https://forum.inductiveautomation.com/t/overview-of-available-functions/18377/4 "2018-06-10T12:08:11Z")

</div>

Hmm. Yes. I’m surprised that works.

---

<div class="post-metadata">

**Author:** ![mpoulsen921](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mpoulsen921](https://forum.inductiveautomation.com/u/mpoulsen921)\
**Post date:** [June 10, 2018, 12:31pm UTC](https://forum.inductiveautomation.com/t/overview-of-available-functions/18377/5 "2018-06-10T12:31:07Z")

</div>

But that is the thing. It’s not:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e16568b0fb400bc54b80883f756847207964ae1b.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 10, 2018, 12:53pm UTC](https://forum.inductiveautomation.com/t/overview-of-available-functions/18377/6 "2018-06-10T12:53:17Z")

</div>

try it with this instead:

```auto
from org.apache.commons.math3.fitting import WeightObservedPoints, PolynomialCurveFitter

```

---

<div class="post-metadata">

**Author:** ![mpoulsen921](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mpoulsen921](https://forum.inductiveautomation.com/u/mpoulsen921)\
**Post date:** [June 10, 2018, 12:59pm UTC](https://forum.inductiveautomation.com/t/overview-of-available-functions/18377/7 "2018-06-10T12:59:58Z")

</div>

That did the trick!

So wildcards ain’t working. You were right. Thanks

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 9, 2019, 7:07am UTC](https://forum.inductiveautomation.com/t/overview-of-available-functions/18377/8 "2019-04-09T07:07:57Z")

</div>

Just out of interest, I got this working but had to change a few things:

- WeightedObservedPoint class name is without the ‘s’ at the end
- WeightedObservedPoint has no empty constructor and contains a single pair of values, not a list of pairs

```auto
from org.apache.commons.math3.fitting import *

obs = []
x = [1552920192.0, 1552938624.0, 1552961664.0]
y = [12.85043621, 12.4644804, 11.92448521]

for i in [0,1,2]:
	obs.append(WeightedObservedPoint(1.0, x[i], y[i])) # WeightedObservedPoint not WeightedObservedPoint **s**

fitter = PolynomialCurveFitter.create(4)
coeff = fitter.fit(obs)
print coeff

```
