GithubHelp home page GithubHelp logo

Rating ratio implementation about librec HOT 4 CLOSED

guoguibing avatar guoguibing commented on May 12, 2024
Rating ratio implementation

from librec.

Comments (4)

guoguibing avatar guoguibing commented on May 12, 2024

I understand. We have getRatioByUser(ratio) in the RatioDataSplitter for this purpose.

from librec.

rburke2233 avatar rburke2233 commented on May 12, 2024

I am talking about getRatioByUser(). Because the training / test split is random by item, this method does not guarantee a fixed number of test items for each user and that number might be zero, as in my example with a small test data set. See code fragment here:

			for (int j : items) {
				if (Randoms.uniform() < ratio) {
					testMatrix.set(u, j, 0.0);
				} else {
					trainMatrix.set(u, j, 0.0);
				}
			}

Randoms.uniform() could be less than ratio for all a user's items and then there is no test data for that user.

from librec.

guoguibing avatar guoguibing commented on May 12, 2024

I see. Can you pull a request to fix up this issue? It is always valuable to fix up any issues.

from librec.

wangyufengkevin avatar wangyufengkevin commented on May 12, 2024

This issue has supported in 2.0.0-RC version, the method is getFixedRatioByUser and configuration is data.splitter.ratio=userfixed, please try it.

from librec.

Related Issues (20)

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.