Giter Club home page Giter Club logo

mmlg's People

Contributors

familiar-project avatar

Watchers

 avatar

mmlg's Issues

Translation of the Xtext grammar to Langium

Translation of your Xtext grammar to Langium using https://github.com/TypeFox/xtext2langium

grammar Mmlg
import 'Terminals'

entry MMLModel infers MMLModel:
    input=DataInput  algorithm=MLChoiceAlgorithm ? formula=RFormula ? validation=Validation ?  
;

DataInput infers DataInput:
    'datainput' filelocation=STRING  (parsingInstruction=CSVParsingConfiguration )?  
;

CSVParsingConfiguration infers CSVParsingConfiguration:
    "separator" sep=CSVSeparator   
;

type CSVSeparator = ',' | ";";
CSVSeparator returns CSVSeparator:
    CSVSeparator_COMMA | CSVSeparator_SEMI_COLON
;
CSVSeparator_COMMA returns string: ',' ;
CSVSeparator_SEMI_COLON returns string: ";" ;

MLChoiceAlgorithm infers MLChoiceAlgorithm:
    'mlframework' framework=FrameworkLang  'algorithm' algorithm=MLAlgorithm   
;

type FrameworkLang = "scikit-learn" | "R" | "Weka";
FrameworkLang returns FrameworkLang:
    FrameworkLang_SCIKIT | FrameworkLang_R | FrameworkLang_JavaWeka
;
FrameworkLang_SCIKIT returns string: "scikit-learn" ;
FrameworkLang_R returns string: "R" ;
FrameworkLang_JavaWeka returns string: "Weka" ;

MLAlgorithm infers MLAlgorithm:
    (SVM | DT | RandomForest | LogisticRegression )
;

SVM infers SVM:
    { infer SVM} 'SVM' ('gamma=' gamma=FLOAT  )? ('C=' C=FLOAT  )? ('kernel=' kernel=SVMKernel  )? ('classification' svmclassification=SVMClassification  )?  
;

type SVMKernel = 'linear' | 'polynomial' | 'radial';
SVMKernel returns SVMKernel:
    SVMKernel_linear | SVMKernel_poly | SVMKernel_radial
;
SVMKernel_linear returns string: 'linear' ;
SVMKernel_poly returns string: 'polynomial' ;
SVMKernel_radial returns string: 'radial' ;

type SVMClassification = "C-classification" | "nu-classification" | "one-classification";
SVMClassification returns SVMClassification:
    SVMClassification_cClass | SVMClassification_nuClass | SVMClassification_oneClass
;
SVMClassification_cClass returns string: "C-classification" ;
SVMClassification_nuClass returns string: "nu-classification" ;
SVMClassification_oneClass returns string: "one-classification" ;

DT infers DT:
    { infer DT} ('DT' | 'DecisionTree' )(max_depth=INT )?  
;

RandomForest infers RandomForest:
    { infer RandomForest} ('RandomForest' | 'RF' ) 
;

LogisticRegression infers LogisticRegression:
    { infer LogisticRegression} 'LogisticRegression'  
;

FLOAT returns string:
    INT '.' INT  
;

RFormula infers RFormula:
    ('formula' (predictive=FormulaItem  "~" )? predictors=XFormula  ) 
;

XFormula infers XFormula:
    (AllVariables | PredictorVariables )
;

AllVariables infers AllVariables:
    all='.'  
;

PredictorVariables infers PredictorVariables:
    (vars+=FormulaItem  ("+" vars+=FormulaItem  )* ) 
;

FormulaItem infers FormulaItem:
    column=INT  | colName=STRING  
;

Validation infers Validation:
    stratification=StratificationMethod  metric+=ValidationMetric +  
;

StratificationMethod infers StratificationMethod:
    CrossValidation | TrainingTest 
;

CrossValidation infers CrossValidation:
    'CrossValidation' '{' 'numRepetitionCross' ^number=INT  '}'  
;

TrainingTest infers TrainingTest:
    'TrainingTest' '{' 'pourcentageTraining' ^number=INT  '}'  
;

type ValidationMetric = 'recall' | 'precision' | 'F1';
ValidationMetric returns ValidationMetric:
    ValidationMetric_RECALL | ValidationMetric_PRECISION | ValidationMetric_F1
;
ValidationMetric_RECALL returns string: 'recall' ;
ValidationMetric_PRECISION returns string: 'precision' ;
ValidationMetric_F1 returns string: 'F1' ;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.