enter image description here
i upload image here you can see whole folder structure..
In StrongLoop Framework there not visible User model in common/model folder so it's difficult to how i add property in user model?
You have to create a new model which inherits user model. You can only make the changes that model and not the existing user model.
I am trying to retrain the model connected to an Azure SQL database. The sample code only deals with uploading CSV files.
It appears to post the data to a web service, make another call to pull back a job ID, then make a call to tell that job to start. I assume the job is created when the CSV is updated, when I call that service directly skipping the first part, it's an empty array. Calling the job start end point just gives me a 500 error with no jobID. I basically think I need to tell it to refresh from the SQL server and then retrain but I cannot find any code related to that.
I found this difficult to find in the documentation, but found this link that I was able to successfully run a batch execution without uploading a blob. https://learn.microsoft.com/en-us/azure/machine-learning/studio/web-services-that-use-import-export-modules
The key part is:
Copy and paste the C# sample code into your Program.cs file, and
remove all references to the blob storage (NOTE: you probably still want to have the blob storage for your output results, but not for uploading data)
Locate the request declaration and update the values of Web Service
Parameters that are passed to the Import Data and Export Data
modules. In this case, you use the original query, but define a new
table name.
To configure the Web Service Parameters for the import query and the destination table:
In the properties pane for the Import Data module, click the icon at the top right of the Database query field and select Set as web service parameter.
In the properties pane for the Export Data module, click the icon at the top right of the Data table name field and select Set as web service parameter.
At the bottom of the Export Data module properties pane, in the Web Service Parameters section, click Database query and rename it Query.
Click Data table name and rename it Table.
var request = new BatchExecutionRequest()
{
GlobalParameters = new Dictionary<string, string>() {
{ "Query", #"select [age], [workclass], [fnlwgt], [education], [education-num], [marital-status], [occupation], [relationship], [race], [sex], [capital-gain], [capital-loss], [hours-per-week], [native-country], [income] from dbo.censusdata" },
{ "Table", "dbo.ScoredTable2" },
}
};
Once you have the database as your load data module source, you need not have a web service input on the training module. You can also set a database query as a web parameter. Once you run the batch execution job to retrain the models, you can store them in Azure blob storage, and have your predictive model load them from there at runtime using "load trained model" modules rather than trained model modules. See this link for that procedure:
https://blogs.technet.microsoft.com/machinelearning/2017/06/19/loading-a-trained-model-dynamically-in-an-azure-ml-web-service/
So in short:
Use your SQL database as the source for your import data module
Run the batch execution process to retrain the model at whatever interval you want
Save the retrained models (ilearner files) to blob storage, or at an http address that is accessable
Use the load trained model module in your predictive experiment rather than trained model.
put the path to your blob or url in the parameters of the load trained model module(s).
run, publish and test the predictive experiment with the dynamically loaded models
Note, this approach can be used if you have multiple models in your experiment.
I was generated loopback.js framework auto generated rest api, I was trying to write acls for the rest api, that table contains multiple relations with other tables. I want to restrict every rest api call by using their names how do I find rest api names to write acls in loopback.js,
I mean if any rest api like "/users/{id}/requests" how to find this kind of rest api name. I am looking for any source or any suggestions.
From LoopBack documentation:
When two models have a relationship between them (see Creating model relations), LoopBack automatically creates a set of related model methods corresponding to the API routes defined for the relationship.
In the following list, modelName is the name of the related model and modelNamePlural is the plural form of the related model name.
belongsTo:
__get__relatedModelName
hasOne:
__create__relatedModelName
__get__relatedModelName
__update__relatedModelName
__destroy__relatedModelName
hasMany:
__count__relatedModelNamePlural
__create__relatedModelNamePlural
__delete__relatedModelNamePlural
__destroyById__relatedModelNamePlural
__findById__relatedModelNamePlural
__get__relatedModelNamePlural
__updateById__relatedModelNamePlural
hasManyThrough:
__count__relatedModelNamePlural
__create__relatedModelNamePlural
__delete__relatedModelNamePlural
__destroyById__relatedModelNamePlural
__exists__relatedModelNamePlural (through only)
__findById__relatedModelNamePlural
__get__relatedModelNamePlural
__link__relatedModelNamePlural (through only)
__updateById__relatedModelNamePlural
__unlink__relatedModelNamePlural (through only)
hasAndBelongsToMany:
__link__relatedModelNamePlural
__unlink__relatedModelNamePlural
I have a few PHP scripts which I am in the process of migrating to Node.js. I am using Sails.js for this and I would like to know how I can change databases for each request based on a request parameter.
Currently I have 3-4 identical PostgreSQL databases. Let's just say that each database corresponds to a different client.
Below is a segment of the current PHP script where the database connection is established:
$database = $_GET['db'];
$conn_details = "host=localhost port=5432 dbname=$database user=****** password=******";
$dbconn = pg_connect($conn_details);
Here you can see that the database name is coming from the request parameter "db".
I would like to have a similar functionality in my sails.js controller. I know that i can declare multiple databases in the connections.js and that I can have models use different databases but what i am after is for the models to stay the same and only the database to change based on each request.
I have found 2 similar questions but they have both stayed unanswered for quite some time now. (Here and here)
I think you are looking for something like sub apps
sails-hook-subapps
but it's experimental module. So i wouldn't recommend using it on production. Other option also not good is multiplying your Models like that:
One main model with all methods, attributes and "stuff"
Many models with connections config
In 'parent' model you will select to which model you want to send send action. For example write method:
getModel: function(dbName){
return models[dbName];
}
in models Object you will store all Models with different connections. Not sure how validators will works in this scenario. You need to test if it will not be required do do something like this in child Models
attributes: parentModel.attributes
I am using a UICollectionView to manage a to-do list with a NSFetchedResultController and RestKit. When I am creating/updating an element with the postObject:/putObject: methods, NSFetchedResultController does not get updated. If I call the reload method on the collection view new objects are not present. The only solution I found is reloading all the objects with getObjectsAtPath.
New objects are well added to the backend storage as well as in the local SQLite database. I set up the NSFetchedResultController's delegate correctly and initialized it with the mainQueueManagedObjectContext.