Load features created by custom primitives - featuretools

I created some features base on custom primitives with help of featuretools and saved them into memory. Then I want load them with featuretools.load_features function. But I get the error RuntimeError: Primitive "LastTime" in module "__main__" not found
where LastTime is my custom primitive name.
So my question is how to properly load my custom features or to let featuretools know that such primitives exist ?
I have searched over documentation and issues on GitHub and didn't find proper information about it

Before loading in the saved features, re-run the code that defined the custom primitive.

Related

Codesys DTU in library

We are working on a data logging code and I would like to make a library of it.
The only thing that different programs will need to define is the type strict for the sample that the want to save. The library will save a sample every x period. But I don't know exactly how to have an external DTU in the library code? Is possible to declare the DTU as an interface or something similar? There must be a way to do so but not so sure what it is.
CODESYS does not have generics, there is no way around that. Although I am not convinced it would be an elegant or fitting design, there is one way you might be able to do if you really want your type to be visible in your logging library, but it has serious drawbacks.
You can create another library, or more accurately a family of libraries that will all use the same placeholder. Each of these libraries can define a type of the same name. Reference this placeholder from your logging library, so that it will resolve the name. That will allow your library to compile. Then, by controlling which library the placeholder resolves to inside the project, you can select which type is used. The big downside is you cannot use your logging library with two different types inside the same project, as you cannot get a placeholder to resolve to two libraries at the same time.
Personally, I would probably implement the logging library with some sort of log entry writer as a function block that contains size + arrays of bytes and manages the details of actual logging, and then define inherited function blocks in projects/libraries that need logging. Each of these inherited function blocks would give access to the bytes in a typed way (method, exposed reference/pointer) and assign the size based on the data type used (SIZEOF in FB_Init, for instance). This requires a bit of code for each type, but really not much, and new types are easy to add with a 20-second copy+paste+modify.

Azure ML Dataset Versioning: What is Different if it Points to the Same Data?

Context
In AzureML, we are facing an error when running a pipeline. It fails on to_pandas_dataframe because a particular dataset "could not be read beyond end of stream". On its own, this seems to be an issue with the parquet file that is being registered, maybe special characters being misinterpreted.
However, when we explicitly load a previous "version" of this Dataset--which points to the exact same location of data--it works as expected. In the documentation (here), Azure says that "when you load data from a dataset, the current data content referenced by the dataset is always loaded." This makes me think that a new version of the dataset with the same schema will be, well, the same.
Questions
What makes a Dataset version different from another version when both point to the same location? Is it only the schema definition?
Based on these differences, is there a way to figure out why one version would be succeeding and another failing?
Attempts
The schemas of the two versions are identical. We can profile both in AzureML, and all the fields have the same profile information.
As rightly suggested by #Anand Sowmithiran in comment section, This looks more like a bug with the SDK.
You can raise Azure support ticket

Nestjs dependency injection order when a module depends on a Mongoose model from #nestjs/mongoose, detailed diagram inside

The diagram does a good job at explaining the flow I currently have and why that is failing.
I have logger.module that exports a loger.service that depends on a #nestjs/mongoose LogModel.
I have a db.module that exports session.service and imports logger.module.
I have a session.service that is exported by the Db.Module and imports logger.service
I have a mock.db.module that is exactly like the real db.module (no mocked services, the real one) except the mongoose connection is to a in-memory mongodb.
I have a session.service.spec tests file that imports mock.db.module
However, I can't find any good way of providing LogModelinto log.module that doesn't need me to import #nestjs/mongooseand instantiate/wait for a new connection on every startup.
I was only able to produce 2 results:
use #forwardRef(() => Logger.module.register()) or/and #forwardRef(()=> Db.module.register()) which causes heap allocation error
don't use forwardRef and get circular dependency warnings.
How can I effectively map dependencies in an efficient way with Nestjs for this use case?
Diagram:

Does sklearn have any model type metadata either in the project or outside?

For example, it could be useful to have information in the library that allows one to select all tree-based ensemble models that work on regression/classifier tasks with more than one output.
I think users could gradually create this meta-data in the library if it doesn't already exist.
So something like:
[model_entry for model_entry in sklearn.meta_info if model_entry.2d_y and model_entry.ensemble]
but with better names.
You can always make use of the estimator tags to get such information: https://scikit-learn.org/dev/developers/develop.html#estimator-tags

Arangodb using Java API: when a graph is created do all Edges need to be defined already?

As far as I can tell, you must specify the edge definitions at creation time and there does not seem to be a method for adding an edge definition later. But I also see examples written in Javascript (I think) where edge definitions can be added later. Am I right about this Java limitation and does that suggest that Javascript might be a better choice for programming language to interact with ArangoDB?
EDIT: Could the edgeDefinitions Collection be added to after the graph is created?
EDIT: Seems to me that since the Java API is making REST calls, adding to the Collection later would not work at all.
It is possible to add an edge definition to an existing graph by using the method addEdgeDefinition of the ArangoDB-Java-Driver.
An example is listed in the Java Driver documentation.
Similar it is possible to replace/remove an edge definition byreplaceEdgeDefinition/removeEdgeDefinition.

Resources