1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "requests": [
12 {
13 "data": "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv",
14 "target": "Survived",
15 "predict": [
16 {
17 "Pclass": 1,
18 "Sex": "female",
19 "Age": 29,
20 "SibSp": 0,
21 "Parch": 0,
22 "Fare": 80,
23 "Embarked": "S"
24 },
25 {
26 "Pclass": 3,
27 "Sex": "male",
28 "Age": 25,
29 "SibSp": 0,
30 "Parch": 0,
31 "Fare": 7.9,
32 "Embarked": "S"
33 }
34 ]
35 },
36 "predict mpg from https://raw.githubusercontent.com/mwaskom/seaborn-data/master/mpg.csv"
37 ]
38};
39
40
41const run = await client.actor("jumblemog/tabular-automl").call(input);
42
43
44console.log('Results from dataset');
45console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51