Skip to content
Snippets Groups Projects
Commit 59e439c1 authored by ROUSSANALY Azim's avatar ROUSSANALY Azim
Browse files

First commit

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 375 additions and 0 deletions
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>weka</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding//src/main/java=UTF8
encoding//src/main/resources=UTF8
encoding//src/test/java=UTF8
encoding//src/test/resources=UTF8
encoding/<project>=UTF8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=11
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
# Régression en Java et API WEKA
Ce projet est un exemple d'utilisation d'un modèle basé sur la régression et construit avec le framework WEKA
## Exemple d'utilisation
```
% ./run -i 13 6 12 2
févr. 09, 2023 3:21:17 PM fr.ul.miage.weka.Main main
INFO: in1=13 in2=6 in3=12 in4=2
févr. 09, 2023 3:21:17 PM fr.ul.miage.weka.Main main
INFO: Démarrage du traitement
févr. 09, 2023 3:21:17 PM fr.ul.miage.weka.Main main
INFO: Model content:
Linear Regression Model
out1 =
0.1551 * in1 +
0.2385 * in2 +
0.1207 * in3 +
0.0527 * in4 +
0.2182
févr. 09, 2023 3:21:17 PM fr.ul.miage.weka.Main main
INFO: Observation : 13,6,12,2
Prediction: 5.218597418144785
```
## Arguments
Les arguments de la ligne de commande sont au format
`-i ou --in <entier#1> <entier#2> <entier#3> <entier#3>
## Explications
Ce programme utilise un modèle préalablement optimisé, évalué et finalisé avec le framework
[WEKA (Explorer)](https://www.cs.waikato.ac.nz/ml/weka/)
Pour plus d'informations sur la création d'un modèle, voir :
[https://machinelearningmastery.com/save-machine-learning-model-make-predictions-weka/](https://machinelearningmastery.com/save-machine-learning-model-make-predictions-weka/)
Pour cet exemple nous avons utilisé un dataset d'illustration de la régression disponible :
[https://prdownloads.sourceforge.net/weka/datasets-arie_ben_david.tar.gz](https://prdownloads.sourceforge.net/weka/datasets-arie_ben_david.tar.gz)
et disponible dans le dossier `samples`de ce projet.
Le modèle résultant est stocké dans le dossier `resources`sous l'intitulé `exemple.model`
##Auteur
Azim Roussanaly (IDMC/Université de Lorraine)
##Licence
Licence MIT
\ No newline at end of file
#!/bin/sh
# ----------------------------------------------------------------------------
# Copyright 2001-2006 The Apache Software Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------
#
# Copyright (c) 2001-2006 The Apache Software Foundation. All rights
# reserved.
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
BASEDIR=`cd "$PRGDIR/.." >/dev/null; pwd`
# Reset the REPO variable. If you need to influence this use the environment setup file.
REPO=
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
Darwin*) darwin=true
if [ -z "$JAVA_VERSION" ] ; then
JAVA_VERSION="CurrentJDK"
else
echo "Using Java version: $JAVA_VERSION"
fi
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
JAVA_HOME=`/usr/libexec/java_home`
else
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# If a specific java binary isn't specified search for the standard 'java' binary
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD=`which java`
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." 1>&2
echo " We cannot execute $JAVACMD" 1>&2
exit 1
fi
if [ -z "$REPO" ]
then
REPO="$BASEDIR"/repo
fi
CLASSPATH="$BASEDIR"/etc:"$REPO"/weka-stable-3.8.0.jar:"$REPO"/java-cup-11b-2015.03.26.jar:"$REPO"/java-cup-11b-runtime-2015.03.26.jar:"$REPO"/bounce-0.18.jar:"$REPO"/mtj-1.0.4.jar:"$REPO"/netlib-native_ref-osx-x86_64-1.1-natives.jar:"$REPO"/native_ref-java-1.1.jar:"$REPO"/jniloader-1.1.jar:"$REPO"/netlib-native_ref-linux-x86_64-1.1-natives.jar:"$REPO"/netlib-native_ref-linux-i686-1.1-natives.jar:"$REPO"/netlib-native_ref-win-x86_64-1.1-natives.jar:"$REPO"/netlib-native_ref-win-i686-1.1-natives.jar:"$REPO"/netlib-native_ref-linux-armhf-1.1-natives.jar:"$REPO"/netlib-native_system-osx-x86_64-1.1-natives.jar:"$REPO"/native_system-java-1.1.jar:"$REPO"/netlib-native_system-linux-x86_64-1.1-natives.jar:"$REPO"/netlib-native_system-linux-i686-1.1-natives.jar:"$REPO"/netlib-native_system-linux-armhf-1.1-natives.jar:"$REPO"/netlib-native_system-win-x86_64-1.1-natives.jar:"$REPO"/netlib-native_system-win-i686-1.1-natives.jar:"$REPO"/arpack_combined_all-0.1.jar:"$REPO"/netlib-java-1.1.jar:"$REPO"/core-1.1.jar:"$REPO"/commons-cli-1.4.jar:"$REPO"/weka-0.0.1-SNAPSHOT.jar
ENDORSED_DIR=
if [ -n "$ENDORSED_DIR" ] ; then
CLASSPATH=$BASEDIR/$ENDORSED_DIR/*:$CLASSPATH
fi
if [ -n "$CLASSPATH_PREFIX" ] ; then
CLASSPATH=$CLASSPATH_PREFIX:$CLASSPATH
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"`
[ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"`
[ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"`
fi
exec "$JAVACMD" $JAVA_OPTS \
-classpath "$CLASSPATH" \
-Dapp.name="run" \
-Dapp.pid="$$" \
-Dapp.repo="$REPO" \
-Dapp.home="$BASEDIR" \
-Dbasedir="$BASEDIR" \
fr.ul.miage.weka.Main \
"$@"
@REM ----------------------------------------------------------------------------
@REM Copyright 2001-2006 The Apache Software Foundation.
@REM
@REM Licensed under the Apache License, Version 2.0 (the "License");
@REM you may not use this file except in compliance with the License.
@REM You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing, software
@REM distributed under the License is distributed on an "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM See the License for the specific language governing permissions and
@REM limitations under the License.
@REM ----------------------------------------------------------------------------
@REM
@REM Copyright (c) 2001-2006 The Apache Software Foundation. All rights
@REM reserved.
@echo off
set ERROR_CODE=0
:init
@REM Decide how to startup depending on the version of windows
@REM -- Win98ME
if NOT "%OS%"=="Windows_NT" goto Win9xArg
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" @setlocal
@REM -- 4NT shell
if "%eval[2+2]" == "4" goto 4NTArgs
@REM -- Regular WinNT shell
set CMD_LINE_ARGS=%*
goto WinNTGetScriptDir
@REM The 4NT Shell from jp software
:4NTArgs
set CMD_LINE_ARGS=%$
goto WinNTGetScriptDir
:Win9xArg
@REM Slurp the command line arguments. This loop allows for an unlimited number
@REM of arguments (up to the command line limit, anyway).
set CMD_LINE_ARGS=
:Win9xApp
if %1a==a goto Win9xGetScriptDir
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto Win9xApp
:Win9xGetScriptDir
set SAVEDIR=%CD%
%0\
cd %0\..\..
set BASEDIR=%CD%
cd %SAVEDIR%
set SAVE_DIR=
goto repoSetup
:WinNTGetScriptDir
set BASEDIR=%~dp0\..
:repoSetup
set REPO=
if "%JAVACMD%"=="" set JAVACMD=java
if "%REPO%"=="" set REPO=%BASEDIR%\repo
set CLASSPATH="%BASEDIR%"\etc;"%REPO%"\weka-stable-3.8.0.jar;"%REPO%"\java-cup-11b-2015.03.26.jar;"%REPO%"\java-cup-11b-runtime-2015.03.26.jar;"%REPO%"\bounce-0.18.jar;"%REPO%"\mtj-1.0.4.jar;"%REPO%"\netlib-native_ref-osx-x86_64-1.1-natives.jar;"%REPO%"\native_ref-java-1.1.jar;"%REPO%"\jniloader-1.1.jar;"%REPO%"\netlib-native_ref-linux-x86_64-1.1-natives.jar;"%REPO%"\netlib-native_ref-linux-i686-1.1-natives.jar;"%REPO%"\netlib-native_ref-win-x86_64-1.1-natives.jar;"%REPO%"\netlib-native_ref-win-i686-1.1-natives.jar;"%REPO%"\netlib-native_ref-linux-armhf-1.1-natives.jar;"%REPO%"\netlib-native_system-osx-x86_64-1.1-natives.jar;"%REPO%"\native_system-java-1.1.jar;"%REPO%"\netlib-native_system-linux-x86_64-1.1-natives.jar;"%REPO%"\netlib-native_system-linux-i686-1.1-natives.jar;"%REPO%"\netlib-native_system-linux-armhf-1.1-natives.jar;"%REPO%"\netlib-native_system-win-x86_64-1.1-natives.jar;"%REPO%"\netlib-native_system-win-i686-1.1-natives.jar;"%REPO%"\arpack_combined_all-0.1.jar;"%REPO%"\netlib-java-1.1.jar;"%REPO%"\core-1.1.jar;"%REPO%"\commons-cli-1.4.jar;"%REPO%"\weka-0.0.1-SNAPSHOT.jar
set ENDORSED_DIR=
if NOT "%ENDORSED_DIR%" == "" set CLASSPATH="%BASEDIR%"\%ENDORSED_DIR%\*;%CLASSPATH%
if NOT "%CLASSPATH_PREFIX%" == "" set CLASSPATH=%CLASSPATH_PREFIX%;%CLASSPATH%
@REM Reaching here means variables are defined and arguments have been captured
:endInit
%JAVACMD% %JAVA_OPTS% -classpath %CLASSPATH% -Dapp.name="run" -Dapp.repo="%REPO%" -Dapp.home="%BASEDIR%" -Dbasedir="%BASEDIR%" fr.ul.miage.weka.Main %CMD_LINE_ARGS%
if %ERRORLEVEL% NEQ 0 goto error
goto end
:error
if "%OS%"=="Windows_NT" @endlocal
set ERROR_CODE=%ERRORLEVEL%
:end
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" goto endNT
@REM For old DOS remove the set variables from ENV - we assume they were not set
@REM before we started - at least we don't leave any baggage around
set CMD_LINE_ARGS=
goto postExec
:endNT
@REM If error code is set to 1 then the endlocal was done already in :error.
if %ERROR_CODE% EQU 0 @endlocal
:postExec
if "%FORCE_EXIT_ON_ERROR%" == "on" (
if %ERROR_CODE% NEQ 0 exit %ERROR_CODE%
)
exit /B %ERROR_CODE%
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment