Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserAttributeBPRMF #472

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
1,038 changes: 1,038 additions & 0 deletions src/.vs/config/applicationhost.config

Large diffs are not rendered by default.

69 changes: 30 additions & 39 deletions src/MyMediaLite.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyMediaLite", "MyMediaLite\MyMediaLite.csproj", "{73424F09-BEEA-4992-B116-5F123496F5D3}"
EndProject
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Packages", "Packages.mdproj", "{AD1EB4BB-DE14-418B-B704-67D76E468FF0}"
Expand All @@ -25,48 +27,52 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Default|Any CPU = Default|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{21DB122B-6D35-41F2-AE88-790A55859209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21DB122B-6D35-41F2-AE88-790A55859209}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21DB122B-6D35-41F2-AE88-790A55859209}.Default|Any CPU.ActiveCfg = Debug|Any CPU
{21DB122B-6D35-41F2-AE88-790A55859209}.Default|Any CPU.Build.0 = Debug|Any CPU
{21DB122B-6D35-41F2-AE88-790A55859209}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21DB122B-6D35-41F2-AE88-790A55859209}.Release|Any CPU.Build.0 = Release|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Default|Any CPU.ActiveCfg = Debug|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Default|Any CPU.Build.0 = Debug|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Release|Any CPU.Build.0 = Release|Any CPU
{73424F09-BEEA-4992-B116-5F123496F5D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73424F09-BEEA-4992-B116-5F123496F5D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73424F09-BEEA-4992-B116-5F123496F5D3}.Default|Any CPU.ActiveCfg = Debug|Any CPU
{73424F09-BEEA-4992-B116-5F123496F5D3}.Default|Any CPU.Build.0 = Debug|Any CPU
{73424F09-BEEA-4992-B116-5F123496F5D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{73424F09-BEEA-4992-B116-5F123496F5D3}.Release|Any CPU.Build.0 = Release|Any CPU
{AD1EB4BB-DE14-418B-B704-67D76E468FF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD1EB4BB-DE14-418B-B704-67D76E468FF0}.Default|Any CPU.ActiveCfg = Debug|Any CPU
{AD1EB4BB-DE14-418B-B704-67D76E468FF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21DB122B-6D35-41F2-AE88-790A55859209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21DB122B-6D35-41F2-AE88-790A55859209}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21DB122B-6D35-41F2-AE88-790A55859209}.Default|Any CPU.ActiveCfg = Debug|Any CPU
{21DB122B-6D35-41F2-AE88-790A55859209}.Default|Any CPU.Build.0 = Debug|Any CPU
{21DB122B-6D35-41F2-AE88-790A55859209}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21DB122B-6D35-41F2-AE88-790A55859209}.Release|Any CPU.Build.0 = Release|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Default|Any CPU.ActiveCfg = Debug|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Default|Any CPU.Build.0 = Debug|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Release|Any CPU.Build.0 = Release|Any CPU
{7DCAB3F3-B687-4589-80F6-76F8BECBC6F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7DCAB3F3-B687-4589-80F6-76F8BECBC6F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7DCAB3F3-B687-4589-80F6-76F8BECBC6F8}.Default|Any CPU.ActiveCfg = Debug|Any CPU
{7DCAB3F3-B687-4589-80F6-76F8BECBC6F8}.Default|Any CPU.Build.0 = Debug|Any CPU
{7DCAB3F3-B687-4589-80F6-76F8BECBC6F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7DCAB3F3-B687-4589-80F6-76F8BECBC6F8}.Release|Any CPU.Build.0 = Release|Any CPU
{AD1EB4BB-DE14-418B-B704-67D76E468FF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD1EB4BB-DE14-418B-B704-67D76E468FF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Default|Any CPU.ActiveCfg = Debug|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Default|Any CPU.Build.0 = Debug|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7180F796-4365-498D-87AA-4A6F8DE42A1D}.Release|Any CPU.Build.0 = Release|Any CPU
{CF099BD4-46D6-4FB0-B42B-641A1F829241}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF099BD4-46D6-4FB0-B42B-641A1F829241}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF099BD4-46D6-4FB0-B42B-641A1F829241}.Default|Any CPU.ActiveCfg = Debug|Any CPU
{CF099BD4-46D6-4FB0-B42B-641A1F829241}.Default|Any CPU.Build.0 = Debug|Any CPU
{CF099BD4-46D6-4FB0-B42B-641A1F829241}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF099BD4-46D6-4FB0-B42B-641A1F829241}.Release|Any CPU.Build.0 = Release|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Default|Any CPU.ActiveCfg = Debug|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Default|Any CPU.Build.0 = Debug|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E1ECFAE9-E3D8-4567-8FA9-536A50F1C531} = {233B7F1D-99AA-4D55-BDD9-770B3428A317}
Expand Down Expand Up @@ -99,21 +105,19 @@ Global
$7.inheritsSet = Mono
$0.NameConventionPolicy = $8
$8.Rules = $9
$9.NamingRule = $10
$9.NamingRule = $29
$10.Name = Namespaces
$10.AffectedEntity = Namespace
$10.VisibilityMask = VisibilityMask
$10.NamingStyle = PascalCase
$10.IncludeInstanceMembers = True
$10.IncludeStaticEntities = True
$9.NamingRule = $11
$11.Name = Types
$11.AffectedEntity = Class, Struct, Enum, Delegate
$11.VisibilityMask = Public
$11.NamingStyle = PascalCase
$11.IncludeInstanceMembers = True
$11.IncludeStaticEntities = True
$9.NamingRule = $12
$12.Name = Interfaces
$12.RequiredPrefixes = $13
$13.String = I
Expand All @@ -122,7 +126,6 @@ Global
$12.NamingStyle = PascalCase
$12.IncludeInstanceMembers = True
$12.IncludeStaticEntities = True
$9.NamingRule = $14
$14.Name = Attributes
$14.RequiredSuffixes = $15
$15.String = Attribute
Expand All @@ -131,7 +134,6 @@ Global
$14.NamingStyle = PascalCase
$14.IncludeInstanceMembers = True
$14.IncludeStaticEntities = True
$9.NamingRule = $16
$16.Name = Event Arguments
$16.RequiredSuffixes = $17
$17.String = EventArgs
Expand All @@ -140,7 +142,6 @@ Global
$16.NamingStyle = PascalCase
$16.IncludeInstanceMembers = True
$16.IncludeStaticEntities = True
$9.NamingRule = $18
$18.Name = Exceptions
$18.RequiredSuffixes = $19
$19.String = Exception
Expand All @@ -149,70 +150,60 @@ Global
$18.NamingStyle = PascalCase
$18.IncludeInstanceMembers = True
$18.IncludeStaticEntities = True
$9.NamingRule = $20
$20.Name = Methods
$20.AffectedEntity = Methods
$20.VisibilityMask = Protected, Public
$20.NamingStyle = PascalCase
$20.IncludeInstanceMembers = True
$20.IncludeStaticEntities = True
$9.NamingRule = $21
$21.Name = Static Readonly Fields
$21.AffectedEntity = ReadonlyField
$21.VisibilityMask = Protected, Public
$21.NamingStyle = PascalCase
$21.IncludeInstanceMembers = False
$21.IncludeStaticEntities = True
$9.NamingRule = $22
$22.Name = Fields
$22.AffectedEntity = Field
$22.VisibilityMask = Protected, Public
$22.NamingStyle = PascalCase
$22.IncludeInstanceMembers = True
$22.IncludeStaticEntities = True
$9.NamingRule = $23
$23.Name = ReadOnly Fields
$23.AffectedEntity = ReadonlyField
$23.VisibilityMask = Protected, Public
$23.NamingStyle = PascalCase
$23.IncludeInstanceMembers = True
$23.IncludeStaticEntities = False
$9.NamingRule = $24
$24.Name = Constant Fields
$24.AffectedEntity = ConstantField
$24.VisibilityMask = Protected, Public
$24.NamingStyle = PascalCase
$24.IncludeInstanceMembers = True
$24.IncludeStaticEntities = True
$9.NamingRule = $25
$25.Name = Properties
$25.AffectedEntity = Property
$25.VisibilityMask = Protected, Public
$25.NamingStyle = PascalCase
$25.IncludeInstanceMembers = True
$25.IncludeStaticEntities = True
$9.NamingRule = $26
$26.Name = Events
$26.AffectedEntity = Event
$26.VisibilityMask = Protected, Public
$26.NamingStyle = PascalCase
$26.IncludeInstanceMembers = True
$26.IncludeStaticEntities = True
$9.NamingRule = $27
$27.Name = Enum Members
$27.AffectedEntity = EnumMember
$27.VisibilityMask = VisibilityMask
$27.NamingStyle = PascalCase
$27.IncludeInstanceMembers = True
$27.IncludeStaticEntities = True
$9.NamingRule = $28
$28.Name = Parameters
$28.AffectedEntity = Parameter
$28.VisibilityMask = VisibilityMask
$28.NamingStyle = CamelCase
$28.IncludeInstanceMembers = True
$28.IncludeStaticEntities = True
$9.NamingRule = $29
$29.Name = Type Parameters
$29.RequiredPrefixes = $30
$30.String = T
Expand Down
2 changes: 0 additions & 2 deletions src/MyMediaLite/Eval/Measures/AUC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ public static double Compute(IList<int> ranked_items, ICollection<int> relevant_
hit_count++;

int missing_relevant_items = relevant_items.Except(ranked_items).Count();
if (num_dropped_items - missing_relevant_items < 0)
throw new Exception("Should not happen.");
num_correct_pairs += hit_count * (num_dropped_items - missing_relevant_items);

return (double) num_correct_pairs / num_eval_pairs;
Expand Down
71 changes: 71 additions & 0 deletions src/MyMediaLite/HyperParameter/IHyperParameterSearch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright (C) 2011, 2012 Zeno Gantner
//
// This file is part of MyMediaLite.
//
// MyMediaLite is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// MyMediaLite is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MyMediaLite. If not, see <http://www.gnu.org/licenses/>.
//

using System;
using System.Collections.Generic;

/*! \namespace MyMediaLite.HyperParameter
* \brief This namespace contains classes for automated hyper-parameter search.
*/

namespace MyMediaLite.HyperParameter
{
/// <summary>Interface for classes that perform hyper-parameter search</summary>
public interface IHyperParameterSearch
{
// configuration properties

/// <summary>the delegate used to compute</summary>
Func<IRecommender, Dictionary<string, double>> EvalJob { get; }

/// <summary>the recommender to find the hyperparameters for</summary>
IRecommender Recommender { get; }

/// <summary>list of (hyper-)parameters to optimize</summary>
IList<string> Parameters { get; }

/// <summary>the evaluation measure to optimize</summary>
string Measure { get; }

/// <summary>true if evaluation measure is to be maximized, false if it is to be minimized</summary>
bool Maximize { get; }

// status properties

/// <summary>size of the current epoch of the hyper-parameter search</summary>
uint EpochSize { get; }

/// <summary>the number of steps computed so far in this hyper-parameter search</summary>
uint NumberOfStepsComputed { get; }

/// <summary>the best result so far</summary>
double BestResult { get; }

/// <summary>the (hyper-)parameter values of the best result so far</summary>
IList<Object> BestParameterValues { get; }

// methods

/// <summary>compute the next step in the current epoch</summary>
void ComputeNextStep();

/// <summary>complete the current epoch</summary>
void ComputeNextEpoch();
}
}

Loading