test
This commit is contained in:
commit
75f8bb5701
3
mahoutBasicReccomender/.idea/.gitignore
vendored
Normal file
3
mahoutBasicReccomender/.idea/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
13
mahoutBasicReccomender/.idea/compiler.xml
Normal file
13
mahoutBasicReccomender/.idea/compiler.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile name="Maven default annotation processors profile" enabled="true">
|
||||||
|
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||||
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||||
|
<outputRelativeToContentRoot value="true" />
|
||||||
|
<module name="mahoutBasicReccomender" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
7
mahoutBasicReccomender/.idea/encodings.xml
Normal file
7
mahoutBasicReccomender/.idea/encodings.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
20
mahoutBasicReccomender/.idea/jarRepositories.xml
Normal file
20
mahoutBasicReccomender/.idea/jarRepositories.xml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Central Repository" />
|
||||||
|
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Maven Central repository" />
|
||||||
|
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="jboss.community" />
|
||||||
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
14
mahoutBasicReccomender/.idea/misc.xml
Normal file
14
mahoutBasicReccomender/.idea/misc.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="MavenProjectsManager">
|
||||||
|
<option name="originalFiles">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="openjdk-19" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
15
mahoutBasicReccomender/csv/customer.csv
Normal file
15
mahoutBasicReccomender/csv/customer.csv
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
1,1,3
|
||||||
|
1,2,1
|
||||||
|
1,4,5
|
||||||
|
1,5,3
|
||||||
|
1,9,3
|
||||||
|
1,10,3
|
||||||
|
2,1,2
|
||||||
|
2,3,2
|
||||||
|
2,4,1
|
||||||
|
2,7,5
|
||||||
|
3,1,5
|
||||||
|
3,2,1
|
||||||
|
3,3,1
|
||||||
|
3,6,1
|
||||||
|
3,8,1
|
|
30
mahoutBasicReccomender/pom.xml
Normal file
30
mahoutBasicReccomender/pom.xml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>org.example</groupId>
|
||||||
|
<artifactId>mahoutBasicReccomender</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>19</maven.compiler.source>
|
||||||
|
<maven.compiler.target>19</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<version>2.0.5</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.mahout</groupId>
|
||||||
|
<artifactId>mahout-core</artifactId>
|
||||||
|
<version>0.9</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
22
mahoutBasicReccomender/src/main/java/org/example/Main.java
Normal file
22
mahoutBasicReccomender/src/main/java/org/example/Main.java
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package org.example;
|
||||||
|
|
||||||
|
import org.apache.mahout.cf.taste.common.TasteException;
|
||||||
|
import org.apache.mahout.cf.taste.impl.model.file.FileDataModel;
|
||||||
|
import org.apache.mahout.cf.taste.impl.similarity.LogLikelihoodSimilarity;
|
||||||
|
import org.apache.mahout.cf.taste.model.DataModel;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class Main {
|
||||||
|
public static String dataFile = "csv/customer.csv";
|
||||||
|
public static void main(String[] args) throws IOException, TasteException {
|
||||||
|
|
||||||
|
DataModel model = new FileDataModel(new File(dataFile));
|
||||||
|
|
||||||
|
LogLikelihoodSimilarity similarity = new LogLikelihoodSimilarity(model);
|
||||||
|
|
||||||
|
System.out.println("Similarity between user1 and user3 is " + similarity.userSimilarity(1, 3));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
BIN
mahoutBasicReccomender/target/classes/org/example/Main.class
Normal file
BIN
mahoutBasicReccomender/target/classes/org/example/Main.class
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user