Published
Edited
Aug 31, 2022
Importers
1 star
Insert cell
# Pyxis: Objective
Insert cell
Insert cell
Insert cell
Insert cell
import { pyxis } from "@leibatt/pyxis";
Insert cell
Insert cell
Insert cell
import { baltimoreCrime, freddyGreyFuneralInsightNode, baltimoreProtestsNode, peakCrimesNode } from "@leibatt/pyxis-insight";
Insert cell
Insert cell
Insert cell
freddyGreyFuneralInsightNode.analyticKnowledge[0].results();
Insert cell
Insert cell
freddyGreyFuneralInsightNode.domainKnowledge[0];
Insert cell
## Specify a Partial Insight
Insert cell
Insert cell
freddyGreyObjective = new pyxis.InsightNode(
"Freddy Grey's Funeral", // name
[baltimoreProtestsNode], // list all relevant domain knowledge
"*" // use a wildcard in place of analytic knowledge
);
Insert cell
Insert cell
Insert cell
april27Objective = new pyxis.InsightNode(
"April 27 Context", // name
"*", // list all relevant domain knowledge
[peakCrimesNode] // use a wildcard in place of analytic knowledge
);
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
peakCrimesNode.transformation;
Insert cell
Insert cell
newTransformation = {
let t = {
sources: [baltimoreCrime],
ops: "*",
transforms: "*", // specify a wildcard in place of the original operators
};
return t;
};
Insert cell
Insert cell
exploreBaltimoreCrime = new pyxis.AnalyticKnowledgeNode(
"exploreBaltlimoreCrime", // name
Date.now(), // timestamp
newTransformation, // transformation with wildcard
null, // relationship
() => pyxis.transformation.arquero.executeDataTransformation(newTransformation) // results function
);
Insert cell
exploreBaltimoreCrimeObjective = new pyxis.InsightNode(
"explore Baltimore Protests", // name
[baltimoreProtestsNode],
[exploreBaltimoreCrime]
);
Insert cell
Insert cell
Insert cell
Insert cell
import { knnrm } from "@leibatt/pyxis-relationships";
Insert cell
Insert cell
Insert cell
Insert cell
allCylindersPredictionsInputWildcard ={
let m = new pyxis.KNNRelationshipModel(
"allCylindersPredictions", // name
"*",
{ // output attribute, the outcome to be predicted
name: "Cylinders",
attributeType: pyxis.AttributeType.quantitative
}
);
return m;
};
Insert cell
Insert cell
allCylindersPredictionsOutputWildcard ={
let m = new pyxis.KNNRelationshipModel(
"allCylindersPredictions", // name
[ // input attributes, the attributes used to predict a certain outcome
{
name: "Weight_in_lbs", // Attribute name from the cars dataset
attributeType: pyxis.AttributeType.quantitative // the type of attribute (quantitative, ordinal, or nominal)
},
{
name: "Horsepower",
attributeType: pyxis.AttributeType.quantitative
}
],
"*"
);
return m;
};
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more