Skip to content

Commit

Permalink
Some extra renaming in RecommendationSystem.SimpleSvd.
Browse files Browse the repository at this point in the history
--HG--
rename : RecommendationSystem.SimpleSvd/Basic/BasicSvdRecommendationSystem.cs => RecommendationSystem.SimpleSvd/Basic/BasicSimpleSvdRecommendationSystem.cs
rename : RecommendationSystem.SimpleSvd/Basic/Prediction/BasicSvdPredictor.cs => RecommendationSystem.SimpleSvd/Basic/Prediction/BasicSimpleSvdPredictor.cs
rename : RecommendationSystem.SimpleSvd/Basic/Recommendations/BasicSvdRecommender.cs => RecommendationSystem.SimpleSvd/Basic/Recommendations/BasicSimpleSimpleSvdRecommender.cs
rename : RecommendationSystem.SimpleSvd/Basic/Training/BasicSvdTrainer.cs => RecommendationSystem.SimpleSvd/Basic/Training/BasicSimpleSimpleSvdTrainer.cs
rename : RecommendationSystem.SimpleSvd/Bias/BiasSvdRecommendationSystem.cs => RecommendationSystem.SimpleSvd/Bias/BiasSimpleSvdRecommendationSystem.cs
rename : RecommendationSystem.SimpleSvd/Bias/Prediction/BiasSvdPredictor.cs => RecommendationSystem.SimpleSvd/Bias/Prediction/BiasSimpleSvdPredictor.cs
rename : RecommendationSystem.SimpleSvd/Bias/Recommendations/BiasSvdRecommender.cs => RecommendationSystem.SimpleSvd/Bias/Recommendations/BiasSimpleSvdRecommender.cs
rename : RecommendationSystem.SimpleSvd/Bias/Training/BiasSvdTrainer.cs => RecommendationSystem.SimpleSvd/Bias/Training/BiasSimpleSvdTrainer.cs
rename : RecommendationSystem.SimpleSvd/ISvdRecommendationSystem.cs => RecommendationSystem.SimpleSvd/ISimpleSvdRecommendationSystem.cs
rename : RecommendationSystem.SimpleSvd/Recommendation/ISvdRecommender.cs => RecommendationSystem.SimpleSvd/Recommendation/ISimpleSvdRecommender.cs
rename : RecommendationSystem.SimpleSvd/Recommendation/SvdRecommenderBase.cs => RecommendationSystem.SimpleSvd/Recommendation/SimpleSvdRecommenderBase.cs
rename : RecommendationSystem.SimpleSvd/SvdRecommendationSystemBase.cs => RecommendationSystem.SimpleSvd/SimpleSvdRecommendationSystemBase.cs
  • Loading branch information
gligoran committed Sep 3, 2011
1 parent 2aa75bd commit ce7c43e
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 89 deletions.
12 changes: 6 additions & 6 deletions RecommendationSystem.QualityTesting/Program.cs
Expand Up @@ -195,14 +195,14 @@ public static void Main(string[] args)

if (svdBasic)
{
var rs = new BasicSvdRecommendationSystem();
var rs = new BasicSimpleSvdRecommendationSystem();
var model = rs.Trainer.TrainModel(trainUsers, artists, trainRatings, trainingParameters);
rs.SaveModel(string.Format(@"D:\Dataset\models\basicSvd-{0}.rs", filename), model);
}

if (svdBias)
{
var rs = new BiasSvdRecommendationSystem();
var rs = new BiasSimpleSvdRecommendationSystem();
var model = rs.Trainer.TrainModel(trainUsers, artists, trainRatings, trainingParameters);
rs.SaveModel(string.Format(@"D:\Dataset\models\biasSvd-{0}.rs", filename), model);
}
Expand Down Expand Up @@ -270,16 +270,16 @@ public static void Main(string[] args)

if (modelFile.Contains("basic"))
{
var basicSvdRecommender = new BasicSvdRecommender(useBiasBins[i]);
var rs = new BasicSvdRecommendationSystem(basicSvdRecommender);
var basicSvdRecommender = new BasicSimpleSimpleSvdRecommender(useBiasBins[i]);
var rs = new BasicSimpleSvdRecommendationSystem(basicSvdRecommender);
var svdModel = rs.LoadModel(modelFile);
var basicSvdTester = new SvdTester<IBasicSvdModel>(testName, rs, svdModel, testUsers, testRatings, artists);
basicSvdTester.Test();
}
else if (models[selectedModel - 1].Contains("bias"))
{
var biasSvdRecommender = new BiasSvdRecommender(useBiasBins[i]);
var rs = new BiasSvdRecommendationSystem(biasSvdRecommender);
var biasSvdRecommender = new BiasSimpleSvdRecommender(useBiasBins[i]);
var rs = new BiasSimpleSvdRecommendationSystem(biasSvdRecommender);
var svdModel = rs.LoadModel(modelFile);
var biasSvdTester = new SvdTester<IBiasSvdModel>(testName, rs, svdModel, testUsers, testRatings, artists);
biasSvdTester.Test();
Expand Down
4 changes: 2 additions & 2 deletions RecommendationSystem.QualityTesting/Testers/SvdTester.cs
Expand Up @@ -16,10 +16,10 @@ public class SvdTester<TSvdModel> : TesterBase
public List<IRating> TestRatings { get; set; }
public List<IArtist> Artists { get; set; }

public IRecommendationSystem<TSvdModel, IUser, ISvdTrainer<TSvdModel>, ISvdRecommender<TSvdModel>> RecommendationSystem { get; set; }
public IRecommendationSystem<TSvdModel, IUser, ISvdTrainer<TSvdModel>, ISimpleSvdRecommender<TSvdModel>> RecommendationSystem { get; set; }
public TSvdModel Model { get; set; }

public SvdTester(string testName, IRecommendationSystem<TSvdModel, IUser, ISvdTrainer<TSvdModel>, ISvdRecommender<TSvdModel>> recommendationSystem, TSvdModel model, List<IUser> testUsers, List<IRating> testRatings, List<IArtist> artists)
public SvdTester(string testName, IRecommendationSystem<TSvdModel, IUser, ISvdTrainer<TSvdModel>, ISimpleSvdRecommender<TSvdModel>> recommendationSystem, TSvdModel model, List<IUser> testUsers, List<IRating> testRatings, List<IArtist> artists)
{
RecommendationSystem = recommendationSystem;
Model = model;
Expand Down
@@ -0,0 +1,36 @@
using RecommendationSystem.SimpleSvd.Basic.Recommendations;
using RecommendationSystem.SimpleSvd.Basic.Training;
using RecommendationSystem.SimpleSvd.Recommendation;
using RecommendationSystem.Svd.Foundation.Basic.Models;
using RecommendationSystem.Svd.Foundation.Training;

namespace RecommendationSystem.SimpleSvd.Basic
{
public class BasicSimpleSvdRecommendationSystem : SimpleSvdRecommendationSystemBase<IBasicSvdModel>
{
public BasicSimpleSvdRecommendationSystem()
{
Trainer = new BasicSimpleSimpleSvdTrainer();
Recommender = new BasicSimpleSimpleSvdRecommender();
}

public BasicSimpleSvdRecommendationSystem(ISvdTrainer<IBasicSvdModel> trainer)
: this(trainer, new BasicSimpleSimpleSvdRecommender())
{}

public BasicSimpleSvdRecommendationSystem(ISimpleSvdRecommender<IBasicSvdModel> recommender)
: this(new BasicSimpleSimpleSvdTrainer(), recommender)
{}

public BasicSimpleSvdRecommendationSystem(ISvdTrainer<IBasicSvdModel> trainer, ISimpleSvdRecommender<IBasicSvdModel> recommender)
{
Trainer = trainer;
Recommender = recommender;
}

protected override IBasicSvdModel GetNewModel()
{
return new BasicSvdModel();
}
}
}

This file was deleted.

Expand Up @@ -5,7 +5,7 @@

namespace RecommendationSystem.SimpleSvd.Basic.Prediction
{
public class BasicSvdPredictor : SvdPredictorBase<IBasicSvdModel>
public class BasicSimpleSvdPredictor : SvdPredictorBase<IBasicSvdModel>
{
public override float PredictRatingForArtist(IUser user, IBasicSvdModel model, List<IArtist> artists, int artistIndex, bool useBiasBins)
{
Expand Down
Expand Up @@ -9,13 +9,13 @@

namespace RecommendationSystem.SimpleSvd.Basic.Recommendations
{
public class BasicSvdRecommender : SvdRecommenderBase<IBasicSvdModel>
public class BasicSimpleSimpleSvdRecommender : SimpleSvdRecommenderBase<IBasicSvdModel>
{
public BasicSvdRecommender(bool useBiasBins = false)
: this(new BasicSvdPredictor(), useBiasBins)
public BasicSimpleSimpleSvdRecommender(bool useBiasBins = false)
: this(new BasicSimpleSvdPredictor(), useBiasBins)
{}

public BasicSvdRecommender(ISvdPredictor<IBasicSvdModel> predictor, bool useBiasBins = false)
public BasicSimpleSimpleSvdRecommender(ISvdPredictor<IBasicSvdModel> predictor, bool useBiasBins = false)
: base(predictor, useBiasBins)
{}

Expand Down
Expand Up @@ -7,13 +7,13 @@

namespace RecommendationSystem.SimpleSvd.Basic.Training
{
public class BasicSvdTrainer : SvdTrainerBase<IBasicSvdModel>
public class BasicSimpleSimpleSvdTrainer : SvdTrainerBase<IBasicSvdModel>
{
public BasicSvdTrainer()
: this(new BasicSvdPredictor())
public BasicSimpleSimpleSvdTrainer()
: this(new BasicSimpleSvdPredictor())
{}

public BasicSvdTrainer(ISvdPredictor<IBasicSvdModel> predictor)
public BasicSimpleSimpleSvdTrainer(ISvdPredictor<IBasicSvdModel> predictor)
: base(predictor)
{}

Expand Down
Expand Up @@ -9,24 +9,24 @@

namespace RecommendationSystem.SimpleSvd.Bias
{
public class BiasSvdRecommendationSystem : SvdRecommendationSystemBase<IBiasSvdModel>
public class BiasSimpleSvdRecommendationSystem : SimpleSvdRecommendationSystemBase<IBiasSvdModel>
{
#region Constructor
public BiasSvdRecommendationSystem()
public BiasSimpleSvdRecommendationSystem()
{
Trainer = new BiasSvdTrainer();
Recommender = new BiasSvdRecommender();
Trainer = new BiasSimpleSvdTrainer();
Recommender = new BiasSimpleSvdRecommender();
}

public BiasSvdRecommendationSystem(ISvdTrainer<IBiasSvdModel> trainer)
: this(trainer, new BiasSvdRecommender())
public BiasSimpleSvdRecommendationSystem(ISvdTrainer<IBiasSvdModel> trainer)
: this(trainer, new BiasSimpleSvdRecommender())
{}

public BiasSvdRecommendationSystem(ISvdRecommender<IBiasSvdModel> recommender)
: this(new BiasSvdTrainer(), recommender)
public BiasSimpleSvdRecommendationSystem(ISimpleSvdRecommender<IBiasSvdModel> recommender)
: this(new BiasSimpleSvdTrainer(), recommender)
{}

public BiasSvdRecommendationSystem(ISvdTrainer<IBiasSvdModel> trainer, ISvdRecommender<IBiasSvdModel> recommender)
public BiasSimpleSvdRecommendationSystem(ISvdTrainer<IBiasSvdModel> trainer, ISimpleSvdRecommender<IBiasSvdModel> recommender)
{
Trainer = trainer;
Recommender = recommender;
Expand Down
Expand Up @@ -6,7 +6,7 @@

namespace RecommendationSystem.SimpleSvd.Bias.Prediction
{
public class BiasSvdPredictor : SvdPredictorBase<IBiasSvdModel>
public class BiasSimpleSvdPredictor : SvdPredictorBase<IBiasSvdModel>
{
public override float PredictRatingForArtist(IUser user, IBiasSvdModel model, List<IArtist> artists, int artist, bool useBiasBins)
{
Expand Down
Expand Up @@ -9,13 +9,13 @@

namespace RecommendationSystem.SimpleSvd.Bias.Recommendations
{
public class BiasSvdRecommender : SvdRecommenderBase<IBiasSvdModel>
public class BiasSimpleSvdRecommender : SimpleSvdRecommenderBase<IBiasSvdModel>
{
public BiasSvdRecommender(bool useBiasBins = false)
: this(new BiasSvdPredictor(), useBiasBins)
public BiasSimpleSvdRecommender(bool useBiasBins = false)
: this(new BiasSimpleSvdPredictor(), useBiasBins)
{}

public BiasSvdRecommender(ISvdPredictor<IBiasSvdModel> predictor, bool useBiasBins = false)
public BiasSimpleSvdRecommender(ISvdPredictor<IBiasSvdModel> predictor, bool useBiasBins = false)
: base(predictor, useBiasBins)
{}

Expand Down
Expand Up @@ -8,14 +8,14 @@

namespace RecommendationSystem.SimpleSvd.Bias.Training
{
public class BiasSvdTrainer : SvdTrainerBase<IBiasSvdModel>
public class BiasSimpleSvdTrainer : SvdTrainerBase<IBiasSvdModel>
{
#region Constructor
public BiasSvdTrainer()
: this(new BiasSvdPredictor())
public BiasSimpleSvdTrainer()
: this(new BiasSimpleSvdPredictor())
{}

public BiasSvdTrainer(ISvdPredictor<IBiasSvdModel> predictor)
public BiasSimpleSvdTrainer(ISvdPredictor<IBiasSvdModel> predictor)
: base(predictor)
{}
#endregion
Expand Down
Expand Up @@ -5,7 +5,7 @@

namespace RecommendationSystem.SimpleSvd
{
public interface ISvdRecommendationSystem<TSvdModel> : IRecommendationSystem<TSvdModel, IUser, ISvdTrainer<TSvdModel>, ISvdRecommender<TSvdModel>>
public interface ISimpleSvdRecommendationSystem<TSvdModel> : IRecommendationSystem<TSvdModel, IUser, ISvdTrainer<TSvdModel>, ISimpleSvdRecommender<TSvdModel>>
where TSvdModel : ISvdModel
{
void SaveModel(string filename, TSvdModel model);
Expand Down
Expand Up @@ -4,7 +4,7 @@

namespace RecommendationSystem.SimpleSvd.Recommendation
{
public interface ISvdRecommender<TSvdModel> : IRecommender<TSvdModel>
public interface ISimpleSvdRecommender<TSvdModel> : IRecommender<TSvdModel>
where TSvdModel : ISvdModel
{
ISvdPredictor<TSvdModel> Predictor { get; set; }
Expand Down
Expand Up @@ -6,13 +6,13 @@

namespace RecommendationSystem.SimpleSvd.Recommendation
{
public abstract class SvdRecommenderBase<TSvdModel> : ISvdRecommender<TSvdModel>
public abstract class SimpleSvdRecommenderBase<TSvdModel> : ISimpleSvdRecommender<TSvdModel>
where TSvdModel : ISvdModel
{
public ISvdPredictor<TSvdModel> Predictor { get; set; }
public bool UseBiasBins { get; set; }

protected SvdRecommenderBase(ISvdPredictor<TSvdModel> predictor, bool useBiasBins = false)
protected SimpleSvdRecommenderBase(ISvdPredictor<TSvdModel> predictor, bool useBiasBins = false)
{
Predictor = predictor;
UseBiasBins = useBiasBins;
Expand Down
Expand Up @@ -53,18 +53,18 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Basic\Prediction\BasicSvdPredictor.cs" />
<Compile Include="Basic\Training\BasicSvdTrainer.cs" />
<Compile Include="Bias\Prediction\BiasSvdPredictor.cs" />
<Compile Include="Bias\Recommendations\BiasSvdRecommender.cs" />
<Compile Include="Basic\BasicSvdRecommendationSystem.cs" />
<Compile Include="Basic\Recommendations\BasicSvdRecommender.cs" />
<Compile Include="Bias\BiasSvdRecommendationSystem.cs" />
<Compile Include="Bias\Training\BiasSvdTrainer.cs" />
<Compile Include="Recommendation\ISvdRecommender.cs" />
<Compile Include="Recommendation\SvdRecommenderBase.cs" />
<Compile Include="ISvdRecommendationSystem.cs" />
<Compile Include="SvdRecommendationSystemBase.cs" />
<Compile Include="Basic\Prediction\BasicSimpleSvdPredictor.cs" />
<Compile Include="Basic\Training\BasicSimpleSimpleSvdTrainer.cs" />
<Compile Include="Bias\Prediction\BiasSimpleSvdPredictor.cs" />
<Compile Include="Bias\Recommendations\BiasSimpleSvdRecommender.cs" />
<Compile Include="Basic\BasicSimpleSvdRecommendationSystem.cs" />
<Compile Include="Basic\Recommendations\BasicSimpleSimpleSvdRecommender.cs" />
<Compile Include="Bias\BiasSimpleSvdRecommendationSystem.cs" />
<Compile Include="Bias\Training\BiasSimpleSvdTrainer.cs" />
<Compile Include="Recommendation\ISimpleSvdRecommender.cs" />
<Compile Include="Recommendation\SimpleSvdRecommenderBase.cs" />
<Compile Include="ISimpleSvdRecommendationSystem.cs" />
<Compile Include="SimpleSvdRecommendationSystemBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
Expand Up @@ -7,11 +7,11 @@

namespace RecommendationSystem.SimpleSvd
{
public abstract class SvdRecommendationSystemBase<TSvdModel> : ISvdRecommendationSystem<TSvdModel>
public abstract class SimpleSvdRecommendationSystemBase<TSvdModel> : ISimpleSvdRecommendationSystem<TSvdModel>
where TSvdModel : ISvdModel
{
public ISvdTrainer<TSvdModel> Trainer { get; set; }
public ISvdRecommender<TSvdModel> Recommender { get; set; }
public ISimpleSvdRecommender<TSvdModel> Recommender { get; set; }

#region SaveModel
public void SaveModel(string filename, TSvdModel model)
Expand Down

0 comments on commit ce7c43e

Please sign in to comment.