Hi all,

I am doing some basic experimenting with ENCOG ANN, but am having issue following a simple walthough. At this stage I am simply trying to grab data from a CSV and normalise it. My code is:

string filename = "spots.csv";
            var format = new CSVFormat(',', ' ');

            IVersatileDataSource source = new CSVDataSource(filename, true, format);
            var data = new VersatileMLDataSet(source);
            data.NormHelper.Format = format;

            Encog.ML.Data.Versatile.Columns.ColumnDefinition columnSSN = data.DefineSourceColumn("SSN", Encog.ML.Data.Versatile.Columns.ColumnType.Continuous);
            Encog.ML.Data.Versatile.Columns.ColumnDefinition columnDEV = data.DefineSourceColumn("DEV", Encog.ML.Data.Versatile.Columns.ColumnType.Continuous);

            data.DefineSingleOutputOthersInput(columnSSN);
            EncogModel model = new EncogModel(data);
            model.SelectMethod(data, MLMethodFactory.TypeFeedforward);

            model.Report = new ConsoleStatusReportable();
            data.Normalize();

I am getting the error "Can't find columns". Which doesn't make sense to me! They are definitely there, and contain the headers SSN and DEV. Does it matter what order they are in?

Your best option here would be to look in the EnCog documentation to see what can cause this error.
Maybe you did not provide the exact format, I see only one data.DefineSingleOutputOthersInput(columnSSN); is this not needed for your other column?

nice post

No, the data.DefineSingleOutputOthersInput(columnSSN); is defining a column to make predictions from (I should have mentioned this is a time series prediction walkthrough).

But yeah, I thought it was a long shot someone would know the anwer here. The Encog documentation is pretty substandard. I'm looking at the FANN library and it appears a lot more succinct, so I might try move the programme to that instead. Thanks anyway

What exactly is this encog stuff? I remeber buying a book on C# web bots by the same guy that made encog, and all I got out of it was poorly documented loops conditionals and logic. At least I think the same guy that wrote encog wrote this stuff. Http programming recipies C# by Mr Heaton?

Hi,

(1) the CSVFormat(',', ' '); is not compatible with the source file the numbers use '.' for decimals.

(2) the data.DefineSingleOutputOthersInput(columnSSN); for just one column is correct.

(3) should call data.Analyse() after line 5, so encog can catch min, max, sd, mean, before calling the data.Normalize();

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.