Oracle Machine Learning for Python Known Issues

Learn about the issues you may encounter when using Oracle Machine Learning for Python and how to work around them.

Topics:

Online Help for oml.Datetime.replace Incorrectly States that oml.integer is Supported for Arguments

Running the help file for oml.Datetime.replace states that the oml.integer is supported for the year, month, day, hour minute, second, and microsecond arguments but it is not yet supported.

%python
help(oml.Datetime.replace)

oml.Integer Math Methods Fail with Numeric Values

Running the oml.integer math method fails with the numeric values.

%python
import oml
DF = oml.push(pd.DataFrame(range(5), columns=['X']))
X_min = DF['X'].min()
DF['X'] - X_min

The output returns TypeError: 'other' must be an oml.Integer, int, oml.Float, or float object.

The workaround is to cast DF['X'] to an oml.Float data type.

%python
oml.Float(DF['X']) - X_min

The output returns [0, 1, 2, 3, 4].

Running oml.dir() from OML4Py in Notebook Paragraph in Oracle Machine Learning Notebooks Returns Empty List

Running the oml.dir() function in a notebook should return the oml.* objects in the current workspace. However, at present, running oml.dir returns an empty list:

%python
import oml
...
oml.dir()
[]

Workaround

To work around this problem, use dir() and check if the objects belong to the oml module. For example, use dir() to return the objects.

%python
dir()
['__builtins__', '__zeppelin__', 'datasets', 'linear_model', 'oml',
    'inv_objects', 'inv_wine', 'inv_wine_columns', 'pd', 'wine', 'x', 'y',  'z']

Then use <obj>.__class__.__module__ to return the module name for an object <obj>; for example:

%python
inv_wine.__class__.__module__
'oml.core.frame'

If the returned string starts with oml., the object belongs to the oml module.

If you have many objects to check, you can iterate through the objects; for example:

%python
[t for t in dir() if eval(t).__class__.__module__[0:4] == 'oml.']
['inv_wine']

See oml.dir() and dir() in Oracle Machine Learning for Python API Reference and see Get Started with Notebooks for Data Analysis and Data Visualization in Using Oracle Machine Learning on Autonomous Database.

Documentation Accessibility

For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.

Access to Oracle Support

Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.