I am struggling to get my ML model to accept the input and outputs that I need.

My aim is to have it accept this as the input:

input_x = [ 
    ((4.11, 8.58, -2.2), (-1.27, -8.76, 2.23)),
    ((0.43, -6.53, 1.25), (7.91, -10.76, 0.06)),
    ...
]

and this as the output:

output_y = [ 
    (34,24),
    (13,30),
    ...
]

The (X1,X2,X3) and the (Y1,Y2,Y3) are different measurements, but they are needed to be considered together to produce the (X, Y) output. The issue that I am running into is that LogisticRegression() does not except the multidimensional input/output. Found array with dim 3, while dim <= 2 is required by LogisticRegression

So, just to get my code running, I flattened everything too:

input_x = [
    (4.11, 8.58, -2.2, -1.27, -8.76, 2.23)
    (0.43, -6.53, 1.25, 7.91, -10.76, 0.06)
    ... 
 ]

output_y = [
    7
    -17
    ...
]

X_train, X_test, y_train, y_test = train_test_split(input_x, output_y, test_size=0.4, random_state=20, shuffle=False)


logreg= LogisticRegression()
logreg.fit(X_train, y_train)
y_pred=logreg.predict(X_test)

print(f"Accuracy: {metrics.accuracy_score(y_test, y_pred)}")
print(f"Recall: {metrics.recall_score(y_test, y_pred, average='micro')}")
print(f"Precision: {metrics.precision_score(y_test, y_pred, average='micro')}")

which works, but had an accuracy of 4.5% - so here is the first round of questions:

  1. Is it possible to input data like ((X1, X2, X3), (Y1, Y2, Y3)) and output data like (X, Y)
  2. Is LogisticRegression() the right thing to use for this project, or is there something better that I should be looking at?
  3. Are there any materials/sites/resources that I should checkout?

Ideally this would be my end goal of the project:

input_x = [ 
    [10, ((4.11, 8.58, -2.2), (-1.27, -8.76, 2.23))],
    [15, ((0.43, -6.53, 1.25), (7.91, -10.76, 0.06))],
    ...
]
  • The added 10 & 15 numbers represent the number of items used to create (X1,X2,X3)/(Y1,Y2,Y3), so 15 would be more accurate than 10 (the numbers go from 8-21), so if possible, I would like to weight the 21's more than the 8's.

  • X1/Y1 and X2/Y2 are more important than X3/Y3, if possible i would like to weight the 1's and 2's to 40% and the 3 to 20%

So, given my end goal

  1. Is the end goal even possible?
  2. Does that change any of your above answers of what I should be using?
  3. Do you have any code samples or know of any code sites, that can get me to my end goal?