Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f852ba7
IGNITE-13814 restorePartitionStates moved to sys pool instead of stri…
ibessonov Dec 9, 2020
27062ee
IGNITE-13801: Fix Ab Initio related ODBC issues
isapego Dec 9, 2020
b6ecc82
IGNITE-13713 Add target encoding preprocessor (#8466)
mrk-andreev Dec 9, 2020
04f6a33
IGNITE-13714 Add catboost inference integration (#8489)
mrk-andreev Dec 9, 2020
afc73ec
IGNITE-13353 Got rid of unnecessary rebalance on starting new cache.
sergeyuttsel Dec 10, 2020
fb5032e
IGNITE-13823 WAL iterator WRITE permission requirement removed. - Fix…
ibessonov Dec 10, 2020
3c2535e
IGNITE-13450 [MINOR] Added missed javadoc for EVT_CACHE_QUERY_EXECUTE…
sk0x50 Dec 10, 2020
dc4b71b
IGNITE-13786 Add defragmentation-specific B+Tree optimizations - Fixe…
ibessonov Dec 10, 2020
cccf20d
IGNITE-13826 .NET: Add RendezvousAffinityFunction.BackupFilter
ptupitsyn Dec 10, 2020
0fa783a
IGNITE-13833 More versions added to PersistenceBasicCompatibilityTest…
ibessonov Dec 11, 2020
f48f31e
IGNITE-13832 Proper handling of interrupted exceptions in disco-notif…
ibessonov Dec 11, 2020
a082ea0
IGNITE-13101 Metastore should complete all write futures during stop …
ibessonov Dec 11, 2020
28b15f1
IGNITE-13815 Remove ability to delete segments from the middle of WAL…
tkalkirill Dec 11, 2020
1f108fb
IGNITE-12892 WAL archive size configuration made more clear - Fixes #…
SammyVimes Dec 11, 2020
08d9242
IGNITE-13838 IgniteSqlSplitterSelfTest fixes various tests - Fixes #8…
zstan Dec 11, 2020
3686792
ignite docs: fixing a broken documentation link
Nikita-tech-writer Dec 11, 2020
8afabe1
IGNITE-13743 Defragmentation JMX API
SammyVimes Dec 14, 2020
5e80954
IGNITE-13743 Fix javadoc
SammyVimes Dec 14, 2020
b4f644c
IGNITE-13743 Fix javadoc
SammyVimes Dec 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assembly/dependencies-apache-ignite-slim.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
<exclude>org.apache.ignite:ignite-ml-h2o-model-parser</exclude>
<exclude>org.apache.ignite:ignite-ml-spark-model-parser</exclude>
<exclude>org.apache.ignite:ignite-ml-xgboost-model-parser</exclude>
<exclude>org.apache.ignite:ignite-ml-catboost-model-parser</exclude>
<exclude>org.apache.ignite:ignite-osgi</exclude>
<exclude>org.apache.ignite:ignite-osgi-karaf</exclude>
<exclude>org.apache.ignite:ignite-osgi-paxlogging</exclude>
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ applications that can process terabytes of data with in-memory speed.

Ignite documentation introduces you to the project's main capabilities, shows how to use certain features, or how to
approach cluster optimizations and issues troubleshooting. If you are new to Ignite, then start with the
link:docs/latest/quick-start/java[Quick Start Guides], and build the first application in a matter of 5-10 minutes.
link:quick-start/java[Quick Start Guides], and build the first application in a matter of 5-10 minutes.
Otherwise, select the topic of your interest and have your problems solved, and questions answered.
Good luck with your Ignite journey!

Expand Down
6 changes: 6 additions & 0 deletions examples/pom-standalone-lgpl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@
<version>to_be_replaced_by_ignite_version</version>
</dependency>

<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-ml-catboost-model-parser</artifactId>
<version>to_be_replaced_by_ignite_version</version>
</dependency>

<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-ml-spark-model-parser</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions examples/pom-standalone.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@
<version>to_be_replaced_by_ignite_version</version>
</dependency>

<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-ml-catboost-model-parser</artifactId>
<version>to_be_replaced_by_ignite_version</version>
</dependency>

<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-ml-spark-model-parser</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-ml-catboost-model-parser</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-ml-h2o-model-parser</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.ignite.examples.ml.inference.catboost;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.Scanner;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import org.apache.ignite.Ignite;
import org.apache.ignite.Ignition;
import org.apache.ignite.internal.util.IgniteUtils;
import org.apache.ignite.ml.catboost.CatboostClassificationModelParser;
import org.apache.ignite.ml.inference.Model;
import org.apache.ignite.ml.inference.builder.AsyncModelBuilder;
import org.apache.ignite.ml.inference.builder.IgniteDistributedModelBuilder;
import org.apache.ignite.ml.inference.reader.FileSystemModelReader;
import org.apache.ignite.ml.inference.reader.ModelReader;
import org.apache.ignite.ml.math.primitives.vector.NamedVector;
import org.apache.ignite.ml.math.primitives.vector.VectorUtils;

/**
* This example demonstrates how to import Catboost model and use imported model for distributed inference in Apache
* Ignite.
*/
public class CatboostClassificationModelParserExample {
/**
* Test model resource name.
*/
private static final String TEST_MODEL_RES = "examples/src/main/resources/models/catboost/model_clf.cbm";

/**
* Test data.
*/
private static final String TEST_DATA_RES = "examples/src/main/resources/datasets/amazon-employee-access-challenge-sample.csv";

/**
* Test expected results.
*/
private static final String TEST_ER_RES = "examples/src/main/resources/datasets/amazon-employee-access-challenge-sample-catboost-expected-results.csv";

/**
* Parser.
*/
private static final CatboostClassificationModelParser parser = new CatboostClassificationModelParser();

/**
* Run example.
*/
public static void main(String... args) throws ExecutionException, InterruptedException,
FileNotFoundException {
try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
File mdlRsrc = IgniteUtils.resolveIgnitePath(TEST_MODEL_RES);
if (mdlRsrc == null)
throw new IllegalArgumentException("File not found [resource_path=" + TEST_MODEL_RES + "]");

ModelReader reader = new FileSystemModelReader(mdlRsrc.getPath());

AsyncModelBuilder mdlBuilder = new IgniteDistributedModelBuilder(ignite, 4, 4);

File testData = IgniteUtils.resolveIgnitePath(TEST_DATA_RES);
if (testData == null)
throw new IllegalArgumentException("File not found [resource_path=" + TEST_DATA_RES + "]");

File testExpRes = IgniteUtils.resolveIgnitePath(TEST_ER_RES);
if (testExpRes == null)
throw new IllegalArgumentException("File not found [resource_path=" + TEST_ER_RES + "]");

try (Model<NamedVector, Future<Double>> mdl = mdlBuilder.build(reader, parser);
Scanner testDataScanner = new Scanner(testData);
Scanner testExpResultsScanner = new Scanner(testExpRes)) {
String header = testDataScanner.nextLine();
String[] columns = header.split(",");

while (testDataScanner.hasNextLine()) {
String testDataStr = testDataScanner.nextLine();
String testExpResultsStr = testExpResultsScanner.nextLine();

HashMap<String, Double> testObj = new HashMap<>();
String[] values = testDataStr.split(",");

for (int i = 0; i < columns.length; i++) {
testObj.put(columns[i], Double.valueOf(values[i]));
}

double prediction = mdl.predict(VectorUtils.of(testObj)).get();
double expPrediction = Double.parseDouble(testExpResultsStr);

System.out.println("Expected: " + expPrediction + ", prediction: " + prediction);
}
}
}
finally {
System.out.flush();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.ignite.examples.ml.inference.catboost;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.Scanner;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import org.apache.ignite.Ignite;
import org.apache.ignite.Ignition;
import org.apache.ignite.internal.util.IgniteUtils;
import org.apache.ignite.ml.catboost.CatboostRegressionModelParser;
import org.apache.ignite.ml.inference.Model;
import org.apache.ignite.ml.inference.builder.AsyncModelBuilder;
import org.apache.ignite.ml.inference.builder.IgniteDistributedModelBuilder;
import org.apache.ignite.ml.inference.reader.FileSystemModelReader;
import org.apache.ignite.ml.inference.reader.ModelReader;
import org.apache.ignite.ml.math.primitives.vector.NamedVector;
import org.apache.ignite.ml.math.primitives.vector.VectorUtils;

/**
* This example demonstrates how to import Catboost model and use imported model for distributed inference in Apache
* Ignite.
*/
public class CatboostRegressionModelParserExample {
/**
* Test model resource name.
* */
private static final String TEST_MODEL_RES = "examples/src/main/resources/models/catboost/model_reg.cbm";

/**
* Test data.
*/
private static final String TEST_DATA_RES = "examples/src/main/resources/datasets/boston_housing_dataset.txt";

/**
* Test expected results.
*/
private static final String TEST_ER_RES = "examples/src/main/resources/datasets/boston_housing_dataset-catboost-expected-results.txt";

/**
* Parser.
*/
private static final CatboostRegressionModelParser parser = new CatboostRegressionModelParser();

/**
* Run example.
*/
public static void main(String... args) throws ExecutionException, InterruptedException,
FileNotFoundException {
try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
File mdlRsrc = IgniteUtils.resolveIgnitePath(TEST_MODEL_RES);
if (mdlRsrc == null)
throw new IllegalArgumentException("File not found [resource_path=" + TEST_MODEL_RES + "]");

ModelReader reader = new FileSystemModelReader(mdlRsrc.getPath());
AsyncModelBuilder mdlBuilder = new IgniteDistributedModelBuilder(ignite, 4, 4);

File testData = IgniteUtils.resolveIgnitePath(TEST_DATA_RES);
if (testData == null)
throw new IllegalArgumentException("File not found [resource_path=" + TEST_DATA_RES + "]");

File testExpRes = IgniteUtils.resolveIgnitePath(TEST_ER_RES);
if (testExpRes == null)
throw new IllegalArgumentException("File not found [resource_path=" + TEST_ER_RES + "]");

try (Model<NamedVector, Future<Double>> mdl = mdlBuilder.build(reader, parser);
Scanner testDataScanner = new Scanner(testData);
Scanner testExpResultsScanner = new Scanner(testExpRes)) {
String[] columns = new String[]{
"f_0",
"f_1",
"f_2",
"f_3",
"f_4",
"f_5",
"f_6",
"f_7",
"f_8",
"f_9",
"f_10",
"f_11",
"f_12",
};

while (testDataScanner.hasNextLine()) {
String testDataStr = testDataScanner.nextLine();
String testExpResultsStr = testExpResultsScanner.nextLine();

HashMap<String, Double> testObj = new HashMap<>();
String[] values = testDataStr.split(",");

for (int i = 0; i < columns.length; i++) {
testObj.put(columns[i], Double.valueOf(values[i]));
}

double prediction = mdl.predict(VectorUtils.of(testObj)).get();
double expPrediction = Double.parseDouble(testExpResultsStr);

System.out.println("Expected: " + expPrediction + ", prediction: " + prediction);
}
}
}
finally {
System.out.flush();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
* limitations under the License.
*/

package org.apache.ignite.internal.processors.cache.persistence.tree.util;

/**
* Rows with this marker interface will always be inserted in the very end of the tree.
* <!-- Package description. --> XGBoost model inference examples.
*/
public interface InsertLast {
}

package org.apache.ignite.examples.ml.inference.catboost;
Loading