Package: exe-kg-lib
ExeKGLibPython library for conveniently constructing and executing Machine Learning (ML) pipelines represented by Knowledge Graphs (KGs). It features a coding interface and a CLI, and allows the user to:Constructan ML pipeline that gets a CSV as input and processes the data using any of theavailable tasks and methods.Savethe constructed pipeline as a KG in Turtle format.Executethe generated KG.The coding interface is demonstrated withthree sample Python files. The pipelines represented by the generated sample KGs are briefly explained below:ML pipeline: Loads features and labels from an input CSV dataset, splits the data, trains and tests a k-NN model, and visualizes the prediction errors.Statistics pipeline: Loads a feature from an input CSV dataset, normalizes it, and plots its values (before and after normalization) using a scatter plot.Visualization pipeline: Loads a feature from an input CSV dataset and plots its values using a line plot.Under the hood,ExeKGLibuses well-known Python libraries for data processing and visualization and performing predictions such aspandas,matplotlib, andscikit-learn.ExeKGLibis described in the following paper published as part of ESWC 2023:Klironomos A., Zhou B., Tan Z., Zheng Z., Gad-Elrab M., Paulheim H., Kharlamov E.ExeKGLib: Knowledge Graphs-Empowered Machine Learning AnalyticsDetailed information (installation, documentation etc.) aboutExeKGLibcan be found inits websiteand basic information is shown below.InstallationTo install, runpip install exe-kg-lib.For detailed installation instructions, refer to theinstallation pageofExeKGLib's website.Ready-to-use ML-related tasks and methodsClick to expandKG schema (abbreviation)TaskMethodPropertiesInput (data structure)Output (data structure)Implemented by Python classMachine Learning (ml)TrainKNNTrain-DataInTrainX (Matrix or Vector)DataInTrainY (Matrix or Vector)DataOutPredictedValueTrain (Matrix or Vector)DataOutTrainModel (SingleValue)TrainKNNTrainMachine Learning (ml)TrainMLPTrain-DataInTrainX (Matrix or Vector)DataInTrainY (Matrix or Vector)DataOutPredictedValueTrain (Matrix or Vector)DataOutTrainModel (SingleValue)TrainMLPTrainMachine Learning (ml)TrainLRTrain-DataInTrainX (Matrix or Vector)DataInTrainY (Matrix or Vector)DataOutPredictedValueTrain (Matrix or Vector)DataOutTrainModel (SingleValue)TrainLRTrainMachine Learning (ml)TestKNNTest-DataInTestModel (SingleValue)DataInTestX (Matrix or Vector)DataOutPredictedValueTest (Matrix or Vector)TestKNNTestMachine Learning (ml)TestMLPTest-DataInTestModel (SingleValue)DataInTestX (Matrix or Vector)DataOutPredictedValueTest (Matrix or Vector)TestMLPTestMachine Learning (ml)TestLRTest-DataInTestModel (SingleValue)DataInTestX (Matrix or Vector)DataOutPredictedValueTest (Matrix or Vector)TestLRTestMachine Learning (ml)PerformanceCalculationPerformanceCalculationMethod-DataInTrainRealY (Matrix or Vector)DataInTrainPredictedY (Matrix or Vector)DataInTestPredictedY (Matrix or Vector)DataInTestRealY (Matrix or Vector)DataOutMLTestErr (Vector)DataOutMLTrainErr (Vector)PerformanceCalculationPerformanceCalculationMethodMachine Learning (ml)ConcatenationConcatenationMethod-DataInConcatenation (list of Vector)DataOutConcatenatedData (Matrix)ConcatenationConcatenationMethodMachine Learning (ml)DataSplittingDataSplittingMethod-DataInDataSplittingX (Matrix or Vector)DataInDataSplittingY (Matrix or Vector)DataOutSplittedTestDataX (Matrix or Vector)DataOutSplittedTrainDataY (Matrix or Vector)DataOutSplittedTrainDataX (Matrix or Vector)DataOutSplittedTestDataY (Matrix or Vector)DataSplittingDataSplittingMethodVisualization (visu)CanvasTaskCanvasMethodhasCanvasName (string)hasLayout (string)--CanvasTaskCanvasMethodVisualization (visu)PlotTaskLineplotMethodhasLineStyle (string)hasLineWidth (int)hasLegendName (string)DataInVector (Vector)-PlotTaskLineplotMethodVisualization (visu)PlotTaskScatterplotMethodhasLineStyle (string)hasLineWidth (int)hasScatterSize (int)hasLegendName (string)DataInVector (Vector)-PlotTaskScatterplotMethodStatistics (stats)TrendCalculationTaskTrendCalculationMethod-DataInTrendCalculation (Vector)DataOutTrendCalculation (Vector)TrendCalculationTaskTrendCalculationMethodStatistics (stats)NormalizationTaskNormalizationMethod-DataInNormalization (Vector)DataOutNormalization (Vector)NormalizationTaskNormalizationMethodStatistics (stats)ScatteringCalculationTaskScatteringCalculationMethod-DataInScatteringCalculation (Vector)DataOutScatteringCalculation (Vector)ScatteringCalculationTaskScatteringCalculationMethodUsageCreating an ML pipelineVia code: See theprovided examples. To fetch them to your working directory for easy access, runtyper exe_kg_lib.cli.main run get-examples.Step-by-step via CLI: Runtyper exe_kg_lib.cli.main run create-pipeline.Executing an ML pipelineVia code: Seeexample code.Via CLI: Runtyper exe_kg_lib.cli.main run run-pipeline <pipeline_path>.Adding a new ML-related task and methodTo perform this type ofExeKGLibextension, there are 3 required steps:Selection of a relevant bottom-level KG schema (Statistics, ML, or Visualization) according to the type of the new task and method.Addition of new semantic components (entities, properties, etc) to the selected KG schema.Addition of a Python class to the corresponding module ofexe_kg_lib.classes.taskspackage.For steps 2 and 3, refer to therelevant pageofExeKGLib's website.DocumentationSee theCode ReferenceandDevelopmentsections of theExeKGLib's website.External resourcesKG schemataTop-level:Data ScienceBottom-level:Visualization|Statistics|Machine LearningThe above KG schemata are included in theExeKGOntology repository.Dataset used in code examplesThe datasetwas generated using thesklearn.datasets.make_classification()function of thescikit-learn Python library.LicenseExeKGLib is open-sourced under the AGPL-3.0 license. See theLICENSEfile for details.