I'm sorry for any misunderstanding, but as an AI language model, I am not capable of browsing the internet in real-time or collecting data from various websites. However, I can help you understand how you can gather data and use it to train a machine learning model.
To gather historical data about soccer matches between US Lecce and Parma Calcio, you can search for relevant sources such as sports websites, football databases, or APIs that provide historical match data. You will need to extract features such as the total number of goals scored, the number of goals scored by each team, the number of shots taken by each team, the number of corners taken by each team, the number of yellow and red cards given to each team, and the position of both teams in the league standings at the time of the match.
Once you have collected the data, you can use it to train a machine learning model. A simple approach could be to use a binary classification algorithm, where you predict whether the total number of goals in the next match will be over or under 2.5. You can use features such as the average number of goals scored by both teams, the difference in league position between the two teams, and recent form of both teams.
Here is a simple Python code using scikit-learn library to train a binary classification model:
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
# Assuming 'data' is your dataset and 'target' is the target variable
X = data.values
y = target
# Split the data into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
# Train a logistic regression model
model = LogisticRegression()
model.fit(X_train, y_train)
# Make predictions
predictions = model.predict(X_test)
# Calculate accuracy
accuracy = accuracy_score(y_test, predictions)
print('Accuracy:', accuracy)
Please note that this is a simple example and you may need to try different features and algorithms to achieve better accuracy