Socket
Socket
Sign inDemoInstall

sap-leonardo

Package Overview
Dependencies
48
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.1 to 0.5.2

dist/product_image_classification.d.ts

1

dist/image_feature_extraction.d.ts

@@ -7,2 +7,3 @@ import { Promise } from "es6-promise";

featureExtraction(files: string, authorization?: any): Promise<any>;
customizable(modelName: string, version: string, files: string): Promise<any>;
}

@@ -36,3 +36,10 @@ "use strict";

}
/*eslint no-unused-vars ["off", { "args": "all" }]*/
customizable(modelName, version, files) {
return new es6_promise_1.Promise((resolve, reject) => {
// const url = "/ml/imageclassification/models/" + modelName + "/versions/" + version;
reject("not implemented");
});
}
}
exports.ImageFeatureExtraction = ImageFeatureExtraction;

@@ -14,1 +14,2 @@ export * from "./imageclassification";

export * from "./face_feature_extraction";
export * from "./product_image_classification";

@@ -19,1 +19,2 @@ "use strict";

__export(require("./face_feature_extraction"));
__export(require("./product_image_classification"));

4

dist/test/test_image_feature_extraction.js

@@ -35,4 +35,4 @@ "use strict";

});
xit("should return method not implemented error", (done) => {
imageFeatureExtraction.featureExtraction("").then(() => { chai_1.expect.fail(); }, (err) => {
it("should return method not implemented error", (done) => {
imageFeatureExtraction.customizable("", "", "").then(() => { chai_1.expect.fail(); }, (err) => {
chai_1.expect(err).is.equal("not implemented");

@@ -39,0 +39,0 @@ }).then(done, done);

@@ -32,3 +32,3 @@ "use strict";

const similarityScoringWithOptions = new index_1.SimilarityScoring(process.env.API_KEY);
describe("texts", () => {
describe("numSimilarVectors", () => {
it("should detect similarity scores for 1 similar vector", (done) => {

@@ -48,2 +48,47 @@ const optionsOne = JSON.stringify({ numSimilarVectors: 1 });

});
describe("algorithm", () => {
it("should detect similarity scores for naive", (done) => {
const optionsOne = JSON.stringify({ numSimilarVectors: 2, algorithm: "naive" });
similarityScoringWithOptions.similarityScoring(null, JSON.stringify(data), optionsOne).then((body) => {
chai_1.expect(body).to.have.property("id");
chai_1.expect(body).to.have.property("predictions");
chai_1.expect(body).to.have.property("processedTime");
chai_1.expect(body).to.have.property("status").to.be.equal("DONE");
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3);
// for (let i = 0; i < 3; i++) {
// expect(body.predictions[i].similarVectors[0].score).to.be.equal(predictions[i].similarVectors[0].score);
// }
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3).is.eql(predictions);
}).then(done, done);
});
it("should detect similarity scores for matrix_mult", (done) => {
const optionsOne = JSON.stringify({ numSimilarVectors: 2, algorithm: "matrix_mult" });
similarityScoringWithOptions.similarityScoring(null, JSON.stringify(data), optionsOne).then((body) => {
chai_1.expect(body).to.have.property("id");
chai_1.expect(body).to.have.property("predictions");
chai_1.expect(body).to.have.property("processedTime");
chai_1.expect(body).to.have.property("status").to.be.equal("DONE");
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3);
// for (let i = 0; i < 3; i++) {
// expect(body.predictions[i].similarVectors[0].score).to.be.equal(predictions[i].similarVectors[0].score);
// }
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3).is.eql(predictions);
}).then(done, done);
});
it("should detect similarity scores for clustering", (done) => {
const optionsOne = JSON.stringify({ numSimilarVectors: 2, algorithm: "clustering" });
similarityScoringWithOptions.similarityScoring(null, JSON.stringify(data), optionsOne).then((body) => {
chai_1.expect(body).to.have.property("id");
chai_1.expect(body).to.have.property("predictions");
chai_1.expect(body).to.have.property("processedTime");
chai_1.expect(body).to.have.property("status").to.be.equal("DONE");
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3);
// for (let i = 0; i < 3; i++) {
// expect(body.predictions[i].similarVectors[0].score).to.be.equal(predictions[i].similarVectors[0].score);
// }
chai_1.expect(body.predictions).to.be.an("array").have.lengthOf(3).is.eql(predictions);
}).then(done, done);
});
});
// algorithm - Optional. Algorithm to use for calculation, one of [“naive”, “matrix_mult”, “clustering”]
});

@@ -50,0 +95,0 @@ describe("error coverage", () => {

{
"name": "sap-leonardo",
"version": "0.5.1",
"version": "0.5.2",
"description": "NPM module for SAP Leonardo Machine Learning Foundation - Functional Services https://api.sap.com/package/SAPLeonardoMLFunctionalServices",

@@ -45,3 +45,3 @@ "main": "dist/index.js",

"coveralls": "^3.0.2",
"eslint": "^5.6.1",
"eslint": "^5.7.0",
"istanbul": "^0.4.5",

@@ -51,4 +51,4 @@ "mocha": "^5.2.0",

"tslint": "^5.11.0",
"typescript": "^3.1.1"
"typescript": "^3.1.3"
}
}
# SAP Leonardo Machine Learning Foundation - Functional Services
[![NPM](https://nodei.co/npm/sap-leonardo.png?mini=true)](https://nodei.co/npm/sap-leonardo/)
[NPM module](https://www.npmjs.com/package/sap-leonardo) for SAP Leonardo Machine Learning Foundation - Functional Services

@@ -57,4 +59,4 @@

- ~~Time Series Changepoint Detection API~~
- ~~Product Image Classification API~~
- ~~decommissioned: Time Series Changepoint Detection API~~
- [Product Image Classification API](https://api.sap.com/api/product_image_classification_api/resource)
- ~~Training Service for Customizable Similarity Search~~

@@ -127,2 +129,2 @@ - ~~Inference Service for Customizable Similarity Search~~

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.
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.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc