32 import daal.algorithms.math.logistic
as logistic
33 from daal.data_management
import FileDataSource, DataSourceIface
35 utils_folder = os.path.realpath(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
36 if utils_folder
not in sys.path:
37 sys.path.insert(0, utils_folder)
38 from utils
import printNumericTable
41 datasetName = os.path.join(
'..',
'data',
'batch',
'covcormoments_dense.csv')
43 if __name__ ==
"__main__":
46 dataSource = FileDataSource(datasetName,
47 DataSourceIface.doAllocateNumericTable,
48 DataSourceIface.doDictionaryFromContext)
49 dataSource.loadDataBlock()
52 algorithm = logistic.Batch()
55 algorithm.input.set(logistic.data, dataSource.getNumericTable())
58 res = algorithm.compute()
61 printNumericTable(res.get(logistic.value),
"Logistic result (first 5 rows):", 5)