Example #1
1
        public MinerLinearModel(Workspace UseHome, HParameterSet Parameters)
            : base(SystemProcedures.Name_MinerLM, "Fits a linear model using ordinary least squares", UseHome, Parameters)
        {

            this._ParametersMap.Add("@NAME", new ProcedureParameterMetaData("@NAME!true!expression!The name of the model"));
            this._ParametersMap.Add("@INPUT", new ProcedureParameterMetaData("@INPUT!true!expressionset!The explanatory variables"));
            this._ParametersMap.Add("@OUTPUT", new ProcedureParameterMetaData("@OUTPUT!true!expression!The model variable"));
            this._ParametersMap.Add("@DATA", new ProcedureParameterMetaData("@DATA!true!dataset!The calibration dataset"));
            this._ParametersMap.Add("@WEIGHT", new ProcedureParameterMetaData("@WEIGHT!false!expression!The weight variable"));
            this._ParametersMap.Add("@WHERE", new ProcedureParameterMetaData("@WHERE!false!expression!The data filter"));
            this._ParametersMap.Add("@PARTITIONS", new ProcedureParameterMetaData("@PARTITIONS!false!expression!The number of partitions to run"));

        }
Example #2
0
        public Procedure(string Name, string Description, Workspace UseSpace, HParameterSet UseParameters)
        {

            this._Name = Name;
            this._ProcedureDescription = Description;
            this._Parameters = UseParameters;
            this._Home = UseSpace;
            this._ParametersMap = new Dictionary<string, ProcedureParameterMetaData>(StringComparer.OrdinalIgnoreCase);

        }
Example #3
0
 public FileProcedureFileDelete(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_FileDelete, "Deletes a file", UseHome, Parameters)
 {
     this._ParametersMap.Add("@PATH", new ProcedureParameterMetaData("@PATH!true!expression!The path of the file to delete"));
 }
Example #4
0
 public SystemProcedureIO(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemIO, "Toggles the communicator's IO on or off", UseHome, Parameters)
 {
     this._ParametersMap.Add("@IO", new ProcedureParameterMetaData("@IO!true!expression!True (turns io on) or false (turns io off)"));
 }
Example #5
0
 public FileProcedureFileCopy(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_FileCopy, "Copies a file from one location to another", UseHome, Parameters)
 {
     this._ParametersMap.Add("@PATH", new ProcedureParameterMetaData("@PATH!true!expression!The path of the file to move"));
     this._ParametersMap.Add("@NEW_PATH", new ProcedureParameterMetaData("@NEW_PATH!true!expression!The path of the new file name"));
 }
Example #6
0
 public SystemProcedureToTable(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemToTable, "Converts a global table to a static table", UseHome, Parameters)
 {
     this._ParametersMap.Add("@CHUNK", new ProcedureParameterMetaData("@CHUNK!true!expression!The name of the chunk to covert"));
     this._ParametersMap.Add("@ALIAS", new ProcedureParameterMetaData("@ALIAS!true!expression!The alias of the datastore to export to"));
     this._ParametersMap.Add("@NAME", new ProcedureParameterMetaData("@NAME!true!expression!The name of the new table to export"));
 }
Example #7
0
 public SystemProcedureDisconnect(Workspace Home, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemDisconnect, "Disconnects a datastore", Home, Parameters)
 {
     this._ParametersMap.Add("@ALIAS", new ProcedureParameterMetaData("@ALIAS!true!expression!The alias to assign to the connection path"));
 }
Example #8
0
        public SystemProcedureShuffle(Workspace UseHome, HParameterSet Parameters)
            : base(SystemProcedures.Name_SystemShuffle, "Randomly shuffles records in a dataset", UseHome, Parameters)
        {

            this._ParametersMap.Add("@TABLE", new ProcedureParameterMetaData("@TABLE!true!dataset!The full table name of the table to shuffle"));
            this._ParametersMap.Add("@SEED", new ProcedureParameterMetaData("@SEED!false!expression!The random seed"));

        }
Example #9
0
 public SystemProcedureMemoryDump(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemMemoryDump, "Prints all objects in memory", UseHome, Parameters)
 {
 }
Example #10
0
 public SystemProcedureDebugAST(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemDebugAST, "Prints the abstract syntax tree of a given expression", UseHome, Parameters)
 {
     this._ParametersMap.Add("@EXPRESSION", new ProcedureParameterMetaData("@EXPRESSION!true!expression!The expression to decompile"));
 }
Example #11
0
        public MinerGeneralizedLinearModel(Workspace UseHome, HParameterSet Parameters)
            : base(SystemProcedures.Name_MinerGLM, "Fits a generalized linear model using Fischer's scoring", UseHome, Parameters)
        {

            this._ParametersMap.Add("@NAME", new ProcedureParameterMetaData("@NAME!true!expression!The name of the model"));
            this._ParametersMap.Add("@INPUT", new ProcedureParameterMetaData("@INPUT!true!expressionset!The explanatory variables"));
            this._ParametersMap.Add("@OUTPUT", new ProcedureParameterMetaData("@OUTPUT!true!expression!The model variable"));
            this._ParametersMap.Add("@DATA", new ProcedureParameterMetaData("@DATA!true!expressionset!The calibration dataset"));
            this._ParametersMap.Add("@LINK", new ProcedureParameterMetaData("@LINK!true!lambda!The link function"));
            this._ParametersMap.Add("@WEIGHT", new ProcedureParameterMetaData("@WEIGHT!false!expression!The weight variable"));
            this._ParametersMap.Add("@WHERE", new ProcedureParameterMetaData("@WEIGHT!false!expression!The data filter"));
            this._ParametersMap.Add("@MAXITT", new ProcedureParameterMetaData("@MAXITT!false!expression!The maximum itterations the model will step"));

        }
Example #12
0
        public SystemProcedureExportText(Workspace UseHome, HParameterSet Parameters)
            : base(SystemProcedures.Name_SystemExportText, "Exports a dataset into a text file", UseHome, Parameters)
        {
            this._ParametersMap.Add("@TABLE", new ProcedureParameterMetaData("@TABLE!true!dataset!The full table name of the table to export"));
            this._ParametersMap.Add("@PATH", new ProcedureParameterMetaData("@PATH!true!expression!The path to the flat file to export to"));
            this._ParametersMap.Add("@DELIM", new ProcedureParameterMetaData("@DELIM!false!expression!The deliminator of the file, defaults to TAB"));

        }
Example #13
0
 public SystemProcedureDownload(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemDownload, "Downloads a web page or file to a local file", UseHome, Parameters)
 {
     this._ParametersMap.Add("@URL", new ProcedureParameterMetaData("@URL!true!expression!The URL to download"));
     this._ParametersMap.Add("@PATH", new ProcedureParameterMetaData("@PATH!true!expression!The path to the flat file to export to"));
 }
Example #14
0
 public SystemProcedureImportText(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemImportText, "Imports a deliminated flat file into a table", UseHome, Parameters)
 {
     this._ParametersMap.Add("@TABLE", new ProcedureParameterMetaData("@TABLE!true!dataset!The full table name of the table to load"));
     this._ParametersMap.Add("@PATH", new ProcedureParameterMetaData("@PATH!true!expression!The path to the flat file to import"));
     this._ParametersMap.Add("@DELIM", new ProcedureParameterMetaData("@DELIM!false!expression!The deliminator of the file, defaults to TAB"));
     this._ParametersMap.Add("@ESCAPE", new ProcedureParameterMetaData("@ESCAPE!false!expression!The escape character of the string, defaults to null"));
     this._ParametersMap.Add("@SKIPS", new ProcedureParameterMetaData("@SKIPS!false!expression!The number of records in the flat file to skip (like headers), defaults to 0"));
 }
Example #15
0
 public SystemProcedurePrintTable(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemPrintTable, "Prints all records in a table", UseHome, Parameters)
 {
     this._ParametersMap.Add("@TABLE", new ProcedureParameterMetaData("@TABLE!true!dataset!The full table name of the table to print"));
     this._ParametersMap.Add("@COUNT", new ProcedureParameterMetaData("@COUNT!false!expression!The max count of records to print; if blank, it will print all records"));
 }
Example #16
0
 public SystemProcedureReverse(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemReverse, "Reverses all records in a dataset", UseHome, Parameters)
 {
     this._ParametersMap.Add("@TABLE", new ProcedureParameterMetaData("@TABLE!true!dataset!The full table name of the table to reverse"));
 }
Example #17
0
 public FileProcedureFileZip(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_FileZip, "Zips a file or directory", UseHome, Parameters)
 {
     this._ParametersMap.Add("@ARC_PATH", new ProcedureParameterMetaData("@ARC_PATH!true!expression!The path of the archive"));
     this._ParametersMap.Add("@DIR_PATH", new ProcedureParameterMetaData("@DIR_PATH!true!expression!The path of a new directory to export to"));
 }
Example #18
0
 public SystemProcedureDeallocate(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemDeallocate, "Deallocates a scalar from memory", UseHome, Parameters)
 {
     this._ParametersMap.Add("@SCALAR", new ProcedureParameterMetaData("@SCALAR!true!expression!The name of scalar variable to deallocate"));
 }
Example #19
0
 public SystemProcedureDebugLambda(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemDebugLambda, "Debugs a lambda already in the heap", UseHome, Parameters)
 {
     this._ParametersMap.Add("@LAMBDA", new ProcedureParameterMetaData("@LAMBDA!true!expression!The name of the lambda to debug"));
 }
Example #20
0
 public SystemProcedureSort(Workspace UseHome, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemSort, "Does an inplace merge-sort of the dataset", UseHome, Parameters)
 {
     
     this._ParametersMap.Add("@TABLE", new ProcedureParameterMetaData("@TABLE!true!dataset!The full table name of the table to sort"));
     this._ParametersMap.Add("@KEY", new ProcedureParameterMetaData("@KEY!true!expression!The sort key as a string"));
     
 }
Example #21
0
        // Parameters //
        public static HParameterSet GetHParameter(Workspace Home, HScriptParser.Hparameter_setContext context)
        {

            // Create a set //
            HParameterSet parmset = new HParameterSet();

            // Step one: cycle through all parameters and look for any tables //
            DataSet first_data = null;
            List<HScriptParser.HparameterContext> param_context = new List<HScriptParser.HparameterContext>();
            foreach (HScriptParser.HparameterContext ctx in context.hparameter())
            {

                if (ctx.full_table_name() != null)
                {
                    DataSet d = VisitorHelper.GetData(Home, ctx.full_table_name());
                    if (first_data == null)
                        first_data = d;
                    parmset.Add(ctx.SCALAR().GetText(), d);
                }
                else
                    param_context.Add(ctx);

            }

            ExpressionVisitor exp_vis =
                first_data != null
                ? new ExpressionVisitor(null, Home, first_data.Name, first_data.Columns, new StaticRegister(null)) 
                : new ExpressionVisitor(null, Home);

            MatrixVisitor mat_vis = new MatrixVisitor(Home, null, exp_vis);

            foreach (HScriptParser.HparameterContext ctx in param_context)
            {

                string name = ctx.SCALAR().GetText();
                if (ctx.expression() != null)
                    parmset.Add(name, exp_vis.ToNode(ctx.expression()));
                else if (ctx.expression_alias_list() != null)
                    parmset.Add(name, exp_vis.ToNodes(ctx.expression_alias_list()));
                else if (ctx.lambda_unit() != null)
                    parmset.Add(name, VisitorHelper.RenderLambda(Home, ctx.lambda_unit()));
                else if (ctx.matrix_expression() != null)
                    parmset.Add(name, mat_vis.ToMatrix(ctx.matrix_expression()));
                else if (ctx.K_OUT() != null)
                    parmset.Add(name, Home.GlobalHeap.Scalars, ctx.IDENTIFIER().GetText());

            }

            return parmset;

        }
Example #22
0
 public TNodeProcedure(TNode Parent, Procedure Proc, HParameterSet Parameters)
     : base(Parent)
 {
     this._proc = Proc;
     this._parameters = Parameters;
 }
Example #23
0
 public SystemProcedureExplain(Workspace Home, HParameterSet Parameters)
     : base(SystemProcedures.Name_SystemExplain, "Prints meta data for a procedure", Home, Parameters)
 {
     
     this._ParametersMap.Add("@NAME", new ProcedureParameterMetaData("@NAME!true!expression!The name of the stored procedure"));
     
 }
Example #24
0
        public MinerFFNeural(Workspace UseHome, HParameterSet Parameters)
            : base(SystemProcedures.Name_MinerFFNN, "Fits a linear model using ordinary least squares", UseHome, Parameters)
        {

            this._ParametersMap.Add("@NAME", new ProcedureParameterMetaData("@NAME!true!expression!The name of the model"));
            this._ParametersMap.Add("@INPUT", new ProcedureParameterMetaData("@INPUT!true!expressionset!The explanatory variables"));
            this._ParametersMap.Add("@OUTPUT", new ProcedureParameterMetaData("@OUTPUT!true!expressionset!The model variables"));
            this._ParametersMap.Add("@OUTACT", new ProcedureParameterMetaData("@OUTACT!true!expression!The output activation function"));
            this._ParametersMap.Add("@RULE", new ProcedureParameterMetaData("@RULE!ftrue!expression!The training rule"));
            
            this._ParametersMap.Add("@DATA", new ProcedureParameterMetaData("@DATA!true!expressionset!The calibration dataset"));
            this._ParametersMap.Add("@WHERE", new ProcedureParameterMetaData("@WHERE!false!expression!The filter to apply to the data"));
            
            this._ParametersMap.Add("@HIDDENMAP", new ProcedureParameterMetaData("@HIDDEN1!false!expression!A string that represents the hidden layers"));

        }
Example #25
0
 public static Procedure Lookup(string Name, Workspace Home, HParameterSet Parameters)
 {
     return PROCEDURES[Name](Home, Parameters);
 }
Example #26
0
        public MinerRowCluster(Workspace UseHome, HParameterSet Parameters)
            : base(SystemProcedures.Name_MinerRC, "Clusters similar rows using a modified k-means algorithm", UseHome, Parameters)
        {

            this._ParametersMap.Add("@NAME", new ProcedureParameterMetaData("@NAME!true!expression!The name of the model"));
            this._ParametersMap.Add("@INPUT", new ProcedureParameterMetaData("@INPUT!true!expressionset!The explanatory equation"));
            this._ParametersMap.Add("@DATA", new ProcedureParameterMetaData("@DATA!true!expressionset!The calibration dataset"));
            this._ParametersMap.Add("@CLUSTERS", new ProcedureParameterMetaData("@CLUSTERS!true!expression!The weight variable"));
            this._ParametersMap.Add("@WEIGHT", new ProcedureParameterMetaData("@WEIGHT!false!expression!The weight variable"));
            this._ParametersMap.Add("@WHERE", new ProcedureParameterMetaData("@WHERE!false!expression!The number of data clusters"));
            this._ParametersMap.Add("@MAXITT", new ProcedureParameterMetaData("@MAXITT!false!expression!The maximum itterations the model will step"));

        }
Example #27
-1
        public SystemProcedureDropTable(Workspace UseHome, HParameterSet Parameters)
            : base(SystemProcedures.Name_SystemDropTable, "Remove an in memory table from memory or drops a static table from disk", UseHome, Parameters)
        {
            this._ParametersMap.Add("@TABLE", new ProcedureParameterMetaData("@TABLE!true!expression!The full table name of the table to drop"));

        }
Example #28
-1
        public MinerNonLinearModel(Workspace UseHome, HParameterSet Parameters)
            : base(SystemProcedures.Name_MinerLM, "Fits a non-linear model using the Levenberg-Marquadt algorithm", UseHome, Parameters)
        {

            this._ParametersMap.Add("@NAME", new ProcedureParameterMetaData("@NAME!true!expression!The name of the model"));
            this._ParametersMap.Add("@INPUT", new ProcedureParameterMetaData("@INPUT!true!expression!The explanatory equation"));
            this._ParametersMap.Add("@OUTPUT", new ProcedureParameterMetaData("@OUTPUT!true!expression!The model variable"));
            this._ParametersMap.Add("@DATA", new ProcedureParameterMetaData("@DATA!true!expressionset!The calibration dataset"));
            this._ParametersMap.Add("@WEIGHT", new ProcedureParameterMetaData("@WEIGHT!false!expression!The weight variable"));
            this._ParametersMap.Add("@WHERE", new ProcedureParameterMetaData("@WEIGHT!false!expression!The data filter"));
            this._ParametersMap.Add("@SCALE", new ProcedureParameterMetaData("@SCALE!false!expression!The starting scale"));
            this._ParametersMap.Add("@MAXITT", new ProcedureParameterMetaData("@MAXITT!false!expression!The maximum itterations the model will step"));
            this._ParametersMap.Add("@STRICT", new ProcedureParameterMetaData("@STRICT!false!expression!True: Trace(Design) * Scale, False: I * Scale"));
            this._ParametersMap.Add("@BETA", new ProcedureParameterMetaData("@BETA!false!matrix!The initial weights"));

        }