Showing posts with label scenario. Show all posts
Showing posts with label scenario. Show all posts

Tuesday, March 20, 2012

Association Scenario

Hi,

I have a product basket scenario in where I have to recommend contracts to a customer based on the product and the quantity he/she buys. Product Quantity is an important factor which administers the user in the purchase of a particular contract

I have the following tables with me.

Customer product transaction table, Customer Contract transaction tablebut there is no direct relationship between contract and product in the database. The only way the two can be linked is through the customer.

If I create a mining structure with Customer-Product information as the nested table and Customer-Contract information as the nested table with customer being the link between the two, the model is showing some irreverent contract recommendations.

what is the solution for the above problem? Is it because the is no direct relationship between the product and the contract?

How can I overcome this problem?

You are on the right track - you have the two nested tables that you need. What you want to do is to make the Product nested table as Input and the Contract nested table as Predict Only. Also, you may want to try excluding the product quantity to see how that impacts results.

Another important factor is how you set parameters for the AR algorithm. Setting the MINIMUM_SUPPORT and MINIMUM_PROBABILITY parameters are crucial - try lowering them until you find interesting results.

|||

Hi,

I tried the above changes but there was not much difference in the results. It still gives irrelevant recommendations.

Can you tell me how differentare the following two mining structures

1. Customertable => CASE Table

Customer – Product table => NESTED Table

Customer – Contract table => NESTED Table

2. Customer – Product table => CASE table

Customer – Contract table => NESTED Table

|||I'm not an expert in association but i think that in the first case

you're bound to have three kind of information : contract 1 /contract 2

OR product1 / product 2 OR contract / product (in fact it depends on

the key of your nested tables but in any case you'll get

contact/product association).
In the second case you won't have product1/product2 association. and the contract/ product association will have a support of 1

I don't really catch your problem but if you want to make the second mining structure, you will have to add customerID to your tables product and contract. With some sql queries, you should be able to prepare correctly your data|||

In the first structure it is possible for a single customer to have many products. In the second structure, each customer can only have one product.

Using the first model you can make Product INPUT and Contract PREDICT ONLY and you are asking the question the right way.

When you say it gives "irrelevant recommendations" what do you mean exactly? It could be that only the "irrelevant" ones are supported by the data, or you need to tweak the parameters a bit more.

If you aren't seeing what you want, use the same structure to create a decision tree model. This way you can look at the trees that are generated to see if there are meaningful patterns in the data. By default you will have 255 inputs (e.g. products) and 255 outputs (e.g. contracts), but that should be enough to get you started, you can adjust those parameters as necessary to refine the models.

Also, just for a question, how many customers, products, and contracts are there?

Thx

-Jamie

|||

Hi Jamie,

In the database there are totally around 800 customers, 300 products and 9 contracts.

These contracts are grouped logically in to long term, short term (depending on the product quantity) and some are applicable to certain products only.

Data in my database may look like the following

Customer - Product

Customer

Product

Quantity

Date

C1

P1

X

Jan 2005

C1

P1

Y

Feb 2005

C1

P2

X

March 2005

Customer – Contract

Customer

Contract

Date

C1

Contract1

June 2005 (For P1 bought in Jan 2005 as above)

C1

Contract2

March 2005 (For P1 bought in Feb 2005 as above)

C1

Contract3

March 2005 (For P2 bought)

So the relevant combinations would be

P1 – Quantity X – Contract1 (long term contract due to quantity X)

P1 – Quantity Y – Contract2 (short term contract due to quantity Y)

P2 – Quantity X – Contract 3 (Contract for the product type P3)

The other combinations are irrelevant.

These combinations or groupings are high level understanding and are not reflected at the technical level.

Some of the mining model recommendations are

1 . For the purchase of P1 of Quantity X apart from recommending Contract1 it also lists Contract2 and Contract3( irrelevant).

2. For P2 it recommends both Contract3 and Contract1 (irrelevant).

Wednesday, March 7, 2012

Assessing needs to install one more SQL server for MOM

I am trying to avoid installing more SQL servers than what I need. This is
the scenario, please let me know if I have justification to buy a SQL server
license to install MOM on local computer or I can use this on my MainSQL
server instead:
a) I need to configure such SQL server for MOM and MOM best practices
require to allow only "Windows authentication". I have virtually dozens of
third-party applications that rely on that SQL server and I do not know if
by changing configuration to "Windows authentication only" to satisfy MOM
setup that could eventually break something down the road.
b) I have to enable IIS on such SQL server box. CUrrently MainSQL server has
no IIS enabled. That would be just a security issue, but I guess so many
applications require to have IIS installed these days...
Do you think the above is enough to make me buy a SQL server license
dedicated for MOM ?And a poster kindly reminded that instances would do work here and allow me
to configure the "Windows authentication only". From reading the SQL help
files, I see that instances are generally not recommended for SQL-production
environment (this is my case here, I will be using MOM in production
environment).
If you have any input on how SQL instances are doing in real world, please
let me know.
"Marlon Brown" <marlon_brown@.hotmail.com> wrote in message
news:eBkAAqU4EHA.708@.TK2MSFTNGP11.phx.gbl...
>I am trying to avoid installing more SQL servers than what I need. This is
> the scenario, please let me know if I have justification to buy a SQL
> server
> license to install MOM on local computer or I can use this on my MainSQL
> server instead:
> a) I need to configure such SQL server for MOM and MOM best practices
> require to allow only "Windows authentication". I have virtually dozens of
> third-party applications that rely on that SQL server and I do not know if
> by changing configuration to "Windows authentication only" to satisfy MOM
> setup that could eventually break something down the road.
> b) I have to enable IIS on such SQL server box. CUrrently MainSQL server
> has
> no IIS enabled. That would be just a security issue, but I guess so many
> applications require to have IIS installed these days...
> Do you think the above is enough to make me buy a SQL server license
> dedicated for MOM ?
>|||They are harder to manage because now you have two sets of executibles that
must be serviced and could be corrupted by OS fixes including two sets of
perf counters, etc., etc., etc.
I'd consider running MOM on another server that's less used. You should
never run the monitoring process on the item that you are monitoring. You
will affect the outcomes of those observations. Your management pieces
should always be on another host and do their monitoring remotely.
Sincerely,
Anthony Thomas
"Marlon Brown" <marlon_brownj@.hotmail.com> wrote in message
news:%230%23r8eY4EHA.2196@.TK2MSFTNGP14.phx.gbl...
And a poster kindly reminded that instances would do work here and allow me
to configure the "Windows authentication only". From reading the SQL help
files, I see that instances are generally not recommended for SQL-production
environment (this is my case here, I will be using MOM in production
environment).
If you have any input on how SQL instances are doing in real world, please
let me know.
"Marlon Brown" <marlon_brown@.hotmail.com> wrote in message
news:eBkAAqU4EHA.708@.TK2MSFTNGP11.phx.gbl...
>I am trying to avoid installing more SQL servers than what I need. This is
> the scenario, please let me know if I have justification to buy a SQL
> server
> license to install MOM on local computer or I can use this on my MainSQL
> server instead:
> a) I need to configure such SQL server for MOM and MOM best practices
> require to allow only "Windows authentication". I have virtually dozens of
> third-party applications that rely on that SQL server and I do not know if
> by changing configuration to "Windows authentication only" to satisfy MOM
> setup that could eventually break something down the road.
> b) I have to enable IIS on such SQL server box. CUrrently MainSQL server
> has
> no IIS enabled. That would be just a security issue, but I guess so many
> applications require to have IIS installed these days...
> Do you think the above is enough to make me buy a SQL server license
> dedicated for MOM ?
>|||I agree. I will buy a SQL server license now !!!.
"AnthonyThomas" <Anthony.Thomas@.CommerceBank.com> wrote in message
news:%23frmjIe4EHA.3864@.TK2MSFTNGP15.phx.gbl...
> They are harder to manage because now you have two sets of executibles
> that
> must be serviced and could be corrupted by OS fixes including two sets of
> perf counters, etc., etc., etc.
> I'd consider running MOM on another server that's less used. You should
> never run the monitoring process on the item that you are monitoring. You
> will affect the outcomes of those observations. Your management pieces
> should always be on another host and do their monitoring remotely.
> Sincerely,
>
> Anthony Thomas
>
> --
> "Marlon Brown" <marlon_brownj@.hotmail.com> wrote in message
> news:%230%23r8eY4EHA.2196@.TK2MSFTNGP14.phx.gbl...
> And a poster kindly reminded that instances would do work here and allow
> me
> to configure the "Windows authentication only". From reading the SQL help
> files, I see that instances are generally not recommended for
> SQL-production
> environment (this is my case here, I will be using MOM in production
> environment).
> If you have any input on how SQL instances are doing in real world, please
> let me know.
>
> "Marlon Brown" <marlon_brown@.hotmail.com> wrote in message
> news:eBkAAqU4EHA.708@.TK2MSFTNGP11.phx.gbl...
>>I am trying to avoid installing more SQL servers than what I need. This is
>> the scenario, please let me know if I have justification to buy a SQL
>> server
>> license to install MOM on local computer or I can use this on my MainSQL
>> server instead:
>> a) I need to configure such SQL server for MOM and MOM best practices
>> require to allow only "Windows authentication". I have virtually dozens
>> of
>> third-party applications that rely on that SQL server and I do not know
>> if
>> by changing configuration to "Windows authentication only" to satisfy MOM
>> setup that could eventually break something down the road.
>> b) I have to enable IIS on such SQL server box. CUrrently MainSQL server
>> has
>> no IIS enabled. That would be just a security issue, but I guess so many
>> applications require to have IIS installed these days...
>> Do you think the above is enough to make me buy a SQL server license
>> dedicated for MOM ?
>>
>

Assessing needs to install one more SQL server for MOM

I am trying to avoid installing more SQL servers than what I need. This is
the scenario, please let me know if I have justification to buy a SQL server
license to install MOM on local computer or I can use this on my MainSQL
server instead:
a) I need to configure such SQL server for MOM and MOM best practices
require to allow only "Windows authentication". I have virtually dozens of
third-party applications that rely on that SQL server and I do not know if
by changing configuration to "Windows authentication only" to satisfy MOM
setup that could eventually break something down the road.
b) I have to enable IIS on such SQL server box. CUrrently MainSQL server has
no IIS enabled. That would be just a security issue, but I guess so many
applications require to have IIS installed these days...
Do you think the above is enough to make me buy a SQL server license
dedicated for MOM ?
And a poster kindly reminded that instances would do work here and allow me
to configure the "Windows authentication only". From reading the SQL help
files, I see that instances are generally not recommended for SQL-production
environment (this is my case here, I will be using MOM in production
environment).
If you have any input on how SQL instances are doing in real world, please
let me know.
"Marlon Brown" <marlon_brown@.hotmail.com> wrote in message
news:eBkAAqU4EHA.708@.TK2MSFTNGP11.phx.gbl...
>I am trying to avoid installing more SQL servers than what I need. This is
> the scenario, please let me know if I have justification to buy a SQL
> server
> license to install MOM on local computer or I can use this on my MainSQL
> server instead:
> a) I need to configure such SQL server for MOM and MOM best practices
> require to allow only "Windows authentication". I have virtually dozens of
> third-party applications that rely on that SQL server and I do not know if
> by changing configuration to "Windows authentication only" to satisfy MOM
> setup that could eventually break something down the road.
> b) I have to enable IIS on such SQL server box. CUrrently MainSQL server
> has
> no IIS enabled. That would be just a security issue, but I guess so many
> applications require to have IIS installed these days...
> Do you think the above is enough to make me buy a SQL server license
> dedicated for MOM ?
>
|||They are harder to manage because now you have two sets of executibles that
must be serviced and could be corrupted by OS fixes including two sets of
perf counters, etc., etc., etc.
I'd consider running MOM on another server that's less used. You should
never run the monitoring process on the item that you are monitoring. You
will affect the outcomes of those observations. Your management pieces
should always be on another host and do their monitoring remotely.
Sincerely,
Anthony Thomas

"Marlon Brown" <marlon_brownj@.hotmail.com> wrote in message
news:%230%23r8eY4EHA.2196@.TK2MSFTNGP14.phx.gbl...
And a poster kindly reminded that instances would do work here and allow me
to configure the "Windows authentication only". From reading the SQL help
files, I see that instances are generally not recommended for SQL-production
environment (this is my case here, I will be using MOM in production
environment).
If you have any input on how SQL instances are doing in real world, please
let me know.
"Marlon Brown" <marlon_brown@.hotmail.com> wrote in message
news:eBkAAqU4EHA.708@.TK2MSFTNGP11.phx.gbl...
>I am trying to avoid installing more SQL servers than what I need. This is
> the scenario, please let me know if I have justification to buy a SQL
> server
> license to install MOM on local computer or I can use this on my MainSQL
> server instead:
> a) I need to configure such SQL server for MOM and MOM best practices
> require to allow only "Windows authentication". I have virtually dozens of
> third-party applications that rely on that SQL server and I do not know if
> by changing configuration to "Windows authentication only" to satisfy MOM
> setup that could eventually break something down the road.
> b) I have to enable IIS on such SQL server box. CUrrently MainSQL server
> has
> no IIS enabled. That would be just a security issue, but I guess so many
> applications require to have IIS installed these days...
> Do you think the above is enough to make me buy a SQL server license
> dedicated for MOM ?
>
|||I agree. I will buy a SQL server license now !!!.
"AnthonyThomas" <Anthony.Thomas@.CommerceBank.com> wrote in message
news:%23frmjIe4EHA.3864@.TK2MSFTNGP15.phx.gbl...
> They are harder to manage because now you have two sets of executibles
> that
> must be serviced and could be corrupted by OS fixes including two sets of
> perf counters, etc., etc., etc.
> I'd consider running MOM on another server that's less used. You should
> never run the monitoring process on the item that you are monitoring. You
> will affect the outcomes of those observations. Your management pieces
> should always be on another host and do their monitoring remotely.
> Sincerely,
>
> Anthony Thomas
>
> --
> "Marlon Brown" <marlon_brownj@.hotmail.com> wrote in message
> news:%230%23r8eY4EHA.2196@.TK2MSFTNGP14.phx.gbl...
> And a poster kindly reminded that instances would do work here and allow
> me
> to configure the "Windows authentication only". From reading the SQL help
> files, I see that instances are generally not recommended for
> SQL-production
> environment (this is my case here, I will be using MOM in production
> environment).
> If you have any input on how SQL instances are doing in real world, please
> let me know.
>
> "Marlon Brown" <marlon_brown@.hotmail.com> wrote in message
> news:eBkAAqU4EHA.708@.TK2MSFTNGP11.phx.gbl...
>

Thursday, February 9, 2012

ASP.NET / SQL 2k Membership prob

Almost have my custom membershipprovider finsihed, but have ran into a small snag.

Scenario:: 2 methods. CreateUser(blah blah) and ValidateUserName(string username). CreateUserWizard control calls CreateUser(blah blah) which in the start of the method calls ValidateUserName(string username). ValidateUserName runs astored procedure onSQL 2k to check and see if user exists in the db. Returns a bool true or false. If true, then everything works correctly and returns a message displaying that the user exists, please enter a different name.

Now the problem. If it returns false, meaning that the username doesnt exist and is available to use, it calls a stored procedure to create the record in the users db. This is where the problem lies. It does NOTHING but sit there waiting. But it never seems to time out. If I comment out the validating. It will add a record successfully.

Im wondering if it has something to do with calling 2stored procedures consecutivly??

::CODE TO FOLLOW::Heres the code.
------------

public override MembershipUser CreateUser(string username, stringpassword, stringemail, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
{
SqlConnection connect = null;
SqlCommand cmd = null;
MembershipUser newUser = null;

if (!ValidateUsername(username))
{
status = MembershipCreateStatus.DuplicateUserName;
return null;
}

try
{
connect = new SqlConnection(ConfigurationManager.ConnectionStrings[ConnString].ConnectionString);

cmd = new SqlCommand("createuser", connect);
cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.Add(new SqlParameter("@.UserName", username));
cmd.Parameters.Add(new SqlParameter("@.Pwd", password));
cmd.Parameters.Add(new SqlParameter("@.PwdQuestion", passwordQuestion));
cmd.Parameters.Add(new SqlParameter("@.PwdAnswer", passwordAnswer));
cmd.Parameters.Add(new SqlParameter("@.Email", email));
cmd.Parameters.Add(new SqlParameter("@.Comment", _Name));
cmd.Parameters.Add(new SqlParameter("@.IsApproved", MyMethods.BoolToInt(isApproved)));
cmd.Parameters.Add("@.IsLockedOut", SqlDbType.Bit).Value = 0;
cmd.Parameters.Add(new SqlParameter("@.CreationDate", DateTime.Now));
cmd.Parameters.Add(new SqlParameter("@.LastLoginDate", DateTime.Now));

connect.Open();
cmd.ExecuteNonQuery();

// Right now I am giving default values for DateTime
// in Membership constructor.
newUser = new MembershipUser(
_Name,
username, null, String.Empty, String.Empty,
String.Empty, true, false, DateTime.Now,
DateTime.Now, DateTime.Now, DateTime.Now,
DateTime.Now
);
status = MembershipCreateStatus.Success;
}
catch (Exception ex)
{
status = MembershipCreateStatus.ProviderError;
newUser = null;
throw ex;
}
finally
{
cmd.Dispose();
connect.Close();
}
return newUser;
}

private bool ValidateUsername(string userName)
{
SqlConnection conn = null;
SqlCommand cmd = null;
SqlDataReader reader = null;
bool IsValid = false;

try
{
conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.ConnectionStrings[ConnString].ConnectionString;

cmd = new SqlCommand("CheckUsername", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@.Username", userName));

conn.Open();
reader = cmd.ExecuteReader();
while (!reader.Read())
{
IsValid = true;
}
return IsValid;
}
catch (Exception ex)
{
throw ex;
}
finally
{
reader.Close();
cmd.Dispose();
conn.Close();
}
}|||

OK! NOT EVERYONE AT ONCE ! <big grin>

just kidding, anyways figured out the problem after pulling all but one last hair out.

The "while(!reader.Read())" was causing problems, just replaced it with "while(reader.HasRows)" and viola, it worked. Beats me.